node

package
v1.16.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 16 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?`
	GET_HARDFORK_ROUND = `/v1/screst/6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d9/hardfork?name=`
)

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) GetHardForkRound added in v1.12.1

func (h *NodeHolder) GetHardForkRound(hardFork string) (int64, 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