From 427abc2fa91bed92b451b99395e815208a1e1e95 Mon Sep 17 00:00:00 2001 From: Julian Rubino Date: Thu, 15 Feb 2024 11:41:01 -0300 Subject: [PATCH] Update State-sync docs to support mainnet (#259) --- docs/validators/mainnet.md | 7 +----- docs/validators/state-sync.mdx | 40 ++++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/docs/validators/mainnet.md b/docs/validators/mainnet.md index b2d1b28b..89f45baa 100644 --- a/docs/validators/mainnet.md +++ b/docs/validators/mainnet.md @@ -46,9 +46,4 @@ wget -O ./latest-snapshot.tar "$(curl -s "https://www.googleapis.com/storage/v1/ ### StateSync: -Follow [these instructions](/validators/state-sync/) but use the IP information -below: - -```bash -STATE_SYNC_SERVER=”34.69.20.168:26657” -``` +Follow [these instructions](/validators/state-sync/) using the Mainnet information detailed in that documentation. \ No newline at end of file diff --git a/docs/validators/state-sync.mdx b/docs/validators/state-sync.mdx index 4b969c5f..ab219d61 100644 --- a/docs/validators/state-sync.mdx +++ b/docs/validators/state-sync.mdx @@ -21,9 +21,9 @@ This guide was created and tested in MacOS and may need to be modified slightly ### Mainnet -| Region | IP | -| :-------------------------- | :-- | -| | TBD | +| Region | IP | +| :-------------------------- | :----------- | +| US | 34.69.20.168 | ## Download binary Make sure you are downloading the same version as our network is using. @@ -40,19 +40,31 @@ chmod a+x /usr/local/bin/zetacored 1. Initialize the base folder and config with the following command: +| Chain | ID | +| :------------- | :--------------- | +| Testnet | athens_7001-1 | +| Mainnet | zetachain_7000-1 | + ```bash MONIKER=$(hostname) -zetacored init ${MONIKER} --chain-id athens_7001-1 +CHAIN_ID="[Replace with desired CHAIN ID]" +zetacored init ${MONIKER} --chain-id $CHAIN_ID ``` ## Download config files 1. Download the genesis.json file and *.toml configuration files: +| Environment | Configuration Files Repository | +| :------------------- | :-------------------------------------------------------------- | +| Testnet | https://raw.githubusercontent.com/zeta-chain/network-athens3 | +| Mainnet | https://raw.githubusercontent.com/zeta-chain/network-mainnet | + ```bash -wget https://raw.githubusercontent.com/zeta-chain/network-athens3/main/network_files/config/genesis.json -O ~/.zetacored/config/genesis.json -wget https://raw.githubusercontent.com/zeta-chain/network-athens3/main/network_files/config/config.toml -O ~/.zetacored/config/config.toml -wget https://raw.githubusercontent.com/zeta-chain/network-athens3/main/network_files/config/app.toml -O ~/.zetacored/config/app.toml -wget https://raw.githubusercontent.com/zeta-chain/network-athens3/main/network_files/config/client.toml -O ~/.zetacored/config/client.toml +REPOSITORY_URL="[Config File Repository]" +wget ${REPOSITORY_URL}/main/network_files/config/genesis.json -O ~/.zetacored/config/genesis.json +wget ${REPOSITORY_URL}/main/network_files/config/config.toml -O ~/.zetacored/config/config.toml +wget ${REPOSITORY_URL}/main/network_files/config/app.toml -O ~/.zetacored/config/app.toml +wget ${REPOSITORY_URL}/main/network_files/config/client.toml -O ~/.zetacored/config/client.toml ``` ## State sync @@ -67,11 +79,17 @@ TRUST_HASH=$(curl -s "http://${STATE_SYNC_SERVER}/block?height=${HEIGHT}" | jq - NOTE: You need to sync from LATEST_HEIGHT - 40000 to make sure that the node will fetch an existing state-sync snapshot. ## Replace config values -1. Make sure to replace `[closest StateSync IP]` with the IP from our state-sync node and run this block of code: +1. Make sure to replace `[closest StateSync IP]` with the IP from our state-sync node, also replace with the desired seed node and run this block of code: + +| Environment | Seed Node | +| :------------------- | :-------------------------------------------------------------- | +| Testnet | `5aaa51a3b9465a32f7f6c9df1d46d4bfcc16aecb@34.30.34.119:26656` | +| Mainnet | `8d93468c6022fb3b263963bdea46b0a131d247cd@34.28.196.79:26656` | + ```bash RPC_STATE_SYNC_SERVERS="[closest StateSync IP]:26657,[closest StateSync IP]:26657" -SEED="5aaa51a3b9465a32f7f6c9df1d46d4bfcc16aecb@34.30.34.119:26656" -EXTERNAL_IP=$(curl -4 icanhazip.com) +SEED="[Seed Node from list]" +EXTERNAL_IP="$(curl -4 icanhazip.com):26656" sed -i "" -e "s/^enable = .*/enable = \"true\"/" ~/.zetacored/config/config.toml && sed -i "" -e "s/^rpc_servers = .*/rpc_servers = \"${RPC_STATE_SYNC_SERVERS}\"/" ~/.zetacored/config/config.toml && sed -i "" -e "s/^trust_height = .*/trust_height = \"${HEIGHT}\"/" ~/.zetacored/config/config.toml &&