A development network setup for running Nimiq validators locally for testing and development purposes.
Before running the devnet, make sure you have the following installed:
-
tmux: Terminal multiplexer for managing multiple validator sessions
- macOS:
brew install tmux - Ubuntu/Debian:
sudo apt-get install tmux - CentOS/RHEL:
sudo yum install tmux
- macOS:
-
Nimiq Client: The setup script will automatically download the required Nimiq client binary (v1.2.1)
This devnet runs validators with the following configuration:
| Validator | Port | RPC Port | Database Path |
|---|---|---|---|
| Client 1 | 8443 | 8648 | ./tmp/.nimiq1 |
| Client 2 | 8445 | 8649 | ./tmp/.nimiq2 |
| Client 3 | 8446 | 8650 | ./tmp/.nimiq3 |
| Client 4 | 8447 | 8651 | ./tmp/.nimiq4 |
You can run the devnet in two ways:
This method automatically starts all validators in a single tmux session:
# clear old data
./clean.sh./setup.shThis will:
- Create a tmux session named
nimiq-validators - Start each validator in separate tmux windows
- Automatically connect clients
To attach to the tmux session and see the validators running:
tmux attach-session -t nimiq-validatorsNavigate between validators using (the tmux prefix Ctrl+b could be different if you have customized it):
Ctrl+b+0- Validator 1Ctrl+b+1- Validator 2Ctrl+b+2- Validator 3Ctrl+b+3- Validator 4
To detach from the session (leave it running in background):
Ctrl+b+d
To stop all validators and exit:
tmux kill-session -t nimiq-validatorsRun each validator manually in separate terminal windows/tabs:
./run-validator.sh 1./run-validator.sh 2./run-validator.sh 3./run-validator.sh 4# Get current block height
curl -X POST http://127.0.0.1:8648 \
-H "Content-Type: application/json" \
-d '{"method":"getBlockNumber","params":[],"id":1,"jsonrpc":"2.0"}'
# Get peer count
curl -X POST http://127.0.0.1:8648 \
-H "Content-Type: application/json" \
-d '{"method":"getPeerCount","params":[],"id":1,"jsonrpc":"2.0"}'- Port already in use: Make sure no other processes are using ports 8443-8447 and 8648-8651
- Permission errors: Ensure the scripts have execute permissions:
chmod +x setup.sh run-validator.sh
- tmux not found: Install tmux using your system's package manager
- Validators not connecting: Make sure validator 1 is running before starting others
- Logs are configured to
debuglevel in all validator configurations - Database files are stored in
./tmp/.nimiqN/directories - Each validator maintains its own database and key files
- tmux method:
tmux kill-session -t nimiq-validators - Manual method: Use
Ctrl+Cin each terminal window
This devnet is configured for development and testing. All validators use:
- Development network mode (
dev-albatross) - Debug logging level
- Local loopback addresses
- Minimal peer connections for faster block times
The network starts from block 21600 with a predefined genesis state for consistent testing.