Documentation
¶
Index ¶
- func InitMetrics()
- type BlocksMap
- type Client
- func (c *Client) GetBlock(ctx context.Context, params structs.HeightHash) (block structs.Block, er error)
- func (c *Client) GetReward(ctx context.Context, pparams []structs.HeightAccount) (resps []structs.GetRewardResponse, err error)
- func (c *Client) GetTx(ctx context.Context, heightMin, heightMax uint64, qstring []string) (txs []structs.Transaction, err error)
- func (c *Client) SearchTx(ctx context.Context, r structs.HeightHash, block structs.Block, perPage uint64) (txs []structs.Transaction, err error)
- type ClientConfig
- type SimpleBlockCache
- type TxLogError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlocksMap ¶
type BlocksMap struct { sync.Mutex Blocks map[uint64]structs.Block NumTxs uint64 StartHeight uint64 EndHeight uint64 }
BlocksMap map of blocks to control block map with extra summary of number of transactions
type Client ¶
type Client struct { Sbc *SimpleBlockCache // contains filtered or unexported fields }
Client is a Tendermint RPC client for cosmos using figmentnetworks datahub
func NewClient ¶
func NewClient(chainID string, logger *zap.Logger, cli *grpc.ClientConn, cfg *ClientConfig) *Client
NewClient returns a new client for a given endpoint
func (*Client) GetBlock ¶ added in v0.2.2
func (c *Client) GetBlock(ctx context.Context, params structs.HeightHash) (block structs.Block, er error)
GetBlock fetches most recent block from chain
func (*Client) GetReward ¶ added in v0.0.5
func (c *Client) GetReward(ctx context.Context, pparams []structs.HeightAccount) (resps []structs.GetRewardResponse, err error)
GetReward fetches total rewards for delegator account
type ClientConfig ¶ added in v0.2.3
type SimpleBlockCache ¶ added in v0.2.3
type SimpleBlockCache struct {
// contains filtered or unexported fields
}
SimpleBlockCache simple in memory block cache to store latest blocks
func NewSimpleBlockCache ¶ added in v0.2.3
func NewSimpleBlockCache(cap int) *SimpleBlockCache
NewSimpleBlockCache a SimpleBlockCache constructor
func (*SimpleBlockCache) Add ¶ added in v0.2.3
func (sbc *SimpleBlockCache) Add(bl structs.Block)
Add blocks to the cache (thread safe)
type TxLogError ¶
type TxLogError struct { Codespace string `json:"codespace"` Code float64 `json:"code"` Message string `json:"message"` }
TxLogError Error message
Source Files
¶
Click to show internal directories.
Click to hide internal directories.