core

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetricScDeployEnableEpoch represents the epoch when the deployment of smart contracts will be enabled
	MetricScDeployEnableEpoch = "erd_smart_contract_deploy_enable_epoch"

	//MetricBuiltInFunctionsEnableEpoch represents the epoch when the built in functions will be enabled
	MetricBuiltInFunctionsEnableEpoch = "erd_built_in_functions_enable_epoch"

	//MetricRelayedTransactionsEnableEpoch represents the epoch when the relayed transactions will be enabled
	MetricRelayedTransactionsEnableEpoch = "erd_relayed_transactions_enable_epoch"

	//MetricPenalizedTooMuchGasEnableEpoch represents the epoch when the penalization for using too much gas will be enabled
	MetricPenalizedTooMuchGasEnableEpoch = "erd_penalized_too_much_gas_enable_epoch"

	//MetricSwitchJailWaitingEnableEpoch represents the epoch when the system smart contract processing at end of epoch is enabled
	MetricSwitchJailWaitingEnableEpoch = "erd_switch_jail_waiting_enable_epoch"

	//MetricSwitchHysteresisForMinNodesEnableEpoch represents the epoch when the system smart contract changes its config to consider
	//also (minimum) hysteresis nodes for the minimum number of nodes
	MetricSwitchHysteresisForMinNodesEnableEpoch = "erd_switch_hysteresis_for_min_nodes_enable_epoch"

	//MetricBelowSignedThresholdEnableEpoch represents the epoch when the change for computing rating for validators below signed rating is enabled
	MetricBelowSignedThresholdEnableEpoch = "erd_below_signed_threshold_enable_epoch"

	//MetricTransactionSignedWithTxHashEnableEpoch represents the epoch when the node will also accept transactions that are
	//signed with the hash of transaction
	MetricTransactionSignedWithTxHashEnableEpoch = "erd_transaction_signed_with_txhash_enable_epoch"

	//MetricMetaProtectionEnableEpoch represents the epoch when the transactions to the metachain are checked to have enough gas
	MetricMetaProtectionEnableEpoch = "erd_meta_protection_enable_epoch"

	//MetricAheadOfTimeGasUsageEnableEpoch represents the epoch when the cost of smart contract prepare changes from compiler per byte to ahead of time prepare per byte
	MetricAheadOfTimeGasUsageEnableEpoch = "erd_ahead_of_time_gas_usage_enable_epoch"

	//MetricGasPriceModifierEnableEpoch represents the epoch when the gas price modifier in fee computation is enabled
	MetricGasPriceModifierEnableEpoch = "erd_gas_price_modifier_enable_epoch"

	//MetricRepairCallbackEnableEpoch represents the epoch when the callback repair is activated for scrs
	MetricRepairCallbackEnableEpoch = "erd_repair_callback_enable_epoch"

	//MetricBlockGasAndFreeRecheckEnableEpoch represents the epoch when gas and fees used in each created or processed block are re-checked
	MetricBlockGasAndFreeRecheckEnableEpoch = "erd_block_gas_and_fee_recheck_enable_epoch"

	//MetricStakingV2EnableEpoch represents the epoch when staking v2 is enabled
	MetricStakingV2EnableEpoch = "erd_staking_v2_enable_epoch"

	//MetricStakeEnableEpoch represents the epoch when staking is enabled
	MetricStakeEnableEpoch = "erd_stake_enable_epoch"

	//MetricDoubleKeyProtectionEnableEpoch represents the epoch when double key protection is enabled
	MetricDoubleKeyProtectionEnableEpoch = "erd_double_key_protection_enable_epoch"

	//MetricEsdtEnableEpoch represents the epoch when ESDT is enabled
	MetricEsdtEnableEpoch = "erd_esdt_enable_epoch"

	//MetricGovernanceEnableEpoch  represents the epoch when governance is enabled
	MetricGovernanceEnableEpoch = "erd_governance_enable_epoch"

	//MetricDelegationManagerEnableEpoch represents the epoch when the delegation manager is enabled epoch should not be 0
	MetricDelegationManagerEnableEpoch = "erd_delegation_manager_enable_epoch"

	//MetricDelegationSmartContractEnableEpoch represents the epoch when delegation smart contract is enabled epoch should not be 0
	MetricDelegationSmartContractEnableEpoch = "erd_delegation_smart_contract_enable_epoch"

	// MetricIncrementSCRNonceInMultiTransferEnableEpoch represents the epoch when the fix for multi transfer SCR is enabled
	MetricIncrementSCRNonceInMultiTransferEnableEpoch = "erd_increment_scr_nonce_in_multi_transfer_enable_epoch"
)
View Source
const (
	// StorerOrder defines the order of storers to be notified of a start of epoch event
	StorerOrder = iota
	// NodesCoordinatorOrder defines the order in which NodesCoordinator is notified of a start of epoch event
	NodesCoordinatorOrder
	// ConsensusOrder defines the order in which Consensus is notified of a start of epoch event
	ConsensusOrder
	// NetworkShardingOrder defines the order in which the network sharding subsystem is notified of a start of epoch event
	NetworkShardingOrder
	// IndexerOrder defines the order in which Indexer is notified of a start of epoch event
	IndexerOrder
	// NetStatisticsOrder defines the order in which netStatistic component is notified of a start of epoch event
	NetStatisticsOrder
	// OldDatabaseCleanOrder defines the order in which oldDatabaseCleaner component is notified of a start of epoch event
	OldDatabaseCleanOrder
)
View Source
const AdditionalScrForEachScCallOrSpecialTx = 3

AdditionalScrForEachScCallOrSpecialTx specifies the additional number of smart contract results which should be considered by a node, when it includes sc calls or special txs in a miniblock. Ex.: normal txs -> aprox. 27000, sc calls or special txs -> aprox. 6250 = 27000 / (AdditionalScrForEachScCallOrSpecialTx + 1), considering that constant below is set to 3

View Source
const AllShardId = uint32(0xFFFFFFF0)

AllShardId will be used to identify that a message is for all shards

View Source
const AsyncCallStepField = "AsyncCallStep"

AsyncCallStepField is the field name for the gas cost for any of the two steps required to execute an async call

View Source
const AsyncCallbackGasLockField = "AsyncCallbackGasLock"

AsyncCallbackGasLockField is the field name for the gas amount to be locked before executing the destination async call, to be put aside for the async callback

View Source
const BaseOperationCost = "BaseOperationCost"

BaseOperationCost represents the field name for base operation costs

View Source
const BuiltInCost = "BuiltInCost"

BuiltInCost represents the field name for built in operation costs

View Source
const BuiltInFunctionChangeOwnerAddress = "ChangeOwnerAddress"

BuiltInFunctionChangeOwnerAddress is the key for the change owner built in function built-in function

View Source
const BuiltInFunctionClaimDeveloperRewards = "ClaimDeveloperRewards"

BuiltInFunctionClaimDeveloperRewards is the key for the claim developer rewards built-in function

View Source
const BuiltInFunctionESDTBurn = "ESDTBurn"

BuiltInFunctionESDTBurn is the key for the elrond standard digital token burn built-in function

View Source
const BuiltInFunctionESDTFreeze = "ESDTFreeze"

BuiltInFunctionESDTFreeze is the key for the elrond standard digital token freeze built-in function

View Source
const BuiltInFunctionESDTLocalBurn = "ESDTLocalBurn"

BuiltInFunctionESDTLocalBurn is the key for the elrond standard digital token local burn built-in function

View Source
const BuiltInFunctionESDTLocalMint = "ESDTLocalMint"

BuiltInFunctionESDTLocalMint is the key for the elrond standard digital token local mint built-in function

View Source
const BuiltInFunctionESDTNFTAddQuantity = "ESDTNFTAddQuantity"

BuiltInFunctionESDTNFTAddQuantity is the key for the elrond standard digital token NFT add quantity built-in function

View Source
const BuiltInFunctionESDTNFTBurn = "ESDTNFTBurn"

BuiltInFunctionESDTNFTBurn is the key for the elrond standard digital token NFT burn built-in function

View Source
const BuiltInFunctionESDTNFTCreate = "ESDTNFTCreate"

BuiltInFunctionESDTNFTCreate is the key for the elrond standard digital token NFT create built-in function

View Source
const BuiltInFunctionESDTNFTCreateRoleTransfer = "ESDTNFTCreateRoleTransfer"

BuiltInFunctionESDTNFTCreateRoleTransfer is the key for the elrond standard digital token create role transfer function

View Source
const BuiltInFunctionESDTNFTTransfer = "ESDTNFTTransfer"

BuiltInFunctionESDTNFTTransfer is the key for the elrond standard digital token NFT transfer built-in function

View Source
const BuiltInFunctionESDTPause = "ESDTPause"

BuiltInFunctionESDTPause is the key for the elrond standard digital token pause built-in function

View Source
const BuiltInFunctionESDTTransfer = "ESDTTransfer"

BuiltInFunctionESDTTransfer is the key for the elrond standard digital token transfer built-in function

View Source
const BuiltInFunctionESDTUnFreeze = "ESDTUnFreeze"

BuiltInFunctionESDTUnFreeze is the key for the elrond standard digital token unfreeze built-in function

View Source
const BuiltInFunctionESDTUnPause = "ESDTUnPause"

BuiltInFunctionESDTUnPause is the key for the elrond standard digital token unpause built-in function

View Source
const BuiltInFunctionESDTWipe = "ESDTWipe"

BuiltInFunctionESDTWipe is the key for the elrond standard digital token wipe built-in function

View Source
const BuiltInFunctionSaveKeyValue = "SaveKeyValue"

BuiltInFunctionSaveKeyValue is the key for the save key value built-in function

View Source
const BuiltInFunctionSetESDTRole = "ESDTSetRole"

BuiltInFunctionSetESDTRole is the key for the elrond standard digital token set built-in function

View Source
const BuiltInFunctionSetUserName = "SetUserName"

BuiltInFunctionSetUserName is the key for the set user name built-in function

View Source
const BuiltInFunctionUnSetESDTRole = "ESDTUnSetRole"

BuiltInFunctionUnSetESDTRole is the key for the elrond standard digital token unset built-in function

View Source
const CombinedPeerType = "%s (%s)"

CombinedPeerType - represents the combination of two peerTypes

View Source
const CommitMaxTime = 3 * time.Second

CommitMaxTime represents max time accepted for a commit action, after which a warn message is displayed

View Source
const ConsensusTopic = "consensus"

ConsensusTopic is the topic used in consensus algorithm

View Source
const DefaultDBPath = "db"

DefaultDBPath is the default path for nodes databases

View Source
const DefaultEpochString = "Epoch"

DefaultEpochString is the default folder root name for node per epoch databases

View Source
const DefaultInterceptorsIdentifier = "default interceptor"

DefaultInterceptorsIdentifier represents the identifier that is used in conjunction with regular interceptors (that makes the node run properly)

View Source
const DefaultLogProfileIdentifier = "[default log profile]"

DefaultLogProfileIdentifier represents the default log profile used when the logviewer/termui applications do not need to change the current logging profile

View Source
const DefaultResolversIdentifier = "default resolver"

DefaultResolversIdentifier represents the identifier that is used in conjunction with regular resolvers (that makes the node run properly)

View Source
const DefaultShardString = "Shard"

DefaultShardString is the default folder root name for per shard databases

View Source
const DefaultStaticDbString = "Static"

DefaultStaticDbString is the default name for the static databases (not changing with epoch)

View Source
const DefaultStatsPath = "stats"

DefaultStatsPath is the default path where the node stats are logged

View Source
const DefaultUnstakedEpoch = math.MaxUint32

DefaultUnstakedEpoch represents the default epoch that is set for a validator that has not unstaked yet

View Source
const DelegationSystemSCKey = "delegation"

DelegationSystemSCKey is the key under which there is data in case of system delegation smart contracts

View Source
const DisabledShardIDAsObserver = uint32(0xFFFFFFFF) - 7

DisabledShardIDAsObserver defines the uint32 identifier which tells that the node hasn't configured any preferred shard to start in as observer

View Source
const ESDTKeyIdentifier = "esdt"

ESDTKeyIdentifier is the key prefix for esdt tokens

View Source
const ESDTNFTLatestNonceIdentifier = "nonce"

ESDTNFTLatestNonceIdentifier is the key prefix for esdt latest nonce identifier

View Source
const ESDTRoleIdentifier = "role"

ESDTRoleIdentifier is the key prefix for esdt role identifier

View Source
const ESDTRoleLocalBurn = "ESDTRoleLocalBurn"

ESDTRoleLocalBurn is the constant string for the local role of burn for ESDT tokens

View Source
const ESDTRoleLocalMint = "ESDTRoleLocalMint"

ESDTRoleLocalMint is the constant string for the local role of mint for ESDT tokens

View Source
const ESDTRoleNFTAddQuantity = "ESDTRoleNFTAddQuantity"

ESDTRoleNFTAddQuantity is the constant string for the local role of adding quantity for existing ESDT NFT tokens

View Source
const ESDTRoleNFTBurn = "ESDTRoleNFTBurn"

ESDTRoleNFTBurn is the constant string for the local role of burn for ESDT NFT tokens

View Source
const ESDTRoleNFTCreate = "ESDTRoleNFTCreate"

ESDTRoleNFTCreate is the constant string for the local role of create for ESDT NFT tokens

View Source
const ElrondAPICost = "ElrondAPICost"

ElrondAPICost represents the field name of the Elrond SC API (EEI) gas costs

View Source
const ElrondProtectedKeyPrefix = "ELROND"

ElrondProtectedKeyPrefix is the key prefix which is protected from writing in the trie - only for special builtin functions

View Source
const EpochStartInterceptorsIdentifier = "epoch start interceptor"

EpochStartInterceptorsIdentifier represents the identifier that is used in the start-in-epoch process

View Source
const ExtraDelayBetweenBroadcastMbsAndTxs = 1 * time.Second

ExtraDelayBetweenBroadcastMbsAndTxs represents the number of seconds to wait since miniblocks have been broadcast and the moment when theirs transactions would be broadcast too

View Source
const ExtraDelayForBroadcastBlockInfo = 1 * time.Second

ExtraDelayForBroadcastBlockInfo represents the number of seconds to wait since a block has been broadcast and the moment when its components, like mini blocks and transactions, would be broadcast too

ExtraDelayForRequestBlockInfo represents the number of seconds to wait since a block has been received and the moment when its components, like mini blocks and transactions, would be requested too if they are still missing

View Source
const FileModeUserReadWrite = 0600

FileModeUserReadWrite represents the permission for a file which allows the user for reading and writing

View Source
const FungibleESDT = "FungibleESDT"

FungibleESDT defines the string for the token type of fungible ESDT

View Source
const GetNodeFromDBErrorString = "getNodeFromDB error"

GetNodeFromDBErrorString represents the string which is returned when a getting node from DB returns an error

View Source
const HardforkInterceptorsIdentifier = "hardfork interceptor"

HardforkInterceptorsIdentifier represents the identifier that is used in the hardfork process

View Source
const HardforkResolversIdentifier = "hardfork resolver"

HardforkResolversIdentifier represents the resolver that is used in the hardfork process

View Source
const HeartbeatTopic = "heartbeat"

HeartbeatTopic is the topic used for heartbeat signaling

View Source
const HighestRoundFromBootStorage = "highestRoundFromBootStorage"

HighestRoundFromBootStorage is the key for the highest round that is saved in storage

View Source
const ImportComplete = "importComplete"

ImportComplete signals that a node restart will be done because the import did complete

View Source
const InvalidMessageBlacklistDuration = time.Second * 3600

InvalidMessageBlacklistDuration represents the time to keep a peer in the black list if it sends a message that does not follow the protocol: example not useing the same marshaler as the other peers

View Source
const LastNonceKeyMetricsStorage = "lastNonce"

LastNonceKeyMetricsStorage holds the key used for storing the last nonce for stored metrics

View Source
const MaxBufferSizeToSendTrieNodes = 1 << 18 //256KB

MaxBufferSizeToSendTrieNodes represents max buffer size to send in bytes used when resolving trie nodes Every trie node that has a greater size than this constant is considered a large trie node and should be split in smaller chunks

View Source
const MaxBulkTransactionSize = 1 << 18 //256KB bulks

MaxBulkTransactionSize specifies the maximum size of one bulk with txs which can be send over the network TODO convert this const into a var and read it from config when this code moves to another binary

View Source
const MaxLeafSize = uint64(1 << 26) //64MB

MaxLeafSize represents maximum amount of data which can be saved under one leaf

View Source
const MaxLenForESDTIssueMint = 100

MaxLenForESDTIssueMint defines the maximum length in bytes for the issued/minted balance

View Source
const MaxNumShards = 256

MaxNumShards represents the maximum number of shards possible in the system

View Source
const MaxRetriesToCreateDB = 10

MaxRetriesToCreateDB represents the maximum number of times to try to create DB if it failed

View Source
const MaxRoundsWithoutCommittedStartInEpochBlock = 50

MaxRoundsWithoutCommittedStartInEpochBlock defines the maximum rounds to wait for start in epoch block to be committed, before a special action to be applied

View Source
const MaxRoyalty = uint32(10000)

MaxRoyalty defines 100% as uint32

View Source
const MaxSoftwareVersionLengthInBytes = 10

MaxSoftwareVersionLengthInBytes represents the maximum length for the software version to be saved in block header

View Source
const MaxTxNonceDeltaAllowed = 30000

MaxTxNonceDeltaAllowed specifies the maximum difference between an account's nonce and a received transaction's nonce in order to mark the transaction as valid.

View Source
const MaxTxsToRequest = 1000

MaxTxsToRequest specifies the maximum number of txs to request

View Source
const MaxUserNameLength = 32

MaxUserNameLength represents the maximum number of bytes a UserName can have

View Source
const MaxWaitingTimeToReceiveRequestedItem = 5 * time.Second

MaxWaitingTimeToReceiveRequestedItem represents the maximum waiting time in seconds needed to receive the requested items

View Source
const MeasurementsLoggerFormat = "%.4fs"

MeasurementsLoggerFormat contains the formatting string to output elapsed time in seconds in a consistent way

View Source
const MegabyteSize = 1024 * 1024

MegabyteSize represents the size in bytes of a megabyte

View Source
const MetaChainSystemSCsCost = "MetaChainSystemSCsCost"

MetaChainSystemSCsCost represents the field name for metachain system smart contract operation costs

View Source
const MetachainShardId = uint32(0xFFFFFFFF)

MetachainShardId will be used to identify a shard ID as metachain

View Source
const MetachainShardName = "metachain"

MetachainShardName is the string identifier of the metachain shard

View Source
const MetricAppVersion = "erd_app_version"

MetricAppVersion is the metric for the current app version

View Source
const MetricAverageBlockTxCount = "erd_average_block_tx_count"

MetricAverageBlockTxCount holds the average count of transactions in a block

View Source
const MetricChainId = "erd_chain_id"

MetricChainId is the metric that specifies current chain id

View Source
const MetricConnectedNodes = "erd_connected_nodes"

MetricConnectedNodes is the metric for monitoring total connected nodes on the network

View Source
const MetricConsensusGroupSize = "erd_consensus_group_size"

MetricConsensusGroupSize is the metric for consensus group size for the current shard/meta

View Source
const MetricConsensusRoundState = "erd_consensus_round_state"

MetricConsensusRoundState is the metric for consensus round state for a block

View Source
const MetricConsensusState = "erd_consensus_state"

MetricConsensusState is the metric for consensus state of node proposer,participant or not consensus group

View Source
const MetricCountAcceptedBlocks = "erd_count_accepted_blocks"

MetricCountAcceptedBlocks is the metric for monitoring number of blocks that was accepted proposed by a node

View Source
const MetricCountConsensus = "erd_count_consensus"

MetricCountConsensus is the metric for monitoring number of rounds when a node was in consensus group

View Source
const MetricCountConsensusAcceptedBlocks = "erd_count_consensus_accepted_blocks"

MetricCountConsensusAcceptedBlocks is the metric for monitoring number of blocks accepted when the node was in consensus group

View Source
const MetricCountLeader = "erd_count_leader"

MetricCountLeader is the metric for monitoring number of rounds when a node was leader

View Source
const MetricCpuLoadPercent = "erd_cpu_load_percent"

MetricCpuLoadPercent is the metric for monitoring CPU load [%]

View Source
const MetricCreatedProposedBlock = "erd_consensus_created_proposed_block"

MetricCreatedProposedBlock is the metric that specify the percent of the block subround used for header and body creation (0 meaning that the block was created in no-time and 100 meaning that the block creation used all the subround spare duration)

View Source
const MetricCrossCheckBlockHeight = "erd_cross_check_block_height"

MetricCrossCheckBlockHeight is the metric that store cross block height

View Source
const MetricCurrentBlockHash = "erd_current_block_hash"

MetricCurrentBlockHash is the metric that stores the current block hash

View Source
const MetricCurrentRound = "erd_current_round"

MetricCurrentRound is the metric for monitoring the current round of a node

View Source
const MetricCurrentRoundTimestamp = "erd_current_round_timestamp"

MetricCurrentRoundTimestamp is the metric that stores current round timestamp

View Source
const MetricDenomination = "erd_denomination"

MetricDenomination is the metric for exposing the denomination

View Source
const MetricDevRewardsInEpoch = "erd_dev_rewards"

MetricDevRewardsInEpoch holds the developers' rewards value for the last epoch

View Source
const MetricEpochForEconomicsData = "erd_epoch_for_economics_data"

MetricEpochForEconomicsData holds the epoch for which economics data are computed

View Source
const MetricEpochNumber = "erd_epoch_number"

MetricEpochNumber is the metric for the number of epoch

View Source
const MetricGasPerDataByte = "erd_gas_per_data_byte"

MetricGasPerDataByte is the metric that specifies the required gas for a data byte

View Source
const MetricGasPriceModifier = "erd_gas_price_modifier"

MetricGasPriceModifier is the metric that specifies the gas price modifier

View Source
const MetricHeaderSize = "erd_current_block_size"

MetricHeaderSize is the metric that stores the current block size

View Source
const MetricHighestFinalBlock = "erd_highest_final_nonce"

MetricHighestFinalBlock is the metric for the nonce of the highest final block

View Source
const MetricInflation = "erd_inflation"

MetricInflation holds the inflation value for the last epoch

View Source
const MetricIsSyncing = "erd_is_syncing"

MetricIsSyncing is the metric for monitoring if a node is syncing

View Source
const MetricLastBlockTxCount = "erd_last_block_tx_count"

MetricLastBlockTxCount holds the number of transactions in the last block

View Source
const MetricLatestTagSoftwareVersion = "erd_latest_tag_software_version"

MetricLatestTagSoftwareVersion is the metric that stores the latest tag software version

View Source
const MetricLeaderPercentage = "erd_leader_percentage"

MetricLeaderPercentage is the metric for leader rewards percentage

View Source
const MetricLiveValidatorNodes = "erd_live_validator_nodes"

MetricLiveValidatorNodes is the metric for monitoring live validators on the network

View Source
const MetricMemHeapInUse = "erd_mem_heap_inuse"

MetricMemHeapInUse is a metric for monitoring the memory ("heap in use")

View Source
const MetricMemLoadPercent = "erd_mem_load_percent"

MetricMemLoadPercent is the metric for monitoring memory load [%]

View Source
const MetricMemStackInUse = "erd_mem_stack_inuse"

MetricMemStackInUse is a metric for monitoring the memory ("stack in use")

View Source
const MetricMemTotal = "erd_mem_total"

MetricMemTotal is the metric for monitoring total memory bytes

View Source
const MetricMemUsedGolang = "erd_mem_used_golang"

MetricMemUsedGolang is a metric for monitoring the memory ("total")

View Source
const MetricMemUsedSystem = "erd_mem_used_sys"

MetricMemUsedSystem is a metric for monitoring the memory ("sys mem")

View Source
const MetricMetaConsensusGroupSize = "erd_meta_consensus_group_size"

MetricMetaConsensusGroupSize is the metric for the metachain consensus group size

View Source
const MetricMinGasLimit = "erd_min_gas_limit"

MetricMinGasLimit is the metric that specifies the minimum gas limit

View Source
const MetricMinGasPrice = "erd_min_gas_price"

MetricMinGasPrice is the metric that specifies min gas price

View Source
const MetricMinTransactionVersion = "erd_min_transaction_version"

MetricMinTransactionVersion is the metric that specifies the minimum transaction version

View Source
const MetricMiniBlocksSize = "erd_mini_blocks_size"

MetricMiniBlocksSize is the metric that stores the current block size

View Source
const MetricNetworkRecvBps = "erd_network_recv_bps"

MetricNetworkRecvBps is the metric for monitoring network received bytes per second

View Source
const MetricNetworkRecvBpsPeak = "erd_network_recv_bps_peak"

MetricNetworkRecvBpsPeak is the metric for monitoring network received peak bytes per second

View Source
const MetricNetworkRecvBytesInCurrentEpochPerHost = "erd_network_recv_bytes_in_epoch_per_host"

MetricNetworkRecvBytesInCurrentEpochPerHost is the metric for monitoring network received bytes in current epoch per host

View Source
const MetricNetworkRecvPercent = "erd_network_recv_percent"

MetricNetworkRecvPercent is the metric for monitoring network receive load [%]

View Source
const MetricNetworkSendBytesInCurrentEpochPerHost = "erd_network_sent_bytes_in_epoch_per_host"

MetricNetworkSendBytesInCurrentEpochPerHost is the metric for monitoring network send bytes in current epoch per host

View Source
const MetricNetworkSentBps = "erd_network_sent_bps"

MetricNetworkSentBps is the metric for monitoring network sent bytes per second

View Source
const MetricNetworkSentBpsPeak = "erd_network_sent_bps_peak"

MetricNetworkSentBpsPeak is the metric for monitoring network sent peak bytes per second

View Source
const MetricNetworkSentPercent = "erd_network_sent_percent"

MetricNetworkSentPercent is the metric for monitoring network sent load [%]

View Source
const MetricNodeDisplayName = "erd_node_display_name"

MetricNodeDisplayName is the metric that stores the name of the node

View Source
const MetricNodeType = "erd_node_type"

MetricNodeType is the metric for monitoring the type of the node

View Source
const MetricNonce = "erd_nonce"

MetricNonce is the metric for monitoring the nonce of a node

View Source
const MetricNonceAtEpochStart = "erd_nonce_at_epoch_start"

MetricNonceAtEpochStart is the metric for storing the first nonce of the current epoch

View Source
const MetricNonceForTPS = "erd_nonce_for_tps"

MetricNonceForTPS is the metric for monitoring the nonce of a node used in TPS benchmarks

View Source
const MetricNoncesPassedInCurrentEpoch = "erd_nonces_passed_in_current_epoch"

MetricNoncesPassedInCurrentEpoch is the metric that tells the number of nonces passed in current epoch

View Source
const MetricNumConnectedPeers = "erd_num_connected_peers"

MetricNumConnectedPeers is the metric for monitoring the number of connected peers

View Source
const MetricNumConnectedPeersClassification = "erd_num_connected_peers_classification"

MetricNumConnectedPeersClassification is the metric for monitoring the number of connected peers split on the connection type

View Source
const MetricNumMetachainNodes = "erd_num_metachain_nodes"

MetricNumMetachainNodes is the metric which holds the number of nodes in metachain

View Source
const MetricNumMiniBlocks = "erd_num_mini_blocks"

MetricNumMiniBlocks is the metric for number of miniblocks in a block

View Source
const MetricNumNodesPerShard = "erd_num_nodes_in_shard"

MetricNumNodesPerShard is the metric which holds the number of nodes in a shard

View Source
const MetricNumProcessedTxs = "erd_num_transactions_processed"

MetricNumProcessedTxs is the metric that stores the number of transactions processed

View Source
const MetricNumProcessedTxsTPSBenchmark = "erd_num_transactions_processed_tps_benchmark"

MetricNumProcessedTxsTPSBenchmark is the metric that stores the number of transactions processed for tps benchmark

View Source
const MetricNumShardHeadersFromPool = "erd_num_shard_headers_from_pool"

MetricNumShardHeadersFromPool is the metric that stores number of shard header from pool

View Source
const MetricNumShardHeadersProcessed = "erd_num_shard_headers_processed"

MetricNumShardHeadersProcessed is the metric that stores number of shard header processed

View Source
const MetricNumShardsWithoutMetachain = "erd_num_shards_without_meta"

MetricNumShardsWithoutMetachain is the metric for monitoring the number of shards (excluding meta)

View Source
const MetricNumTimesInForkChoice = "erd_fork_choice_count"

MetricNumTimesInForkChoice is the metric that counts how many time a node was in fork choice

View Source
const MetricNumTxInBlock = "erd_num_tx_block"

MetricNumTxInBlock is the metric for the number of transactions in the proposed block

View Source
const MetricNumValidators = "erd_num_validators"

MetricNumValidators is the metric for the number of validators

View Source
const MetricP2PCrossShardObservers = "erd_p2p_cross_shard_observers"

MetricP2PCrossShardObservers is the metric that outputs the cross-shard connected observers

View Source
const MetricP2PCrossShardValidators = "erd_p2p_cross_shard_validators"

MetricP2PCrossShardValidators is the metric that outputs the cross-shard connected validators

View Source
const MetricP2PFullHistoryObservers = "erd_p2p_full_history_observers"

MetricP2PFullHistoryObservers is the metric that outputs the full-history connected observers

View Source
const MetricP2PIntraShardObservers = "erd_p2p_intra_shard_observers"

MetricP2PIntraShardObservers is the metric that outputs the intra-shard connected observers

View Source
const MetricP2PIntraShardValidators = "erd_p2p_intra_shard_validators"

MetricP2PIntraShardValidators is the metric that outputs the intra-shard connected validators

View Source
const MetricP2PNumConnectedPeersClassification = "erd_p2p_num_connected_peers_classification"

MetricP2PNumConnectedPeersClassification is the metric for monitoring the number of connected peers split on the connection type

View Source
const MetricP2PNumReceiverPeers = "erd_p2p_num_receiver_peers"

MetricP2PNumReceiverPeers represents the number of connected peer sent messages to the current peer (and have been received by the current peer) in the amount of time

View Source
const MetricP2PPeakNumReceiverPeers = "erd_p2p_peak_num_receiver_peers"

MetricP2PPeakNumReceiverPeers represents the peak number of connected peer sent messages to the current peer (and have been received by the current peer) in the amount of time

View Source
const MetricP2PPeakPeerNumProcessedMessages = "erd_p2p_peak_peer_num_processed_messages"

MetricP2PPeakPeerNumProcessedMessages represents the peak maximum number of processed messages in the amount of time counted on a connected peer

View Source
const MetricP2PPeakPeerNumReceivedMessages = "erd_p2p_peak_peer_num_received_messages"

MetricP2PPeakPeerNumReceivedMessages represents the peak maximum number of received messages in the amount of time counted on a connected peer

View Source
const MetricP2PPeakPeerSizeProcessedMessages = "erd_p2p_peak_peer_size_processed_messages"

MetricP2PPeakPeerSizeProcessedMessages represents the peak maximum size of processed data (sum of all messages) in the amount of time counted on a connected peer

View Source
const MetricP2PPeakPeerSizeReceivedMessages = "erd_p2p_peak_peer_size_received_messages"

MetricP2PPeakPeerSizeReceivedMessages represents the peak maximum size of received data (sum of all messages) in the amount of time counted on a connected peer

View Source
const MetricP2PPeerInfo = "erd_p2p_peer_info"

MetricP2PPeerInfo is the metric for the node's p2p info

View Source
const MetricP2PPeerNumProcessedMessages = "erd_p2p_peer_num_processed_messages"

MetricP2PPeerNumProcessedMessages represents the current maximum number of processed messages in the amount of time counted on a connected peer

View Source
const MetricP2PPeerNumReceivedMessages = "erd_p2p_peer_num_received_messages"

MetricP2PPeerNumReceivedMessages represents the current maximum number of received messages in the amount of time counted on a connected peer

View Source
const MetricP2PPeerSizeProcessedMessages = "erd_p2p_peer_size_processed_messages"

MetricP2PPeerSizeProcessedMessages represents the current maximum size of processed data (sum of all messages) in the amount of time counted on a connected peer

View Source
const MetricP2PPeerSizeReceivedMessages = "erd_p2p_peer_size_received_messages"

MetricP2PPeerSizeReceivedMessages represents the current maximum size of received data (sum of all messages) in the amount of time counted on a connected peer

View Source
const MetricP2PUnknownPeers = "erd_p2p_unknown_shard_peers"

MetricP2PUnknownPeers is the metric that outputs the unknown-shard connected peers

View Source
const MetricPeakTPS = "erd_peak_tps"

MetricPeakTPS holds the peak transactions per second

View Source
const MetricPeerSubType = "erd_peer_subtype"

MetricPeerSubType is the metric which tells the peer's subtype (regular observer or full history observer)

View Source
const MetricPeerType = "erd_peer_type"

MetricPeerType is the metric which tells the peer's type (in eligible list, in waiting list, or observer)

View Source
const MetricProbableHighestNonce = "erd_probable_highest_nonce"

MetricProbableHighestNonce is the metric for monitoring the max speculative nonce received by the node by listening on the network

View Source
const MetricProcessedProposedBlock = "erd_consensus_processed_proposed_block"

MetricProcessedProposedBlock is the metric that specify the percent of the block subround used for header and body processing (0 meaning that the block was processed in no-time and 100 meaning that the block processing used all the subround spare duration)

View Source
const MetricPublicKeyBlockSign = "erd_public_key_block_sign"

MetricPublicKeyBlockSign is the metric for monitoring public key of a node used in block signing

View Source
const MetricReceivedProposedBlock = "erd_consensus_received_proposed_block"

MetricReceivedProposedBlock is the metric that specify the moment in the round when the received block has reached the current node. The value is provided in percent (0 meaning it has been received just after the round started and 100 meaning that the block has been received in the last moment of the round)

View Source
const MetricRewardsTopUpGradientPoint = "erd_rewards_top_up_gradient_point"

MetricRewardsTopUpGradientPoint is the metric that specifies the rewards top up gradient point

View Source
const MetricRewardsValue = "erd_rewards_value"

MetricRewardsValue is the metric that stores rewards value

View Source
const MetricRoundAtEpochStart = "erd_round_at_epoch_start"

MetricRoundAtEpochStart is the metric for storing the first round of the current epoch

View Source
const MetricRoundDuration = "erd_round_duration"

MetricRoundDuration is the metric that specifies the round duration in milliseconds

View Source
const MetricRoundTime = "erd_round_time"

MetricRoundTime is the metric for round time in seconds

View Source
const MetricRoundsPassedInCurrentEpoch = "erd_rounds_passed_in_current_epoch"

MetricRoundsPassedInCurrentEpoch is the metric that tells the number of rounds passed in current epoch

View Source
const MetricRoundsPerEpoch = "erd_rounds_per_epoch"

MetricRoundsPerEpoch is the metric that tells the number of rounds in an epoch

View Source
const MetricShardConsensusGroupSize = "erd_shard_consensus_group_size"

MetricShardConsensusGroupSize is the metric for the shard consensus group size

View Source
const MetricShardId = "erd_shard_id"

MetricShardId is the metric for monitoring shard id of a node

View Source
const MetricStartTime = "erd_start_time"

MetricStartTime is the metric that specifies the genesis start time

View Source
const MetricSynchronizedRound = "erd_synchronized_round"

MetricSynchronizedRound is the metric for monitoring the synchronized round of a node

View Source
const MetricTopUpFactor = "erd_top_up_factor"

MetricTopUpFactor is the metric that specifies the top up factor

View Source
const MetricTopUpValue = "erd_total_top_up_value"

MetricTopUpValue holds the total top up value

View Source
const MetricTotalBaseStakedValue = "erd_total_base_staked_value"

MetricTotalBaseStakedValue holds the total base staked value

View Source
const MetricTotalFees = "erd_total_fees"

MetricTotalFees holds the total fees value for the last epoch

View Source
const MetricTotalSupply = "erd_total_supply"

MetricTotalSupply holds the total supply value for the last epoch

View Source
const MetricTxPoolLoad = "erd_tx_pool_load"

MetricTxPoolLoad is the metric for monitoring number of transactions from pool of a node

View Source
const MinLenArgumentsESDTNFTTransfer = 4

MinLenArgumentsESDTNFTTransfer defines the minimum length for esdt nft transfer

View Source
const MinLenArgumentsESDTTransfer = 2

MinLenArgumentsESDTTransfer defines the min length of arguments for the ESDT transfer

View Source
const MinMetaTxExtraGasCost = uint64(1_000_000)

MinMetaTxExtraGasCost is the constant defined for minimum gas value to be sent in meta transaction

View Source
const NodesCoordinatorRegistryKeyPrefix = "indexHashed_"

NodesCoordinatorRegistryKeyPrefix is the key prefix to save epoch start registry to storage

View Source
const NodesSetupJsonFileName = "nodesSetup.json"

NodesSetupJsonFileName specifies the name of the json file which contains the setup of the nodes

View Source
const NonFungibleESDT = "NonFungibleESDT"

NonFungibleESDT defines the string for the token type of non fungible ESDT

View Source
const NotSetDestinationShardID = "disabled"

NotSetDestinationShardID represents the shardIdString when the destinationShardId is not set in the prefs

View Source
const NumInitCharactersForScAddress = 10

NumInitCharactersForScAddress numbers of characters for smart contract address identifier

View Source
const PathEpochPlaceholder = "[E]"

PathEpochPlaceholder represents the placeholder for the epoch number in paths

View Source
const PathIdentifierPlaceholder = "[I]"

PathIdentifierPlaceholder represents the placeholder for the identifier in paths

View Source
const PathShardPlaceholder = "[S]"

PathShardPlaceholder represents the placeholder for the shard ID in paths

View Source
const PublicKeyBlacklistDuration = time.Second * 7200

PublicKeyBlacklistDuration represents the time to keep a public key in the black list if it will degrade its rating to a minimum threshold due to improper messages

View Source
const PutInStorerMaxTime = time.Second

PutInStorerMaxTime represents max time accepted for a put action, after which a warn message is displayed

View Source
const RelayedTransaction = "relayedTx"

RelayedTransaction is the key for the elrond meta/gassless/relayed transaction standard

View Source
const RelayedTransactionV2 = "relayedTxV2"

RelayedTransactionV2 is the key for the optimized elrond meta/gassless/relayed transaction standard

View Source
const SCDeployInitFunctionName = "_init"

SCDeployInitFunctionName is the key for the function which is called at smart contract deploy time

View Source
const SecondsToWaitForP2PBootstrap = 20

SecondsToWaitForP2PBootstrap is the wait time for the P2P to bootstrap

View Source
const SemiFungibleESDT = "SemiFungibleESDT"

SemiFungibleESDT defines the string for the token type of semi fungible ESDT

View Source
const ShardIdentiferLen = 2

ShardIdentiferLen number of characters for shard identifier in an address

View Source
const ShuffledOut = "shuffledOut"

ShuffledOut signals that a restart is pending because the node was shuffled out

View Source
const SleepTimeBetweenCreateDBRetries = 5 * time.Second

SleepTimeBetweenCreateDBRetries represents the number of seconds to sleep between DB creates

View Source
const TemporaryPath = "temp"

TemporaryPath is the default temporary path directory

View Source
const TriggerRegistryInitialKeyPrefix = "initial_value_epoch_"

TriggerRegistryInitialKeyPrefix is the key prefix to save initial data to storage

View Source
const TriggerRegistryKeyPrefix = "epochStartTrigger_"

TriggerRegistryKeyPrefix is the key prefix to save epoch start registry to storage

View Source
const UnVersionedAppString = "undefined"

UnVersionedAppString represents the default app version that indicate that the binary wasn't build by setting the appVersion flag

View Source
const VMTypeLen = 2

VMTypeLen number of characters with VMType identifier in an address, these are the last 2 characters from the initial identifier

View Source
const WrongConfiguration = "wrongConfiguration"

WrongConfiguration signals that the node has a malformed configuration and cannot continue processing

View Source
const WrongP2PMessageBlacklistDuration = time.Second * 7200

WrongP2PMessageBlacklistDuration represents the time to keep a peer id in the blacklist if it sends a message that do not follow this protocol

Variables

View Source
var ErrAdditionOverflow = errors.New("uint64 addition overflowed")

ErrAdditionOverflow signals that uint64 addition overflowed

View Source
var ErrEmptyFile = errors.New("empty file provided")

ErrEmptyFile signals that a empty file has been provided

View Source
var ErrFileLoggingProcessIsClosed = errors.New("file logging process is closed")

ErrFileLoggingProcessIsClosed signals that the file logging process is closed

View Source
var ErrInvalidGasScheduleConfig = errors.New("invalid gas schedule config")

ErrInvalidGasScheduleConfig signals that invalid gas schedule config was provided

View Source
var ErrInvalidIdentifierForEpochStartBlockRequest = errors.New("invalid identifier for epoch start block request")

ErrInvalidIdentifierForEpochStartBlockRequest signals that an invalid identifier for epoch start block request has been provided

View Source
var ErrInvalidIndex = errors.New("invalid private key index")

ErrInvalidIndex signals that an invalid private key index has been provided

View Source
var ErrInvalidLogFileMinLifeSpan = errors.New("minimum log file life span is invalid")

ErrInvalidLogFileMinLifeSpan signals that an invalid log file life span was provided

View Source
var ErrInvalidPollingInterval = errors.New("invalid polling interval ")

ErrInvalidPollingInterval signals that an invalid polling interval has been provided

View Source
var ErrInvalidTransactionVersion = errors.New("invalid transaction version")

ErrInvalidTransactionVersion signals that an invalid transaction version has been provided

View Source
var ErrInvalidValue = errors.New("invalid value provided")

ErrInvalidValue signals that a nil value has been provided

View Source
var ErrMajorVersionMismatch = errors.New("major version mismatch")

ErrMajorVersionMismatch signals that the major version mismatch

View Source
var ErrMinorVersionMismatch = errors.New("minor version mismatch")

ErrMinorVersionMismatch signals that the minor version mismatch

View Source
var ErrNilAppStatusHandler = errors.New("appStatusHandler is nil")

ErrNilAppStatusHandler signals that a nil status handler has been provided

View Source
var ErrNilEpochStartNotifier = errors.New("nil epoch start notifier")

ErrNilEpochStartNotifier signals that nil epoch start notifier has been provided

View Source
var ErrNilFile = errors.New("nil file provided")

ErrNilFile signals that a nil file has been provided

View Source
var ErrNilGoRoutineProcessor = errors.New("nil go routine processor")

ErrNilGoRoutineProcessor signals that a nil go routine processor has been provided

View Source
var ErrNilHasher = errors.New("nil hasher provided")

ErrNilHasher signals that a nil hasher has been provided

View Source
var ErrNilInputData = errors.New("nil input data")

ErrNilInputData signals that a nil data has been provided

View Source
var ErrNilMarshalizer = errors.New("nil marshalizer provided")

ErrNilMarshalizer signals that a nil marshalizer has been provided

View Source
var ErrNilNodesCoordinator = errors.New("nil nodes coordinator")

ErrNilNodesCoordinator signals a nil nodes coordinator has been provided

View Source
var ErrNilPemBLock = errors.New("nil pem block")

ErrNilPemBLock signals that the pem block is nil

View Source
var ErrNilShardCoordinator = errors.New("nil shard coordinator")

ErrNilShardCoordinator signals that a nil shard coordinator was provided

View Source
var ErrNilSignalChan = errors.New("nil signal channel")

ErrNilSignalChan returns whenever a nil signal channel is provided

View Source
var ErrNilStatusTagProvider = errors.New("nil status tag provider")

ErrNilStatusTagProvider signals that a nil status tag provider has been given as parameter

View Source
var ErrNilStore = errors.New("nil data storage service")

ErrNilStore signals that the provided storage service is nil

View Source
var ErrNilTransactionFeeCalculator = errors.New("nil transaction fee calculator")

ErrNilTransactionFeeCalculator signals that a nil transaction fee calculator has been provided

View Source
var ErrNilUrl = errors.New("url is empty")

ErrNilUrl signals that the provided url is empty

View Source
var ErrNotPositiveValue = errors.New("the provided value is not positive")

ErrNotPositiveValue signals that a 0 or negative value has been provided

View Source
var ErrPemFileIsInvalid = errors.New("pem file is invalid")

ErrPemFileIsInvalid signals that a pem file is invalid

View Source
var ErrReleaseVersionMismatch = errors.New("release version mismatch")

ErrReleaseVersionMismatch signals that the release version mismatch

View Source
var ErrSubtractionOverflow = errors.New("uint64 subtraction overflowed")

ErrSubtractionOverflow signals that uint64 subtraction overflowed

View Source
var ErrSuffixNotPresentOrInIncorrectPosition = errors.New("suffix is not present or the position is incorrect")

ErrSuffixNotPresentOrInIncorrectPosition signals that the suffix is not present in the data field or its position is incorrect

View Source
var ErrVersionNumComponents = errors.New("invalid version while checking number of components")

ErrVersionNumComponents signals that a wrong number of components was provided

View Source
var SystemAccountAddress = bytes.Repeat([]byte{255}, 32)

SystemAccountAddress is the hard-coded address in which we save global settings on all shards

Functions

func AbsDuration added in v1.1.43

func AbsDuration(duration time.Duration) time.Duration

AbsDuration returns the absolute value of the provided time.Duration parameter

func AssignShardForPubKeyWhenNotSpecified added in v1.1.46

func AssignShardForPubKeyWhenNotSpecified(pubKey []byte, numShards uint32) uint32

AssignShardForPubKeyWhenNotSpecified will return the same shard ID when it is called with the same parameters This function fetched the last byte of the public key and based on a modulo operation it will return a shard ID

func CalculateHash

func CalculateHash(
	marshalizer marshal.Marshalizer,
	hasher hashing.Hasher,
	object interface{},
) ([]byte, error)

CalculateHash marshalizes the interface and calculates its hash

func CommunicationIdentifierBetweenShards added in v1.0.102

func CommunicationIdentifierBetweenShards(shardId1 uint32, shardId2 uint32) string

CommunicationIdentifierBetweenShards is used to generate the identifier between shardID1 and shardID2 identifier is generated such as the first shard from identifier is always smaller or equal than the last

func ConvertBytes

func ConvertBytes(bytes uint64) string

ConvertBytes converts the input bytes in a readable string using multipliers (k, M, G)

func ConvertShardIDToUint32 added in v1.1.12

func ConvertShardIDToUint32(shardIDStr string) (uint32, error)

ConvertShardIDToUint32 converts shard id from string to uint32

func ConvertToEvenHex added in v1.0.133

func ConvertToEvenHex(value int) string

ConvertToEvenHex converts the provided value in a hex string, even number of characters

func ConvertToEvenHexBigInt added in v1.0.133

func ConvertToEvenHexBigInt(value *big.Int) string

ConvertToEvenHexBigInt converts the provided value in a hex string, even number of characters

func CreateFile

func CreateFile(arg ArgCreateFileArgument) (*os.File, error)

CreateFile opens or creates a file relative to the default path

func DumpGoRoutinesToLog added in v1.2.0

func DumpGoRoutinesToLog(goRoutinesNumberStart int)

DumpGoRoutinesToLog will print the currently running go routines in the log

func EmptyChannel added in v1.0.102

func EmptyChannel(ch chan bool) int

EmptyChannel empties the given channel

func EpochStartIdentifier

func EpochStartIdentifier(epoch uint32) string

EpochStartIdentifier returns the string for the epoch start identifier

func FileExists added in v1.2.1

func FileExists(path string) bool

FileExists returns true if the file at the given path exists

func GetAnonymizedMachineID added in v1.2.4

func GetAnonymizedMachineID(appID string) string

GetAnonymizedMachineID returns the machine ID anonymized with the provided app ID string

func GetApproximatePercentageOfValue added in v1.1.28

func GetApproximatePercentageOfValue(value *big.Int, percentage float64) *big.Int

GetApproximatePercentageOfValue returns the approximate percentage of value the approximation comes from floating point operations, which in case of large numbers has some loss in accuracy and can cause the result to be slightly lower or higher than the actual value

func GetIntTrimmedPercentageOfValue added in v1.1.28

func GetIntTrimmedPercentageOfValue(value *big.Int, percentage float64) *big.Int

GetIntTrimmedPercentageOfValue returns the exact percentage of value, that fits into the integer (with loss of division remainder)

func GetPBFTFallbackThreshold added in v1.1.3

func GetPBFTFallbackThreshold(consensusSize int) int

GetPBFTFallbackThreshold returns the pBFT fallback threshold for a given consensus size

func GetPBFTThreshold added in v1.1.3

func GetPBFTThreshold(consensusSize int) int

GetPBFTThreshold returns the pBFT threshold for a given consensus size

func GetRunningGoRoutines added in v1.2.5

func GetRunningGoRoutines() *bytes.Buffer

GetRunningGoRoutines gets the currently running go routines stack trace as a bytes.Buffer

func GetShardIDString added in v1.0.137

func GetShardIDString(shardID uint32) string

GetShardIDString will return the string representation of the shard id

func GetTrimmedPk

func GetTrimmedPk(pk string) string

GetTrimmedPk returns a trimmed string to the pkPrefixSize value

func IsEmptyAddress added in v1.0.67

func IsEmptyAddress(address []byte) bool

IsEmptyAddress returns whether an address is empty

func IsInRangeInclusive added in v1.1.30

func IsInRangeInclusive(value, min, max *big.Int) bool

IsInRangeInclusive returns true if the provided value is in the given range, including the provided min and max values

func IsInRangeInclusiveFloat64 added in v1.1.30

func IsInRangeInclusiveFloat64(value, min, max float64) bool

IsInRangeInclusiveFloat64 returns true if the provided value is in the given range including the provided min and max values

func IsMetachainIdentifier

func IsMetachainIdentifier(identifier []byte) bool

IsMetachainIdentifier verifies if the identifier is of type metachain

func IsSmartContractAddress

func IsSmartContractAddress(rcvAddress []byte) bool

IsSmartContractAddress verifies if a set address is of type smart contract

func IsSmartContractOnMetachain

func IsSmartContractOnMetachain(identifier []byte, rcvAddress []byte) bool

IsSmartContractOnMetachain verifies if an address is smart contract on metachain

func IsSystemAccountAddress added in v1.1.3

func IsSystemAccountAddress(address []byte) bool

IsSystemAccountAddress returns true if given address is system account address

func IsUnknownEpochIdentifier

func IsUnknownEpochIdentifier(identifier []byte) (bool, error)

IsUnknownEpochIdentifier return if the epoch identifier represents unknown epoch

func IsValidESDTRole added in v1.1.58

func IsValidESDTRole(role string) bool

IsValidESDTRole returns true if the input string represents a valid ESDT role

func LoadApiConfig added in v1.2.0

func LoadApiConfig(filepath string) (*config.ApiRoutesConfig, error)

LoadApiConfig returns a ApiRoutesConfig by reading the config file provided

func LoadEconomicsConfig added in v1.2.0

func LoadEconomicsConfig(filepath string) (*config.EconomicsConfig, error)

LoadEconomicsConfig returns a EconomicsConfig by reading the config file provided

func LoadEpochConfig added in v1.2.0

func LoadEpochConfig(filepath string) (*config.EpochConfig, error)

LoadEpochConfig returns an EpochConfig by reading from the provided config file

func LoadExternalConfig added in v1.2.0

func LoadExternalConfig(filepath string) (*config.ExternalConfig, error)

LoadExternalConfig returns a ExternalConfig by reading the config file provided

func LoadGasScheduleConfig

func LoadGasScheduleConfig(filepath string) (map[string]map[string]uint64, error)

LoadGasScheduleConfig returns a map[string]uint64 of gas costs read from the provided config file

func LoadJsonFile

func LoadJsonFile(dest interface{}, relativePath string) error

LoadJsonFile method to open and decode json file

func LoadMainConfig added in v1.2.0

func LoadMainConfig(filepath string) (*config.Config, error)

LoadMainConfig returns a Config by reading the config file provided

func LoadP2PConfig

func LoadP2PConfig(filepath string) (*config.P2PConfig, error)

LoadP2PConfig returns a P2PConfig by reading the config file provided

func LoadPreferencesConfig added in v1.2.0

func LoadPreferencesConfig(filepath string) (*config.Preferences, error)

LoadPreferencesConfig returns a Preferences by reading the config file provided

func LoadRatingsConfig added in v1.2.0

func LoadRatingsConfig(filepath string) (*config.RatingsConfig, error)

LoadRatingsConfig returns a RatingsConfig by reading the config file provided

func LoadSkPkFromPemFile

func LoadSkPkFromPemFile(relativePath string, skIndex int) ([]byte, string, error)

LoadSkPkFromPemFile loads the secret key and existing public key bytes stored in the file

func LoadSystemSmartContractsConfig added in v1.2.0

func LoadSystemSmartContractsConfig(filepath string) (*config.SystemSmartContractsConfig, error)

LoadSystemSmartContractsConfig returns a SystemSmartContractsConfig by reading the config file provided

func LoadTomlFile

func LoadTomlFile(dest interface{}, relativePath string) error

LoadTomlFile method to open and decode toml file

func LoadTomlFileToMap

func LoadTomlFileToMap(relativePath string) (map[string]interface{}, error)

LoadTomlFileToMap opens and decodes a toml file as a map[string]interface{}

func MaxFloat64 added in v1.1.6

func MaxFloat64(a float64, b float64) float64

MaxFloat64 returns the maximum of two given numbers

func MaxInt

func MaxInt(a int, b int) int

MaxInt returns the maximum of two given numbers

func MaxInt32

func MaxInt32(a int32, b int32) int32

MaxInt32 returns the maximum of two given numbers

func MaxInt64 added in v1.0.114

func MaxInt64(a int64, b int64) int64

MaxInt64 returns the maximum of two given numbers

func MaxUint32

func MaxUint32(a uint32, b uint32) uint32

MaxUint32 returns the maximum of two given numbers

func MaxUint64

func MaxUint64(a uint64, b uint64) uint64

MaxUint64 returns the maximum of two given numbers

func MinInt

func MinInt(a int, b int) int

MinInt returns the minimum of two given numbers

func MinInt32

func MinInt32(a int32, b int32) int32

MinInt32 returns the minimum of two given numbers

func MinInt64 added in v1.0.114

func MinInt64(a int64, b int64) int64

MinInt64 returns the minimum of two given numbers

func MinUint32

func MinUint32(a uint32, b uint32) uint32

MinUint32 returns the minimum of two given numbers

func MinUint64

func MinUint64(a uint64, b uint64) uint64

MinUint64 returns the minimum of two given numbers

func OpenFile

func OpenFile(relativePath string) (*os.File, error)

OpenFile method opens the file from given path - does not close the file

func ProcessDestinationShardAsObserver added in v1.2.0

func ProcessDestinationShardAsObserver(destinationShardIdAsObserver string) (uint32, error)

ProcessDestinationShardAsObserver returns the shardID given the destination as observer string

func SafeAddUint64 added in v1.1.15

func SafeAddUint64(a, b uint64) (uint64, error)

SafeAddUint64 performs addition on uint64 and returns an error if the addition overflows

func SafeMul added in v1.1.1

func SafeMul(a uint64, b uint64) *big.Int

SafeMul returns multiplication results of two uint64 values into a big int

func SafeSubUint64 added in v1.1.15

func SafeSubUint64(a, b uint64) (uint64, error)

SafeSubUint64 performs subtraction on uint64 and returns an error if it overflows

func SaveSkToPemFile

func SaveSkToPemFile(file *os.File, identifier string, skBytes []byte) error

SaveSkToPemFile saves secret key bytes in the file

func SecondsToHourMinSec

func SecondsToHourMinSec(input int) string

SecondsToHourMinSec transform seconds input in a human friendly format

func ShardIdToString added in v1.0.102

func ShardIdToString(shardId uint32) string

ShardIdToString returns the string according to the shard id

func UniqueIdentifier added in v1.0.126

func UniqueIdentifier() string

UniqueIdentifier returns a unique string identifier of 32 bytes

Types

type Accumulator added in v1.2.0

type Accumulator interface {
	AddData(data interface{})
	OutputChannel() <-chan []interface{}
	Close() error
	IsInterfaceNil() bool
}

Accumulator defines the interface able to accumulate data and periodically evict them

type AppStatusHandler

type AppStatusHandler interface {
	IsInterfaceNil() bool
	Increment(key string)
	AddUint64(key string, val uint64)
	Decrement(key string)
	SetInt64Value(key string, value int64)
	SetUInt64Value(key string, value uint64)
	SetStringValue(key string, value string)
	Close()
}

AppStatusHandler interface will handle different implementations of monitoring tools, such as term-ui or status metrics

type ArgCreateFileArgument added in v1.1.1

type ArgCreateFileArgument struct {
	Directory     string
	Prefix        string
	FileExtension string
}

ArgCreateFileArgument will hold the arguments for a new file creation method call

type ConnectedAddressesHandler

type ConnectedAddressesHandler interface {
	ConnectedAddresses() []string
}

ConnectedAddressesHandler interface will be used for passing the network component to AppStatusPolling

type ESDTType added in v1.1.39

type ESDTType uint32

ESDTType defines the possible types in case of ESDT tokens

const (
	// Fungible defines the token type for ESDT fungible tokens
	Fungible ESDTType = iota
	// NonFungible defines the token type for ESDT non fungible tokens
	NonFungible
)

type EpochNotifier added in v1.1.12

type EpochNotifier interface {
	RegisterNotifyHandler(handler EpochSubscriberHandler)
	IsInterfaceNil() bool
}

EpochNotifier can notify upon an epoch change and provide the current epoch

type EpochSubscriberHandler added in v1.1.1

type EpochSubscriberHandler interface {
	EpochConfirmed(epoch uint32, timestamp uint64)
	IsInterfaceNil() bool
}

EpochSubscriberHandler defines the behavior of a component that can be notified if a new epoch was confirmed

type GasScheduleNotifier added in v1.1.12

type GasScheduleNotifier interface {
	RegisterNotifyHandler(handler GasScheduleSubscribeHandler)
	LatestGasSchedule() map[string]map[string]uint64
	UnRegisterAll()
	IsInterfaceNil() bool
}

GasScheduleNotifier can notify upon a gas schedule change

type GasScheduleSubscribeHandler added in v1.1.12

type GasScheduleSubscribeHandler interface {
	GasScheduleChange(gasSchedule map[string]map[string]uint64)
	IsInterfaceNil() bool
}

GasScheduleSubscribeHandler defines the behavior of a component that can be notified if a the gas schedule was changed

type KeyLoader added in v1.2.0

type KeyLoader struct {
}

KeyLoader holds the logic for loading a key from a file and an index

func (*KeyLoader) LoadKey added in v1.2.0

func (kl *KeyLoader) LoadKey(relativePath string, skIndex int) ([]byte, string, error)

LoadKey loads the key with the given index found in the pem file from the given relative path.

type KeyValueHolder added in v1.0.137

type KeyValueHolder interface {
	Key() []byte
	Value() []byte
	ValueWithoutSuffix(suffix []byte) ([]byte, error)
}

KeyValueHolder is used to hold a key and an associated value

type NodeState

type NodeState int

NodeState specifies what type of state a node could have

const (
	// NsSynchronized defines ID of a state of synchronized
	NsSynchronized NodeState = iota
	// NsNotSynchronized defines ID of a state of not synchronized
	NsNotSynchronized
	// NsNotCalculated defines ID of a state which is not calculated
	NsNotCalculated
)

type NodeType

type NodeType string

NodeType represents the node's role in the network

const NodeTypeObserver NodeType = "observer"

NodeTypeObserver signals that a node is running as observer node

const NodeTypeValidator NodeType = "validator"

NodeTypeValidator signals that a node is running as validator node

type NodeTypeProviderHandler added in v1.2.4

type NodeTypeProviderHandler interface {
	SetType(nodeType NodeType)
	GetType() NodeType
	IsInterfaceNil() bool
}

NodeTypeProviderHandler defines the actions needed for a component that can handle the node type

type P2PPeerInfo

type P2PPeerInfo struct {
	PeerType    P2PPeerType
	PeerSubType P2PPeerSubType
	ShardID     uint32
	PkBytes     []byte
}

P2PPeerInfo represents a peer info structure

type P2PPeerSubType added in v1.2.0

type P2PPeerSubType uint32

P2PPeerSubType defines the subtype of peer (e.g. FullArchive)

const (
	// RegularPeer
	RegularPeer P2PPeerSubType = iota
	// FullHistoryObserver is a node that syncs the entire history of its shard
	FullHistoryObserver
)

func (P2PPeerSubType) String added in v1.2.0

func (pst P2PPeerSubType) String() string

String returns the string-ified version of P2PPeerSubType

type P2PPeerType

type P2PPeerType int

P2PPeerType defines the type of a p2p peer

const (
	// UnknownPeer defines a peer that is unknown (did not advertise data in any way)
	UnknownPeer P2PPeerType = iota
	// ValidatorPeer means that the peer is a validator
	ValidatorPeer
	// ObserverPeer means that the peer is an observer
	ObserverPeer
)

func (P2PPeerType) String added in v1.0.106

func (pt P2PPeerType) String() string

String returns the string-ified version of P2PPeerType

type PeerID added in v1.0.127

type PeerID string

PeerID is a p2p peer identity.

func (PeerID) Bytes added in v1.0.127

func (pid PeerID) Bytes() []byte

Bytes returns the peer ID as byte slice

func (PeerID) Pretty added in v1.0.127

func (pid PeerID) Pretty() string

Pretty returns a b58-encoded string of the peer id

type PeerTopicType added in v1.2.3

type PeerTopicType string

PeerTopicType represents the type of a peer in regards to the topic it is used

const (
	// IntraShardPeer represents the identifier for intra shard peers to be used in intra shard topics
	IntraShardPeer PeerTopicType = "intra peer"

	// CrossShardPeer represents the identifier for intra shard peers to be used in cross shard topics
	CrossShardPeer PeerTopicType = "cross peer"

	// FullHistoryPeer represents the identifier for intra shard peers to be used in full history topics
	FullHistoryPeer PeerTopicType = "full history peer"
)

func (PeerTopicType) String added in v1.2.3

func (pt PeerTopicType) String() string

String returns a string version of the peer topic type

type PeerType

type PeerType string

PeerType represents the type of a peer

const EligibleList PeerType = "eligible"

EligibleList represents the list of peers who participate in consensus inside a shard

const InactiveList PeerType = "inactive"

InactiveList represents the list of peers who were taken out because they were leaving

const JailedList PeerType = "jailed"

JailedList represents the list of peers who have stake but are in jail

const LeavingList PeerType = "leaving"

LeavingList represents the list of peers who were taken out of eligible and waiting because of rating

const NewList PeerType = "new"

NewList -

const ObserverList PeerType = "observer"

ObserverList represents the list of peers who don't participate in consensus but will join the next epoch

const WaitingList PeerType = "waiting"

WaitingList represents the list of peers who don't participate in consensus but will join the next epoch

type PubkeyConverter added in v1.0.120

type PubkeyConverter interface {
	Len() int
	Decode(humanReadable string) ([]byte, error)
	Encode(pkBytes []byte) string
	IsInterfaceNil() bool
}

PubkeyConverter can convert public key bytes to/from a human readable form

type QueryP2PPeerInfo added in v1.0.130

type QueryP2PPeerInfo struct {
	IsBlacklisted bool     `json:"isblacklisted"`
	Pid           string   `json:"pid"`
	Pk            string   `json:"pk"`
	PeerType      string   `json:"peertype"`
	PeerSubType   string   `json:"peersubtype"`
	Addresses     []string `json:"addresses"`
}

QueryP2PPeerInfo represents a DTO used in exporting p2p peer info after a query

type Queue added in v1.2.0

type Queue interface {
	Add(hash []byte) []byte
}

Queue is an interface for queue implementations that evict the first element when the queue is full

type SafeCloser added in v1.2.3

type SafeCloser interface {
	Close()
	ChanClose() <-chan struct{}
	IsInterfaceNil() bool
}

SafeCloser represents a subcomponent used for signaling a closing event. Its Close method is considered to be concurrent safe

type StopWatch

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

StopWatch is used to measure duration

func NewStopWatch

func NewStopWatch() *StopWatch

NewStopWatch returns a new stopWatch instance used to measure duration between finished and started events

func (*StopWatch) Add

func (sw *StopWatch) Add(src *StopWatch)

Add adds a time measure containing duration list to self

func (*StopWatch) GetMeasurement

func (sw *StopWatch) GetMeasurement(identifier string) time.Duration

GetMeasurement returns the measurement by identifier

func (*StopWatch) GetMeasurements

func (sw *StopWatch) GetMeasurements() []interface{}

GetMeasurements returns a logger compatible slice of interface{} containing pairs of (identifier, duration)

func (*StopWatch) GetMeasurementsMap

func (sw *StopWatch) GetMeasurementsMap() map[string]float64

GetMeasurementsMap returns the measurements as a map of (identifier, duration in seconds)

func (*StopWatch) Start

func (sw *StopWatch) Start(identifier string)

Start marks a start event for a provided identifier

func (*StopWatch) Stop

func (sw *StopWatch) Stop(identifier string)

Stop marks a finish event for a provided identifier

type Throttler added in v1.0.137

type Throttler interface {
	CanProcess() bool
	StartProcessing()
	EndProcessing()
	IsInterfaceNil() bool
}

Throttler can monitor the number of the currently running go routines

type TimersScheduler added in v1.0.133

type TimersScheduler interface {
	Add(callback func(alarmID string), duration time.Duration, alarmID string)
	Cancel(alarmID string)
	Close()
	Reset(alarmID string)
	IsInterfaceNil() bool
}

TimersScheduler exposes functionality for scheduling multiple timers

type WatchdogTimer added in v1.0.133

type WatchdogTimer interface {
	Set(callback func(alarmID string), duration time.Duration, alarmID string)
	SetDefault(duration time.Duration, alarmID string)
	Stop(alarmID string)
	Reset(alarmID string)
	IsInterfaceNil() bool
}

WatchdogTimer is used to set alarms for different components

Jump to

Keyboard shortcuts

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