How uomi-network/uomi-node works
Project Type and Purpose
• A Substrate-based blockchain node (“uomi”), designed to host on-chain AI economic agents, integrate IPFS storage, threshold-cryptography services, and custom EVM precompiles.
Main Components
• Node Binary (node/… → bin/main.rs, service.rs): the Substrate Service builder, networking, consensus, RPC.
• Runtime (runtime/uomi, runtime/finney, runtime/local): the WASM runtime with:
– Chain Extensions (chain_extensions.rs)
– Precompiles (precompiles.rs)
– Voter Bags, Pallet Weights
• Pallets (pallets/…): on-chain modules—unified-accounts, tss, ipfs, uomi-engine, base-fee, etc.
• Precompiles (precompiles/…): EVM precompiled contracts for assets, IPFS, sr25519, unified-accounts, uomi-engine.
• Chain-Extensions (chain-extensions/…): custom FRAME pallet extensions (assets, unified-accounts) and types.
• Primitives (primitives/…): shared types (governance, EVM, precompiles).
• Client Libraries (client/…):
– IPFS Manager: download/manage IPFS binaries
– Offchain API: HTTP & timestamping for offchain workers
– TSS: distributed keygen/signing, test framework
• External Services:
– IPFS network
– JSON-RPC clients (curl, frontends)
– libp2p peer network
Relationships & Data Flows
• Node Binary ←→ Peer Network (libp2p): block/transaction gossip
• Node Binary ←→ JSON-RPC & WS Clients: RPC endpoints (rpc.rs)
• Node Binary → Runtime (WASM): execute blocks
• Runtime → Storage DB (RocksDB): state persistence
• Runtime → Pallets: call pallet logic (unified-accounts, uomi-engine, etc.)
• Runtime → Precompiles: EVM CALLs to precompiled modules
• Pallets → Chain-Extensions: invoke offchain chain-extension calls
• Offchain Workers (in pallets/uomi-engine, collective-proxy, etc.) → Client Libraries: IPFS Manager, TSS
• Client Libraries → External IPFS or TSS network peers
Architectural Patterns & Principles
• Modularity via Rust workspace and Substrate FRAME
• Separation of concerns:
– On-chain logic (runtime, pallets, precompiles)
– Off-chain helpers (offchain workers, client crates)
• Extensibility: chain-extensions & precompiles as plugin layers
• No-std contexts: crates compiled with default-features=false for WASM