pub

package
v0.2403.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodGet = "Get"
)

Constants related to the Get method.

View Source
const (
	MethodGetPrefixes = "GetPrefixes"
)

Constants related to the GetPrefixes method.

View Source
const (
	MethodIterate = "Iterate"
)

Constants related to the Iterate method.

View Source
const StoragePubProtocolID = "storagepub"

StoragePubProtocolID is a unique protocol identifier for the storage pub protocol.

Variables

View Source
var StoragePubProtocolVersion = version.Version{Major: 2, Minor: 0, Patch: 0}

StoragePubProtocolVersion is the supported version of the storage pub protocol.

Functions

func NewServer

func NewServer(chainContext string, runtimeID common.Namespace, backend storage.Backend) rpc.Server

NewServer creates a new storage pub protocol server.

Types

type Client

type Client interface {
	// Get fetches a single key and returns the corresponding proof.
	Get(ctx context.Context, request *GetRequest) (*ProofResponse, rpc.PeerFeedback, error)

	// GetPrefixes fetches all keys under the given prefixes and returns the corresponding proofs.
	GetPrefixes(ctx context.Context, request *GetPrefixesRequest) (*ProofResponse, rpc.PeerFeedback, error)

	// Iterate seeks to a given key and then fetches the specified number of following items based
	// on key iteration order.
	Iterate(ctx context.Context, request *IterateRequest) (*ProofResponse, rpc.PeerFeedback, error)
}

Client is a storage pub protocol client.

func NewClient

func NewClient(p2p rpc.P2P, chainContext string, runtimeID common.Namespace) Client

NewClient creates a new storage pub protocol client.

type GetPrefixesRequest

type GetPrefixesRequest = syncer.GetPrefixesRequest

GetPrefixesRequest is a GetPrefixes request.

type GetRequest

type GetRequest = syncer.GetRequest

GetRequest is a Get request.

type IterateRequest

type IterateRequest = syncer.IterateRequest

IterateRequest is an Iterate request.

type ProofResponse

type ProofResponse = syncer.ProofResponse

ProofResponse is a response to Get/GetPrefixes/Iterate containing a proof.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL