grpc

package
v0.5.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHeightRequestHeader

func GetHeightRequestHeader(height int64) grpc.CallOption

GetHeightRequestHeader returns the grpc.CallOption to query the state at a given height

Types

type Client

type Client struct {
	SlashingQueryClient     slashingtypes.QueryClient
	TmsService              tmservice.ServiceClient
	TxService               tx.ServiceClient
	BankQueryClient         banktypes.QueryClient
	AuthQueryClient         authtypes.QueryClient
	GovQueryClient          govtypes.QueryClient
	MintQueryClient         minttypes.QueryClient
	StakingQueryClient      stakingtypes.QueryClient
	DistributionQueryClient distributiontypes.QueryClient
	AuthzQueryClient        authztypes.QueryClient
	FeegrantQueryClient     feegranttypes.QueryClient
	IbcTransferQueryClient  ibctransfertypes.QueryClient
	LiquidityQueryClient    liquiditytypes.QueryClient
	GraphQueryClient        graphtypes.QueryClient
	BandwidthQueryClient    bandwidthtypes.QueryClient
	DMNQueryClient          dmntypes.QueryClient
	GridQueryClient         gridtypes.QueryClient
	RankQueryClient         ranktypes.QueryClient
	ResourcesQueryClient    resourcestypes.QueryClient
	// contains filtered or unexported fields
}

func New

func New(cfg Config, l zerolog.Logger) *Client

func (*Client) Block

func (c *Client) Block(ctx context.Context, height int64) (*cometbftcoretypes.ResultBlock, error)

func (*Client) GetTotalSupply

func (c *Client) GetTotalSupply(ctx context.Context, height int64) (basetypes.Coins, error)

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

func (*Client) Stop

func (c *Client) Stop(_ context.Context) error

func (*Client) Txs

func (c *Client) Txs(ctx context.Context, height int64, txs cometbfttypes.Txs) ([]*tx.GetTxResponse, error)

Txs queries for all the transactions in a block. Transactions are returned in sdk.TxResponse format which internally contains a sdk.Tx. An error is returned if any query fails.

func (*Client) Validators

func (c *Client) Validators(ctx context.Context, height int64) (*cometbftcoretypes.ResultValidators, error)

type Config

type Config struct {
	Host             string `env:"GRPC_URL" envDefault:"http://localhost:9090"`
	SecureConnection bool   `env:"GRPC_SECURE_CONNECTION" envDefault:"false"`
	MetricsEnabled   bool   `env:"METRICS_ENABLED" envDefault:"false"`
}

Jump to

Keyboard shortcuts

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