syspar

package
v0.0.0-...-8e17a21 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: GPL-2.0 Imports: 13 Imported by: 45

Documentation

Index

Constants

View Source
const (
	// NumberNodes is the number of nodes
	NumberNodes = `number_of_nodes`
	// FuelRate is the rate
	FuelRate = `fuel_rate`
	// FullNodes is the list of nodes
	FullNodes = `full_nodes`
	// GapsBetweenBlocks is the time between blocks
	GapsBetweenBlocks = `gap_between_blocks`
	// BlockchainURL is the address of the blockchain file.  For those who don't want to collect it from nodes
	BlockchainURL = `blockchain_url`
	// MaxBlockSize is the maximum size of the block
	MaxBlockSize = `max_block_size`
	// MaxTxSize is the maximum size of the transaction
	MaxTxSize = `max_tx_size`
	// MaxForsignSize is the maximum size of the forsign of transaction
	MaxForsignSize = `max_forsign_size`
	// MaxBlockFuel is the maximum fuel of the block
	MaxBlockFuel = `max_fuel_block`
	// MaxTxFuel is the maximum fuel of the transaction
	MaxTxFuel = `max_fuel_tx`
	// MaxTxCount is the maximum count of the transactions
	MaxTxCount = `max_tx_block`
	// MaxBlockGenerationTime is the time limit for block generation (in ms)
	MaxBlockGenerationTime = `max_block_generation_time`
	// MaxColumns is the maximum columns in tables
	MaxColumns = `max_columns`
	// MaxIndexes is the maximum indexes in tables
	MaxIndexes = `max_indexes`
	// MaxBlockUserTx is the maximum number of user's transactions in one block
	MaxBlockUserTx = `max_tx_block_per_user`
	// SizeFuel is the fuel cost of 1024 bytes of the transaction data
	SizeFuel = `price_tx_data`
	// CommissionWallet is the address for commissions
	CommissionWallet = `commission_wallet`
	// RbBlocks1 rollback from queue_bocks
	RbBlocks1 = `rollback_blocks`
	// BlockReward value of reward, which is chrged on block generation
	BlockReward = "block_reward"
	// IncorrectBlocksPerDay is value of incorrect blocks per day before global ban
	IncorrectBlocksPerDay = `incorrect_blocks_per_day`
	// NodeBanTime is value of ban time for bad nodes (in ms)
	NodeBanTime = `node_ban_time`
	// LocalNodeBanTime is value of local ban time for bad nodes (in ms)
	LocalNodeBanTime = `local_node_ban_time`
	// CommissionSize is the value of the commission
	CommissionSize = `commission_size`
	// Test equals true or 1 if we have a test blockchain
	Test = `test`
	// PrivateBlockchain is value defining blockchain mode
	PrivateBlockchain = `private_blockchain`

	// CostDefault is the default maximum cost of F
	CostDefault = int64(20000000)
)

Variables

This section is empty.

Functions

func GetBlockchainURL

func GetBlockchainURL() string

GetBlockchainURL is retrieving blockchain url

func GetCommissionWallet

func GetCommissionWallet(ecosystem int64) string

GetCommissionWallet is returns commission wallet

func GetCountOfActiveNodes

func GetCountOfActiveNodes() int64

GetCountOfActiveNodes is count of nodes with stopped = false

func GetFirstBlockData

func GetFirstBlockData() (*consts.FirstBlock, error)

GetFirstBlockData gets data of first block from global variable

func GetFuelRate

func GetFuelRate(ecosystem int64) string

GetFuelRate is returning fuel rate

func GetGapsBetweenBlocks

func GetGapsBetweenBlocks() int64

GetGapsBetweenBlocks is returns gaps between blocks

func GetIncorrectBlocksPerDay

func GetIncorrectBlocksPerDay() int

func GetLocalNodeBanTime

func GetLocalNodeBanTime() time.Duration

func GetMaxBlockFuel

func GetMaxBlockFuel() int64

GetMaxBlockFuel is returns max block fuel

func GetMaxBlockGenerationTime

func GetMaxBlockGenerationTime() int64

GetMaxBlockGenerationTime is returns max block generation time (in ms)

func GetMaxBlockSize

func GetMaxBlockSize() int64

GetMaxBlockSize is returns max block size

func GetMaxBlockUserTx

func GetMaxBlockUserTx() int

GetMaxBlockUserTx is returns max tx block user

func GetMaxColumns

func GetMaxColumns() int

GetMaxColumns is returns max columns

func GetMaxCost

func GetMaxCost() int64

func GetMaxForsignSize

func GetMaxForsignSize() int64

GetMaxTxTextSize is returns max tx text size

func GetMaxIndexes

func GetMaxIndexes() int

GetMaxIndexes is returns max indexes

func GetMaxTxCount

func GetMaxTxCount() int

GetMaxTxCount is returns max tx count

func GetMaxTxFuel

func GetMaxTxFuel() int64

GetMaxTxFuel is returns max tx fuel

func GetMaxTxSize

func GetMaxTxSize() int64

GetMaxTxSize is returns max tx size

func GetNodeBanTime

func GetNodeBanTime() time.Duration

func GetNodeHostByPosition

func GetNodeHostByPosition(position int64) (string, error)

GetNodeHostByPosition is retrieving node host by position

func GetNodePositionByKeyID

func GetNodePositionByKeyID(keyID int64) (int64, error)

GetNodePositionByKeyID is returning node position by key id

func GetNodePublicKeyByPosition

func GetNodePublicKeyByPosition(position int64) ([]byte, error)

GetNodePublicKeyByPosition is retrieving node public key by position

func GetNumberOfNodes

func GetNumberOfNodes() int64

GetNumberOfNodes is count number of nodes

func GetNumberOfNodesFromDB

func GetNumberOfNodesFromDB(transaction *model.DbTransaction) int64

func GetRbBlocks1

func GetRbBlocks1() int64

GetRbBlocks1 is returns RbBlocks1

func GetRemoteHosts

func GetRemoteHosts() []string

GetRemoteHosts returns array of hostnames excluding myself

func GetSizeFuel

func GetSizeFuel() int64

GetSizeFuel is returns fuel size

func HasSys

func HasSys(name string) bool

HasSys returns boolean whether this system parameter exists

func IsPrivateBlockchain

func IsPrivateBlockchain() bool

IsPrivateBlockchain returns the value of private_blockchain system parameter or true

func IsTestMode

func IsTestMode() bool

func SetFirstBlockData

func SetFirstBlockData(data *consts.FirstBlock)

SetFirstBlockData sets data of first block to global variable

func SysInt

func SysInt(name string) int

SysInt is converting sys string to int

func SysInt64

func SysInt64(name string) int64

SysInt64 is converting sys string to int64

func SysString

func SysString(name string) string

SysString returns string value of the system parameter

func SysUpdate

func SysUpdate(dbTransaction *model.DbTransaction) error

SysUpdate reloads/updates values of system parameters

Types

type FullNode

type FullNode struct {
	TCPAddress string
	APIAddress string
	KeyID      int64
	PublicKey  []byte
	UnbanTime  time.Time
	Stopped    bool
}

FullNode is storing full node data

func GetNode

func GetNode(wallet int64) *FullNode

GetNode is retrieving node by wallet

func GetNodeByHost

func GetNodeByHost(host string) (FullNode, error)

func GetNodeByPosition

func GetNodeByPosition(position int64) (*FullNode, error)

GetNodeByPosition is retrieving node by position

func GetNodes

func GetNodes() []FullNode

func (*FullNode) MarshalJSON

func (fn *FullNode) MarshalJSON() ([]byte, error)

func (*FullNode) UnmarshalJSON

func (fn *FullNode) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON is custom json unmarshaller

func (*FullNode) Validate

func (fn *FullNode) Validate() error

Validate checks values

Jump to

Keyboard shortcuts

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