Documentation ¶
Index ¶
- Constants
- Variables
- type Accumulator
- type HardforkTrigger
- 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) 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) (state.UserAccountHandler, error)
- func (n *Node) GetAllESDTTokens(address string) (map[string]*esdt.ESDigitalToken, error)
- func (n *Node) GetAllIssuedESDTs(tokenType string) ([]string, error)
- func (n *Node) GetAppStatusHandler() core.AppStatusHandler
- func (n *Node) GetBalance(address string) (*big.Int, error)
- func (n *Node) GetBlockByHash(hash string, withTxs bool) (*api.Block, error)
- func (n *Node) GetBlockByNonce(nonce uint64, withTxs bool) (*api.Block, error)
- func (n *Node) GetCode(account state.UserAccountHandler) []byte
- func (n *Node) GetESDTData(address, tokenID string, nonce uint64) (*esdt.ESDigitalToken, error)
- func (n *Node) GetHeartbeats() []heartbeatData.PubKeyHeartbeat
- func (n *Node) GetKeyValuePairs(address string) (map[string]string, error)
- func (n *Node) GetPeerInfo(pid string) ([]core.QueryP2PPeerInfo, error)
- func (n *Node) GetQueryHandler(name string) (debug.QueryHandler, error)
- func (n *Node) GetTransaction(txHash string, withResults bool) (*transaction.ApiTransactionResult, error)
- func (n *Node) GetUsername(address string) (string, error)
- func (n *Node) GetValueForKey(address string, key string) (string, error)
- func (n *Node) IsInterfaceNil() bool
- func (n *Node) IsSelfTrigger() bool
- func (n *Node) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
- func (n *Node) StartConsensus() error
- func (n *Node) StartHeartbeat(hbConfig config.HeartbeatConfig, versionNumber string, ...) 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)
- type Option
- func WithAccountsAdapter(accounts state.AccountsAdapter) Option
- func WithAccountsAdapterAPI(accountsAPI state.AccountsAdapter) Option
- func WithAddressPubkeyConverter(pubkeyConverter core.PubkeyConverter) Option
- func WithAddressSignatureSize(signatureSize int) Option
- func WithAppStatusHandler(aph core.AppStatusHandler) Option
- func WithBlockBlackListHandler(blackListHandler process.TimeCacher) Option
- func WithBlockChain(blkc data.ChainHandler) Option
- func WithBlockProcessor(blockProcessor process.BlockProcessor) Option
- func WithBlockTracker(blockTracker process.BlockTracker) Option
- func WithBootStorer(bootStorer process.BootStorer) Option
- func WithBootstrapRoundIndex(bootstrapRoundIndex uint64) Option
- func WithChainID(chainID []byte) Option
- func WithConsensusGroupSize(consensusGroupSize int) Option
- func WithConsensusType(consensusType string) Option
- func WithDataPool(dataPool dataRetriever.PoolsHolder) Option
- func WithDataStore(store dataRetriever.StorageService) Option
- func WithEnableSignTxWithHashEpoch(enableSignTxWithHashEpoch uint32) Option
- func WithEpochStartEventNotifier(epochStartEventNotifier epochStart.RegistrationHandler) Option
- func WithEpochStartTrigger(epochStartTrigger epochStart.TriggerHandler) Option
- func WithFallbackHeaderValidator(fallbackHeaderValidator consensus.FallbackHeaderValidator) Option
- func WithForkDetector(forkDetector process.ForkDetector) Option
- func WithGenesisTime(genesisTime time.Time) Option
- func WithHardforkTrigger(hardforkTrigger HardforkTrigger) Option
- func WithHasher(hasher hashing.Hasher) Option
- func WithHeaderIntegrityVerifier(headerIntegrityVerifier spos.HeaderIntegrityVerifier) Option
- func WithHeaderSigVerifier(headerSigVerifier consensus.HeaderSigVerifier) Option
- func WithHistoryRepository(historyRepo dblookupext.HistoryRepository) Option
- func WithImportMode(importMode bool) Option
- func WithIndexer(indexer process.Indexer) Option
- func WithInitialNodesPubKeys(pubKeys map[uint32][]string) Option
- func WithInputAntifloodHandler(antifloodHandler P2PAntifloodHandler) Option
- func WithInterceptorsContainer(interceptorsContainer process.InterceptorsContainer) Option
- func WithInternalMarshalizer(marshalizer marshal.Marshalizer, sizeCheckDelta uint32) Option
- func WithKeyGen(keyGen crypto.KeyGenerator) Option
- func WithKeyGenForAccounts(keyGenForAccounts crypto.KeyGenerator) Option
- func WithMessenger(mes P2PMessenger) Option
- func WithMinTransactionVersion(minTransactionVersion uint32) Option
- func WithMultiSigner(multiSigner crypto.MultiSigner) Option
- func WithNetworkShardingCollector(networkShardingCollector NetworkShardingCollector) Option
- func WithNodeRedundancyHandler(nodeRedundancyHandler consensus.NodeRedundancyHandler) Option
- func WithNodeStopChannel(channel chan endProcess.ArgEndProcess) Option
- func WithNodesCoordinator(nodesCoordinator sharding.NodesCoordinator) Option
- func WithPeerDenialEvaluator(handler p2p.PeerDenialEvaluator) Option
- func WithPeerHonestyHandler(peerHonestyHandler consensus.PeerHonestyHandler) Option
- func WithPeerSignatureHandler(peerSignatureHandler crypto.PeerSignatureHandler) Option
- func WithPendingMiniBlocksHandler(pendingMiniBlocksHandler process.PendingMiniBlocksHandler) Option
- func WithPrivKey(sk crypto.PrivateKey) Option
- func WithPubKey(pk crypto.PublicKey) Option
- func WithPublicKeySize(publicKeySize int) Option
- func WithRequestHandler(requestHandler process.RequestHandler) Option
- func WithRequestedItemsHandler(requestedItemsHandler dataRetriever.RequestedItemsHandler) Option
- func WithResolversFinder(resolversFinder dataRetriever.ResolversFinder) Option
- func WithRoundDuration(roundDuration uint64) Option
- func WithRounder(rounder consensus.Rounder) Option
- func WithShardCoordinator(shardCoordinator sharding.Coordinator) Option
- func WithSingleSigner(singleSigner crypto.SingleSigner) Option
- func WithSyncer(syncer ntp.SyncTimer) Option
- func WithTxAccumulator(accumulator Accumulator) Option
- func WithTxFeeHandler(feeHandler process.FeeHandler) Option
- func WithTxSignHasher(txSignHasher hashing.Hasher) Option
- func WithTxSignMarshalizer(marshalizer marshal.Marshalizer) Option
- func WithTxSingleSigner(txSingleSigner crypto.SingleSigner) Option
- func WithTxVersionChecker(txVersionChecker process.TxVersionCheckerHandler) Option
- func WithUint64ByteSliceConverter(converter typeConverters.Uint64ByteSliceConverter) Option
- func WithValidatorPubkeyConverter(pubkeyConverter core.PubkeyConverter) Option
- func WithValidatorSignatureSize(signatureSize int) Option
- func WithValidatorStatistics(validatorStatistics process.ValidatorStatisticsProcessor) Option
- func WithValidatorsProvider(validatorsProvider process.ValidatorsProvider) Option
- func WithVmMarshalizer(marshalizer marshal.Marshalizer) Option
- func WithWatchdogTimer(watchdog core.WatchdogTimer) Option
- func WithWhiteListHandler(whiteListHandler process.WhiteListHandler) Option
- func WithWhiteListHandlerVerified(whiteListHandler process.WhiteListHandler) Option
- type P2PAntifloodHandler
- type P2PMessenger
- type Throttler
Constants ¶
const (
// SendTransactionsPipe is the pipe used for sending new transactions
SendTransactionsPipe = "send transactions pipe"
)
Variables ¶
var ErrAccountNotFound = errors.New("account not found")
ErrAccountNotFound signals that an account was not found in trie
var ErrCannotRetrieveTransaction = errors.New("transaction cannot be retrieved")
ErrCannotRetrieveTransaction signals that a transaction was not found
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 ErrGenesisBlockNotInitialized = errors.New("genesis block is not initialized")
ErrGenesisBlockNotInitialized signals that genesis block is not initialized
var ErrInvalidAddressLength = errors.New("invalid address length")
ErrInvalidAddressLength signals that an invalid address length has been provided
var ErrInvalidChainID = errors.New("invalid chain ID in Node")
ErrInvalidChainID signals that an invalid chain ID has been provided
var ErrInvalidChainIDInTransaction = errors.New("invalid chain ID")
ErrInvalidChainIDInTransaction signals that an invalid chain id has been provided in transaction
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 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 ErrNilAntifloodHandler = errors.New("nil antiflood handler")
ErrNilAntifloodHandler signals that a nil antiflood handler has been provided
var ErrNilBlockHeader = errors.New("nil block header")
ErrNilBlockHeader signals that current block header is nil
var ErrNilBlockProcessor = errors.New("trying to set nil block processor")
ErrNilBlockProcessor signals that a nil block processor has been provided
var ErrNilBlockTracker = errors.New("trying to set nil block tracker")
ErrNilBlockTracker signals that a nil block tracker has been provided
var ErrNilBlockchain = errors.New("nil blockchain")
ErrNilBlockchain signals that a nil blockchain structure has been provided
var ErrNilBootStorer = errors.New("nil boot storer")
ErrNilBootStorer signals that a nil boot storer was provided
var ErrNilDataPool = errors.New("trying to set nil data pool")
ErrNilDataPool signals that a nil data pool has been provided
var ErrNilEpochStartTrigger = errors.New("nil start of epoch trigger")
ErrNilEpochStartTrigger signals that a nil start of epoch trigger has been provided
var ErrNilFallbackHeaderValidator = errors.New("nil fallback header validator")
ErrNilFallbackHeaderValidator signals that a nil fallback header validator has been provided
var ErrNilForkDetector = errors.New("nil fork detector")
ErrNilForkDetector signals that a nil forkdetector object has been provided
var ErrNilHardforkTrigger = errors.New("nil hardfork trigger")
ErrNilHardforkTrigger signals that a nil hardfork trigger has been provided
var ErrNilHasher = errors.New("trying to set nil hasher")
ErrNilHasher signals that a nil hasher has been provided
var ErrNilHeaderIntegrityVerifier = errors.New("nil header integrity verifier")
ErrNilHeaderIntegrityVerifier signals that a nil header integrity verifier has been provided
var ErrNilHeaderSigVerifier = errors.New("nil header sig verifier")
ErrNilHeaderSigVerifier signals that a nil header sig verifier has been provided
var ErrNilHistoryRepository = errors.New("history repository is nil")
ErrNilHistoryRepository signals that history repository is nil
var ErrNilInterceptorsContainer = errors.New("nil interceptors container")
ErrNilInterceptorsContainer signals that a nil interceptors container has been provided
var ErrNilIntermediateProcessorContainer = errors.New("intermediate processor container is nil")
ErrNilIntermediateProcessorContainer signals that intermediate processors container is nil
var ErrNilKeyGenForBalances = errors.New("trying to set a nil key gen for signing")
ErrNilKeyGenForBalances signals that a nil keygen for balances has been provided
var ErrNilMarshalizer = errors.New("trying to set nil marshalizer")
ErrNilMarshalizer signals that a nil marshalizer has been provided
var ErrNilMessenger = errors.New("nil messenger")
ErrNilMessenger signals that a nil messenger has been provided
var ErrNilMultiSig = errors.New("trying to set nil multiSigner")
ErrNilMultiSig signals that a nil multiSigner object has been provided
var ErrNilNetworkShardingCollector = errors.New("nil network sharding collector")
ErrNilNetworkShardingCollector defines the error for setting a nil network sharding collector
var ErrNilNodeRedundancyHandler = errors.New("nil node redundancy handler")
ErrNilNodeRedundancyHandler signals that provided node redundancy handler is nil
var ErrNilNodeStopChannel = errors.New("nil node stop channel")
ErrNilNodeStopChannel signals that a nil channel for node process stop has been provided
var ErrNilNodesCoordinator = errors.New("trying to set nil nodes coordinator")
ErrNilNodesCoordinator signals that a nil nodes coordinator has been provided
var ErrNilPeerDenialEvaluator = errors.New("nil peer denial evaluator")
ErrNilPeerDenialEvaluator signals that a nil peer denial evaluator was provided
var ErrNilPeerHonestyHandler = errors.New("nil peer honesty handler")
ErrNilPeerHonestyHandler signals that a nil peer honesty handler has been provided
var ErrNilPeerSignatureHandler = errors.New("trying to set nil peerSignatureHandler")
ErrNilPeerSignatureHandler signals that a nil peerSignatureHandler object has been provided
var ErrNilPendingMiniBlocksHandler = errors.New("trying to set nil pending miniblocks handler")
ErrNilPendingMiniBlocksHandler signals that a nil pending miniblocks handler has been provided
var ErrNilPrivateKey = errors.New("trying to set nil private key")
ErrNilPrivateKey signals that a nil private key 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 ErrNilPublicKey = errors.New("trying to set nil public key")
ErrNilPublicKey signals that a nil public key has been provided
var ErrNilQueryHandler = errors.New("nil query handler")
ErrNilQueryHandler signals that a nil query handler has been provided
var ErrNilRequestHandler = errors.New("trying to set nil request handler")
ErrNilRequestHandler signals that a nil request handler has been provided
var ErrNilRequestedItemsHandler = errors.New("nil requested items handler")
ErrNilRequestedItemsHandler signals that a nil requested items handler was provided
var ErrNilResolversFinder = errors.New("nil resolvers finder")
ErrNilResolversFinder signals that a nil resolvers finder has been provided
var ErrNilRounder = errors.New("trying to set nil rounder")
ErrNilRounder signals that a nil rounder has been 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 ErrNilSingleSignKeyGen = errors.New("trying to set nil single sign key generator")
ErrNilSingleSignKeyGen signals that a nil single key generator has been provided
var ErrNilStatusHandler = errors.New("nil AppStatusHandler")
ErrNilStatusHandler is returned when the status handler is nil
var ErrNilStore = errors.New("nil data store")
ErrNilStore signals that a nil store has been provided
var ErrNilSyncTimer = errors.New("trying to set nil sync timer")
ErrNilSyncTimer signals that a nil sync timer has been provided
var ErrNilTimeCache = errors.New("nil time cache")
ErrNilTimeCache signals that a nil time cache was provided
var ErrNilTransactionVersionChecker = errors.New("nil transaction version checker")
ErrNilTransactionVersionChecker signals that provided transaction version checker is nil
var ErrNilTxAccumulator = errors.New("nil tx accumulator")
ErrNilTxAccumulator signals that a nil Accumulator instance has been provided
var ErrNilTxFeeHandler = errors.New("trying to set a nil tx fee handler")
ErrNilTxFeeHandler signals that a nil tx fee handler was provided
var ErrNilTxSimulatorProcessor = errors.New("nil transaction simulator processor")
ErrNilTxSimulatorProcessor signals that a nil transaction simulator processor has been provided
var ErrNilUint64ByteSliceConverter = errors.New("trying to set nil uint64 - byte slice converter")
ErrNilUint64ByteSliceConverter signals that a nil uint64 <-> byte slice converter has been provided
var ErrNilValidatorStatistics = errors.New("nil validator statistics")
ErrNilValidatorStatistics signals that a nil validator statistics has been provided
var ErrNilWatchdog = errors.New("nil watchdog")
ErrNilWatchdog signals that a nil watchdog has been provided
var ErrNilWhiteListHandler = errors.New("nil whitelist handler")
ErrNilWhiteListHandler signals that white list handler is nil
var ErrNoTxToProcess = errors.New("no transaction to process")
ErrNoTxToProcess signals that no transaction were sent for processing
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 ErrTransactionNotFound = errors.New("transaction not found")
ErrTransactionNotFound signals that a transaction was not found
var ErrTransactionValueLengthTooBig = errors.New("value length is too big")
ErrTransactionValueLengthTooBig signals that a too big value has been given to a transaction
var ErrUnknownPeerID = errors.New("unknown peer ID")
ErrUnknownPeerID signals that the provided peer is unknown by the current node
var ErrValidatorAlreadySet = errors.New("topic validator has already been set")
ErrValidatorAlreadySet signals that a topic validator has already been set
var ErrZeroRoundDurationNotSupported = errors.New("0 round duration time is not supported")
ErrZeroRoundDurationNotSupported signals that 0 seconds round duration is not supported
Functions ¶
This section is empty.
Types ¶
type Accumulator ¶
type Accumulator interface { AddData(data interface{}) OutputChannel() <-chan []interface{} IsInterfaceNil() bool }
Accumulator defines the interface able to accumulate data and periodically evict them
type HardforkTrigger ¶ added in v1.0.102
type HardforkTrigger interface { 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{} IsSelfTrigger() bool IsInterfaceNil() bool }
HardforkTrigger defines the behavior of a hardfork trigger
type HeartbeatHandler ¶ added in v1.1.3
type HeartbeatHandler interface { Monitor() *process.Monitor Sender() *process.Sender IsInterfaceNil() bool }
HeartbeatHandler defines the behavior of a heartbeat handler
type NetworkShardingCollector ¶
type NetworkShardingCollector interface { UpdatePeerIdPublicKey(pid core.PeerID, pk []byte) UpdatePublicKeyShardId(pk []byte, shardId uint32) UpdatePeerIdShardId(pid core.PeerID, shardId uint32) 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 passes the configuration parameters and initializes
required services as requested
func (*Node) AddQueryHandler ¶ added in v1.0.110
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 ¶ added in v1.0.104
DecodeAddressPubkey will try to decode the provided address public key string
func (*Node) DirectTrigger ¶ added in v1.0.102
DirectTrigger will start the hardfork trigger
func (*Node) EncodeAddressPubkey ¶ added in v1.0.104
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) (state.UserAccountHandler, error)
GetAccount will return account details for a given address
func (*Node) GetAllESDTTokens ¶ added in v1.1.12
GetAllESDTTokens returns all the ESDTs that the given address interacted with
func (*Node) GetAllIssuedESDTs ¶ added in v1.1.42
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 ¶
GetBalance gets the balance for a specific address
func (*Node) GetBlockByHash ¶ added in v1.0.147
GetBlockByHash return the block for a given hash
func (*Node) GetBlockByNonce ¶ added in v1.0.147
GetBlockByNonce returns the block for a given nonce
func (*Node) GetCode ¶ added in v1.1.22
func (n *Node) GetCode(account state.UserAccountHandler) []byte
GetCode returns the code for the given account
func (*Node) GetESDTData ¶ added in v1.1.39
GetESDTData returns the esdt balance and properties from a given account
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 ¶ added in v1.1.29
GetKeyValuePairs returns all the key-value pairs under the address
func (*Node) GetPeerInfo ¶ added in v1.0.130
func (n *Node) GetPeerInfo(pid string) ([]core.QueryP2PPeerInfo, error)
GetPeerInfo returns information about a peer id
func (*Node) GetQueryHandler ¶ added in v1.0.110
func (n *Node) GetQueryHandler(name string) (debug.QueryHandler, error)
GetQueryHandler returns the query handler if existing
func (*Node) GetTransaction ¶
func (n *Node) GetTransaction(txHash string, withResults bool) (*transaction.ApiTransactionResult, error)
GetTransaction gets the transaction based on the given hash. It will search in the cache and the storage and will return the transaction in a format which can be respected by all types of transactions (normal, reward or unsigned)
func (*Node) GetUsername ¶ added in v1.1.1
GetUsername gets the username for a specific address
func (*Node) GetValueForKey ¶ added in v1.0.125
GetValueForKey will return the value for a key from a given account
func (*Node) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*Node) IsSelfTrigger ¶ added in v1.0.102
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) StartConsensus ¶
StartConsensus will start the consensus service for the current node
func (*Node) StartHeartbeat ¶
func (n *Node) StartHeartbeat(hbConfig config.HeartbeatConfig, versionNumber string, prefsConfig config.PreferencesConfig) error
StartHeartbeat starts the node's heartbeat processing/signaling module TODO(next PR) remove the instantiation of the heartbeat component from here
func (*Node) ValidateTransaction ¶
func (n *Node) ValidateTransaction(tx *transaction.Transaction) error
ValidateTransaction will validate a transaction
func (*Node) ValidateTransactionForSimulation ¶ added in v1.1.4
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 WithAccountsAdapter ¶
func WithAccountsAdapter(accounts state.AccountsAdapter) Option
WithAccountsAdapter sets up the accounts adapter option for the Node
func WithAccountsAdapterAPI ¶ added in v1.1.40
func WithAccountsAdapterAPI(accountsAPI state.AccountsAdapter) Option
WithAccountsAdapterAPI sets up the accounts API adapter option for the Node
func WithAddressPubkeyConverter ¶ added in v1.0.104
func WithAddressPubkeyConverter(pubkeyConverter core.PubkeyConverter) Option
WithAddressPubkeyConverter sets up the address public key converter adapter option for the Node
func WithAddressSignatureSize ¶ added in v1.1.22
WithAddressSignatureSize sets up an addressSignatureSize option for the Node
func WithAppStatusHandler ¶
func WithAppStatusHandler(aph core.AppStatusHandler) Option
WithAppStatusHandler sets up which handler will monitor the status of the node
func WithBlockBlackListHandler ¶ added in v1.0.102
func WithBlockBlackListHandler(blackListHandler process.TimeCacher) Option
WithBlockBlackListHandler sets up a block black list handler for the Node
func WithBlockChain ¶
func WithBlockChain(blkc data.ChainHandler) Option
WithBlockChain sets up the blockchain option for the Node
func WithBlockProcessor ¶
func WithBlockProcessor(blockProcessor process.BlockProcessor) Option
WithBlockProcessor sets up the block processor option for the Node
func WithBlockTracker ¶
func WithBlockTracker(blockTracker process.BlockTracker) Option
WithBlockTracker sets up the block tracker for the Node
func WithBootStorer ¶
func WithBootStorer(bootStorer process.BootStorer) Option
WithBootStorer sets up a boot storer for the Node
func WithBootstrapRoundIndex ¶
WithBootstrapRoundIndex sets up a bootstrapRoundIndex option for the Node
func WithChainID ¶
WithChainID sets up the chain ID on which the current node is supposed to work on
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 WithDataPool ¶
func WithDataPool(dataPool dataRetriever.PoolsHolder) Option
WithDataPool sets up the data pools option for the Node
func WithDataStore ¶
func WithDataStore(store dataRetriever.StorageService) Option
WithDataStore sets up the storage options for the Node
func WithEnableSignTxWithHashEpoch ¶ added in v1.1.12
WithEnableSignTxWithHashEpoch sets up enableSignTxWithHashEpoch for the node
func WithEpochStartEventNotifier ¶ added in v1.0.102
func WithEpochStartEventNotifier(epochStartEventNotifier epochStart.RegistrationHandler) Option
WithEpochStartEventNotifier sets up the notifier for the epoch start event
func WithEpochStartTrigger ¶
func WithEpochStartTrigger(epochStartTrigger epochStart.TriggerHandler) Option
WithEpochStartTrigger sets up an start of epoch trigger option for the node
func WithFallbackHeaderValidator ¶ added in v1.1.3
func WithFallbackHeaderValidator(fallbackHeaderValidator consensus.FallbackHeaderValidator) Option
WithFallbackHeaderValidator sets up a fallback header validator for the Node
func WithForkDetector ¶
func WithForkDetector(forkDetector process.ForkDetector) Option
WithForkDetector sets up the multiSigner option for the Node
func WithGenesisTime ¶
WithGenesisTime sets up the genesis time option for the Node
func WithHardforkTrigger ¶ added in v1.0.102
func WithHardforkTrigger(hardforkTrigger HardforkTrigger) Option
WithHardforkTrigger sets up a hardfork trigger
func WithHasher ¶
WithHasher sets up the hasher option for the Node
func WithHeaderIntegrityVerifier ¶ added in v1.0.117
func WithHeaderIntegrityVerifier(headerIntegrityVerifier spos.HeaderIntegrityVerifier) Option
WithHeaderIntegrityVerifier sets up a header integrity verifier for the Node
func WithHeaderSigVerifier ¶
func WithHeaderSigVerifier(headerSigVerifier consensus.HeaderSigVerifier) Option
WithHeaderSigVerifier sets up a header sig verifier for the Node
func WithHistoryRepository ¶ added in v1.0.147
func WithHistoryRepository(historyRepo dblookupext.HistoryRepository) Option
WithHistoryRepository sets up a history repository for the node
func WithImportMode ¶ added in v1.1.15
WithImportMode sets up the flag if the node is running in import mode
func WithIndexer ¶
WithIndexer sets up a indexer for the Node
func WithInitialNodesPubKeys ¶
WithInitialNodesPubKeys sets up the initial nodes public key option for the Node
func WithInputAntifloodHandler ¶
func WithInputAntifloodHandler(antifloodHandler P2PAntifloodHandler) Option
WithInputAntifloodHandler sets up an antiflood handler for the Node on the input side
func WithInterceptorsContainer ¶
func WithInterceptorsContainer(interceptorsContainer process.InterceptorsContainer) Option
WithInterceptorsContainer sets up the interceptors container option for the Node
func WithInternalMarshalizer ¶
func WithInternalMarshalizer(marshalizer marshal.Marshalizer, sizeCheckDelta uint32) Option
WithInternalMarshalizer sets up the marshalizer option for the Node
func WithKeyGen ¶
func WithKeyGen(keyGen crypto.KeyGenerator) Option
WithKeyGen sets up the single sign key generator option for the Node
func WithKeyGenForAccounts ¶
func WithKeyGenForAccounts(keyGenForAccounts crypto.KeyGenerator) Option
WithKeyGenForAccounts sets up the balances key generator option for the Node
func WithMessenger ¶
func WithMessenger(mes P2PMessenger) Option
WithMessenger sets up the messenger option for the Node
func WithMinTransactionVersion ¶ added in v1.0.137
WithMinTransactionVersion sets up the minimum transaction version on which the current node is supposed to work on
func WithMultiSigner ¶
func WithMultiSigner(multiSigner crypto.MultiSigner) Option
WithMultiSigner sets up the multiSigner option for the Node
func WithNetworkShardingCollector ¶
func WithNetworkShardingCollector(networkShardingCollector NetworkShardingCollector) Option
WithNetworkShardingCollector sets up a network sharding updater for the Node
func WithNodeRedundancyHandler ¶ added in v1.1.31
func WithNodeRedundancyHandler(nodeRedundancyHandler consensus.NodeRedundancyHandler) Option
WithNodeRedundancyHandler sets up a node redundancy handler for the node
func WithNodeStopChannel ¶ added in v1.0.103
func WithNodeStopChannel(channel chan endProcess.ArgEndProcess) Option
WithNodeStopChannel sets up the channel which will handle closing the node
func WithNodesCoordinator ¶
func WithNodesCoordinator(nodesCoordinator sharding.NodesCoordinator) Option
WithNodesCoordinator sets up the nodes coordinator
func WithPeerDenialEvaluator ¶ added in v1.0.133
func WithPeerDenialEvaluator(handler p2p.PeerDenialEvaluator) Option
WithPeerDenialEvaluator sets up a peer denial evaluator for the Node
func WithPeerHonestyHandler ¶ added in v1.0.133
func WithPeerHonestyHandler(peerHonestyHandler consensus.PeerHonestyHandler) Option
WithPeerHonestyHandler sets up a peer honesty handler for the Node
func WithPeerSignatureHandler ¶ added in v1.0.138
func WithPeerSignatureHandler(peerSignatureHandler crypto.PeerSignatureHandler) Option
WithPeerSignatureHandler sets up a peerSignatureHandler for the Node
func WithPendingMiniBlocksHandler ¶
func WithPendingMiniBlocksHandler(pendingMiniBlocksHandler process.PendingMiniBlocksHandler) Option
WithPendingMiniBlocksHandler sets up the pending miniblocks handler for the Node
func WithPrivKey ¶
func WithPrivKey(sk crypto.PrivateKey) Option
WithPrivKey sets up the multi sign private key option for the Node
func WithPubKey ¶
WithPubKey sets up the multi sign pub key option for the Node
func WithPublicKeySize ¶ added in v1.0.103
WithPublicKeySize sets up a publicKeySize option for the Node
func WithRequestHandler ¶
func WithRequestHandler(requestHandler process.RequestHandler) Option
WithRequestHandler sets up the request handler for the Node
func WithRequestedItemsHandler ¶
func WithRequestedItemsHandler(requestedItemsHandler dataRetriever.RequestedItemsHandler) Option
WithRequestedItemsHandler sets up a requested items handler for the Node
func WithResolversFinder ¶
func WithResolversFinder(resolversFinder dataRetriever.ResolversFinder) Option
WithResolversFinder sets up the resolvers finder option for the Node
func WithRoundDuration ¶
WithRoundDuration sets up the round duration option for the Node
func WithRounder ¶
WithRounder sets up the rounder option for the Node
func WithShardCoordinator ¶
func WithShardCoordinator(shardCoordinator sharding.Coordinator) Option
WithShardCoordinator sets up the shard coordinator for the Node
func WithSingleSigner ¶
func WithSingleSigner(singleSigner crypto.SingleSigner) Option
WithSingleSigner sets up a singleSigner option for the Node
func WithSyncer ¶
WithSyncer sets up the syncTimer option for the Node
func WithTxAccumulator ¶
func WithTxAccumulator(accumulator Accumulator) Option
WithTxAccumulator sets up a transaction accumulator handler for the Node
func WithTxFeeHandler ¶
func WithTxFeeHandler(feeHandler process.FeeHandler) Option
WithTxFeeHandler sets up the tx fee handler for the Node
func WithTxSignHasher ¶ added in v1.1.12
WithTxSignHasher sets up a transaction sign hasher for the node
func WithTxSignMarshalizer ¶
func WithTxSignMarshalizer(marshalizer marshal.Marshalizer) Option
WithTxSignMarshalizer sets up the marshalizer used in transaction singning
func WithTxSingleSigner ¶
func WithTxSingleSigner(txSingleSigner crypto.SingleSigner) Option
WithTxSingleSigner sets up a txSingleSigner option for the Node
func WithTxVersionChecker ¶ added in v1.1.12
func WithTxVersionChecker(txVersionChecker process.TxVersionCheckerHandler) Option
WithTxVersionChecker sets up a transaction version checker for the node
func WithUint64ByteSliceConverter ¶
func WithUint64ByteSliceConverter(converter typeConverters.Uint64ByteSliceConverter) Option
WithUint64ByteSliceConverter sets up the uint64 <-> []byte converter
func WithValidatorPubkeyConverter ¶ added in v1.0.104
func WithValidatorPubkeyConverter(pubkeyConverter core.PubkeyConverter) Option
WithValidatorPubkeyConverter sets up the validator public key converter adapter option for the Node
func WithValidatorSignatureSize ¶ added in v1.1.22
WithValidatorSignatureSize sets up a validatorSignatureSize option for the Node
func WithValidatorStatistics ¶
func WithValidatorStatistics(validatorStatistics process.ValidatorStatisticsProcessor) Option
WithValidatorStatistics sets up the validator statistics for the node
func WithValidatorsProvider ¶ added in v0.0.5
func WithValidatorsProvider(validatorsProvider process.ValidatorsProvider) Option
WithValidatorsProvider sets up the validators provider for the node
func WithVmMarshalizer ¶
func WithVmMarshalizer(marshalizer marshal.Marshalizer) Option
WithVmMarshalizer sets up the marshalizer used in Vm communication (SC)
func WithWatchdogTimer ¶ added in v1.0.133
func WithWatchdogTimer(watchdog core.WatchdogTimer) Option
WithWatchdogTimer sets up a watchdog for the Node
func WithWhiteListHandler ¶ added in v1.0.110
func WithWhiteListHandler(whiteListHandler process.WhiteListHandler) Option
WithWhiteListHandler sets up a white list handler option
func WithWhiteListHandlerVerified ¶ added in v1.0.110
func WithWhiteListHandlerVerified(whiteListHandler process.WhiteListHandler) Option
WithWhiteListHandlerVerified sets up a white list handler option
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 HasTopicValidator(name string) bool RegisterMessageProcessor(topic 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