Full Node - Algorand Specifications

Algorand Specifications

The algod Full Node is responsible for:

The pseudocode below outlines the main steps involved when initializing an algod Full Node:


Algorithm1: Full Node InitializationAlgorithm 1: Full Node Initialization

1: function FullNode.Start(rootDir,nodeConfig,phonebookAddrs,genesisBlock) 2: node ← new FullNode 3: node.log ← Logger(nodeConfig) 4: node.genesisBlock.ID ← genesisBlock.ID() 5: node.genesisBlock.ID ← genesisBlock.Hash() 6: Network Initialization 7: if nodeConfig.EnableHybridMode then 8: node.Network ← CreateHYBNetwork(phonebookAddrs) 9: else if nodeConfig.EnableP2P then 10: node.Network ← CreateP2PNetwork(phonebookAddrs) 11: else 12: node.Network ← CreateWSNetwork(phonebookAddrs) 13: end if 14: Crypto Resource Pools Initialization 15: node.CryptoPool ← CreateExecutionPool() 16: node.CryptoPool.lowPriority ← CreateBacklogPool() 17: node.CryptoPool.highPriority ← CreateBacklogPool() 18: Ledger Initialization 19: ledgerPaths ← ResolvePaths(rootDir,nodeConfig) 20: node.Ledger ← LoadLedger(ledgerPaths,genesisBlock) 21: Account Management 22: Registry ← ParticipationRegistry() 23: node.AccountManager ← CreateAccountManager(Registry) 24: LoadParticipationKeys(node) 25: Transaction Pool Initialization 26: node.TxPool ← CreateTxPool(node.Ledger) 27: RegisterBlockListeners(node.TxPool) 28: Services Initialization 29: node.BlockService ← CreateBlockService() 30: node.LedgerService ← CreateLedgerService() 31: node.TxPoolService ← CreateTxPoolSyncer() 32: node.AgreementService ← CreateAgreementService() 33: node.CatchupService ← CreateCatchupService() 34: node.StateProofService ← CreateStateProofService() 35: node.HeartbeatService ← CreateHeartbeatService() 36: return node 37: end function


Important

IMPLEMENTATION:

Full Node initialization reference implementation.

The network layer is set up depending on the configuration:

The network layer manages:

For further details on the network layer, refer to Algorand Network non-normative specification.

The node initializes worker pools for handling cryptographic tasks with priority queues:

For further details on the transaction validation, see the Ledger specification.

For further details on the cryptographic primitives and algorithms, see the Crypto specification.

The node loads its local view of the blockchain state from disk (accounts, blocks, protocol data, etc.), based on the specified genesis configuration.

If the Ledger is empty, it initializes the required structures.

It also validates:

For further details on the Ledger entities, see the Ledger specification.

The node prepares for consensus participation and registered account tracking by:

For further details on the Algorand keys, see the Keys specification.

For further details on the key registration transactions, see the Ledger specification.

The node creates the Transaction Pool (TxPool), which:

For further details on the Transaction Pool, see the Ledger non-normative specification.

Finally, the node launches all essential background services: