Documentation ¶
Index ¶
- Variables
- func CreateGrpcConnection(cfg *GRPCConfig) (*grpc.ClientConn, error)
- func GetHeightRequestContext(context context.Context, height int64) context.Context
- func MustCreateGrpcConnection(cfg *GRPCConfig) *grpc.ClientConn
- type Details
- type GRPCConfig
- type Node
- func (cp *Node) Block(height int64) (*tmctypes.ResultBlock, error)
- func (cp *Node) BlockResults(height int64) (*tmctypes.ResultBlockResults, error)
- func (cp *Node) ChainID() (string, error)
- func (cp *Node) ConsensusState() (*constypes.RoundStateSimple, error)
- func (cp *Node) Genesis() (*tmctypes.ResultGenesis, error)
- func (cp *Node) LatestHeight() (int64, error)
- func (cp *Node) Stop()
- func (cp *Node) SubscribeEvents(subscriber, query string) (<-chan tmctypes.ResultEvent, context.CancelFunc, error)
- func (cp *Node) SubscribeNewBlocks(subscriber string) (<-chan tmctypes.ResultEvent, context.CancelFunc, error)
- func (cp *Node) Tx(hash string) (*types.Tx, error)
- func (cp *Node) TxSearch(query string, page *int, perPage *int, orderBy string) (*tmctypes.ResultTxSearch, error)
- func (cp *Node) Txs(block *tmctypes.ResultBlock) ([]*types.Tx, error)
- func (cp *Node) Validators(height int64) (*tmctypes.ResultValidators, error)
- type RPCConfig
- type Source
Constants ¶
This section is empty.
Variables ¶
var (
HTTPProtocols = regexp.MustCompile("https?://")
)
Functions ¶
func CreateGrpcConnection ¶
func CreateGrpcConnection(cfg *GRPCConfig) (*grpc.ClientConn, error)
CreateGrpcConnection creates a new gRPC client connection from the given configuration
func GetHeightRequestContext ¶
GetHeightRequestContext adds the height to the context for querying the state at a given height
func MustCreateGrpcConnection ¶
func MustCreateGrpcConnection(cfg *GRPCConfig) *grpc.ClientConn
MustCreateGrpcConnection creates a new gRPC connection using the provided configuration and panics on error
Types ¶
type Details ¶
type Details struct { RPC *RPCConfig `yaml:"rpc"` GRPC *GRPCConfig `yaml:"grpc"` }
Details represents a node details for a remote node
func DefaultDetails ¶
func DefaultDetails() *Details
func NewDetails ¶
func NewDetails(rpc *RPCConfig, grpc *GRPCConfig) *Details
type GRPCConfig ¶
GRPCConfig contains the configuration for the RPC endpoint
func DefaultGrpcConfig ¶
func DefaultGrpcConfig() *GRPCConfig
DefaultGrpcConfig returns the default instance of a GrpcConfig
func NewGrpcConfig ¶
func NewGrpcConfig(address string, insecure bool) *GRPCConfig
NewGrpcConfig allows to build a new GrpcConfig instance
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node implements a wrapper around both a Tendermint RPCConfig client and a chain SDK REST client that allows for essential data queries.
func (*Node) Block ¶
func (cp *Node) Block(height int64) (*tmctypes.ResultBlock, error)
Block implements node.Node
func (*Node) BlockResults ¶
func (cp *Node) BlockResults(height int64) (*tmctypes.ResultBlockResults, error)
BlockResults implements node.Node
func (*Node) ConsensusState ¶
func (cp *Node) ConsensusState() (*constypes.RoundStateSimple, error)
ConsensusState implements node.Node
func (*Node) Genesis ¶
func (cp *Node) Genesis() (*tmctypes.ResultGenesis, error)
Genesis implements node.Node
func (*Node) LatestHeight ¶
LatestHeight implements node.Node
func (*Node) SubscribeEvents ¶
func (cp *Node) SubscribeEvents(subscriber, query string) (<-chan tmctypes.ResultEvent, context.CancelFunc, error)
SubscribeEvents implements node.Node
func (*Node) SubscribeNewBlocks ¶
func (cp *Node) SubscribeNewBlocks(subscriber string) (<-chan tmctypes.ResultEvent, context.CancelFunc, error)
SubscribeNewBlocks implements node.Node
func (*Node) TxSearch ¶
func (cp *Node) TxSearch(query string, page *int, perPage *int, orderBy string) (*tmctypes.ResultTxSearch, error)
TxSearch implements node.Node
func (*Node) Validators ¶
func (cp *Node) Validators(height int64) (*tmctypes.ResultValidators, error)
Validators implements node.Node
type RPCConfig ¶
type RPCConfig struct { ClientName string `yaml:"client_name"` Address string `yaml:"address"` MaxConnections int `yaml:"max_connections"` }
RPCConfig contains the configuration for the RPC endpoint
func DefaultRPCConfig ¶
func DefaultRPCConfig() *RPCConfig
DefaultRPCConfig returns the default instance of RPCConfig
func NewRPCConfig ¶
NewRPCConfig allows to build a new RPCConfig instance