Skip to content

Instantly share code, notes, and snippets.

@giansalex
Last active November 29, 2021 17:53
Show Gist options
  • Save giansalex/8bbc27b9203c61002930e05f0953ab6a to your computer and use it in GitHub Desktop.
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

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