How elshadhu/blockchain-go works
This is a command-line Bitcoin-style blockchain: users create wallets and a genesis chain, send signed UTXO payments, and inspect balances or blocks. Nodes relay transactions, mine blocks, synchronize chains, and rebuild cached UTXO state. The graph distinguishes wallet/address handling, transaction validation, block mining, persistence, and peer networking. Edges cite shown calls or README-described behavior; several CLI command implementations and iterator details were not excerpted, so their internal links are omitted.
Main entry points: blockchain.go Blockchain · transaction.go Transactions · server.go TCP node server · utxo_set.go UTXO cache
Components 18
CLI workflows
- Command router
cli.go - CLI commands
Wallets and payments
- Wallet collection
wallets.go - Keys and addresses
wallet.go - Base58 encoding
base58.go - Transactions
transaction.go - Transaction inputs
transaction_input.go - Transaction outputs
transaction_output.go
Chain and mining
- Blockchain
blockchain.go - Blocks and Merkle roots
block.go - Proof of work
proofofwork.go - Chain iterator
blockchain_iterator.go - Merkle tree
merkle_tree.go
Persistence and UTXOs
- UTXO cache
utxo_set.go - BoltDB
Peer networking
- TCP node server
server.go - Peer nodes
Other components
- Operator
Connections 27
- Operator → Command router: runs commands
README.md - Command router → CLI commands: dispatches to
cli.go - CLI commands → Wallet collection: manages wallets
README.md - Wallet collection → Keys and addresses: creates and loads
wallets.go - Keys and addresses → Base58 encoding: encodes address
wallet.go - CLI commands → Transactions: builds payments
README.md - Transactions → UTXO cache: selects spendable outputs
transaction.go - Transactions → Blockchain: signs inputs via
transaction.go - Transactions → Transaction inputs: uses inputs
transaction.go - Transactions → Transaction outputs: creates outputs
transaction.go - Transaction outputs → Base58 encoding: decodes address
transaction_output.go - Blockchain → BoltDB: stores blocks
blockchain.go - Blockchain → Chain iterator: iterates chain
blockchain.go - Blockchain → Transactions: verifies transactions
blockchain.go - Blockchain → Blocks and Merkle roots: mines and appends
blockchain.go - Blocks and Merkle roots → Proof of work: runs proof of work
block.go - Blocks and Merkle roots → Merkle tree: builds transaction root
block.go - UTXO cache → BoltDB: reads and writes cache
utxo_set.go - UTXO cache → Blockchain: rebuilds from chain
utxo_set.go - CLI commands → Blockchain: creates and inspects chain
README.md - CLI commands → UTXO cache: queries or reindexes
README.md - CLI commands → TCP node server: starts node
README.md - TCP node server → Blockchain: loads and updates chain
server.go - TCP node server → UTXO cache: reindexes after blocks
server.go - TCP node server → Transactions: relays and verifies
server.go - TCP node server → Peer nodes: exchanges TCP messages
server.go - Peer nodes → TCP node server: sends node messages
README.md