node

package
v1.11.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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 Node

type Node struct {
	// contains filtered or unexported fields
}

func NewNode

func NewNode(id string) *Node

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 (h *NodeHolder) GetBlockByRound(ctx context.Context, numSharders int, round int64) (b *block.Block, err error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL