request

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client serves incoming requests and handles routing of outgoing requests for data from the consensus system.

func (*Client) Init

func (rb *Client) Init(peerSub interfaces.PeerSubscription) error

Init initializes the object

func (*Client) RequestP2PGetBlockHeaders

func (rb *Client) RequestP2PGetBlockHeaders(ctx context.Context, blockNums []uint32) ([]*objs.BlockHeader, error)

func (*Client) RequestP2PGetMinedTxs

func (rb *Client) RequestP2PGetMinedTxs(ctx context.Context, txHashes [][]byte) ([][]byte, error)

func (*Client) RequestP2PGetPendingTx

func (rb *Client) RequestP2PGetPendingTx(ctx context.Context, txHashes [][]byte) ([][]byte, error)

func (*Client) RequestP2PGetSnapShotHdrNode

func (rb *Client) RequestP2PGetSnapShotHdrNode(ctx context.Context, key []byte) ([]byte, error)

func (*Client) RequestP2PGetSnapShotNode

func (rb *Client) RequestP2PGetSnapShotNode(ctx context.Context, height uint32, key []byte) ([]byte, error)

func (*Client) RequestP2PGetSnapShotStateData

func (rb *Client) RequestP2PGetSnapShotStateData(ctx context.Context, key []byte) ([]byte, error)

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves incoming requests and handles routing of outgoing requests for data from the consensus system.

func (*Handler) Done

func (rb *Handler) Done() <-chan struct{}

Done will trInger when both of the gossip busses have stopped

func (*Handler) Exit

func (rb *Handler) Exit()

Exit will kill the gossip busses

func (*Handler) HandleP2PGetBlockHeaders

func (rb *Handler) HandleP2PGetBlockHeaders(ctx context.Context, r *pb.GetBlockHeadersRequest) (*pb.GetBlockHeadersResponse, error)

HandleP2PGetBlockHeaders serves block headers

func (*Handler) HandleP2PGetMinedTxs

func (rb *Handler) HandleP2PGetMinedTxs(ctx context.Context, r *pb.GetMinedTxsRequest) (*pb.GetMinedTxsResponse, error)

HandleP2PGetMinedTxs returns the mined transactions from a specific block If the block number it is not known, it returns an empty byte slice.

func (*Handler) HandleP2PGetPendingTxs

func (rb *Handler) HandleP2PGetPendingTxs(ctx context.Context, r *pb.GetPendingTxsRequest) (*pb.GetPendingTxsResponse, error)

HandleP2PGetPendingTxs serves pending txs

func (*Handler) HandleP2PGetSnapShotHdrNode

func (rb *Handler) HandleP2PGetSnapShotHdrNode(ctx context.Context, r *pb.GetSnapShotHdrNodeRequest) (*pb.GetSnapShotHdrNodeResponse, error)

func (*Handler) HandleP2PGetSnapShotNode

func (rb *Handler) HandleP2PGetSnapShotNode(ctx context.Context, r *pb.GetSnapShotNodeRequest) (*pb.GetSnapShotNodeResponse, error)

HandleP2PGetSnapShotNode ....

func (*Handler) HandleP2PGetSnapShotStateData

func (rb *Handler) HandleP2PGetSnapShotStateData(ctx context.Context, r *pb.GetSnapShotStateDataRequest) (*pb.GetSnapShotStateDataResponse, error)

HandleP2PGetSnapShotStateData ....

func (*Handler) Init

func (rb *Handler) Init(database *db.Database, app appHandler) error

Init initializes the object

func (*Handler) Start

func (rb *Handler) Start()

Start will start the gossip busses

Jump to

Keyboard shortcuts

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