Multi-Validator Local Network Setup Guide
TL;DR: Use
multivalidator.shfor a local network setup on ZIGChain with three nodes. You get test accounts, genesis settings, and RPC ports on your machine. The steps below cover download, script output, and starting each validator.
Overview
ZIGChain runs on many nodes that agree on blocks. A local network setup on your PC copies that pattern for development work. This guide walks you through a multi-validator local network setup with three signing nodes.
When you build on ZIGChain, one node is often enough at first. Real chains use many nodes to agree on blocks, secure the chain, and run votes. The multivalidator.sh script sets up a local ZIGChain network with three validators for testing and development purposes.
That layout creates a more realistic chain setup than a single-node localnet. You can test votes, multi-node apps, and RPC clients before you move to testnet or mainnet. A local network setup with three nodes is a common next step after your first single-node tests.
This guide focuses on the multivalidator script and the ports it opens on your machine. You do not need public cloud hosts for this flow. Follow the Quick Start Guide to install zigchaind and jq before you run the script.
Key Concepts
- Validator node: A node that signs blocks and joins consensus on the chain in this local network setup.
- Genesis configuration: The initial chain state at start, including denoms and governance parameters used for local development on your machine.
- Test accounts: Pre-configured test accounts with known mnemonics for easy testing; the script funds them so you can send transactions right away.
- RPC endpoint: A ready-to-use HTTP URL for application development; each of the three validators exposes one on a distinct port on localhost.
- multivalidator.sh: The script that automates creation of the three-validator network, genesis, connectivity, and start commands for this local network setup.
These terms map directly to the script output and to the RPC list in the Connecting Applications section. Refer back here if a label in the terminal output is unclear. They are the same labels you will see in the Quick Start steps when the script finishes.
What the Script Does
The script automates the creation of a three-validator ZIGChain network with the following features:
- Three separate validator nodes running on different ports
- Pre-configured test accounts with known mnemonics for easy testing
- Genesis configuration with proper denom settings and governance parameters
- Network connectivity between all three validators
- Ready-to-use RPC endpoints for application development
Multi-Validator Local Network Setup Quick Start
This local network setup begins with one script download and run. You then start three validators in separate terminals using the printed commands. Read the subsections below in order from download through starting the validators.
Follow the Quick Start Guide to install zigchaind and jq if you haven't already.
Download and Execute the Script
Download and run the multivalidator setup script from /tmp/. The curl command pulls the file from the ZIGChain docs repo on GitHub. The chmod and execute steps make the script runnable and start the local network setup.
cd /tmp/
curl -O https://raw.githubusercontent.com/ZIGChain/docs/main/scripts/multivalidator.sh
chmod +x multivalidator.sh
./multivalidator.sh
The script will automatically:
- Set up three validator nodes with different port configurations
- Create and fund test accounts with known mnemonics
- Configure genesis parameters for local development
- Generate connection information and start commands
After Running the Script
Once the script completes successfully, you'll see output with:
- Node IDs and connection information for all three validators
- Validator operator addresses for use in contracts and tests
- Start commands for each validator
- RPC endpoint URLs for connecting your applications
Starting the Validators
The script will display three start commands with the correct node IDs and connection details. Copy and run each command in a separate terminal.
- Terminal 1 - Start the first validator (bootstrap node)
- Terminal 2 - Start the second validator (connects to first)
- Terminal 3 - Start the third validator (connects to first)
Connecting Applications
After all three validators are running, point your app at any RPC URL below. Each URL targets one node in this local network setup. You can use the same URL for queries and for broadcasts during local tests on your machine.
Use any of the three RPC endpoints to connect your applications:
- Node1 RPC:
http://127.0.0.1:26657 - Node2 RPC:
http://127.0.0.1:26667 - Node3 RPC:
http://127.0.0.1:26669
This setup is ideal for testing multi-validator scenarios. It also fits governance proposals. It supports distributed application development on your machine.