Documentation ¶
Overview ¶
MIT License
Copyright (c) 2016 GenesisCommunity ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- func GetBlockchainURL() string
- func GetCommissionWallet(ecosystem int64) string
- func GetFirstBlockData() (*consts.FirstBlock, error)
- func GetFuelRate(ecosystem int64) string
- func GetGapsBetweenBlocks() int64
- func GetIncorrectBlocksPerDay() int
- func GetLocalNodeBanTime() time.Duration
- func GetMaxBlockFuel() int64
- func GetMaxBlockGenerationTime() int64
- func GetMaxBlockSize() int64
- func GetMaxBlockUserTx() int
- func GetMaxColumns() int
- func GetMaxForsignSize() int64
- func GetMaxIndexes() int
- func GetMaxTxCount() int
- func GetMaxTxFuel() int64
- func GetMaxTxSize() int64
- func GetNodeBanTime() time.Duration
- func GetNodeHostByPosition(position int64) (string, error)
- func GetNodePositionByKeyID(keyID int64) (int64, error)
- func GetNodePublicKeyByPosition(position int64) ([]byte, error)
- func GetNumberOfNodes() int64
- func GetNumberOfNodesFromDB(transaction *model.DbTransaction) int64
- func GetRbBlocks1() int64
- func GetRemoteHosts() []string
- func GetSizeFuel() int64
- func GetSleepTimeByKey(myKeyID, prevBlockNodePosition int64) (int64, error)
- func GetSleepTimeByPosition(CurrentPosition, prevBlockNodePosition int64) (int64, error)
- func HasSys(name string) bool
- func SetFirstBlockData(data *consts.FirstBlock)
- func SysInt(name string) int
- func SysInt64(name string) int64
- func SysString(name string) string
- func SysUpdate(dbTransaction *model.DbTransaction) error
- type FullNode
Constants ¶
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_count` // 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_block_user_tx` // SizeFuel is the fuel cost of 1024 bytes of the transaction data SizeFuel = `size_fuel` // CommissionWallet is the address for commissions CommissionWallet = `commission_wallet` // RbBlocks1 rollback from queue_bocks RbBlocks1 = `rb_blocks_1` // 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` )
Variables ¶
This section is empty.
Functions ¶
func GetBlockchainURL ¶
func GetBlockchainURL() string
GetBlockchainURL is retrieving blockchain url
func GetCommissionWallet ¶
GetCommissionWallet is returns commission wallet
func GetFirstBlockData ¶
func GetFirstBlockData() (*consts.FirstBlock, error)
GetFirstBlockData gets data of first block from global variable
func GetGapsBetweenBlocks ¶
func GetGapsBetweenBlocks() int64
GetGapsBetweenBlocks is returns gaps between blocks
func GetIncorrectBlocksPerDay ¶
func GetIncorrectBlocksPerDay() int
func GetLocalNodeBanTime ¶
func GetMaxBlockGenerationTime ¶
func GetMaxBlockGenerationTime() int64
GetMaxBlockGenerationTime is returns max block generation time (in ms)
func GetMaxBlockUserTx ¶
func GetMaxBlockUserTx() int
GetMaxBlockUserTx is returns max tx block user
func GetMaxForsignSize ¶
func GetMaxForsignSize() int64
GetMaxTxTextSize is returns max tx text size
func GetNodeBanTime ¶
func GetNodeHostByPosition ¶
GetNodeHostByPosition is retrieving node host by position
func GetNodePositionByKeyID ¶
GetNodePositionByKeyID is returning node position by key id
func GetNodePublicKeyByPosition ¶
GetNodePublicKeyByPosition is retrieving node public key by position
func GetNumberOfNodesFromDB ¶
func GetNumberOfNodesFromDB(transaction *model.DbTransaction) int64
func GetRemoteHosts ¶
func GetRemoteHosts() []string
GetRemoteHosts returns array of hostnames excluding myself
func GetSleepTimeByKey ¶
GetSleepTimeByKey is returns sleep time by key
func GetSleepTimeByPosition ¶
GetSleepTimeByPosition is returns sleep time by position
func SetFirstBlockData ¶
func SetFirstBlockData(data *consts.FirstBlock)
SetFirstBlockData sets data of first block to global variable
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 }
FullNode is storing full node data
func GetNodeByHost ¶
func GetNodeByPosition ¶
GetNodeByPosition is retrieving node by position
func (*FullNode) MarshalJSON ¶
func (*FullNode) UnmarshalJSON ¶
UnmarshalJSON is custom json unmarshaller