Documentation ¶
Index ¶
- Constants
- Variables
- func NewNodeRunner(cfgs *config.Configs) (*nodeRunner, error)
- type HardforkTrigger
- type HealthService
- type HeartbeatHandler
- type NetworkShardingCollector
- type Node
- func (n *Node) AddQueryHandler(name string, handler debug.QueryHandler) error
- func (n *Node) ApplyOptions(opts ...Option) error
- func (n *Node) Close() error
- func (n *Node) CreateShardedStores() error
- func (n *Node) CreateTransaction(nonce uint64, value string, receiver string, receiverUsername []byte, ...) (*transaction.Transaction, []byte, error)
- func (n *Node) DecodeAddressPubkey(pk string) ([]byte, error)
- func (n *Node) DirectTrigger(epoch uint32, withEarlyEndOfEpoch bool) error
- func (n *Node) EncodeAddressPubkey(pk []byte) (string, error)
- func (n *Node) GenerateAndSendBulkTransactions(receiverHex string, value *big.Int, numOfTxs uint64, sk crypto.PrivateKey, ...) error
- func (n *Node) GenerateTransaction(senderHex string, receiverHex string, value *big.Int, transactionData string, ...) (*transaction.Transaction, error)
- func (n *Node) GetAccount(address string, options api.AccountQueryOptions) (api.AccountResponse, api.BlockInfo, error)
- func (n *Node) GetAllESDTTokens(address string, options api.AccountQueryOptions, ctx context.Context) (map[string]*esdt.ESDigitalToken, api.BlockInfo, error)
- func (n *Node) GetAllIssuedESDTs(tokenType string, ctx context.Context) ([]string, error)
- func (n *Node) GetAppStatusHandler() core.AppStatusHandler
- func (n *Node) GetBalance(address string, options api.AccountQueryOptions) (*big.Int, api.BlockInfo, error)
- func (n *Node) GetBootstrapComponents() mainFactory.BootstrapComponentsHolder
- func (n *Node) GetCode(codeHash []byte, options api.AccountQueryOptions) ([]byte, api.BlockInfo)
- func (n *Node) GetConsensusComponents() mainFactory.ConsensusComponentsHolder
- func (n *Node) GetConsensusGroupSize() int
- func (n *Node) GetCoreComponents() mainFactory.CoreComponentsHolder
- func (n *Node) GetCryptoComponents() mainFactory.CryptoComponentsHolder
- func (n *Node) GetDataComponents() mainFactory.DataComponentsHolder
- func (n *Node) GetESDTData(address, tokenID string, nonce uint64, options api.AccountQueryOptions) (*esdt.ESDigitalToken, api.BlockInfo, error)
- func (n *Node) GetESDTsRoles(address string, options api.AccountQueryOptions, ctx context.Context) (map[string][]string, api.BlockInfo, error)
- func (n *Node) GetESDTsWithRole(address string, role string, options api.AccountQueryOptions, ...) ([]string, api.BlockInfo, error)
- func (n *Node) GetEpochStartDataAPI(epoch uint32) (*common.EpochStartDataAPI, error)
- func (n *Node) GetHeartbeatComponents() mainFactory.HeartbeatComponentsHolder
- func (n *Node) GetHeartbeatV2Components() mainFactory.HeartbeatV2ComponentsHolder
- func (n *Node) GetHeartbeats() []heartbeatData.PubKeyHeartbeat
- func (n *Node) GetKeyValuePairs(address string, options api.AccountQueryOptions, ctx context.Context) (map[string]string, api.BlockInfo, error)
- func (n *Node) GetNFTTokenIDsRegisteredByAddress(address string, options api.AccountQueryOptions, ctx context.Context) ([]string, api.BlockInfo, error)
- func (n *Node) GetNetworkComponents() mainFactory.NetworkComponentsHolder
- func (n *Node) GetPeerInfo(pid string) ([]core.QueryP2PPeerInfo, error)
- func (n *Node) GetProcessComponents() mainFactory.ProcessComponentsHolder
- func (n *Node) GetProof(rootHash string, key string) (*common.GetProofResponse, error)
- func (n *Node) GetProofDataTrie(rootHash string, address string, key string) (*common.GetProofResponse, *common.GetProofResponse, error)
- func (n *Node) GetQueryHandler(name string) (debug.QueryHandler, error)
- func (n *Node) GetStateComponents() mainFactory.StateComponentsHolder
- func (n *Node) GetStatusComponents() mainFactory.StatusComponentsHolder
- func (n *Node) GetTokenSupply(token string) (*api.ESDTSupply, error)
- func (n *Node) GetUsername(address string, options api.AccountQueryOptions) (string, api.BlockInfo, error)
- func (n *Node) GetValueForKey(address string, key string, options api.AccountQueryOptions) (string, api.BlockInfo, error)
- func (n *Node) IsInImportMode() bool
- func (n *Node) IsInterfaceNil() bool
- func (n *Node) IsSelfTrigger() bool
- func (n *Node) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
- func (n *Node) ValidateTransaction(tx *transaction.Transaction) error
- func (n *Node) ValidateTransactionForSimulation(tx *transaction.Transaction, checkSignature bool) error
- func (n *Node) ValidatorStatisticsApi() (map[string]*state.ValidatorApiResponse, error)
- func (n *Node) VerifyProof(rootHash string, address string, proof [][]byte) (bool, error)
- type Option
- func WithAddressSignatureSize(signatureSize int) Option
- func WithBootstrapComponents(bootstrapComponents factory.BootstrapComponentsHandler) Option
- func WithBootstrapRoundIndex(bootstrapRoundIndex uint64) Option
- func WithConsensusComponents(consensusComponents factory.ConsensusComponentsHandler) Option
- func WithConsensusGroupSize(consensusGroupSize int) Option
- func WithConsensusType(consensusType string) Option
- func WithCoreComponents(coreComponents factory.CoreComponentsHandler) Option
- func WithCryptoComponents(cryptoComponents factory.CryptoComponentsHandler) Option
- func WithDataComponents(dataComponents factory.DataComponentsHandler) Option
- func WithESDTNFTStorageHandler(storageHandler vmcommon.ESDTNFTStorageHandler) Option
- func WithEnableSignTxWithHashEpoch(enableSignTxWithHashEpoch uint32) Option
- func WithGenesisTime(genesisTime time.Time) Option
- func WithHeartbeatComponents(heartbeatComponents factory.HeartbeatComponentsHandler) Option
- func WithHeartbeatV2Components(heartbeatV2Components factory.HeartbeatV2ComponentsHandler) Option
- func WithImportMode(importMode bool) Option
- func WithInitialNodesPubKeys(pubKeys map[uint32][]string) Option
- func WithNetworkComponents(networkComponents factory.NetworkComponentsHandler) Option
- func WithNodeStopChannel(channel chan endProcess.ArgEndProcess) Option
- func WithPeerDenialEvaluator(handler p2p.PeerDenialEvaluator) Option
- func WithProcessComponents(processComponents factory.ProcessComponentsHandler) Option
- func WithPublicKeySize(publicKeySize int) Option
- func WithRequestedItemsHandler(requestedItemsHandler dataRetriever.RequestedItemsHandler) Option
- func WithRoundDuration(roundDuration uint64) Option
- func WithStateComponents(stateComponents factory.StateComponentsHandler) Option
- func WithStatusComponents(statusComponents factory.StatusComponentsHandler) Option
- func WithValidatorSignatureSize(signatureSize int) Option
- type P2PAntifloodHandler
- type P2PMessenger
- type Throttler
Constants ¶
const (
// SoftRestartMessage is the custom message used when the node does a soft restart operation
SoftRestartMessage = "Shuffled out - soft restart"
)
Variables ¶
var ErrCannotCastAccountHandlerToUserAccountHandler = errors.New("cannot cast account handler to user account handler")
ErrCannotCastAccountHandlerToUserAccountHandler signals that an account handler cannot be cast to user account handler
var ErrCannotCastUserAccountHandlerToVmCommonUserAccountHandler = errors.New("cannot cast user account handler to vm common user account handler")
ErrCannotCastUserAccountHandlerToVmCommonUserAccountHandler signals that an user account handler cannot be cast to vm common user account handler
var ErrDataFieldTooBig = errors.New("data field is too big")
ErrDataFieldTooBig signals that the data field is too big
var ErrDifferentSenderShardId = errors.New("different shard ID between the transaction sender shard ID and current node shard ID")
ErrDifferentSenderShardId signals that a different shard ID was detected between the sender shard ID and the current node shard ID
var ErrEmptyQueryHandlerName = errors.New("empty query handler name")
ErrEmptyQueryHandlerName signals that an empty string can not be used to be used in the query handler container
var ErrInvalidAddressLength = errors.New("invalid address length")
ErrInvalidAddressLength signals that an invalid address length has been provided
var ErrInvalidChainIDInTransaction = errors.New("invalid chain ID")
ErrInvalidChainIDInTransaction signals that an invalid chain id has been provided in transaction
var ErrInvalidESDTRole = errors.New("invalid ESDT role")
ErrInvalidESDTRole signals that an invalid ESDT role has been provided
var ErrInvalidReceiverUsernameLength = errors.New("invalid receiver username length")
ErrInvalidReceiverUsernameLength signals that the length of the receiver username is invalid
var ErrInvalidSenderUsernameLength = errors.New("invalid sender username length")
ErrInvalidSenderUsernameLength signals that the length of the sender username is invalid
var ErrInvalidSignatureLength = errors.New("invalid signature length")
ErrInvalidSignatureLength signals that an invalid signature length has been provided
var ErrInvalidTransactionVersion = errors.New("invalid transaction version")
ErrInvalidTransactionVersion signals that an invalid transaction version has been provided
var ErrInvalidValue = errors.New("invalid value")
ErrInvalidValue signals that an invalid value has been provided such as NaN to an integer field
var ErrMetachainOnlyEndpoint = errors.New("the endpoint is only available on metachain nodes")
ErrMetachainOnlyEndpoint signals that an endpoint was called, but it is only available for metachain nodes
var ErrNegativeOrZeroConsensusGroupSize = errors.New("group size should be a strict positive number")
ErrNegativeOrZeroConsensusGroupSize signals that 0 elements consensus group is not supported
var ErrNilAccountsAdapter = errors.New("trying to set nil accounts adapter")
ErrNilAccountsAdapter signals that a nil accounts adapter has been provided
var ErrNilBootstrapComponents = errors.New("nil bootstrap componennts")
ErrNilBootstrapComponents signals that a nil bootstrap components instance has been provided
var ErrNilCoreComponents = errors.New("nil core components")
ErrNilCoreComponents signals that a nil core components instance has been provided
var ErrNilCryptoComponents = errors.New("nil crypto components")
ErrNilCryptoComponents signals that a nil crypto components instance has been provided
var ErrNilDataComponents = errors.New("nil data components")
ErrNilDataComponents signals that a nil data components instance has been provided
var ErrNilDataPool = errors.New("trying to set nil data pool")
ErrNilDataPool signals that a nil data pool has been provided
var ErrNilESDTNFTStorageHandler = errors.New("nil esdt and nft storage handler")
ErrNilESDTNFTStorageHandler signals that a nil esdt and nft storage handler has been provided
var ErrNilMarshalizer = errors.New("trying to set nil marshalizer")
ErrNilMarshalizer signals that a nil marshalizer has been provided
var ErrNilNetworkComponents = errors.New("nil network components")
ErrNilNetworkComponents signals that a nil network components instance has been provided
var ErrNilNodeStopChannel = errors.New("nil node stop channel")
ErrNilNodeStopChannel signals that a nil channel for node process stop has been provided
var ErrNilPeerDenialEvaluator = errors.New("nil peer denial evaluator")
ErrNilPeerDenialEvaluator signals that a nil peer denial evaluator was provided
var ErrNilPrivateKey = errors.New("trying to set nil private key")
ErrNilPrivateKey signals that a nil private key has been provided
var ErrNilProcessComponents = errors.New("nil process components")
ErrNilProcessComponents signals that a nil process components instance has been provided
var ErrNilPubkeyConverter = errors.New("trying to use a nil pubkey converter")
ErrNilPubkeyConverter signals that a nil public key converter has been provided
var ErrNilQueryHandler = errors.New("nil query handler")
ErrNilQueryHandler signals that a nil query handler has been provided
var ErrNilRequestedItemsHandler = errors.New("nil requested items handler")
ErrNilRequestedItemsHandler signals that a nil requested items handler was provided
var ErrNilShardCoordinator = errors.New("trying to set nil shard coordinator")
ErrNilShardCoordinator signals that a nil shard coordinator has been provided
var ErrNilSingleSig = errors.New("trying to set nil singlesig")
ErrNilSingleSig signals that a nil singlesig object has been provided
var ErrNilStateComponents = errors.New("nil state components")
ErrNilStateComponents signals that a nil state components instance has been provided
var ErrNilStatusComponents = errors.New("nil status components")
ErrNilStatusComponents signals that a nil status components instance has been provided
var ErrNilStorer = errors.New("nil storer")
ErrNilStorer signals the using of a nil storer
var ErrNodeCloseFailed = errors.New("node closing failed ")
ErrNodeCloseFailed signals that the close function of the node failed
var ErrQueryHandlerAlreadyExists = errors.New("query handler already exists")
ErrQueryHandlerAlreadyExists signals that the query handler is already registered
var ErrSystemBusyGeneratingTransactions = errors.New("system busy while generating bulk transactions")
ErrSystemBusyGeneratingTransactions signals that to many transactions are trying to get generated
var ErrTransactionValueLengthTooBig = errors.New("value length is too big")
ErrTransactionValueLengthTooBig signals that a too big value has been given to a transaction
var ErrTrieOperationsTimeout = errors.New("trie operations timeout")
ErrTrieOperationsTimeout signals that a trie operation took too long
var ErrUnknownPeerID = errors.New("unknown peer ID")
ErrUnknownPeerID signals that the provided peer is unknown by the current node
var ErrZeroRoundDurationNotSupported = errors.New("0 round duration time is not supported")
ErrZeroRoundDurationNotSupported signals that 0 seconds round duration is not supported
Functions ¶
func NewNodeRunner ¶
NewNodeRunner creates a nodeRunner instance
Types ¶
type HardforkTrigger ¶
type HardforkTrigger interface { SetExportFactoryHandler(exportFactoryHandler update.ExportFactoryHandler) error TriggerReceived(payload []byte, data []byte, pkBytes []byte) (bool, error) RecordedTriggerMessage() ([]byte, bool) Trigger(epoch uint32, withEarlyEndOfEpoch bool) error CreateData() []byte AddCloser(closer update.Closer) error NotifyTriggerReceived() <-chan struct{} NotifyTriggerReceivedV2() <-chan struct{} IsSelfTrigger() bool IsInterfaceNil() bool }
HardforkTrigger defines the behavior of a hardfork trigger
type HealthService ¶
HealthService defines the behavior of a service able to keep track of the node's health
type HeartbeatHandler ¶
type HeartbeatHandler interface { Monitor() *process.Monitor Sender() *process.Sender IsInterfaceNil() bool }
HeartbeatHandler defines the behavior of a heartbeat handler
type NetworkShardingCollector ¶
type NetworkShardingCollector interface { UpdatePeerIDInfo(pid core.PeerID, pk []byte, shardID uint32) PutPeerIdSubType(pid core.PeerID, peerSubType core.P2PPeerSubType) GetPeerInfo(pid core.PeerID) core.P2PPeerInfo IsInterfaceNil() bool }
NetworkShardingCollector defines the updating methods used by the network sharding component The interface assures that the collected data will be used by the p2p network sharding components
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a structure that holds all managed components
func CreateNode ¶
func CreateNode( config *config.Config, bootstrapComponents factory.BootstrapComponentsHandler, coreComponents factory.CoreComponentsHandler, cryptoComponents factory.CryptoComponentsHandler, dataComponents factory.DataComponentsHandler, networkComponents factory.NetworkComponentsHandler, processComponents factory.ProcessComponentsHandler, stateComponents factory.StateComponentsHandler, statusComponents factory.StatusComponentsHandler, heartbeatComponents factory.HeartbeatComponentsHandler, heartbeatV2Components factory.HeartbeatV2ComponentsHandler, consensusComponents factory.ConsensusComponentsHandler, epochConfig config.EpochConfig, bootstrapRoundIndex uint64, isInImportMode bool, ) (*Node, error)
CreateNode is the node factory
func (*Node) AddQueryHandler ¶
func (n *Node) AddQueryHandler(name string, handler debug.QueryHandler) error
AddQueryHandler adds a query handler in cache
func (*Node) ApplyOptions ¶
ApplyOptions can set up different configurable options of a Node instance
func (*Node) CreateShardedStores ¶
CreateShardedStores instantiate sharded cachers for Transactions and Headers
func (*Node) CreateTransaction ¶
func (n *Node) CreateTransaction( nonce uint64, value string, receiver string, receiverUsername []byte, sender string, senderUsername []byte, gasPrice uint64, gasLimit uint64, dataField []byte, signatureHex string, chainID string, version uint32, options uint32, ) (*transaction.Transaction, []byte, error)
CreateTransaction will return a transaction from all the required fields
func (*Node) DecodeAddressPubkey ¶
DecodeAddressPubkey will try to decode the provided address public key string
func (*Node) DirectTrigger ¶
DirectTrigger will start the hardfork trigger
func (*Node) EncodeAddressPubkey ¶
EncodeAddressPubkey will encode the provided address public key bytes to string
func (*Node) GenerateAndSendBulkTransactions ¶
func (n *Node) GenerateAndSendBulkTransactions( receiverHex string, value *big.Int, numOfTxs uint64, sk crypto.PrivateKey, whiteList func([]*transaction.Transaction), chainID []byte, minTxVersion uint32, ) error
GenerateAndSendBulkTransactions is a method for generating and propagating a set of transactions to be processed. It is mainly used for demo purposes
func (*Node) GenerateTransaction ¶
func (n *Node) GenerateTransaction(senderHex string, receiverHex string, value *big.Int, transactionData string, privateKey crypto.PrivateKey, chainID []byte, minTxVersion uint32) (*transaction.Transaction, error)
GenerateTransaction generates a new transaction with sender, receiver, amount and code
func (*Node) GetAccount ¶
func (n *Node) GetAccount(address string, options api.AccountQueryOptions) (api.AccountResponse, api.BlockInfo, error)
GetAccount will return account details for a given address
func (*Node) GetAllESDTTokens ¶
func (n *Node) GetAllESDTTokens(address string, options api.AccountQueryOptions, ctx context.Context) (map[string]*esdt.ESDigitalToken, api.BlockInfo, error)
GetAllESDTTokens returns all the ESDTs that the given address interacted with
func (*Node) GetAllIssuedESDTs ¶
GetAllIssuedESDTs returns all the issued esdt tokens, works only on metachain
func (*Node) GetAppStatusHandler ¶
func (n *Node) GetAppStatusHandler() core.AppStatusHandler
GetAppStatusHandler will return the current status handler
func (*Node) GetBalance ¶
func (n *Node) GetBalance(address string, options api.AccountQueryOptions) (*big.Int, api.BlockInfo, error)
GetBalance gets the balance for a specific address
func (*Node) GetBootstrapComponents ¶
func (n *Node) GetBootstrapComponents() mainFactory.BootstrapComponentsHolder
GetBootstrapComponents returns the bootstrap components
func (*Node) GetConsensusComponents ¶
func (n *Node) GetConsensusComponents() mainFactory.ConsensusComponentsHolder
GetConsensusComponents returns the consensus components
func (*Node) GetConsensusGroupSize ¶
GetConsensusGroupSize returns the configured consensus size
func (*Node) GetCoreComponents ¶
func (n *Node) GetCoreComponents() mainFactory.CoreComponentsHolder
GetCoreComponents returns the core components
func (*Node) GetCryptoComponents ¶
func (n *Node) GetCryptoComponents() mainFactory.CryptoComponentsHolder
GetCryptoComponents returns the crypto components
func (*Node) GetDataComponents ¶
func (n *Node) GetDataComponents() mainFactory.DataComponentsHolder
GetDataComponents returns the data components
func (*Node) GetESDTData ¶
func (n *Node) GetESDTData(address, tokenID string, nonce uint64, options api.AccountQueryOptions) (*esdt.ESDigitalToken, api.BlockInfo, error)
GetESDTData returns the esdt balance and properties from a given account
func (*Node) GetESDTsRoles ¶
func (n *Node) GetESDTsRoles(address string, options api.AccountQueryOptions, ctx context.Context) (map[string][]string, api.BlockInfo, error)
GetESDTsRoles returns all the tokens identifiers and roles for the given address
func (*Node) GetESDTsWithRole ¶
func (n *Node) GetESDTsWithRole(address string, role string, options api.AccountQueryOptions, ctx context.Context) ([]string, api.BlockInfo, error)
GetESDTsWithRole returns all the tokens with the given role for the given address
func (*Node) GetEpochStartDataAPI ¶
func (n *Node) GetEpochStartDataAPI(epoch uint32) (*common.EpochStartDataAPI, error)
GetEpochStartDataAPI returns epoch start data of a given epoch
func (*Node) GetHeartbeatComponents ¶
func (n *Node) GetHeartbeatComponents() mainFactory.HeartbeatComponentsHolder
GetHeartbeatComponents returns the heartbeat components
func (*Node) GetHeartbeatV2Components ¶
func (n *Node) GetHeartbeatV2Components() mainFactory.HeartbeatV2ComponentsHolder
GetHeartbeatV2Components returns the heartbeatV2 components
func (*Node) GetHeartbeats ¶
func (n *Node) GetHeartbeats() []heartbeatData.PubKeyHeartbeat
GetHeartbeats returns the heartbeat status for each public key defined in genesis.json
func (*Node) GetKeyValuePairs ¶
func (n *Node) GetKeyValuePairs(address string, options api.AccountQueryOptions, ctx context.Context) (map[string]string, api.BlockInfo, error)
GetKeyValuePairs returns all the key-value pairs under the address
func (*Node) GetNFTTokenIDsRegisteredByAddress ¶
func (n *Node) GetNFTTokenIDsRegisteredByAddress(address string, options api.AccountQueryOptions, ctx context.Context) ([]string, api.BlockInfo, error)
GetNFTTokenIDsRegisteredByAddress returns all the token identifiers for semi or non fungible tokens registered by the address
func (*Node) GetNetworkComponents ¶
func (n *Node) GetNetworkComponents() mainFactory.NetworkComponentsHolder
GetNetworkComponents returns the network components
func (*Node) GetPeerInfo ¶
func (n *Node) GetPeerInfo(pid string) ([]core.QueryP2PPeerInfo, error)
GetPeerInfo returns information about a peer id
func (*Node) GetProcessComponents ¶
func (n *Node) GetProcessComponents() mainFactory.ProcessComponentsHolder
GetProcessComponents returns the process components
func (*Node) GetProofDataTrie ¶
func (n *Node) GetProofDataTrie(rootHash string, address string, key string) (*common.GetProofResponse, *common.GetProofResponse, error)
GetProofDataTrie returns the Merkle Proof for the given address, and another Merkle Proof for the given key, if it exists in the dataTrie
func (*Node) GetQueryHandler ¶
func (n *Node) GetQueryHandler(name string) (debug.QueryHandler, error)
GetQueryHandler returns the query handler if existing
func (*Node) GetStateComponents ¶
func (n *Node) GetStateComponents() mainFactory.StateComponentsHolder
GetStateComponents returns the state components
func (*Node) GetStatusComponents ¶
func (n *Node) GetStatusComponents() mainFactory.StatusComponentsHolder
GetStatusComponents returns the status components
func (*Node) GetTokenSupply ¶
func (n *Node) GetTokenSupply(token string) (*api.ESDTSupply, error)
GetTokenSupply returns the provided token supply from current shard
func (*Node) GetUsername ¶
func (n *Node) GetUsername(address string, options api.AccountQueryOptions) (string, api.BlockInfo, error)
GetUsername gets the username for a specific address
func (*Node) GetValueForKey ¶
func (n *Node) GetValueForKey(address string, key string, options api.AccountQueryOptions) (string, api.BlockInfo, error)
GetValueForKey will return the value for a key from a given account
func (*Node) IsInImportMode ¶
IsInImportMode returns true if the node is in import mode
func (*Node) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*Node) IsSelfTrigger ¶
IsSelfTrigger returns true if the trigger's registered public key matches the self public key
func (*Node) SendBulkTransactions ¶
func (n *Node) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
SendBulkTransactions sends the provided transactions as a bulk, optimizing transfer between nodes
func (*Node) ValidateTransaction ¶
func (n *Node) ValidateTransaction(tx *transaction.Transaction) error
ValidateTransaction will validate a transaction
func (*Node) ValidateTransactionForSimulation ¶
func (n *Node) ValidateTransactionForSimulation(tx *transaction.Transaction, checkSignature bool) error
ValidateTransactionForSimulation will validate a transaction for use in transaction simulation process
func (*Node) ValidatorStatisticsApi ¶
func (n *Node) ValidatorStatisticsApi() (map[string]*state.ValidatorApiResponse, error)
ValidatorStatisticsApi will return the statistics for all the validators from the initial nodes pub keys
type Option ¶
Option represents a functional configuration parameter that can operate
over the None struct.
func WithAddressSignatureSize ¶
WithAddressSignatureSize sets up an addressSignatureSize option for the Node
func WithBootstrapComponents ¶
func WithBootstrapComponents(bootstrapComponents factory.BootstrapComponentsHandler) Option
WithBootstrapComponents sets up the Node bootstrap components
func WithBootstrapRoundIndex ¶
WithBootstrapRoundIndex sets up a bootstrapRoundIndex option for the Node
func WithConsensusComponents ¶
func WithConsensusComponents(consensusComponents factory.ConsensusComponentsHandler) Option
WithConsensusComponents sets up the Node consensus components
func WithConsensusGroupSize ¶
WithConsensusGroupSize sets up the consensus group size option for the Node
func WithConsensusType ¶
WithConsensusType sets up the consensus type option for the Node
func WithCoreComponents ¶
func WithCoreComponents(coreComponents factory.CoreComponentsHandler) Option
WithCoreComponents sets up the Node core components
func WithCryptoComponents ¶
func WithCryptoComponents(cryptoComponents factory.CryptoComponentsHandler) Option
WithCryptoComponents sets up Node crypto components
func WithDataComponents ¶
func WithDataComponents(dataComponents factory.DataComponentsHandler) Option
WithDataComponents sets up the Node data components
func WithESDTNFTStorageHandler ¶
func WithESDTNFTStorageHandler(storageHandler vmcommon.ESDTNFTStorageHandler) Option
WithESDTNFTStorageHandler sets the esdt nft storage handler
func WithEnableSignTxWithHashEpoch ¶
WithEnableSignTxWithHashEpoch sets up enableSignTxWithHashEpoch for the node
func WithGenesisTime ¶
WithGenesisTime sets up the genesis time option for the Node
func WithHeartbeatComponents ¶
func WithHeartbeatComponents(heartbeatComponents factory.HeartbeatComponentsHandler) Option
WithHeartbeatComponents sets up the Node heartbeat components
func WithHeartbeatV2Components ¶
func WithHeartbeatV2Components(heartbeatV2Components factory.HeartbeatV2ComponentsHandler) Option
WithHeartbeatV2Components sets up the Node heartbeatV2 components
func WithImportMode ¶
WithImportMode sets up the flag if the node is running in import mode
func WithInitialNodesPubKeys ¶
WithInitialNodesPubKeys sets up the initial nodes public key option for the Node
func WithNetworkComponents ¶
func WithNetworkComponents(networkComponents factory.NetworkComponentsHandler) Option
WithNetworkComponents sets up the Node network components
func WithNodeStopChannel ¶
func WithNodeStopChannel(channel chan endProcess.ArgEndProcess) Option
WithNodeStopChannel sets up the channel which will handle closing the node
func WithPeerDenialEvaluator ¶
func WithPeerDenialEvaluator(handler p2p.PeerDenialEvaluator) Option
WithPeerDenialEvaluator sets up a peer denial evaluator for the Node
func WithProcessComponents ¶
func WithProcessComponents(processComponents factory.ProcessComponentsHandler) Option
WithProcessComponents sets up the Node process components
func WithPublicKeySize ¶
WithPublicKeySize sets up a publicKeySize option for the Node
func WithRequestedItemsHandler ¶
func WithRequestedItemsHandler(requestedItemsHandler dataRetriever.RequestedItemsHandler) Option
WithRequestedItemsHandler sets up a requested items handler for the Node
func WithRoundDuration ¶
WithRoundDuration sets up the round duration option for the Node
func WithStateComponents ¶
func WithStateComponents(stateComponents factory.StateComponentsHandler) Option
WithStateComponents sets up the Node state components
func WithStatusComponents ¶
func WithStatusComponents(statusComponents factory.StatusComponentsHandler) Option
WithStatusComponents sets up the Node status components
func WithValidatorSignatureSize ¶
WithValidatorSignatureSize sets up a validatorSignatureSize option for the Node
type P2PAntifloodHandler ¶
type P2PAntifloodHandler interface { CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error CanProcessMessagesOnTopic(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, sequence []byte) error ResetForTopic(topic string) SetMaxMessagesForTopic(topic string, maxNum uint32) ApplyConsensusSize(size int) BlacklistPeer(peer core.PeerID, reason string, duration time.Duration) IsInterfaceNil() bool }
P2PAntifloodHandler defines the behavior of a component able to signal that the system is too busy (or flooded) processing p2p messages
type P2PMessenger ¶
type P2PMessenger interface { io.Closer Bootstrap() error Broadcast(topic string, buff []byte) BroadcastOnChannel(channel string, topic string, buff []byte) BroadcastOnChannelBlocking(channel string, topic string, buff []byte) error CreateTopic(name string, createChannelForTopic bool) error HasTopic(name string) bool RegisterMessageProcessor(topic string, identifier string, handler p2p.MessageProcessor) error PeerAddresses(pid core.PeerID) []string IsConnectedToTheNetwork() bool ID() core.PeerID Peers() []core.PeerID IsInterfaceNil() bool }
P2PMessenger defines a subset of the p2p.Messenger interface