package
1.2.23
Repository: https://github.com/multiversx/mx-chain-core-go.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AbsDuration returns the absolute value of the provided time.Duration parameter.
CalculateHash marshalizes the interface and calculates its hash.
CheckHandlerCompatibility checks if the provided handler is compatible with this mx-chain-core-go version.
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.
ConvertBytes converts the input bytes in a readable string using multipliers (k, M, G).
ConvertESDTTypeToUint32 converts the esdt type to uint32.
ConvertShardIDToUint32 converts shard id from string to uint32.
ConvertToEvenHex converts the provided value in a hex string, even number of characters.
ConvertToEvenHexBigInt converts the provided value in a hex string, even number of characters.
CreateFile opens or creates a file relative to the default path.
DumpGoRoutinesToLog will print the currently running go routines in the log.
EmptyChannel empties the given channel.
EpochStartIdentifier returns the string for the epoch start identifier.
FileExists returns true if the file at the given path exists.
GetAnonymizedMachineID returns the machine ID anonymized with the provided app ID string.
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.
GetHeaderType will return the type of the provided header.
GetIntTrimmedPercentageOfValue returns the exact percentage of value, that fits into the integer (with loss of division remainder).
GetPBFTFallbackThreshold returns the pBFT fallback threshold for a given consensus size.
GetPBFTThreshold returns the pBFT threshold for a given consensus size.
GetRunningGoRoutines gets the currently running go routines stack trace as a bytes.Buffer.
GetShardIDString will return the string representation of the shard id.
GetTrimmedPk returns a trimmed string to the pkPrefixSize value.
GetVersionForNewData returns the trie node version that should be used for new data.
IsClosingError returns true if the provided error is used whenever the node is in the closing process.
IsDynamicESDT returns true if the esdt type is dynamic.
IsEmptyAddress returns whether an address is empty.
IsGetNodeFromDBError returns true if the provided error is of type getNodeFromDB.
IsInRangeInclusive returns true if the provided value is in the given range, including the provided min and max values.
IsInRangeInclusiveFloat64 returns true if the provided value is in the given range including the provided min and max values.
IsMetachainIdentifier verifies if the identifier is of type metachain.
IsSmartContractAddress verifies if a set address is of type smart contract.
IsSmartContractOnMetachain verifies if an address is smart contract on metachain.
IsSystemAccountAddress returns true if given address is system account address.
IsUnknownEpochIdentifier return if the epoch identifier represents unknown epoch.
IsValidESDTRole returns true if the input string represents a valid ESDT role.
LoadAllKeysFromPemFile loads all the secret keys and existing public key bytes stored in the file.
LoadJsonFile method to open and decode json file.
LoadSkPkFromPemFile loads the secret key and existing public key bytes stored in the file.
LoadTomlFile method to open and decode toml file.
LoadTomlFileToMap opens and decodes a toml file as a map[string]interface{}.
MaxFloat64 returns the maximum of two given numbers.
MaxInt returns the maximum of two given numbers.
MaxInt32 returns the maximum of two given numbers.
MaxInt64 returns the maximum of two given numbers.
MaxUint32 returns the maximum of two given numbers.
MaxUint64 returns the maximum of two given numbers.
MinInt returns the minimum of two given numbers.
MinInt32 returns the minimum of two given numbers.
MinInt64 returns the minimum of two given numbers.
MinUint32 returns the minimum of two given numbers.
MinUint64 returns the minimum of two given numbers.
NewGetNodeFromDBErrWithKey will create a new instance of GetNodeFromDBErrWithKey.
NewKeyLoader creates a new instance of type key loader.
NewPeerID creates a new peer id or returns an error.
NewStopWatch returns a new stopWatch instance used to measure duration between finished and started events.
NewTrieNodeVersionVerifier returns a new instance of trieNodeVersionVerifier.
OpenFile method opens the file from given path - does not close the file.
SafeAddUint64 performs addition on uint64 and returns an error if the addition overflows.
SafeMul returns multiplication results of two uint64 values into a big int.
SafeSubUint64 performs subtraction on uint64 and returns an error if it overflows.
SaveSkToPemFile saves secret key bytes in the file.
SaveTomlFile will open and save data to toml file.
SecondsToHourMinSec transform seconds input in a human friendly format.
ShardIdToString returns the string according to the shard id.
UniqueIdentifier returns a unique string identifier of 32 bytes.
UnwrapGetNodeFromDBErr unwraps the provided error until it finds a GetNodeFromDbErrHandler.

# Constants

AllShardId will be used to identify that a message is for all shards.
AutoBalanceEnabled is used for data tries, and only after the activation of AutoBalanceDataTriesEnableEpoch flag.
AutoBalanceEnabledString is the string representation of AutoBalanceEnabled trie node version.
BaseOperationCostString represents the field name for base operation costs.
BuiltInCostString represents the field name for built in operation costs.
BuiltInFunctionChangeOwnerAddress is the key for the change owner built in function built-in function.
BuiltInFunctionClaimDeveloperRewards is the key for the claim developer rewards built-in function.
BuiltInFunctionESDTBurn is the key for the electronic standard digital token burn built-in function.
BuiltInFunctionESDTFreeze is the key for the electronic standard digital token freeze built-in function.
BuiltInFunctionESDTLocalBurn is the key for the electronic standard digital token local burn built-in function.
BuiltInFunctionESDTLocalMint is the key for the electronic standard digital token local mint built-in function.
BuiltInFunctionESDTNFTAddQuantity is the key for the electronic standard digital token NFT add quantity built-in function.
BuiltInFunctionESDTNFTAddURI is the key for the electronic standard digital token NFT add URI built-in function.
BuiltInFunctionESDTNFTBurn is the key for the electronic standard digital token NFT burn built-in function.
BuiltInFunctionESDTNFTCreate is the key for the electronic standard digital token NFT create built-in function.
BuiltInFunctionESDTNFTCreateRoleTransfer is the key for the electronic standard digital token create role transfer function.
BuiltInFunctionESDTNFTTransfer is the key for the electronic standard digital token NFT transfer built-in function.
BuiltInFunctionESDTNFTUpdateAttributes is the key for the electronic standard digital token NFT update attributes built-in function.
BuiltInFunctionESDTPause is the key for the electronic standard digital token pause built-in function.
BuiltInFunctionESDTSetLimitedTransfer is the key for the electronic standard digital token built-in function which sets the property for the token to be transferable only through accounts with transfer roles.
BuiltInFunctionESDTTransfer is the key for the electronic standard digital token transfer built-in function.
BuiltInFunctionESDTUnFreeze is the key for the electronic standard digital token unfreeze built-in function.
BuiltInFunctionESDTUnPause is the key for the electronic standard digital token unpause built-in function.
BuiltInFunctionESDTUnSetLimitedTransfer is the key for the electronic standard digital token built-in function which unsets the property for the token to be transferable only through accounts with transfer roles.
BuiltInFunctionESDTWipe is the key for the electronic standard digital token wipe built-in function.
BuiltInFunctionGuardAccount is the built-in function key for guarding an account.
BuiltInFunctionMigrateDataTrie is the built-in function key for migrating the data trie.
BuiltInFunctionMultiESDTNFTTransfer is the key for the electronic standard digital token multi transfer built-in function.
BuiltInFunctionSaveKeyValue is the key for the save key value built-in function.
BuiltInFunctionSetESDTRole is the key for the electronic standard digital token set built-in function.
BuiltInFunctionSetGuardian is the key for setting a guardian built-in function.
BuiltInFunctionSetUserName is the key for the set user name built-in function.
BuiltInFunctionUnGuardAccount is the built-in function key for un-guarding an account.
BuiltInFunctionUnSetESDTRole is the key for the electronic standard digital token unset built-in function.
CompletedTxEventIdentifier is the identifier for the log that is generated when the execution of a smart contract call is done.
CrossShardPeer represents the identifier for intra shard peers to be used in cross shard topics.
DefaultAddressPrefix is the default hrp of MultiversX/Elrond.
DelegationSystemSCKey is the key under which there is data in case of system delegation smart contracts.
Dynamic is the prefix used for dynamic ESDT tokens.
DynamicMeta defines the token type for ESDT dynamic meta tokens.
DynamicMetaESDT defines the string for the token type of dynamic meta ESDT.
DynamicNFT defines the token type for ESDT dynamic NFT tokens.
DynamicNFTESDT defines the string for the token type of dynamic NFT ESDT.
DynamicSFT defines the token type for ESDT dynamic SFT tokens.
DynamicSFTESDT defines the string for the token type of dynamic SFT ESDT.
ESDTKeyIdentifier is the key prefix for esdt tokens.
ESDTMetaDataRecreate represents the builtin function name to recreate the metadata for ESDT tokens.
ESDTMetaDataUpdate represents the builtin function name to update the metadata for ESDT tokens.
ESDTModifyCreator represents the builtin function name to modify creator for NFTs.
ESDTModifyRoyalties represents the builtin function name to modify royalties.
ESDTNFTLatestNonceIdentifier is the key prefix for esdt latest nonce identifier.
ESDTRoleIdentifier is the key prefix for esdt role identifier.
ESDTRoleLocalBurn is the constant string for the local role of burn for ESDT tokens.
ESDTRoleLocalMint is the constant string for the local role of mint for ESDT tokens.
ESDTRoleModifyCreator represents the role which can rewrite the creator in the token metadata.
ESDTRoleModifyRoyalties represents the role which can rewrite the royalties of a token.
ESDTRoleNFTAddQuantity is the constant string for the local role of adding quantity for existing ESDT NFT tokens.
ESDTRoleNFTAddURI is the constant string for the local role of adding a URI for ESDT NFT tokens.
ESDTRoleNFTBurn is the constant string for the local role of burn for ESDT NFT tokens.
ESDTRoleNFTCreate is the constant string for the local role of create for ESDT NFT tokens.
ESDTRoleNFTCreateMultiShard is the constant string for the local role of create for ESDT NFT tokens multishard.
ESDTRoleNFTRecreate represents the role which can recreate the token metadata.
ESDTRoleNFTUpdate represents the role which can update the token metadata.
ESDTRoleNFTUpdateAttributes is the constant string for the local role of updating attributes for ESDT NFT tokens.
ESDTRoleSetNewURI represents the role which can rewrite the URI in the token metadata.
ESDTRoleTransfer is the constant string for the local role to transfer ESDT, only for special tokens.
ESDTSetNewURIs represents the builtin function name to set new URIs for NFTs.
ESDTSetTokenType represents the builtin function name to set token type.
FileModeReadWrite represents the permission for a file which allows reading and writing for user and group and read for others.
FileModeUserReadWrite represents the permission for a file which allows the user for reading and writing.
FullHistoryObserver is a node that syncs the entire history of its shard.
FullHistoryPeer represents the identifier for intra shard peers to be used in full history topics.
Fungible defines the token type for ESDT fungible tokens.
FungibleESDT defines the string for the token type of fungible ESDT.
GasRefundForRelayerMessage is the return message for to the smart contract result with refund for the relayer.
GetNodeFromDBErrorString represents the string which is returned when a getting node from DB returns an error.
GuardiansKeyIdentifier is the key prefix for guardians.
InitialVersionOfTransaction defines the initial version for a transaction.
InternalVMErrorsOperation is the identifier for the log that is generated when the execution of a smart contract generates an interval vm error.
IntraShardPeer represents the identifier for intra shard peers to be used in intra shard topics.
256KB.
64MB.
MaxLenForESDTIssueMint defines the maximum length in bytes for the issued/minted balance.
MaxMachineIDLen is the maximum machine ID length.
MaxNumShards represents the maximum number of shards possible in the system.
MaxRoyalty defines 100% as uint32.
MaxUserNameLength represents the maximum number of bytes a UserName can have.
MeasurementsLoggerFormat contains the formatting string to output elapsed time in seconds in a consistent way.
MegabyteSize represents the size in bytes of a megabyte.
MetachainShardId will be used to identify a shard ID as metachain.
MetaESDT defines the string for the token type of meta ESDT.
MetaFungible defines the token type for ESDT meta fungible tokens.
MetaHeader defines the type of *block.MetaBlock.
MinLenArgumentsESDTNFTTransfer defines the minimum length for esdt nft transfer.
MinLenArgumentsESDTTransfer defines the min length of arguments for the ESDT transfer.
MinMetaTxExtraGasCost is the constant defined for minimum gas value to be sent in meta transaction.
NodeTypeObserver signals that a node is running as observer node.
NodeTypeValidator signals that a node is running as validator node.
NonFungible defines the token type for ESDT non fungible tokens.
NonFungibleESDT defines the string for the token type of non fungible ESDT.
NonFungibleESDTv2 defines the string for the token type of non fungible ESDT.
NonFungibleV2 defines the token type for ESDT non fungible tokens.
NotSpecified means that the value is not populated or is not important.
NotSpecifiedString is the string representation of NotSpecified trie node version.
NumInitCharactersForScAddress numbers of characters for smart contract address identifier.
ObserverPeer means that the peer is an observer.
ProtectedKeyPrefix is the key prefix which is protected from writing in the trie - only for special builtin functions.
RegularPeer.
RelayedTransaction is the key for the electronic meta/gassless/relayed transaction standard.
RelayedTransactionV2 is the key for the optimized electronic meta/gassless/relayed transaction standard.
SCDeployIdentifier is the identifier for a smart contract deploy.
SCDeployInitFunctionName is the key for the function which is called at smart contract deploy time.
SCUpgradeIdentifier is the identifier for a smart contract upgrade.
SemiFungible defines the token type for ESDT semi fungible tokens.
SemiFungibleESDT defines the string for the token type of semi fungible ESDT.
ShardHeaderV1 defines the type of *block.Header.
ShardHeaderV2 defines the type of *block.HeaderV2.
ShardIdentiferLen number of characters for shard identifier in an address.
SignalErrorOperation is the identifier for the log that is generated when a smart contract is executed but return an error.
TopicRequestSuffix represents the topic name suffix for requests.
UnknownPeer defines a peer that is unknown (did not advertise data in any way).
ValidatorPeer means that the peer is a validator.
VMTypeLen number of characters with VMType identifier in an address, these are the last 2 characters from the initial identifier.
WriteLogIdentifier is the identifier for the information log that is generated by a smart contract call/esdt transfer.

# Variables

ErrAdditionOverflow signals that uint64 addition overflowed.
ErrContextClosing signals that the parent context requested the closing of its children.
ErrDBIsClosed is raised when the DB is closed.
ErrEmptyFile signals that a empty file has been provided.
ErrFileLoggingProcessIsClosed signals that the file logging process is closed.
ErrInvalidEnableEpochsHandler signals that an invalid enable epochs handler has been provided.
ErrInvalidGasScheduleConfig signals that invalid gas schedule config was provided.
ErrInvalidIdentifierForEpochStartBlockRequest signals that an invalid identifier for epoch start block request has been provided.
ErrInvalidIndex signals that an invalid private key index has been provided.
ErrInvalidLogFileMinLifeSpan signals that an invalid log file life span was provided.
ErrInvalidPollingInterval signals that an invalid polling interval has been provided.
ErrInvalidTransactionVersion signals that an invalid transaction version has been provided.
ErrInvalidValue signals that a nil value has been provided.
ErrMajorVersionMismatch signals that the major version mismatch.
ErrMinorVersionMismatch signals that the minor version mismatch.
ErrNilAppStatusHandler signals that a nil status handler has been provided.
ErrNilEnableEpochsHandler signals that a nil enable epochs handler has been provided.
ErrNilEpochStartNotifier signals that nil epoch start notifier has been provided.
ErrNilFile signals that a nil file has been provided.
ErrNilGoRoutineProcessor signals that a nil go routine processor has been provided.
ErrNilHasher signals that a nil hasher has been provided.
ErrNilInputData signals that a nil data has been provided.
ErrNilLogger signals that a nil logger instance has been provided.
ErrNilMarshalizer signals that a nil marshalizer has been provided.
ErrNilNodesCoordinator signals a nil nodes coordinator has been provided.
ErrNilPemBLock signals that the pem block is nil.
ErrNilPubkeyConverter signals that a nil public key converter has been provided.
ErrNilShardCoordinator signals that a nil shard coordinator was provided.
ErrNilSignalChan returns whenever a nil signal channel is provided.
ErrNilStatusTagProvider signals that a nil status tag provider has been given as parameter.
ErrNilStore signals that the provided storage service is nil.
ErrNilTransactionFeeCalculator signals that a nil transaction fee calculator has been provided.
ErrNilUrl signals that the provided url is empty.
ErrNotPositiveValue signals that a 0 or negative value has been provided.
ErrPemFileIsInvalid signals that a pem file is invalid.
ErrReleaseVersionMismatch signals that the release version mismatch.
ErrSubtractionOverflow signals that uint64 subtraction overflowed.
ErrSuffixNotPresentOrInIncorrectPosition signals that the suffix is not present in the data field or its position is incorrect.
ErrVersionNumComponents signals that a wrong number of components was provided.
ESDTSCAddress is the hard-coded address for esdt issuing smart contract.
SystemAccountAddress is the hard-coded address in which we save global settings on all shards.

# Structs

ArgCreateFileArgument will hold the arguments for a new file creation method call.
OptionalUint32 holds an optional uint32 value.
OptionalUint64 holds an optional uint64 value.
P2PPeerInfo represents a peer info structure.
QueryP2PPeerInfo represents a DTO used in exporting p2p peer info after a query.
StopWatch is used to measure duration.
TrieData holds the data that will be inserted into the trie.

# Interfaces

Accumulator defines the interface able to accumulate data and periodically evict them.
AppStatusHandler interface will handle different implementations of monitoring tools, such as term-ui or status metrics.
ConnectedAddressesHandler interface will be used for passing the network component to AppStatusPolling.
EnableEpochsHandler defines the behavior of a component that can return if a feature is enabled or not.
EpochNotifier can notify upon an epoch change and provide the current epoch.
EpochSubscriberHandler defines the behavior of a component that can be notified if a new epoch was confirmed.
GasScheduleNotifier can notify upon a gas schedule change.
GasScheduleSubscribeHandler defines the behavior of a component that can be notified if a the gas schedule was changed.
GetNodeFromDbErrHandler defines the behavior of a component that can provide extra info from a missing trie node err.
KeyValueHolder is used to hold a key and an associated value.
Logger defines the behavior of a data logger component.
NodeTypeProviderHandler defines the actions needed for a component that can handle the node type.
PubkeyConverter can convert public key bytes to/from a human readable form.
Queue is an interface for queue implementations that evict the first element when the queue is full.
SafeCloser represents a subcomponent used for signaling a closing event.
Throttler can monitor the number of the currently running go routines.
TimersScheduler exposes functionality for scheduling multiple timers.
TrieNodeVersionVerifier defines the behavior of a component that can verify if a trie node version is valid.
WatchdogTimer is used to set alarms for different components.

# Type aliases

EnableEpochFlag defines a flag specific to the enableEpochs.toml.
ESDTType defines the possible types in case of ESDT tokens.
HeaderType defines the type to be used for the header that is sent.
NodeType represents the node's role in the network.
P2PPeerSubType defines the subtype of peer (e.g.
P2PPeerType defines the type of a p2p peer.
PeerID is a p2p peer identity.
PeerTopicType represents the type of a peer in regards to the topic it is used.
TrieNodeVersion defines the version of the trie node.