Documentation ¶
Index ¶
- type Proxy
- func (p *Proxy) Block(ctx context.Context, height int64) (*tmctypes.ResultBlock, error)
- func (p *Proxy) BlockResults(ctx context.Context, height int64) (*tmctypes.ResultBlockResults, error)
- func (p *Proxy) Genesis(ctx context.Context) (*tmctypes.ResultGenesis, error)
- func (p *Proxy) LatestHeight(ctx context.Context) (int64, error)
- func (p *Proxy) Status(ctx context.Context) (*tmctypes.ResultStatus, error)
- func (p *Proxy) Stop() error
- func (p *Proxy) SubscribeNewBlocks(subscriber string) (<-chan tmctypes.ResultEvent, context.CancelFunc, error)
- func (p *Proxy) Tx(hash string) (*sdk.TxResponse, error)
- func (p *Proxy) Txs(block *tmctypes.ResultBlock) ([]*sdk.TxResponse, error)
- func (p *Proxy) Validators(ctx context.Context, height int64) (*tmctypes.ResultValidators, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy implements a wrapper around both a Tendermint RPC client and a cosmos SDK REST client that allows for essential data queries.
func NewProxy ¶
func NewProxy(rpcNode string, encodingConfig stargazeparams.EncodingConfig) (*Proxy, error)
NewProxy returns a new Proxy instance
func (*Proxy) BlockResults ¶
func (p *Proxy) BlockResults(ctx context.Context, height int64) (*tmctypes.ResultBlockResults, error)
BlockResults queries for block results by height. An error is returned if the query fails.
func (*Proxy) LatestHeight ¶
LatestHeight returns the latest block height on the active chain. An error is returned if the query fails.
func (*Proxy) SubscribeNewBlocks ¶
func (p *Proxy) SubscribeNewBlocks(subscriber string) (<-chan tmctypes.ResultEvent, context.CancelFunc, error)
SubscribeNewBlocks subscribes to the new block event handler through the RPC client with the given subscriber name. An receiving only channel, context cancel function and an error is returned. It is up to the caller to cancel the context and handle any errors appropriately.
func (*Proxy) Tx ¶
func (p *Proxy) Tx(hash string) (*sdk.TxResponse, error)
Tx queries for a transaction from the REST client and decodes it into a sdk.Tx if the transaction exists. An error is returned if the tx doesn't exist or decoding fails.
func (*Proxy) Txs ¶
func (p *Proxy) Txs(block *tmctypes.ResultBlock) ([]*sdk.TxResponse, error)
Txs queries for all the transactions in a block. Transactions are returned in the sdk.TxResponse format which internally contains an sdk.Tx. An error is returned if any query fails.
func (*Proxy) Validators ¶
Validators returns all the known Tendermint validators for a given block height. An error is returned if the query fails.