client

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultClientInterceptors added in v0.3.2

func DefaultClientInterceptors(logger zerolog.Logger) []grpc.UnaryClientInterceptor

func NewConnection

func NewConnection(
	target string,
	logger zerolog.Logger,
) (*grpc.ClientConn, error)

func NewConnectionWithInterceptors added in v0.3.2

func NewConnectionWithInterceptors(
	target string,
	inter ...grpc.UnaryClientInterceptor,
) (*grpc.ClientConn, error)

func NewConnectionWithMetrics added in v0.3.2

func NewConnectionWithMetrics(
	target string,
	metricsNamespace string,
	logger zerolog.Logger,
) (*grpc.ClientConn, error)

Types

type Client

type Client interface {
	GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.BlockHeader, error)
	ExecuteScriptAtBlockHeight(ctx context.Context, height uint64, script []byte, arguments []cadence.Value) (cadence.Value, error)
	GetBlockByHeight(ctx context.Context, height uint64) (*flow.Block, error)
	GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.Transaction, error)
	GetEventsForHeightRange(ctx context.Context, query flowgrpc.EventRangeQuery) ([]flow.BlockEvents, error)
	GetCollection(ctx context.Context, colID flow.Identifier) (*flow.Collection, error)
}

func NewClientFromConnection

func NewClientFromConnection(
	conn grpc.ClientConnInterface,
) Client

type ClosableClient

type ClosableClient interface {
	Client
	io.Closer
}

func NewClient

func NewClient(
	target string,
	logger zerolog.Logger,
) (ClosableClient, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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