Documentation
¶
Index ¶
- func FetchWithMajority[T any](ctx context.Context, nodes []*T, fetchFunc func(*T) (json.RawMessage, error)) (json.RawMessage, error)
- type Client
- func (c *Client) FetchBlockMerkleProof(ctx context.Context, rootHeight uint64, hotshotHeight uint64) (types.HotShotBlockMerkleProof, error)
- func (c *Client) FetchHeaderByHeight(ctx context.Context, blockHeight uint64) (types.HeaderImpl, error)
- func (c *Client) FetchHeadersByRange(ctx context.Context, from uint64, until uint64) ([]types.HeaderImpl, error)
- func (c *Client) FetchLatestBlockHeight(ctx context.Context) (uint64, error)
- func (c *Client) FetchRawHeaderByHeight(ctx context.Context, blockHeight uint64) (json.RawMessage, error)
- func (c *Client) FetchTransactionByHash(ctx context.Context, hash *types.TaggedBase64) (types.TransactionQueryData, error)
- func (c *Client) FetchTransactionsInBlock(ctx context.Context, blockHeight uint64, namespace uint64) (TransactionsInBlock, error)
- func (c *Client) FetchVidCommonByHeight(ctx context.Context, blockHeight uint64) (common.VidCommon, error)
- func (c *Client) SubmitTransaction(ctx context.Context, tx types.Transaction) (*types.TaggedBase64, error)
- type EspressoClient
- type MultipleNodesClient
- func (c *MultipleNodesClient) FetchHeaderByHeight(ctx context.Context, height uint64) (types.HeaderImpl, error)
- func (c *MultipleNodesClient) FetchHeadersByRange(ctx context.Context, from uint64, until uint64) ([]types.HeaderImpl, error)
- func (c *MultipleNodesClient) FetchLatestBlockHeight(ctx context.Context) (uint64, error)
- func (c *MultipleNodesClient) FetchRawHeaderByHeight(ctx context.Context, height uint64) (json.RawMessage, error)
- func (c *MultipleNodesClient) FetchTransactionByHash(ctx context.Context, hash *types.TaggedBase64) (types.TransactionQueryData, error)
- func (c *MultipleNodesClient) FetchTransactionsInBlock(ctx context.Context, blockHeight uint64, namespace uint64) (TransactionsInBlock, error)
- func (c *MultipleNodesClient) FetchVidCommonByHeight(ctx context.Context, blockHeight uint64) (common.VidCommon, error)
- func (c *MultipleNodesClient) SubmitTransaction(ctx context.Context, tx common.Transaction) (*common.TaggedBase64, error)
- type NamespaceResponse
- type QueryService
- type SubmitAPI
- type TransactionsInBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchWithMajority ¶
func FetchWithMajority[T any](ctx context.Context, nodes []*T, fetchFunc func(*T) (json.RawMessage, error)) (json.RawMessage, error)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) FetchBlockMerkleProof ¶
func (c *Client) FetchBlockMerkleProof(ctx context.Context, rootHeight uint64, hotshotHeight uint64) (types.HotShotBlockMerkleProof, error)
Fetches a block merkle proof at the snapshot rootHeight for the leaf at the provided HotShot height
func (*Client) FetchHeaderByHeight ¶
func (*Client) FetchHeadersByRange ¶
func (*Client) FetchLatestBlockHeight ¶
func (*Client) FetchRawHeaderByHeight ¶
func (*Client) FetchTransactionByHash ¶
func (c *Client) FetchTransactionByHash(ctx context.Context, hash *types.TaggedBase64) (types.TransactionQueryData, error)
func (*Client) FetchTransactionsInBlock ¶
func (*Client) FetchVidCommonByHeight ¶
func (*Client) SubmitTransaction ¶
func (c *Client) SubmitTransaction(ctx context.Context, tx types.Transaction) (*types.TaggedBase64, error)
type EspressoClient ¶
type EspressoClient interface { QueryService SubmitAPI }
type MultipleNodesClient ¶
type MultipleNodesClient struct {
// contains filtered or unexported fields
}
func NewMultipleNodesClient ¶
func NewMultipleNodesClient(urls []string) *MultipleNodesClient
func (*MultipleNodesClient) FetchHeaderByHeight ¶
func (c *MultipleNodesClient) FetchHeaderByHeight(ctx context.Context, height uint64) (types.HeaderImpl, error)
func (*MultipleNodesClient) FetchHeadersByRange ¶
func (c *MultipleNodesClient) FetchHeadersByRange(ctx context.Context, from uint64, until uint64) ([]types.HeaderImpl, error)
func (*MultipleNodesClient) FetchLatestBlockHeight ¶
func (c *MultipleNodesClient) FetchLatestBlockHeight(ctx context.Context) (uint64, error)
func (*MultipleNodesClient) FetchRawHeaderByHeight ¶
func (c *MultipleNodesClient) FetchRawHeaderByHeight(ctx context.Context, height uint64) (json.RawMessage, error)
func (*MultipleNodesClient) FetchTransactionByHash ¶
func (c *MultipleNodesClient) FetchTransactionByHash(ctx context.Context, hash *types.TaggedBase64) (types.TransactionQueryData, error)
func (*MultipleNodesClient) FetchTransactionsInBlock ¶
func (c *MultipleNodesClient) FetchTransactionsInBlock(ctx context.Context, blockHeight uint64, namespace uint64) (TransactionsInBlock, error)
func (*MultipleNodesClient) FetchVidCommonByHeight ¶
func (*MultipleNodesClient) SubmitTransaction ¶
func (c *MultipleNodesClient) SubmitTransaction(ctx context.Context, tx common.Transaction) (*common.TaggedBase64, error)
type NamespaceResponse ¶
type NamespaceResponse struct { Proof *json.RawMessage `json:"proof"` Transactions *[]types.Transaction `json:"transactions"` }
type QueryService ¶
type QueryService interface { // Get the latest block number FetchLatestBlockHeight(ctx context.Context) (uint64, error) // Get the header for block number `height`. FetchHeaderByHeight(ctx context.Context, height uint64) (types.HeaderImpl, error) // Get the raw header for block number `height`. FetchRawHeaderByHeight(ctx context.Context, height uint64) (json.RawMessage, error) // Get the headers starting from the given :from up until the given :until FetchHeadersByRange(ctx context.Context, from uint64, until uint64) ([]types.HeaderImpl, error) // Get the transactions belonging to the given namespace at the block height, // along with a proof that these are all such transactions. FetchTransactionsInBlock(ctx context.Context, blockHeight uint64, namespace uint64) (TransactionsInBlock, error) // Get the transaction by its hash. FetchTransactionByHash(ctx context.Context, hash *types.TaggedBase64) (types.TransactionQueryData, error) // Get the VidCommon for the given block height. FetchVidCommonByHeight(ctx context.Context, blockHeight uint64) (types.VidCommon, error) }
Interface to the Espresso Sequencer query service.
type SubmitAPI ¶
type SubmitAPI interface { // Submit a transaction to the espresso sequencer. SubmitTransaction(ctx context.Context, tx common.Transaction) (*common.TaggedBase64, error) }
Interface to the Espresso Sequencer submit API
type TransactionsInBlock ¶
type TransactionsInBlock struct { // The transactions. Transactions []types.Bytes `json:"transactions"` // A proof that these are all the transactions in the block with the requested namespace. Proof types.NamespaceProof `json:"proof"` VidCommon types.VidCommon `json:"vidCommon"` }
Response to `FetchTransactionsInBlock`
func (*TransactionsInBlock) UnmarshalJSON ¶
func (t *TransactionsInBlock) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.