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) GetRewardBalances(ctx context.Context, pparams []structs.HeightAccount) (resps map[uint64]structs.GetRewardResponse, err error)
- func (c *Client) GetTx(ctx context.Context, qstring []string) (txs []*tx.GetTxsEventResponse, err error)
- func (c *Client) GetValidatorRewardsFromTx(txResp *types.TxResponse, ...) (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) GetRewardBalances ¶ added in v0.5.0
func (c *Client) GetRewardBalances(ctx context.Context, pparams []structs.HeightAccount) (resps map[uint64]structs.GetRewardResponse, err error)
GetReward fetches total rewards for delegator account
func (*Client) GetTx ¶ added in v0.5.0
func (c *Client) GetTx(ctx context.Context, qstring []string) (txs []*tx.GetTxsEventResponse, err error)
SearchTx is making search api call
func (*Client) GetValidatorRewardsFromTx ¶ added in v0.5.0
func (c *Client) GetValidatorRewardsFromTx(txResp *types.TxResponse, cc map[rstructs.ValidatorAndCurrency]structs.RewardAmount, v map[string]bool) (err error)
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.