blockchain

package
v1.17.0-RC4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 7 Imported by: 4

Documentation

Overview

Methods and types for blockchain entities and interactions.

Index

Constants

This section is empty.

Variables

View Source
var Sharders *node.NodeHolder

Functions

func GetAllSharders added in v1.11.0

func GetAllSharders() []string

GetSharders get sharders

func GetBlockWorker

func GetBlockWorker() string

GetBlockWorker get block worker

func GetChainID

func GetChainID() string

GetChainConfig get chain config

func GetMaxTxnQuery

func GetMaxTxnQuery() int

GetMaxTxnQuery get max transaction query

func GetMinConfirmation

func GetMinConfirmation() int

func GetMinSubmit

func GetMinSubmit() int

func GetMiners

func GetMiners() []string

GetMiners get miners

func GetQuerySleepTime

func GetQuerySleepTime() int

func GetSharders

func GetSharders() []string

GetSharders get healthy sharders

func GetStableMiners added in v1.11.0

func GetStableMiners() []string

GetStableMiners get stable miners

func PopulateChain

func PopulateChain(minerjson string, sharderjson string) error

PopulateChain populate chain from json string

  • minerjson is the array of miner urls, serialized as json
  • sharderjson is the array of sharder urls, serialized as json

func PopulateNodes

func PopulateNodes(nodesjson string) ([]string, error)

PopulateNodes populate nodes from json string

  • nodesjson is the json string

func ResetStableMiners added in v1.11.0

func ResetStableMiners()

ResetStableMiners reset stable miners to random miners

func SetBlockWorker

func SetBlockWorker(blockWorker string)

func SetChainID

func SetChainID(id string)

func SetMaxTxnQuery

func SetMaxTxnQuery(num int)

SetMaxTxnQuery set max transaction query, maximum number of trials to query a transaction confirmation from sharders.

  • num is the number of transaction query

func SetMinConfirmation

func SetMinConfirmation(minConfirmation int)

SetMinConfirmation set minimum confirmation, minimum number of miners to confirm a transaction

  • minConfirmation is the minimum confirmation

func SetMinSubmit

func SetMinSubmit(minSubmit int)

SetMinSubmit set minimum submit, minimum number of miners to submit a transaction

  • minSubmit is the minimum submit

func SetMiners

func SetMiners(minerArray []string)

func SetQuerySleepTime

func SetQuerySleepTime(time int)

SetQuerySleepTime set query sleep time, number of seconds to sleep between each transaction query.

  • time is the sleep time

func SetSharders

func SetSharders(sharderArray []string)

Types

type ChainConfig

type ChainConfig struct {
	BlockWorker     string
	Sharders        []string
	Miners          []string
	MinSubmit       int
	MinConfirmation int
	ChainID         string
	MaxTxnQuery     int
	QuerySleepTime  int
}

type StakePoolSettings added in v1.8.5

type StakePoolSettings struct {
	DelegateWallet string  `json:"delegate_wallet"`
	NumDelegates   int     `json:"num_delegates"`
	ServiceCharge  float64 `json:"service_charge"`
}

StakePoolSettings information.

type StorageNode

type StorageNode struct {
	ID      string `json:"id"`
	Baseurl string `json:"url"`
	// contains filtered or unexported fields
}

StorageNode represents a storage node (blobber)

func (*StorageNode) IsSkip

func (sn *StorageNode) IsSkip() bool

IsSkip check if skip

func (*StorageNode) SetSkip

func (sn *StorageNode) SetSkip(t bool)

SetSkip set skip, whether to skip this node in operations or not

  • t is the boolean value

type UpdateStakePoolSettings added in v1.8.17

type UpdateStakePoolSettings struct {
	DelegateWallet *string  `json:"delegate_wallet,omitempty"`
	NumDelegates   *int     `json:"num_delegates,omitempty"`
	ServiceCharge  *float64 `json:"service_charge,omitempty"`
}

UpdateStakePoolSettings represent stake pool information of a provider node.

type UpdateValidationNode added in v1.8.17

type UpdateValidationNode struct {
	ID                string                   `json:"id"`
	BaseURL           *string                  `json:"url"`
	StakePoolSettings *UpdateStakePoolSettings `json:"stake_pool_settings"`
}

UpdateValidationNode represents a validation node (miner) update

type ValidationNode added in v1.8.5

type ValidationNode struct {
	ID                string            `json:"id"`
	BaseURL           string            `json:"url"`
	StakePoolSettings StakePoolSettings `json:"stake_pool_settings"`
}

ValidationNode represents a validation node (miner)

Jump to

Keyboard shortcuts

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