starknet

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockBodiesPID added in v0.7.0

func BlockBodiesPID(n *utils.Network) protocol.ID

func BlockHeadersPID added in v0.7.0

func BlockHeadersPID(n *utils.Network) protocol.ID

func CurrentBlockHeaderPID added in v0.10.0

func CurrentBlockHeaderPID(n *utils.Network) protocol.ID

Todo: consider merging this with BlockHeadersPID

func EventsPID added in v0.7.0

func EventsPID(n *utils.Network) protocol.ID

func ReceiptsPID added in v0.7.0

func ReceiptsPID(n *utils.Network) protocol.ID

func TransactionsPID added in v0.7.0

func TransactionsPID(n *utils.Network) protocol.ID

Types

type Client

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

func NewClient

func NewClient(newStream NewStreamFunc, snNetwork *utils.Network, log utils.SimpleLogger) *Client

func (*Client) RequestBlockBodies added in v0.7.0

func (c *Client) RequestBlockBodies(ctx context.Context, req *spec.BlockBodiesRequest) (iter.Seq[*spec.BlockBodiesResponse], error)

func (*Client) RequestBlockHeaders added in v0.7.0

func (c *Client) RequestBlockHeaders(
	ctx context.Context, req *spec.BlockHeadersRequest,
) (iter.Seq[*spec.BlockHeadersResponse], error)

func (*Client) RequestCurrentBlockHeader added in v0.10.0

func (c *Client) RequestCurrentBlockHeader(
	ctx context.Context, req *spec.CurrentBlockHeaderRequest,
) (iter.Seq[*spec.BlockHeadersResponse], error)

func (*Client) RequestEvents added in v0.7.0

func (c *Client) RequestEvents(ctx context.Context, req *spec.EventsRequest) (iter.Seq[*spec.EventsResponse], error)

func (*Client) RequestReceipts added in v0.7.0

func (c *Client) RequestReceipts(ctx context.Context, req *spec.ReceiptsRequest) (iter.Seq[*spec.ReceiptsResponse], error)

func (*Client) RequestTransactions added in v0.7.0

func (c *Client) RequestTransactions(ctx context.Context, req *spec.TransactionsRequest) (iter.Seq[*spec.TransactionsResponse], error)

type Handler

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

func NewHandler

func NewHandler(bcReader blockchain.Reader, log utils.SimpleLogger) *Handler

func (*Handler) BlockBodiesHandler added in v0.7.0

func (h *Handler) BlockBodiesHandler(stream network.Stream)

func (*Handler) BlockHeadersHandler added in v0.7.0

func (h *Handler) BlockHeadersHandler(stream network.Stream)

func (*Handler) CurrentBlockHeaderHandler added in v0.10.0

func (h *Handler) CurrentBlockHeaderHandler(stream network.Stream)

func (*Handler) EventsHandler added in v0.7.0

func (h *Handler) EventsHandler(stream network.Stream)

func (*Handler) ReceiptsHandler added in v0.7.0

func (h *Handler) ReceiptsHandler(stream network.Stream)

func (*Handler) TransactionsHandler added in v0.7.0

func (h *Handler) TransactionsHandler(stream network.Stream)

type NewStreamFunc

type NewStreamFunc func(ctx context.Context, pids ...protocol.ID) (network.Stream, error)

type Stream

type Stream[T any] func() (T, bool)

Stream represents a series of messages that can be accessed by invoking Stream a number of times. After stream is entirely consumed of elements, it should return false as its second return value

func StaticStream

func StaticStream[T any](elems ...T) Stream[T]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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