Genesis
Download Genesis File
The genesis file defines the initial state of the blockchain. This guide explains how to download and set up the genesis file for Terp Network.
What is the Genesis File?
The genesis file contains:
- Initial chain parameters
- Initial token distribution
- Validator set at chain start
- Chain ID and other network configuration
Download Genesis File
Mainnet (morocco-1)
# Create config directory if it doesn't exist
mkdir -p $HOME/.terpd/config
# Download genesis file
curl -Ls https://raw.githubusercontent.com/terpnetwork/mainnet/main/morocco-1/genesis.json > $HOME/.terpd/config/genesis.json
# Verify the download
ls -la $HOME/.terpd/config/genesis.jsonTestnet (90u-4)
# Create config directory if it doesn't exist
mkdir -p $HOME/.terpd/config
# Download genesis file
curl -Ls https://raw.githubusercontent.com/terpnetwork/test-net/master/90u-4/genesis.json > $HOME/.terpd/config/genesis.json
# Verify the download
ls -la $HOME/.terpd/config/genesis.jsonVerify Genesis File
Always verify the genesis file after downloading:
# Check it's valid JSON
jq '.' $HOME/.terpd/config/genesis.json
# Verify chain ID
jq '.chain_id' $HOME/.terpd/config/genesis.json
# Verify initial height
jq '.initial_height' $HOME/.terpd/config/genesis.jsonGenesis Locations
| Network | Chain ID | Genesis URL |
|---|---|---|
| Mainnet | morocco-1 | https://raw.githubusercontent.com/terpnetwork/mainnet/main/morocco-1/genesis.json |
| Testnet | 90u-4 | https://raw.githubusercontent.com/terpnetwork/test-net/master/90u-4/genesis.json |
Manual Node Initialization
If you're starting from scratch:
# 1. Initialize the node
terpd init <your-moniker> --chain-id <chain-id>
# 2. Download the appropriate genesis file (see above)
# 3. Verify the genesis file matches your chain
terpd validate-genesis $HOME/.terpd/config/genesis.jsonGenesis for Different Use Cases
For Full Nodes
# Download mainnet genesis
curl -Ls https://raw.githubusercontent.com/terpnetwork/mainnet/main/morocco-1/genesis.json > $HOME/.terpd/config/genesis.jsonFor Validators
# Validators should verify the genesis file before starting
# Check the chain ID matches the expected network
jq '.chain_id' $HOME/.terpd/config/genesis.json
# Verify genesis hash matches official sources
sha256sum $HOME/.terpd/config/genesis.jsonFor Testnet Development
# Download testnet genesis
curl -Ls https://raw.githubusercontent.com/terpnetwork/test-net/master/90u-4/genesis.json > $HOME/.terpd/config/genesis.json
# Verify testnet chain ID
jq '.chain_id' $HOME/.terpd/config/genesis.json
# Should output: "90u-4"Troubleshooting
Invalid Genesis JSON
If you get a JSON parsing error:
# Re-download the genesis file
rm $HOME/.terpd/config/genesis.json
curl -Ls https://raw.githubusercontent.com/terpnetwork/mainnet/main/morocco-1/genesis.json > $HOME/.terpd/config/genesis.json
# Verify it's valid JSON
jq '.' $HOME/.terpd/config/genesis.json > /dev/null && echo "Valid JSON"Chain ID Mismatch
If you see "chain ID mismatch" error:
# Make sure you're using the correct genesis for your network
# Check what chain ID your terpd is configured for
grep 'chain-id' $HOME/.terpd/config/client.toml
# If needed, re-initialize with correct chain ID
terpd init <moniker> --chain-id <correct-chain-id>Network Upgrade
When a network upgrade requires a new genesis file:
- Stop your node
- Backup the existing genesis:
cp $HOME/.terpd/config/genesis.json $HOME/.terpd/config/genesis.json.backup - Download the new genesis file
- Restart your node
Next Steps
After setting up the genesis file:
- Configure your node
- Add persistent peers to help your node discover peers
- Start your node
- Set up systemd for production use