Documentation ¶
Overview ¶
Package firehose implements simplified APIs for accessing the StreamingFast Firehose gRPC service. See https://firehose.streamingfast.io/
Index ¶
- Constants
- func DefaultDialOptions(tokenURL, apiKey string) ([]grpc.DialOption, error)
- func ERC721TransferEvent() *ethpb.Event
- func ETHClient(ctx context.Context, endpointURL, tokenURL, apiKey string, ...) (svcpb.HydrantServiceClient, func() error, error)
- func ETHClientFromSecret(ctx context.Context, chainID uint64, apiKey *secrets.Secret) (svcpb.HydrantServiceClient, func() error, error)
- func ETHGoerliClient(ctx context.Context, apiKey string, opts ...grpc.DialOption) (svcpb.HydrantServiceClient, func() error, error)
- func ETHGoerliServer(ctx context.Context, apiKey string, opts ...grpc.DialOption) (svcpb.HydrantServiceServer, func() error, error)
- func ETHMainnetClient(ctx context.Context, apiKey string, opts ...grpc.DialOption) (svcpb.HydrantServiceClient, func() error, error)
- func ETHMainnetServer(ctx context.Context, apiKey string, opts ...grpc.DialOption) (svcpb.HydrantServiceServer, func() error, error)
- func ETHServer(ctx context.Context, endpointURL, tokenURL, apiKey string, ...) (svcpb.HydrantServiceServer, func() error, error)
- type Block
- type BlockProto
- type Blocks
- type Proxy
- func Dial[B BlockProto](ctx context.Context, endpointURL, tokenURL, apiKey string, ...) (*Proxy[B], error)
- func DialETHGoerli(ctx context.Context, apiKey string, opts ...grpc.DialOption) (*Proxy[*sfethpb.Block], error)
- func DialETHMainnet(ctx context.Context, apiKey string, opts ...grpc.DialOption) (*Proxy[*sfethpb.Block], error)
Constants ¶
const ( TokenURL = "https://auth.dfuse.io/v1/auth/issue" ETHMainnetURL = "mainnet.eth.streamingfast.io:443" ETHGoerliURL = "goerli.eth.streamingfast.io:443" )
Production URLs for the hosted Firehose service.
Variables ¶
This section is empty.
Functions ¶
func DefaultDialOptions ¶
func DefaultDialOptions(tokenURL, apiKey string) ([]grpc.DialOption, error)
DefaultDialOptions returns gRPC DialOptions suitable for calling production Firehose servers as run by StreamingFast.
func ERC721TransferEvent ¶
ERC721TransferEvent returns the protobuf signature of an ERC721 Transfer event.
func ETHClient ¶
func ETHClient(ctx context.Context, endpointURL, tokenURL, apiKey string, opts ...grpc.DialOption) (svcpb.HydrantServiceClient, func() error, error)
ETHClient returns a new Ethereum Hydrant service client.
func ETHClientFromSecret ¶
func ETHClientFromSecret(ctx context.Context, chainID uint64, apiKey *secrets.Secret) (svcpb.HydrantServiceClient, func() error, error)
ETHClientFromSecret returns a new Ethereum Hydrant service client for the given chain ID using the provided secret.
func ETHGoerliClient ¶
func ETHGoerliClient(ctx context.Context, apiKey string, opts ...grpc.DialOption) (svcpb.HydrantServiceClient, func() error, error)
ETHGoerliClient returns a new Ethereum Hydrant service client connected to the Goerli endpoint.
func ETHGoerliServer ¶
func ETHGoerliServer(ctx context.Context, apiKey string, opts ...grpc.DialOption) (svcpb.HydrantServiceServer, func() error, error)
ETHGoerliServer returns a new Ethereum Hydrant service server connected to the Goerli endpoint.
func ETHMainnetClient ¶
func ETHMainnetClient(ctx context.Context, apiKey string, opts ...grpc.DialOption) (svcpb.HydrantServiceClient, func() error, error)
ETHMainnetClient returns a new Ethereum Hydrant service client connected to the Mainnet endpoint.
func ETHMainnetServer ¶
func ETHMainnetServer(ctx context.Context, apiKey string, opts ...grpc.DialOption) (svcpb.HydrantServiceServer, func() error, error)
ETHMainnetServer returns a new Ethereum Hydrant service server connected to the Mainnet endpoint.
Types ¶
type Block ¶
type Block[B BlockProto] struct { Response *hosepb.Response Block B }
An Block couples a Firehose response with an unmarshalled block of concrete type.
type BlockProto ¶
BlockProto is a type constraint limited to the types of blocks supported by Firehose.
type Blocks ¶
type Blocks[B BlockProto] struct { // C is a channel on which new Blocks are sent. It is closed when either the // stream client ends or an error occurs. C <-chan Block[B] // contains filtered or unexported fields }
A Blocks stream provides a channel of blocks.
type Proxy ¶
type Proxy[B BlockProto] struct { // contains filtered or unexported fields }
A Proxy provides access to the Firehose service through a modified API.
func Dial ¶
func Dial[B BlockProto](ctx context.Context, endpointURL, tokenURL, apiKey string, opts ...grpc.DialOption) (*Proxy[B], error)
Dial dials the gRPC endpoint with tokens obtained from the token URL. If no gRPC DialOptions are provided then DefaultDialOptions(…) is used.
func DialETHGoerli ¶
func DialETHGoerli(ctx context.Context, apiKey string, opts ...grpc.DialOption) (*Proxy[*sfethpb.Block], error)
DialETHGoerli is equivalent to Dial() with URLs to connect to the Ethereum Goerli endpoint and sfethpb.Block as the type argument.
func DialETHMainnet ¶
func DialETHMainnet(ctx context.Context, apiKey string, opts ...grpc.DialOption) (*Proxy[*sfethpb.Block], error)
DialETHMainnet is equivalent to Dial() with URLs to connect to the Ethereum Mainnet endpoint and sfethpb.Block as the type argument.
Directories ¶
Path | Synopsis |
---|---|
Package firehosetest provides test doubles for the StreamingFast Firehose service, coupled to EVM code running on a simulated blockchain.
|
Package firehosetest provides test doubles for the StreamingFast Firehose service, coupled to EVM code running on a simulated blockchain. |
The hydrant binary connects to the StreamingFast Firehose service to expose simplified APIs.
|
The hydrant binary connects to the StreamingFast Firehose service to expose simplified APIs. |