Skip to content

Commit

Permalink
Update State-sync docs to support mainnet (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianrubino authored Feb 15, 2024
1 parent dff8725 commit 427abc2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
7 changes: 1 addition & 6 deletions docs/validators/mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
40 changes: 29 additions & 11 deletions docs/validators/state-sync.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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 | `[email protected]:26656` |
| Mainnet | `[email protected]:26656` |

```bash
RPC_STATE_SYNC_SERVERS="[closest StateSync IP]:26657,[closest StateSync IP]:26657"
SEED="[email protected]: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 &&
Expand Down

0 comments on commit 427abc2

Please sign in to comment.