starknet

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 20 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 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.Logger) *Client

func (*Client) RequestBlockBodies added in v0.7.0

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

func (*Client) RequestBlockHeaders added in v0.7.0

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

func (*Client) RequestEvents added in v0.7.0

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

func (*Client) RequestReceipts added in v0.7.0

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

func (*Client) RequestTransactions added in v0.7.0

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

type Handler

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

func NewHandler

func NewHandler(bcReader blockchain.Reader, log utils.Logger) *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) 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