rpc

package
v1.0.1-rc13 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*jsonrpcclient.WSClient
	*cometbftHttp.WSEvents

	RPCClient *cometbftHttp.HTTP
	// contains filtered or unexported fields
}

func New

func New(cfg Config) *Client

func (*Client) Genesis

func (c *Client) Genesis(ctx context.Context) (*cometbfttypes.GenesisDoc, error)

func (*Client) GetBlockEvents

func (c *Client) GetBlockEvents(ctx context.Context, height int64) (begin, end types.BlockerEvents, err error)

GetBlockEvents returns begin block and end block events.

func (*Client) GetBlockResults added in v1.1.0

func (c *Client) GetBlockResults(ctx context.Context, height int64) (*coretypes.ResultBlockResults, error)

func (*Client) GetLastBlockHeight

func (c *Client) GetLastBlockHeight(ctx context.Context) (int64, error)

func (*Client) GetTxResults added in v0.4.0

func (c *Client) GetTxResults(ctx context.Context, height int64) ([]*abci.ResponseDeliverTx, error)

func (*Client) Start

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

func (*Client) Stop

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

func (*Client) SubscribeNewBlocks

func (c *Client) SubscribeNewBlocks(ctx context.Context) (<-chan cometbftcoretypes.ResultEvent, error)

func (*Client) WsEnabled

func (c *Client) WsEnabled() bool

type Config

type Config struct {
	Host      string        `env:"RPC_URL" envDefault:"http://localhost:26657"`
	WSEnabled bool          `env:"WS_ENABLED" envDefault:"true"`
	Timeout   time.Duration `env:"RPC_TIMEOUT" envDefault:"15s"`
}

Jump to

Keyboard shortcuts

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