# 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 drt-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).
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.
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.
IsValidDCDTRole returns true if the input string represents a valid DCDT 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.
BuiltInFunctionDCDTBurn is the key for the electronic standard digital token burn built-in function.
BuiltInFunctionDCDTFreeze is the key for the electronic standard digital token freeze built-in function.
BuiltInFunctionDCDTLocalBurn is the key for the electronic standard digital token local burn built-in function.
BuiltInFunctionDCDTLocalMint is the key for the electronic standard digital token local mint built-in function.
BuiltInFunctionDCDTNFTAddQuantity is the key for the electronic standard digital token NFT add quantity built-in function.
BuiltInFunctionDCDTNFTAddURI is the key for the electronic standard digital token NFT add URI built-in function.
BuiltInFunctionDCDTNFTBurn is the key for the electronic standard digital token NFT burn built-in function.
BuiltInFunctionDCDTNFTCreate is the key for the electronic standard digital token NFT create built-in function.
BuiltInFunctionDCDTNFTCreateRoleTransfer is the key for the electronic standard digital token create role transfer function.
BuiltInFunctionDCDTNFTTransfer is the key for the electronic standard digital token NFT transfer built-in function.
BuiltInFunctionDCDTNFTUpdateAttributes is the key for the electronic standard digital token NFT update attributes built-in function.
BuiltInFunctionDCDTPause is the key for the electronic standard digital token pause built-in function.
BuiltInFunctionDCDTSetLimitedTransfer 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.
BuiltInFunctionDCDTTransfer is the key for the electronic standard digital token transfer built-in function.
BuiltInFunctionDCDTUnFreeze is the key for the electronic standard digital token unfreeze built-in function.
BuiltInFunctionDCDTUnPause is the key for the electronic standard digital token unpause built-in function.
BuiltInFunctionDCDTUnSetLimitedTransfer 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.
BuiltInFunctionDCDTWipe 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.
BuiltInFunctionMultiDCDTNFTTransfer 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.
BuiltInFunctionSetDCDTRole 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.
BuiltInFunctionUnSetDCDTRole 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.
DCDTKeyIdentifier is the key prefix for dcdt tokens.
DCDTNFTLatestNonceIdentifier is the key prefix for dcdt latest nonce identifier.
DCDTRoleIdentifier is the key prefix for dcdt role identifier.
DCDTRoleLocalBurn is the constant string for the local role of burn for DCDT tokens.
DCDTRoleLocalMint is the constant string for the local role of mint for DCDT tokens.
DCDTRoleNFTAddQuantity is the constant string for the local role of adding quantity for existing DCDT NFT tokens.
DCDTRoleNFTAddURI is the constant string for the local role of adding a URI for DCDT NFT tokens.
DCDTRoleNFTBurn is the constant string for the local role of burn for DCDT NFT tokens.
DCDTRoleNFTCreate is the constant string for the local role of create for DCDT NFT tokens.
DCDTRoleNFTCreateMultiShard is the constant string for the local role of create for DCDT NFT tokens multishard.
DCDTRoleNFTUpdateAttributes is the constant string for the local role of updating attributes for DCDT NFT tokens.
DCDTRoleTransfer is the constant string for the local role to transfer DCDT, only for special tokens.
DefaultAddressPrefix is the default hrp of DharitriOne/Numbat.
DelegationSystemSCKey is the key under which there is data in case of system delegation smart contracts.
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 DCDT fungible tokens.
FungibleDCDT defines the string for the token type of fungible DCDT.
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.
MaxLenForDCDTIssueMint 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.
MetaHeader defines the type of *block.MetaBlock.
MinLenArgumentsDCDTNFTTransfer defines the minimum length for dcdt nft transfer.
MinLenArgumentsDCDTTransfer defines the min length of arguments for the DCDT 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 DCDT non fungible tokens.
NonFungibleDCDT defines the string for the token type of non fungible DCDT.
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.
SemiFungibleDCDT defines the string for the token type of semi fungible DCDT.
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/dcdt transfer.
# Variables
DCDTSCAddress is the hard-coded address for dcdt issuing smart contract.
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.
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
DCDTType defines the possible types in case of DCDT tokens.
EnableEpochFlag defines a flag specific to the enableEpochs.toml.
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.