Class FullNode

Implementation of the FullNode API

class FullNode
  : API ;

This class implements the business code of the FullNode. Communication with the other nodes is handled by the Network class.

Constructors

NameDescription
this (config) Constructor

Fields

NameTypeDescription
app_stats Stats!(agora.stats.App.ApplicationStatsValue,agora.stats.App.ApplicationStatsLabels)Persistence-related fields
block_handlers agora.node.FullNode.FullNode.HandlerInfo!(agora.api.Handlers.BlockExternalizedHandler)[]List of handlers for specific actions
block_header_handlers agora.node.FullNode.FullNode.HandlerInfo!(agora.api.Handlers.BlockHeaderUpdatedHandler)[]List of handlers for specific actions
cacheDB ManagedDatabasePersistence-related fields
clock ClockClock instance
config ConfigConfig instance
endpoint_request_stats Stats!(agora.stats.EndpointReq.EndpointReqStatsValue,agora.stats.EndpointReq.EndpointReqStatsLabel)Persistence-related fields
enroll_man EnrollmentManagerEnrollment manager
is_shutting_down boolNode is shutting down
ledger NodeLedgerThe Ledger is the main class driving consensus
log LoggerLogger instance
network NetworkManagerNetwork of connected nodes
params immutable(ConsensusParams)Parameters for consensus-critical constants
pool TransactionPoolTransaction pool
preimage_handlers agora.node.FullNode.FullNode.HandlerInfo!(agora.api.Handlers.PreImageReceivedHandler)[]List of handlers for specific actions
registry NameRegistryName registry, if enabled for this node
stateDB ManagedDatabasePersistence-related fields
storage IBlockStoragePersistence-related fields
taskman ITaskManagerTask manager
timers ITimer[int]Timers this node has started
transaction_handlers agora.node.FullNode.FullNode.HandlerInfo!(agora.api.Handlers.TransactionReceivedHandler)[]List of handlers for specific actions
transaction_relayer TransactionRelayerTransaction relayer

Methods

NameDescription
getBlock (height)
getBlockHeaders (heights)
getBlockHeight ()
getBlocksFrom (height, max_blocks)
getConsensusParams ()
getEnrollment (enroll_hash)
getLocalTime () GET /local_time
getMerklePath (height, hash)
getNetworkManager ()
getNodeInfo ()
getPreimages (enroll_keys)
getPreimagesFrom (start_height)
getTaskManager ()
getTransactions (tx_hashes)
getTransactions (from)
getValidators (height)
handshake (peer)
hasTransactionHash (tx)
makeConsensusParams (config) Make a new instance of the consensus parameters based on the config
postEnrollment (enroll, avail_height) POST /enrollment
postPreimage (preimage) POST /preimage
postTransaction (tx) Receive a transaction.
shutdown () Called on node shutdown.
start () Begins asynchronous tasks for node discovery and periodic catchup.
getLocalTime ()
acceptBlock (block) Add block to ledger and remove expired validators from network whitelist
acceptHeader (header) Push the header to upstream servers.
catchupTask () Periodically retrieve the latest blocks and apply them to the provided ledger.
discoveryTask () Periodically discovers new nodes in the network
getDoubleSpentSelector (txs) Returns an instance of a DoubleSpentSelector
makeBlockStorage () Returns an instance of an IBlockStorage
makeCacheDB ()
makeClock () Returns an instance of a Clock
makeEnrollmentManager () Returns an instance of a EnrollmentManager
makeLedger () Returns an instance of a Ledger to be used for a Fullnode.
makeLogger ()
makeNetworkManager () Returns an instance of a NetworkManager
makeStateDB ()
makeTaskManager () Returns an instance of a TaskManager
onAcceptedBlock (block, validators_changed) Called when a block was externalized.
potentialExtraSigs (header) Count extra signatures that could be added to the provided header.
pushBlockHeader (header) Push an updated block header to the blockheader_handlers target server list set in config. The blockheader can have signatures from validators added even after the block has been externalized.
pushPreImage (pre_image) Push the preimage to the preimage_handlers target server list set in config.
pushTransaction (tx) Push the transaction to the transaction_handlers target server list set in config.
recordReq (endpoint, weight) Convenience function to increase an endpoint stats

Enums

NameDescription
TimersIdx