logo
Expand description

start subcommand - entry point for starting a zebra node

Application Structure

A zebra node consists of the following services and tasks:

Peers:

  • Peer Connection Pool Service
    • primary external interface for outbound requests from this node to remote peers
    • accepts requests from services and tasks in this node, and sends them to remote peers
  • Peer Discovery Service
    • maintains a list of peer addresses, and connection priority metadata
    • discovers new peer addresses from existing peer connections
    • initiates new outbound peer connections in response to demand from tasks within this node

Blocks & Mempool Transactions:

  • Consensus Service
    • handles all validation logic for the node
    • verifies blocks using zebra-chain, then stores verified blocks in zebra-state
    • verifies mempool and block transactions using zebra-chain and zebra-script, and returns verified mempool transactions for mempool storage
  • Groth16 Parameters Download Task
    • downloads the Sprout and Sapling Groth16 circuit parameter files
    • finishes when the download is complete and the download file hashes have been checked
  • Inbound Service
    • primary external interface for inbound peer requests to this node
    • handles requests from peers for network data, chain data, and mempool transactions
    • spawns download and verify tasks for each gossiped block
    • sends gossiped transactions to the mempool service

Blocks:

  • Sync Task
    • runs in the background and continuously queries the network for new blocks to be verified and added to the local state
    • spawns download and verify tasks for each crawled block
  • State Service
    • contextually verifies blocks
    • handles in-memory storage of multiple non-finalized chains
    • handles permanent storage of the best finalized chain
  • Block Gossip Task
    • runs in the background and continuously queries the state for newly committed blocks to be gossiped to peers
  • Progress Task
    • logs progress towards the chain tip

Mempool Transactions:

  • Mempool Service
    • activates when the syncer is near the chain tip
    • spawns download and verify tasks for each crawled or gossiped transaction
    • handles in-memory storage of unmined transactions
  • Queue Checker Task
    • runs in the background, polling the mempool to store newly verified transactions
  • Transaction Gossip Task
    • runs in the background and gossips newly added mempool transactions to peers

Remote Procedure Calls:

  • JSON-RPC Service
    • answers RPC client requests using the State Service and Mempool Service
    • submits client transactions to the node’s mempool

Structs

start subcommand

Constants