txsync

package
v0.2300.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MethodGetTxs   = "GetTxs"
	MaxGetTxsCount = 128
)

Constants related to the GetTxs method.

View Source
const TxSyncProtocolID = "txsync"

TxSyncProtocolID is a unique protocol identifier for the transaction sync protocol.

Variables

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

TxSyncProtocolVersion is the supported version of the transaction sync protocol.

Functions

func NewServer

func NewServer(chainContext string, runtimeID common.Namespace, txPool txpool.TransactionPool) rpc.Server

NewServer creates a new transaction sync protocol server.

Types

type Client

type Client interface {
	// GetTxs queries peers for transaction data.
	GetTxs(ctx context.Context, request *GetTxsRequest) (*GetTxsResponse, error)
}

Client is a transaction sync protocol client.

func NewClient

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

NewClient creates a new transaction sync protocol client.

type GetTxsRequest

type GetTxsRequest struct {
	Txs []hash.Hash `json:"txs"`
}

GetTxsRequest is a GetTxs request.

type GetTxsResponse

type GetTxsResponse struct {
	Txs [][]byte `json:"txs,omitempty"`
}

GetTxsResponse is a response to a GetTxs request.

Jump to

Keyboard shortcuts

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