Class FullNode
Implementation of the FullNode API
This class implements the business code of the FullNode.
Communication with the other nodes is handled by the Network
class.
Constructors
Name | Description |
---|---|
this
(config)
|
Constructor |
Fields
Name | Type | Description |
---|---|---|
app_stats
|
Stats!(agora.stats.App.ApplicationStatsValue,agora.stats.App.ApplicationStatsLabels) | Persistence-related fields |
block_handlers
|
agora | List of handlers for specific actions |
block_header_handlers
|
agora | List of handlers for specific actions |
cacheDB
|
ManagedDatabase | Persistence-related fields |
clock
|
Clock | Clock instance |
config
|
Config | Config instance |
endpoint_request_stats
|
Stats!(agora.stats.EndpointReq.EndpointReqStatsValue,agora.stats.EndpointReq.EndpointReqStatsLabel) | Persistence-related fields |
enroll_man
|
EnrollmentManager | Enrollment manager |
is_shutting_down
|
bool | Node is shutting down |
ledger
|
NodeLedger | The Ledger is the main class driving consensus |
log
|
Logger | Logger instance |
network
|
NetworkManager | Network of connected nodes |
params
|
immutable(ConsensusParams) | Parameters for consensus-critical constants |
pool
|
TransactionPool | Transaction pool |
preimage_handlers
|
agora | List of handlers for specific actions |
registry
|
NameRegistry | Name registry, if enabled for this node |
stateDB
|
ManagedDatabase | Persistence-related fields |
storage
|
IBlockStorage | Persistence-related fields |
taskman
|
ITaskManager | Task manager |
timers
|
ITimer[int] | Timers this node has started |
transaction_handlers
|
agora | List of handlers for specific actions |
transaction_relayer
|
TransactionRelayer | Transaction relayer |
Methods
Name | Description |
---|---|
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
Name | Description |
---|---|
TimersIdx
|