var img = document.createElement('img'); img.src = "https://terradocs.matomo.cloud//piwik.php?idsite=1&rec=1&url=https://docs.terra.money" + location.pathname; img.style = "border:0"; img.alt = "tracker"; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(img,s);
Skip to main content

Validator migration guide

Follow this guide to become a validator on the new Terra chain. This guide walks you through making a gentx file that will be added to the validator chain. A gentx is a special transaction included in the genesis file that accomplishes three things:

  1. Registers your validator account as a validator operator account.
  2. Self-delegates the specified amount of LUNA tokens for staking.
  3. Links the validator operator account with a Tendermint node pubkey used to sign blocks.

All validators that want to be included in the new Terra chain must follow the steps below.

Networks

  • New Terra testnet: pisco-1
  • New Terra mainnet: phoenix-1

Prerequisites

Supplemental Resources

Timeline (Expected)

  • Fri May 27 2022 18:00:00 GMT+0900 (KST)

  • Thu May 27 2022 09:00:00 GMT+0000 (UTC)

    Share preultimate-genesis.json and start to collect gen_txs from the validators.

  • Sat May 28 2022 12:00:00 GMT+0900 (KST)

  • Sat May 28 2022 03:00:00 GMT+0000 (UTC)

    Finish collecting gen_txs and build & share genesis.json.

  • Sat May 28 2022 15:00:00 GMT+0900 (KST)

  • Sat May 28 2022 06:00:00 GMT+0000 (UTC)

    Launch network.

Snapshot

This section covers how to take the pre- and post-attack snapshots. The following steps need to be run on your existing validator's machine.

  1. Stop your columbus-5 node:
sudo systemctl stop terrad
Copy
  1. Clone, checkout, and install the Terra Core Genesis state exporter:
git clone https://github.com/terra-money/core-genesis-exporter
cd core-genesis-exporter
make install
Copy
  1. Verify the exporter binary version:
terrad version --long
Copy

The above command should result in the following:

terrad version --long
name: terra
server_name: terrad
version: ""
commit: 2565577ccf47d1b11a82d77500a0cb880080a70c
build_tags: netgo,ledger
go: go version go1.20 darwin/arm64
Copy
  1. Take the pre-attack snapshot:
terrad export --height 7544910 > pre-attack-snapshot.json
Copy
  1. Take the post-attack snapshot:
terrad export --height 7790000 > post-attack-snapshot.json
Copy
  1. Verify the SHA256 hash of the sorted pre-attack & post-attack export snapshots:
# pre-attack
jq -S -c -M '' pre-attack-snapshot.json | shasum -a 256
0ac0d5b8f7ea49e500d9033687a6720a99818e99280aba8f12f00b39832a0d5c

# post-attack
jq -S -c -M '' post-attack-snapshot.json | shasum -a 256
9d294b300eb3d936d9567eb128bc66651d196b07c37583e2e051b3bced965766
Copy

Penultimate Genesis

The following steps need to be run on the same machine as your snapshot.

  1. Clone and checkout genesis builder:
git clone https://github.com/terra-money/genesis-tools
Copy
  1. Move pre-attack and post-attack snapshots into genesis-tools:
mv ./pre-attack-snapshot.json ./post-attack-snapshot.json ./genesis-tools
Copy
  1. Run genesis builder script:

# install dependency
pip3 install bech32
pip3 install python-dateutil

python3 ./src/genesis_builder.py \
./genesis-template.json \
./pre-attack-snapshot.json \
./post-attack-snapshot.json \
./genesis-validators.json \
--genesis-time=2022-05-28T06:00:00.000000Z \
--chain-id=phoenix-1 \
> penultimate-genesis.json
Copy
  1. Verify the SHA256 of the sorted penultimate-genesis.json:
jq -S -c -M '' penultimate-genesis.json | shasum -a 256
def346f3ef21e5f484c4e8634918d527382115b871786bd794fac5dacdf46c63
Copy

Set up a new validator

Set up a new validator on a new machine by following the steps outlined in the full node tutorial.

After configuring your general settings, continue to the next section.

GenTx

Complete the following steps on your new validator's machine.

  1. Checkout and install the new Terra core:
# checkout and install
git clone https://github.com/terra-money/core
cd core
git checkout v2.0.0
make install
Copy
  1. Verify the binary version:
terrad version --long
core: v2.0.0
git commit: [placeholder]
go.sum hash: [placeholder]
build tags: netgo ledger
Copy
  1. Prepare your environment:
# install or move penultimate-genesis.json to server
wget https://phoenix-genesis.s3.us-west-1.amazonaws.com/penultimate-genesis.json

# move genesis to config location
mv ./penultimate-genesis.json ~/.terra/config/genesis.json
Copy
  1. Execute GenTx:
terrad gentx validator 1000000uluna \
--chain-id="phoenix-1" \
--pubkey=$(terrad tendermint show-validator) \
--min-self-delegation="1"\
--security-contact="contact@aaa.services" \
--moniker=AAA \
--details="Trusted security provider for Terra Network and projects building on Terra." \
--identity="AAAAAAAAAAAA" \
--commission-rate="0.1" \
--commission-max-rate="0.2" \
--commission-max-change-rate="0.01" \
--node-id="validator-moniker" \
--ip="0.0.0.0"
Copy
  1. Upload the generated GenTx file to this repository's gentx folder via PR:
ls ~/.terra/config/gentx/*
Copy

Collect GenTxs

The following steps need to be run on the same machine as your GenTx.

  1. Download gentx files and change into the terra home config:
git clone https://github.com/terra-money/genesis-tools
cd genesis-tools
mv ./gentx/* ~/.terra/config/gentx/
Copy
  1. Execute collect-gentxs:
terrad collect-gentxs
Copy
  1. Verify the SHA256 hash of the sorted final genesis:
jq -S -c -M '' ~/.terra/config/genesis.json | shasum -a 256
[placeholder]
Copy

Launch Network

Execute the Terrad binary on your new validator's machine and wait until network launch:

sudo systemctl start terrad
Copy