Local Blockchain
Version: 0.2.0
Overview
The Local Blockchain workspace provides a complete Ethereum Proof of Authority (PoA) blockchain environment for local development. This includes:
- Geth Archive Node: A single validator PoA Ethereum node (v1.12.2)
- Blockscout Explorer: Full-featured blockchain explorer for inspecting transactions, blocks, and contracts
- Automated Setup: Scripts to initialize, manage, and clean your local blockchain
This workspace is designed for testing smart contracts and dApps in a controlled environment with fast block times and predictable behavior.
Note: If you see references to “ritonet” in the codebase, that’s just a branded / internal name for this local blockchain setup.
Prerequisites
- Docker and Docker Compose installed
- Node.js and pnpm
- Available ports: 8545 (RPC), 8546 (WebSocket), 4000 (Blockscout)
Installation and Setup
-
Install dependencies:
bash pnpm install
-
Run the setup script:
pnpm setup-all
This will:
- Create necessary directories
- Generate a validator keystore (if not exists)
- Create genesis.json with your validator
- Initialize the genesis block
- Clone Blockscout (if needed)
-
Start the network:
pnpm start
Configuration
The network is configured via .env
file with these key settings:
Variable | Default | Description |
---|---|---|
LOCAL_CHAIN_ID | 90999999 | Chain ID for your network |
BLOCK_TIME | 27 | Seconds between blocks |
RPC_PORT | 8545 | HTTP-RPC port |
RPC_WS_PORT | 8546 | WebSocket port |
BLOCKSCOUT_PORT | 4000 | Explorer web interface |
KEYSTORE_PASSWORD | testtesttest | Validator key password |
TEST_ACCOUNT | 0xee15… | Pre-funded test account |
Password Configuration
The default password is testtesttest
. To use a custom password:
- Update
KEYSTORE_PASSWORD
in.env
before running setup. - Or manually edit
config/password.txt
before running setup.
Pre-funded Accounts
By default, two accounts receive ETH in the genesis block:
- Validator Address: Auto-generated during setup, receives 10,000 ETH
- Test Account: Configure via
TEST_ACCOUNT
in.env
, receives 10,000 ETH
You can add your own address to .env
as TEST_ACCOUNT
before running setup.
Geth Version
We use Geth v1.12.2 specifically. While newer versions exist, Proof of Authority is deprecated and v1.12.2 provides excellent stability and all features needed for local development.
Manual Genesis Generation
If you need to generate the genesis block without redoing the complete setup:
pnpm run generate:genesis
This reads your .env
configuration and creates a new config/genesis.json
.
Docker Container Conflicts
If you have existing containers with the same names, clean them up:
docker-compose down -v
# or
pnpm run clean