Documentation ¶
Index ¶
- Constants
- Variables
- func NewServer(chainContext string, runtimeID common.Namespace, backend storage.Backend) rpc.Server
- type Checkpoint
- type Client
- type GetCheckpointChunkRequest
- type GetCheckpointChunkResponse
- type GetCheckpointsRequest
- type GetCheckpointsResponse
- type GetDiffRequest
- type GetDiffResponse
Constants ¶
const ( MethodGetDiff = "GetDiff" MaxGetDiffResponseTime = 15 * time.Second )
Constants related to the GetDiff method.
const ( MethodGetCheckpointChunk = "GetCheckpointChunk" MaxGetCheckpointChunkResponseTime = 60 * time.Second )
Constants related to the GetCheckpointChunk method.
const (
MethodGetCheckpoints = "GetCheckpoints"
)
Constants related to the GetCheckpoints method.
const StorageSyncProtocolID = "storagesync"
StorageSyncProtocolID is a unique protocol identifier for the storage sync protocol.
Variables ¶
var StorageSyncProtocolVersion = version.Version{Major: 2, Minor: 0, Patch: 0}
StorageSyncProtocolVersion is the supported version of the storage sync protocol.
Functions ¶
Types ¶
type Checkpoint ¶ added in v0.2202.0
type Checkpoint struct { *checkpoint.Metadata // Peers are the feedback structures of all the peers that have advertised this checkpoint. Peers []rpc.PeerFeedback }
Checkpoint contains checkpoint metadata together with peer information.
type Client ¶
type Client interface { // GetDiff requests a write log of entries that must be applied to get from the first given root // to the second one. GetDiff(ctx context.Context, request *GetDiffRequest) (*GetDiffResponse, rpc.PeerFeedback, error) // GetCheckpoints returns a list of checkpoint metadata for all known checkpoints. GetCheckpoints(ctx context.Context, request *GetCheckpointsRequest) ([]*Checkpoint, error) // GetCheckpointChunk requests a specific checkpoint chunk. GetCheckpointChunk( ctx context.Context, request *GetCheckpointChunkRequest, cp *Checkpoint, ) (*GetCheckpointChunkResponse, rpc.PeerFeedback, error) }
Client is a storage sync protocol client.
type GetCheckpointChunkRequest ¶
type GetCheckpointChunkRequest struct { Version uint16 `json:"version"` Root storage.Root `json:"root"` Index uint64 `json:"index"` Digest hash.Hash `json:"digest"` }
GetCheckpointChunkRequest is a GetCheckpointChunk request.
type GetCheckpointChunkResponse ¶
type GetCheckpointChunkResponse struct {
Chunk []byte `json:"chunk,omitempty"`
}
GetCheckpointChunkResponse is a respose to a GetCheckpointChunk request.
type GetCheckpointsRequest ¶
type GetCheckpointsRequest struct {
Version uint16 `json:"version"`
}
GetCheckpointsRequest is a GetCheckpoints request.
type GetCheckpointsResponse ¶
type GetCheckpointsResponse struct {
Checkpoints []*checkpoint.Metadata `json:"checkpoints,omitempty"`
}
GetCheckpointsResponse is a response to a GetCheckpoints request.
type GetDiffRequest ¶
type GetDiffRequest struct { StartRoot storage.Root `json:"start_root"` EndRoot storage.Root `json:"end_root"` }
GetDiffRequest is a GetDiff request.
type GetDiffResponse ¶
GetDiffResponse is a response to a GetDiff request.