Documentation ¶
Index ¶
- Constants
- func InitCache(sharders *NodeHolder)
- type Node
- type NodeHolder
- func (h *NodeHolder) All() (res []string)
- func (h *NodeHolder) Fail(id string)
- func (h *NodeHolder) GetBalanceFieldFromSharders(clientID, name string) (int64, string, error)
- func (h *NodeHolder) GetBlockByRound(ctx context.Context, numSharders int, round int64) (b *block.Block, err error)
- func (h *NodeHolder) GetNonceFromSharders(clientID string) (int64, string, error)
- func (h *NodeHolder) GetRoundFromSharders() (int64, error)
- func (h *NodeHolder) Healthy() (res []string)
- func (h *NodeHolder) QueryFromSharders(numSharders int, query string, result chan *util.GetResponse)
- func (h *NodeHolder) QueryFromShardersContext(ctx context.Context, numSharders int, query string, ...)
- func (h *NodeHolder) Success(id string)
- type NonceCache
Constants ¶
View Source
const ( GET_BALANCE = `/v1/client/get/balance?client_id=` CURRENT_ROUND = "/v1/current-round" GET_BLOCK_INFO = `/v1/block/get?` )
Variables ¶
This section is empty.
Functions ¶
func InitCache ¶
func InitCache(sharders *NodeHolder)
Types ¶
type NodeHolder ¶
type NodeHolder struct {
// contains filtered or unexported fields
}
func NewHolder ¶
func NewHolder(nodes []string, consensus int) *NodeHolder
func (*NodeHolder) All ¶
func (h *NodeHolder) All() (res []string)
func (*NodeHolder) Fail ¶
func (h *NodeHolder) Fail(id string)
func (*NodeHolder) GetBalanceFieldFromSharders ¶
func (h *NodeHolder) GetBalanceFieldFromSharders(clientID, name string) (int64, string, error)
func (*NodeHolder) GetBlockByRound ¶
func (*NodeHolder) GetNonceFromSharders ¶
func (h *NodeHolder) GetNonceFromSharders(clientID string) (int64, string, error)
func (*NodeHolder) GetRoundFromSharders ¶
func (h *NodeHolder) GetRoundFromSharders() (int64, error)
func (*NodeHolder) Healthy ¶
func (h *NodeHolder) Healthy() (res []string)
func (*NodeHolder) QueryFromSharders ¶
func (h *NodeHolder) QueryFromSharders(numSharders int, query string, result chan *util.GetResponse)
func (*NodeHolder) QueryFromShardersContext ¶
func (h *NodeHolder) QueryFromShardersContext(ctx context.Context, numSharders int, query string, result chan *util.GetResponse)
func (*NodeHolder) Success ¶
func (h *NodeHolder) Success(id string)
type NonceCache ¶
type NonceCache struct {
// contains filtered or unexported fields
}
var Cache *NonceCache
func (*NonceCache) Evict ¶
func (nc *NonceCache) Evict(clientId string)
func (*NonceCache) GetNextNonce ¶
func (nc *NonceCache) GetNextNonce(clientId string) int64
func (*NonceCache) Set ¶
func (nc *NonceCache) Set(clientId string, nonce int64)
Click to show internal directories.
Click to hide internal directories.