How metalblockchain/metalgo works
MetalGo is Metal’s blockchain node implementation, forked from AvalancheGo. A user starts the node with a selected network configuration; the application constructs the node, which manages chains and their virtual machines while consensus and peer networking process blockchain activity. Chain execution includes transaction verification, state updates, and persistent storage; APIs expose node information and administration. The graph includes documented and indexed major subsystems, but sampled excerpts do not establish every runtime connection, so uncertain relationships are omitted. The README describes network selection but not detailed runtime wiring.
Main entry points: service.go Platform VM · manager.go Chain manager · vm.go AVM · engine.go Chain consensus
Components 20
Node Runtime
- Executable entry
main/main.go - Application bootstrap
app/app.go - Node services
node/node.go
Networking and Consensus
- DAG engine
snow/engine/avalanche/engine.go - Chain consensus
snow/engine/snowman/engine.go - Validator manager
snow/validators/manager.go - Peer networking
network/p2p/network.go
Chains and Virtual Machines
- Chain manager
chains/manager.go - AVM
vms/avm/vm.go - AVM block executor
vms/avm/block/executor/manager.go - Platform VM
vms/platformvm/service.go - Platform block executor
vms/platformvm/block/executor/manager.go - Platform validators
vms/platformvm/validators/manager.go
State and Storage
- State sync
x/sync/manager.go - Block database
x/blockdb/database.go - Simplex persistence
simplex/storage.go
Node Interfaces
- Info API
api/info/service.go - API server
api/server/server.go
Other components
- Node operator
- API client
Connections 15
- Node operator → Executable entry: starts
README.md - Executable entry → Application bootstrap: calls
main/main.go - Application bootstrap → Node services: constructs
app/app.go - Chain manager → DAG engine: initializes
chains/manager.go - Chain manager → AVM: initializes
chains/manager.go - Chain manager → Platform VM: initializes
- Chain consensus → AVM: parses blocks
- Chain consensus → Platform VM: parses blocks
- AVM block executor → AVM: applies transactions
vms/avm/block/executor/manager.go - Platform block executor → Platform VM: executes blocks
vms/platformvm/block/executor/manager.go - Platform validators → Platform VM: reads state
vms/platformvm/validators/manager.go - State sync → Block database: updates database
- Simplex persistence → Block database: stores finalizations
- API client → API server: requests
- API server → Info API: routes requests