Skip to content

Instantly share code, notes, and snippets.

@giansalex
Last active November 29, 2021 17:53
Show Gist options
  • Select an option

  • Save giansalex/8bbc27b9203c61002930e05f0953ab6a to your computer and use it in GitHub Desktop.

Select an option

Save giansalex/8bbc27b9203c61002930e05f0953ab6a to your computer and use it in GitHub Desktop.
Join to Juno UNI Testnet [state-sync]

Juno Cosmwasm state-sync

Build binary

git clone https://github.com/disperze/Juno
cd Juno
git checkout v2.0.0-beta-sync.3
make build && make install

Configure node

You can follow Uni testnet guide

junod init <moniker-name> --chain-id=uni

Download genesis:

curl -s  https://raw.githubusercontent.com/CosmosContracts/testnets/main/uni/genesis.json > ~/.juno/config/genesis.json

Add persistent_peers to ~/.juno/config/config.toml

persistent_peers = "21fd1098c6f75ad35b1d43d8382984c35ff0cd5b@143.244.189.189:26656,b2ef97b03c049c39a975b7845abe40fb3e48ee36@216.238.71.243:26656,34e9b3698c0a0fc7e5a8c16dc63b4d913c496c2d@206.189.151.85:26656,7ff7fd0119b104f659810ece82e9cefe2819bb33@128.199.97.8:26656,a1d3e3e6615f8eded91b012c69edb6b1bb0f5e42@161.97.187.234:26656,cdfdd1735bad77c49290e9485b8eb49fbd61ca4d@178.128.36.63:26656,4a91597dfe3ec715bbf6def225066fbb6ad86cfe@207.180.204.112:36656,15bbe91a29693284c4c13138550ea0b6a34f9c42@137.184.11.214:26656,b5377aa9885c69e154820d19be6c87c3d3c34d14@65.108.85.61:26656"

State sync

Enable and configure state-sync

LATEST_HEIGHT=$(curl -s http://143.244.189.189:26657/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 100)); \
TRUST_HASH=$(curl -s "http://143.244.189.189:26657/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"http://143.244.189.189:26657,http://143.244.189.189:26657\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" ~/.juno/config/config.toml

Run

junod start

State sync may take a few minutes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment