Documentation ¶
Index ¶
- Constants
- type AdminContractService
- type ContractService
- type DummyArgs
- type DummyReply
- type FuncTestContractService
- func (s *FuncTestContractService) CallConstructor(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, ...) error
- func (s *FuncTestContractService) CallMethod(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, ...) error
- func (s *FuncTestContractService) Upload(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, ...) error
- type HealthChecker
- type InfoArgs
- type InfoReply
- type InfoService
- type NodeCertArgs
- type NodeCertReply
- type NodeCertService
- type NodeService
- type Runner
- type RunnerWrapper
- type SeedArgs
- type UploadReply
Constants ¶
const ( ParseError = -31700 ParseErrorMessage = "Parsing error on the server side: received an invalid JSON." InvalidRequestError = -31600 InvalidRequestErrorMessage = "The JSON received is not a valid request payload." MethodNotFoundError = -31601 MethodNotFoundErrorMessage = "Method does not exist / is not available." InvalidParamsError = -31602 InvalidParamsErrorMessage = "Invalid method parameter(s)." InternalError = -31603 InternalErrorMessage = "Internal JSON RPC error." TimeoutError = -31106 TimeoutErrorMessage = "Request's timeout has expired." ExecutionError = -31103 ExecutionErrorMessage = "Execution error." )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminContractService ¶ added in v0.9.0
type AdminContractService struct {
// contains filtered or unexported fields
}
AdminContractService is a service that provides API for working with smart contracts.
func NewAdminContractService ¶ added in v0.9.0
func NewAdminContractService(runner *Runner) *AdminContractService
NewAdminContractService creates new AdminContract service instance.
func (*AdminContractService) Call ¶ added in v0.9.0
func (cs *AdminContractService) Call(req *http.Request, args *requester.Params, requestBody *rpc.RequestBody, result *requester.ContractResult) error
type ContractService ¶ added in v0.9.0
type ContractService struct {
// contains filtered or unexported fields
}
ContractService is a service that provides API for working with smart contracts.
func NewContractService ¶ added in v0.9.0
func NewContractService(runner *Runner) *ContractService
NewContractService creates new Contract service instance.
func (*ContractService) Call ¶ added in v0.9.0
func (cs *ContractService) Call(req *http.Request, args *requester.Params, requestBody *rpc.RequestBody, result *requester.ContractResult) error
type DummyReply ¶ added in v0.9.0
type DummyReply struct{}
type FuncTestContractService ¶ added in v0.9.0
type FuncTestContractService struct {
// contains filtered or unexported fields
}
FuncTestContractService is a service that provides ability to add custom contracts
func NewFuncTestContractService ¶ added in v0.9.0
func NewFuncTestContractService(runner *Runner) *FuncTestContractService
NewFuncTestContractService is dummy for NewFuncTestContractService in functest_contract.go that hidden under build tag
func (*FuncTestContractService) CallConstructor ¶ added in v0.9.0
func (s *FuncTestContractService) CallConstructor(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, reply *DummyReply) error
func (*FuncTestContractService) CallMethod ¶ added in v0.9.0
func (s *FuncTestContractService) CallMethod(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, reply *DummyReply) error
func (*FuncTestContractService) Upload ¶ added in v0.9.0
func (s *FuncTestContractService) Upload(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, reply *DummyReply) error
type HealthChecker ¶ added in v0.8.7
type HealthChecker struct { CertificateManager insolar.CertificateManager NodeNetwork network.NodeNetwork PulseAccessor pulse.Accessor }
HealthChecker allows to check network status of a node.
func NewHealthChecker ¶ added in v0.8.7
func NewHealthChecker(cm insolar.CertificateManager, nn network.NodeNetwork, pa pulse.Accessor) *HealthChecker
NewHealthChecker creates new HealthChecker.
func (*HealthChecker) CheckHandler ¶ added in v0.8.7
func (hc *HealthChecker) CheckHandler(w http.ResponseWriter, r *http.Request)
CheckHandler is a HTTP handler for health check.
type InfoArgs ¶ added in v0.6.3
type InfoArgs struct{}
InfoArgs is arguments that Info service accepts.
type InfoReply ¶ added in v0.6.3
type InfoReply struct { RootDomain string `json:"rootDomain"` RootMember string `json:"rootMember"` MigrationAdminMember string `json:"migrationAdminMember"` MigrationDaemonMembers []string `json:"migrationDaemonMembers"` NodeDomain string `json:"nodeDomain"` TraceID string `json:"traceID"` }
InfoReply is reply for Info service requests.
type InfoService ¶ added in v0.6.3
type InfoService struct {
// contains filtered or unexported fields
}
InfoService is a service that provides API for getting info about genesis objects.
func NewInfoService ¶ added in v0.6.3
func NewInfoService(runner *Runner) *InfoService
NewInfoService creates new Info service instance.
func (*InfoService) GetInfo ¶ added in v0.9.0
func (s *InfoService) GetInfo(r *http.Request, args *InfoArgs, requestBody *rpc.RequestBody, reply *InfoReply) error
Get returns info about genesis objects.
Request structure: { "jsonrpc": "2.0", "method": "network.getInfo", "id": str|int|null "params": { } } Response structure: { "jsonrpc": "2.0", "result": { "rootDomain": str, // reference to RootDomain instance "rootMember": str, // reference to RootMember instance "migrationAdminMember": str, // reference to migrationAdminMember "migrationDaemonMembers": [ //array string str, // reference to migrationDaemon str, // reference to migrationDaemon str, // reference to migrationDaemon
],
"nodeDomain": str, // reference to NodeDomain instance "traceID": str // traceID for request }, "id": str|int|null // same as in request }
type NodeCertArgs ¶ added in v0.7.5
type NodeCertArgs struct {
Ref string
}
NodeCertArgs is arguments that NodeCert service accepts.
type NodeCertReply ¶ added in v0.7.5
type NodeCertReply struct {
Cert *certificate.Certificate `json:"cert"`
}
NodeCertReply is reply for NodeCert service requests.
type NodeCertService ¶ added in v0.7.5
type NodeCertService struct {
// contains filtered or unexported fields
}
NodeCertService is a service that provides cert for node.
func NewNodeCertService ¶ added in v0.7.5
func NewNodeCertService(runner *Runner) *NodeCertService
NewNodeCertService creates new NodeCert service instance.
func (*NodeCertService) Get ¶ added in v0.7.5
func (s *NodeCertService) Get(r *http.Request, args *NodeCertArgs, requestBody *rpc.RequestBody, reply *NodeCertReply) error
Get returns certificate for node with given reference.
type NodeService ¶ added in v0.9.0
type NodeService struct {
// contains filtered or unexported fields
}
NodeService is a service that provides API for getting new seed and status.
func NewNodeService ¶ added in v0.9.0
func NewNodeService(runner *Runner) *NodeService
NewNodeService creates new Node service instance.
func (*NodeService) GetSeed ¶ added in v0.9.0
func (s *NodeService) GetSeed(r *http.Request, args *SeedArgs, requestBody *rpc.RequestBody, reply *requester.SeedReply) error
Get returns new active seed.
Request structure: { "jsonrpc": "2.0", "method": "node.getSeed", "id": str|int|null } Response structure: { "jsonrpc": "2.0", "result": { "Seed": str, // correct seed for new Call request "TraceID": str // traceID for request }, "id": str|int|null // same as in request }
func (*NodeService) GetStatus ¶ added in v0.9.0
func (s *NodeService) GetStatus(r *http.Request, args *interface{}, requestBody *rpc.RequestBody, reply *requester.StatusResponse) error
Get returns status info
type Runner ¶
type Runner struct { CertificateManager insolar.CertificateManager ContractRequester insolar.ContractRequester // nolint NodeNetwork network.NodeNetwork CertificateGetter insolar.CertificateGetter PulseAccessor pulse.Accessor ArtifactManager artifacts.Client JetCoordinator jet.Coordinator NetworkStatus insolar.NetworkStatus SeedManager *seedmanager.SeedManager SeedGenerator seedmanager.SeedGenerator // contains filtered or unexported fields }
Runner implements Component for API
func NewRunner ¶
func NewRunner(cfg *configuration.APIRunner, certificateManager insolar.CertificateManager, contractRequester insolar.ContractRequester, nodeNetwork network.NodeNetwork, certificateGetter insolar.CertificateGetter, pulseAccessor pulse.Accessor, artifactManager artifacts.Client, jetCoordinator jet.Coordinator, networkStatus insolar.NetworkStatus, ) (*Runner, error)
NewRunner is C-tor for API Runner
func (*Runner) IsAPIRunner ¶ added in v0.6.3
IsAPIRunner is implementation of APIRunner interface for component manager
type RunnerWrapper ¶ added in v0.9.0
func NewWrapper ¶ added in v0.9.0
func NewWrapper(publicAPI, adminAPI insolar.APIRunner) *RunnerWrapper
NewWrapper is C-tor for wrapper of API Runner
type SeedArgs ¶ added in v0.6.3
type SeedArgs struct{}
SeedArgs is arguments that Seed service accepts.
type UploadReply ¶ added in v0.9.0
type UploadReply struct {
PrototypeRef string `json:"PrototypeRef"`
}