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-allThis 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 |
TEST_ACCOUNT | 0xee15… | Pre-funded test account |
Password Configuration
The validator keystore password is stored in config/password.txt. The setup script seeds this file with testtesttest the first time it runs. To use a custom password:
- Edit
config/password.txtbefore runningpnpm setup-all. - If you’ve already created a keystore with the old password, run
pnpm cleanandpnpm setup-allto regenerate the validator with your new password (or manually re-encrypt the key).
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_ACCOUNTin.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:genesisThis 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