Documentation
¶
Index ¶
- func UnmarshalRequest(req *http.Request, params interface{}) ([]byte, error)
- type InfoArgs
- type InfoReply
- type InfoService
- type Node
- type NodeCertArgs
- type NodeCertReply
- type NodeCertService
- type Request
- type Runner
- type SeedArgs
- type SeedReply
- type SeedService
- type StatusReply
- type StatusService
- type StorageExporterArgs
- type StorageExporterReply
- type StorageExporterService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InfoArgs ¶ added in v0.6.3
type InfoArgs struct{}
InfoArgs is arguments that Info service accepts.
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) Get ¶ added in v0.6.3
Get returns info about genesis objects.
Request structure:
{
"jsonrpc": "2.0",
"method": "info.Get",
"id": str|int|null
}
Response structure:
{
"jsonrpc": "2.0",
"result": {
"RootDomain": str, // reference to RootDomain instance
"RootMember": str, // reference to RootMember instance
"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, reply *NodeCertReply) error
Get returns certificate for node with given reference.
type Request ¶ added in v0.6.3
type Request struct {
Reference string `json:"reference"`
Method string `json:"method"`
Params []byte `json:"params"`
Seed []byte `json:"seed"`
Signature []byte `json:"signature"`
}
Request is a representation of request struct to api
type Runner ¶
type Runner struct {
CertificateManager core.CertificateManager `inject:""`
StorageExporter core.StorageExporter `inject:""`
ContractRequester core.ContractRequester `inject:""`
NetworkCoordinator core.NetworkCoordinator `inject:""`
GenesisDataProvider core.GenesisDataProvider `inject:""`
NetworkSwitcher core.NetworkSwitcher `inject:""`
NodeNetwork core.NodeNetwork `inject:""`
PulseStorage core.PulseStorage `inject:""`
SeedManager *seedmanager.SeedManager
SeedGenerator seedmanager.SeedGenerator
// contains filtered or unexported fields
}
Runner implements Component for API
func NewRunner ¶
func NewRunner(cfg *configuration.APIRunner) (*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 SeedArgs ¶ added in v0.6.3
type SeedArgs struct{}
SeedArgs is arguments that Seed service accepts.
type SeedService ¶ added in v0.6.3
type SeedService struct {
// contains filtered or unexported fields
}
SeedService is a service that provides API for getting new seed.
func NewSeedService ¶ added in v0.6.3
func NewSeedService(runner *Runner) *SeedService
NewSeedService creates new Seed service instance.
func (*SeedService) Get ¶ added in v0.6.3
Get returns new active seed.
Request structure:
{
"jsonrpc": "2.0",
"method": "seed.Get",
"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
}
type StatusReply ¶ added in v0.7.5
type StatusReply struct {
NetworkState string
Origin Node
ActiveListSize int
WorkingListSize int
Nodes []Node
PulseNumber uint32
Entropy []byte
NodeState string
AdditionalNodeState string
}
StatusReply is reply for Status service requests.
type StatusService ¶ added in v0.7.5
type StatusService struct {
// contains filtered or unexported fields
}
StatusService is a service that provides API for getting status of node.
func NewStatusService ¶ added in v0.7.5
func NewStatusService(runner *Runner) *StatusService
NewStatusService creates new StatusService instance.
func (*StatusService) Get ¶ added in v0.7.5
func (s *StatusService) Get(r *http.Request, args *interface{}, reply *StatusReply) error
Get returns status info
type StorageExporterArgs ¶ added in v0.6.3
StorageExporterArgs is arguments that StorageExporter service accepts.
type StorageExporterReply ¶ added in v0.6.3
type StorageExporterReply = core.StorageExportResult
StorageExporterReply is reply for StorageExporter service requests.
type StorageExporterService ¶ added in v0.6.3
type StorageExporterService struct {
// contains filtered or unexported fields
}
StorageExporterService is a service that provides API for exporting storage data.
func NewStorageExporterService ¶ added in v0.6.3
func NewStorageExporterService(runner *Runner) *StorageExporterService
NewStorageExporterService creates new StorageExporter service instance.
func (*StorageExporterService) Export ¶ added in v0.6.3
func (s *StorageExporterService) Export(r *http.Request, args *StorageExporterArgs, reply *StorageExporterReply) error
Export returns data view from storage.
Request structure:
{
"jsonrpc": "2.0",
"method": "exporter.Export",
"params": {
// Pulse number from which data load should start.
// If less than first pulse, the load will start from the first pulse (e.i. use "0" to load from the beginning).
"From": int,
// Number of pulses to load.
"Size": int
},
"id": str|int|null
}
Response structure:
{
"Data": {
[pulse number]: [{
"Records": {
[record ID]: {
"Type": str, // Constant record type.
"Data": { ... }, // Structured record data.
"Payload": { ... }|null // Additional data related to the record (e.g. Object's memory).
}
},
"Pulse": {
"PulseNumber": int, // Pulse number. Same as parent key.
},
"JetID": string,
}],
"NextFrom": int|null, // Pulse number from which to start next batch. Put it as "From" param for next incremental fetch.
"Size": int // Number of returned pulses (length of the "Data" dictionary).
}