Mining Getting Started
This section highlights mining behavior for the toy blockchain implementation.
Overview
- Blocks are mined via
Blockchain.mine_pending_transactions()insideNodeService.mine_block(). - Mining rewards originate from a coinbase transaction (sender
"0"). - Difficulty is configurable in
qrl/core/blockchain.py(defaultdifficulty=4).
Manual mining via wallet UI
- Launch the wallet (
python run_web_wallet.py). - Log in and click Mine Block (requires a wallet).
- Pending transactions from the mempool are included, then rewards are credited to your address.
Programmatic mining
from qrl.services.node_service import NodeService
node = NodeService()
node.create_wallet()
node.mine_block()
For experiments, reduce difficulty or add fake transactions to observe reward halving logic.