Overview
Observer nodes:- Connect to existing peers to receive blockchain updates
- Synchronize blocks from the network
- Provide read-only access to blockchain data
- Do not submit or verify blocks
- Require minimal resources compared to submission nodes
Prerequisites
- Rust toolchain installed (1.70+)
- Network access to at least one peer node
- SQLite database support
Setup Instructions
The observer node uses in-memory SQLite databases by default, but you can modify the source to use persistent storage.
let chain_db = SqlitePool::connect_lazy("sqlite::memory:").unwrap();
let private_db = SqlitePool::connect_lazy("sqlite::memory:").unwrap();
Environment Variables
| Variable | Description | Default |
|---|---|---|
RUST_LOG | Logging level (trace, debug, info, warn, error) | info |
Peer Configuration
By default, the observer node connects to a peer at127.0.0.1:9090 as defined in nodes/observer/src/main.rs:78:
peer_addr value before building.
P2P Configuration
The observer node uses the default P2P configuration defined incrates/types/src/p2p.rs:102-112:
Initial Data
The observer node initializes with sample electoral data including:- Positions (MCA, Women Rep, MP, Senator, Governor, President)
- Political parties (ODM, PNU)
- Counties (Kiambu, Kisii)
- Constituencies (Juja, Bonchari)
- Wards (Kalimoni, Bomariba)
- Polling stations
- Candidates
nodes/observer/src/main.rs:8-75.
Monitoring
To monitor your observer node:Troubleshooting
Connection Failed
If the node cannot connect to peers:- Verify the peer address is correct and accessible
- Check firewall settings
- Ensure the peer node is running
Database Errors
For persistent storage, ensure:- SQLite is properly installed
- The data directory has write permissions
- Database file paths are absolute or relative to the correct directory
Next Steps
Submission Node
Learn how to run a submission node
Configuration
Explore advanced configuration options