Documentation ¶
Index ¶
- func Do[R any, T any](ctx context.Context, c *Client, url string, method string, payload R) (*T, error)
- func DoArrow[R any](ctx context.Context, c *Client, url string, method string, payload R) (*types.QueryResponse, error)
- func DoQuery[R any, T any](ctx context.Context, c *Client, method string, payload R) (*T, error)
- type ArchiveHeight
- type Client
- func (c *Client) BlockByNumber(ctx context.Context, blockNumber *big.Int) (*types.Block, error)
- func (c *Client) GeUrlFromNodeAndPath(node options.Node, path ...string) string
- func (c *Client) Get(ctx context.Context, query *types.Query) (*types.QueryResponse, error)
- func (c *Client) GetArrow(ctx context.Context, query *types.Query) (*types.QueryResponse, error)
- func (c *Client) GetContractCreator(ctx context.Context, addr common.Address) (*ContractCreatorResponse, error)
- func (c *Client) GetHeight(ctx context.Context) (*big.Int, error)
- func (c *Client) GetQueryUrlFromNode(node options.Node) string
- func (c *Client) GetRPC() *ethclient.Client
- func (c *Client) HeaderByNumber(ctx context.Context, blockNumber *big.Int) (*types.Header, error)
- func (c *Client) Stream(ctx context.Context, query *types.Query, opts *options.StreamOptions) (*Stream, error)
- func (c *Client) StreamBlocksInRange(ctx context.Context, fromBlock *big.Int, toBlock *big.Int, ...) (*Stream, error)
- func (c *Client) StreamFullBlocksInRange(ctx context.Context, fromBlock *big.Int, toBlock *big.Int, ...) (*Stream, error)
- func (c *Client) StreamLogsInRange(ctx context.Context, fromBlock *big.Int, toBlock *big.Int, ...) (*Stream, error)
- func (c *Client) StreamTracesInRange(ctx context.Context, fromBlock *big.Int, toBlock *big.Int, ...) (*Stream, error)
- func (c *Client) StreamTransactionsInRange(ctx context.Context, fromBlock *big.Int, toBlock *big.Int, ...) (*Stream, error)
- type ContractCreatorResponse
- type Hyper
- type Stream
- func (s *Stream) Ack()
- func (s *Stream) Channel() <-chan *types.QueryResponse
- func (s *Stream) Done() <-chan struct{}
- func (s *Stream) Err() <-chan error
- func (s *Stream) ProcessNextQuery(query *types.Query) (*types.QueryResponse, error)
- func (s *Stream) QueueError(err error)
- func (s *Stream) Subscribe() error
- func (s *Stream) Unsubscribe() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArchiveHeight ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BlockByNumber ¶
func (*Client) GeUrlFromNodeAndPath ¶
func (*Client) GetContractCreator ¶
func (c *Client) GetContractCreator(ctx context.Context, addr common.Address) (*ContractCreatorResponse, error)
GetContractCreator fetches the transaction details of the creator of a specified contract address.
This function sends a POST request to the Envio API to retrieve information about the contract creator. It takes the context, network ID, and contract address as parameters and returns the transaction details.
Parameters: - ctx: The context for managing the request lifecycle. - networkId: The ID of the network where the contract is deployed. - addr: The contract address for which the creator's transaction details are to be fetched.
Returns: - *Transaction: The transaction details of the contract creator, if found. - error: An error if the request fails or the contract is not found.
func (*Client) HeaderByNumber ¶
func (*Client) StreamBlocksInRange ¶
func (*Client) StreamFullBlocksInRange ¶
func (*Client) StreamLogsInRange ¶
func (*Client) StreamTracesInRange ¶
func (*Client) StreamTransactionsInRange ¶
type ContractCreatorResponse ¶
type Hyper ¶
type Hyper struct {
// contains filtered or unexported fields
}
Hyper manages a collection of blockchain clients.
func NewHyper ¶
NewHyper creates a new instance of HyperSync with the given context and options. It validates the provided options and initializes clients for each blockchain network.
Returns an error if the options are invalid or if a client for any network cannot be created.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream represents a streaming process that handles data queries and responses using a client and worker for concurrent processing.
func NewStream ¶
func NewStream(ctx context.Context, client *Client, query *types.Query, opts *options.StreamOptions) (*Stream, error)
NewStream creates a new Stream instance with the provided context, client, query, and options.
func (*Stream) Ack ¶
func (s *Stream) Ack()
Ack acknowledges that a response has been processed. This method is thread-safe.
func (*Stream) Channel ¶
func (s *Stream) Channel() <-chan *types.QueryResponse
Channel returns the stream's response channel.
func (*Stream) Done ¶
func (s *Stream) Done() <-chan struct{}
Done returns a channel that signals when the stream is done.
func (*Stream) ProcessNextQuery ¶
ProcessNextQuery processes the next query using the client and returns the response or error.
func (*Stream) QueueError ¶
QueueError adds an error to the stream's error channel.
func (*Stream) Subscribe ¶
Subscribe starts the streaming process, initializing the first query and handling subsequent ones.
func (*Stream) Unsubscribe ¶
Unsubscribe stops the stream and closes all channels associated with it.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package arrowhs provides functionality to read and process query responses using Cap'n Proto for message decoding and Apache Arrow for data processing.
|
Package arrowhs provides functionality to read and process query responses using Cap'n Proto for message decoding and Apache Arrow for data processing. |
Package logger provides a global logging interface for structured logging.
|
Package logger provides a global logging interface for structured logging. |
Package streams provides a framework for creating and managing concurrent worker pools to process streams of data, including utilities for iterating over blocks of data.
|
Package streams provides a framework for creating and managing concurrent worker pools to process streams of data, including utilities for iterating over blocks of data. |
Package types provides the definitions for various data structures used in the hypersync-client-go library.
|
Package types provides the definitions for various data structures used in the hypersync-client-go library. |