From 9f5afdc5a7100cfa4432e886f9d0a5432a6c2c3e Mon Sep 17 00:00:00 2001 From: faddat Date: Mon, 23 Aug 2021 23:46:42 +0000 Subject: [PATCH 01/20] Workflow testing for state sync --- .github/workflows/statesync.yml | 31 +++++++++++++++ scripts/statesync.sh | 69 +++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 .github/workflows/statesync.yml create mode 100644 scripts/statesync.sh diff --git a/.github/workflows/statesync.yml b/.github/workflows/statesync.yml new file mode 100644 index 00000000000..22f2576dd64 --- /dev/null +++ b/.github/workflows/statesync.yml @@ -0,0 +1,31 @@ +# This is a basic workflow that is manually triggered + +name: compile osmosis + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: [push, pull_request, workflow_dispatch] + +# This workflow makes x86_64 binaries for mac, windows, and linux. + +jobs: + build: + runs-on: ubuntu-latest + name: osmosis state sync + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2.1.3 + with: + go-version: '^1.17' + + - name: Compile osmosis + run: ./... + + - name: init + run: | + osmosisd init test + wget -O ~/.osmosisd/config/genesis.json https://cloudflare-ipfs.com/ipfs/QmXRvBT3hgoXwwPqbK6a2sXUuArGM8wPyo1ybskyyUwUxs + + + - name: state sync + run: bash scripts/statesync.sh \ No newline at end of file diff --git a/scripts/statesync.sh b/scripts/statesync.sh new file mode 100644 index 00000000000..2bc3b71c28d --- /dev/null +++ b/scripts/statesync.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# Based on the work of Joe (Chorus-One) for Microtick - https://github.com/microtick/bounties/tree/main/statesync +# Further based on the work of Bitcanna. +# For now this is a test script that ensures that state sync is working. +# You need config in two peers (avoid seed servers) this values in app.toml: +# [state-sync] +# snapshot-interval = 1000 +# snapshot-keep-recent = 10 +# Pruning should be fine tuned also, for this testings is set to nothing +# pruning = "nothing" + +set -e + +# Change for your custom chain + + + + NODE1_IP="144.76.183.180" + RPC1="http://$NODE1_IP" + P2P_PORT1=2000 + RPC_PORT1=2001 + + NODE2_IP="http://5.9.106.185" + RPC2="http://$NODE2_IP" + RPC_PORT2=2000 + P2P_PORT2=2001 + + #If you want to use a third StateSync Server... + #DOMAIN_3=seed1.bitcanna.io # If you want to use domain names + #NODE3_IP=$(dig $DOMAIN_1 +short + #RPC3="http://$NODE3_IP" + #RPC_PORT3=26657 + #P2P_PORT3=26656 + + INTERVAL=1000 + + LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); + BLOCK_HEIGHT=$((($(($LATEST_HEIGHT / $INTERVAL)) -10) * $INTERVAL)); #Mark addition + + if [ $BLOCK_HEIGHT -eq 0 ]; then + echo "Error: Cannot state sync to block 0; Latest block is $LATEST_HEIGHT and must be at least $INTERVAL; wait a few blocks!" + exit 1 + fi + + TRUST_HASH=$(curl -s "$RPC1:$RPC_PORT1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) + if [ "$TRUST_HASH" == "null" ]; then + echo "Error: Cannot find block hash. This shouldn't happen :/" + exit 1 + fi + + NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) + NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) + #NODE3_ID=$(curl -s "$RPC3:$RPC_PORT3/status" | jq -r .result.node_info.id) + + + sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ + s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"http://$NODE1_IP:$RPC_PORT1,http://$NODE2_IP:$RPC_PORT2\"| ; \ + s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ + s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ + s|^(persistent_peers[[:space:]]+=[[:space:]]+).*$|\1\"${NODE1_ID}@${NODE1_IP}:${P2P_PORT1},${NODE2_ID}@${NODE2_IP}:${P2P_PORT2}\"| ; \ + s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656,23671067d0fd40aec523290585c7d8e91034a771@seed2.bitcanna.io:16656\"|" $HOME/.bcna/config/config.toml + + + sed -E -i 's/minimum-gas-prices = \".*\"/minimum-gas-prices = \"0.01bcna\"/' $HOME/.bcna/config/app.toml + + ./bcnad unsafe-reset-all + ./bcnad start + echo If your node is synced considerate to create a service file. +fi \ No newline at end of file From f31735e74ba77c974e14cab308e3dcd5301bed54 Mon Sep 17 00:00:00 2001 From: faddat Date: Tue, 24 Aug 2021 08:03:51 +0000 Subject: [PATCH 02/20] Added state sync script --- .github/workflows/statesync.yml | 1 - scripts/statesync.sh | 72 ++++++++++++++++++++------------- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/.github/workflows/statesync.yml b/.github/workflows/statesync.yml index 22f2576dd64..2aff732f57c 100644 --- a/.github/workflows/statesync.yml +++ b/.github/workflows/statesync.yml @@ -26,6 +26,5 @@ jobs: osmosisd init test wget -O ~/.osmosisd/config/genesis.json https://cloudflare-ipfs.com/ipfs/QmXRvBT3hgoXwwPqbK6a2sXUuArGM8wPyo1ybskyyUwUxs - - name: state sync run: bash scripts/statesync.sh \ No newline at end of file diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 2bc3b71c28d..a673ab84e4a 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -6,6 +6,7 @@ # [state-sync] # snapshot-interval = 1000 # snapshot-keep-recent = 10 +# Simplifications from: https://binary-star.plus/cosmos-sdk-state-sync-guide/ # Pruning should be fine tuned also, for this testings is set to nothing # pruning = "nothing" @@ -32,38 +33,55 @@ set -e #RPC_PORT3=26657 #P2P_PORT3=26656 - INTERVAL=1000 +INTERVAL=1000 - LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); - BLOCK_HEIGHT=$((($(($LATEST_HEIGHT / $INTERVAL)) -10) * $INTERVAL)); #Mark addition +LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); +BLOCK_HEIGHT=$((($(($LATEST_HEIGHT / $INTERVAL)) -10) * $INTERVAL)); #Mark addition - if [ $BLOCK_HEIGHT -eq 0 ]; then - echo "Error: Cannot state sync to block 0; Latest block is $LATEST_HEIGHT and must be at least $INTERVAL; wait a few blocks!" - exit 1 - fi - - TRUST_HASH=$(curl -s "$RPC1:$RPC_PORT1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) - if [ "$TRUST_HASH" == "null" ]; then - echo "Error: Cannot find block hash. This shouldn't happen :/" - exit 1 - fi - - NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) - NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) +if [ $BLOCK_HEIGHT -eq 0 ]; then + echo "Error: Cannot state sync to block 0; Latest block is $LATEST_HEIGHT and must be at least $INTERVAL; wait a few blocks!" + exit 1 +fi + +TRUST_HASH=$(curl -s "$RPC1:$RPC_PORT1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) +if [ "$TRUST_HASH" == "null" ]; then + echo "Error: Cannot find block hash. This shouldn't happen :/" + exit 1 +fi + + +# Not needed because of embedded seeds +# NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) +# NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) + + #NODE3_ID=$(curl -s "$RPC3:$RPC_PORT3/status" | jq -r .result.node_info.id) +# [statesync] +# enable = true +# rpc_servers = "foo.net:26657,bar.com:26657" +# trust_height = 1964 +# trust_hash = "6FD28DAAAC79B77F589AE692B6CD403412CE27D0D2629E81951607B297696E5B" +# trust_period = "336h" # 2/3 of unbonding time + +export OSMOSISD_STATESYNC_ENABLE=true +export OSMOSISD_STATESYNC_RPC_SERVERS="$RPC1:$RPC_PORT1/status,$RPC2:$RPC_PORT2/status" +export OSMOSISD_STATESYNC_TRUST_HEIGHT=$BLOCK_HEIGHT +export OSMOSISD_STATESYNC_TRUST_HASH=$TRUST_HASH +export OSMOSISD_STATESYNC_TRUST_PERIOD="224h" + + - sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ - s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"http://$NODE1_IP:$RPC_PORT1,http://$NODE2_IP:$RPC_PORT2\"| ; \ - s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ - s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ - s|^(persistent_peers[[:space:]]+=[[:space:]]+).*$|\1\"${NODE1_ID}@${NODE1_IP}:${P2P_PORT1},${NODE2_ID}@${NODE2_IP}:${P2P_PORT2}\"| ; \ - s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656,23671067d0fd40aec523290585c7d8e91034a771@seed2.bitcanna.io:16656\"|" $HOME/.bcna/config/config.toml +# SED MAGIC TO PUT IN CONFIG FILE +# sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ +# s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"http://$NODE1_IP:$RPC_PORT1,http://$NODE2_IP:$RPC_PORT2\"| ; \ +# s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ +# s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ +# s|^(persistent_peers[[:space:]]+=[[:space:]]+).*$|\1\"${NODE1_ID}@${NODE1_IP}:${P2P_PORT1},${NODE2_ID}@${NODE2_IP}:${P2P_PORT2}\"| ; \ +# s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656,23671067d0fd40aec523290585c7d8e91034a771@seed2.bitcanna.io:16656\"|" $HOME/.bcna/config/config.toml - sed -E -i 's/minimum-gas-prices = \".*\"/minimum-gas-prices = \"0.01bcna\"/' $HOME/.bcna/config/app.toml +# sed -E -i 's/minimum-gas-prices = \".*\"/minimum-gas-prices = \"0.01bcna\"/' $HOME/.bcna/config/app.toml - ./bcnad unsafe-reset-all - ./bcnad start - echo If your node is synced considerate to create a service file. -fi \ No newline at end of file +osmosisd unsafe-reset-all +osmosisd start From 52c81fe4b462de531987e8da5e206d92e737faa3 Mon Sep 17 00:00:00 2001 From: faddat Date: Tue, 24 Aug 2021 10:36:59 +0000 Subject: [PATCH 03/20] State sync script (WIP) --- scripts/statesync.sh | 61 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index a673ab84e4a..1bd2f035c93 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -1,6 +1,7 @@ #!/bin/bash # Based on the work of Joe (Chorus-One) for Microtick - https://github.com/microtick/bounties/tree/main/statesync # Further based on the work of Bitcanna. +# Adapted for osmosis by Jacob Gadikian of Notional Validation. # For now this is a test script that ensures that state sync is working. # You need config in two peers (avoid seed servers) this values in app.toml: # [state-sync] @@ -16,27 +17,29 @@ set -e - NODE1_IP="144.76.183.180" - RPC1="http://$NODE1_IP" - P2P_PORT1=2000 - RPC_PORT1=2001 - - NODE2_IP="http://5.9.106.185" - RPC2="http://$NODE2_IP" - RPC_PORT2=2000 - P2P_PORT2=2001 - - #If you want to use a third StateSync Server... - #DOMAIN_3=seed1.bitcanna.io # If you want to use domain names - #NODE3_IP=$(dig $DOMAIN_1 +short - #RPC3="http://$NODE3_IP" - #RPC_PORT3=26657 - #P2P_PORT3=26656 +NODE1_IP="144.76.183.180" +RPC1="http://$NODE1_IP" +P2P_PORT1=2000 +RPC_PORT1=2001 + +NODE2_IP="144.76.183.180" +RPC2="http://$NODE2_IP" +P2P_PORT2=2000 +RPC_PORT2=2001 + +#If you want to use a third StateSync Server... +#DOMAIN_3=seed1.bitcanna.io # If you want to use domain names +#NODE3_IP=$(dig $DOMAIN_1 +short +#RPC3="http://$NODE3_IP" +#RPC_PORT3=26657 +#P2P_PORT3=26656 INTERVAL=1000 -LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); -BLOCK_HEIGHT=$((($(($LATEST_HEIGHT / $INTERVAL)) -10) * $INTERVAL)); #Mark addition +LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height) +BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL)) + +echo "State syncing from $BLOCK_HEIGHT" if [ $BLOCK_HEIGHT -eq 0 ]; then echo "Error: Cannot state sync to block 0; Latest block is $LATEST_HEIGHT and must be at least $INTERVAL; wait a few blocks!" @@ -51,8 +54,15 @@ fi # Not needed because of embedded seeds -# NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) -# NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) + +echo "$RPC1:$RPC_PORT1/status" +echo "$RPC2:$RPC_PORT2/status" +NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) +NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) + +echo "Node 1 id is: $NODE1_ID" +echo "Node 2 id is: $NODE2_ID" +echo "Trust hash is: $TRUST_HASH" #NODE3_ID=$(curl -s "$RPC3:$RPC_PORT3/status" | jq -r .result.node_info.id) @@ -69,19 +79,10 @@ export OSMOSISD_STATESYNC_RPC_SERVERS="$RPC1:$RPC_PORT1/status,$RPC2:$RPC_PORT2/ export OSMOSISD_STATESYNC_TRUST_HEIGHT=$BLOCK_HEIGHT export OSMOSISD_STATESYNC_TRUST_HASH=$TRUST_HASH export OSMOSISD_STATESYNC_TRUST_PERIOD="224h" +export OSMOSISD_P2P_PERSISTENT_PEERS="$NODE1_ID@$NODE1_IP:$P2P_PORT1,$NODE2_ID@$NODE2_IP:$P2P_PORT2" -# SED MAGIC TO PUT IN CONFIG FILE -# sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ -# s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"http://$NODE1_IP:$RPC_PORT1,http://$NODE2_IP:$RPC_PORT2\"| ; \ -# s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ -# s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ -# s|^(persistent_peers[[:space:]]+=[[:space:]]+).*$|\1\"${NODE1_ID}@${NODE1_IP}:${P2P_PORT1},${NODE2_ID}@${NODE2_IP}:${P2P_PORT2}\"| ; \ -# s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656,23671067d0fd40aec523290585c7d8e91034a771@seed2.bitcanna.io:16656\"|" $HOME/.bcna/config/config.toml - - -# sed -E -i 's/minimum-gas-prices = \".*\"/minimum-gas-prices = \"0.01bcna\"/' $HOME/.bcna/config/app.toml osmosisd unsafe-reset-all osmosisd start From 362d257c16f53f9c5370b2a16850050bb0a28191 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Tue, 24 Aug 2021 17:38:40 +0700 Subject: [PATCH 04/20] Update statesync.yml --- .github/workflows/statesync.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/statesync.yml b/.github/workflows/statesync.yml index 2aff732f57c..47233e0ba80 100644 --- a/.github/workflows/statesync.yml +++ b/.github/workflows/statesync.yml @@ -19,7 +19,7 @@ jobs: go-version: '^1.17' - name: Compile osmosis - run: ./... + run: go install ./... - name: init run: | @@ -27,4 +27,4 @@ jobs: wget -O ~/.osmosisd/config/genesis.json https://cloudflare-ipfs.com/ipfs/QmXRvBT3hgoXwwPqbK6a2sXUuArGM8wPyo1ybskyyUwUxs - name: state sync - run: bash scripts/statesync.sh \ No newline at end of file + run: bash scripts/statesync.sh From dd7a73ed661f44a8c9eb2470716fa73a9a8157ce Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Tue, 24 Aug 2021 17:39:46 +0700 Subject: [PATCH 05/20] Update statesync.yml --- .github/workflows/statesync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/statesync.yml b/.github/workflows/statesync.yml index 47233e0ba80..3c2d2878710 100644 --- a/.github/workflows/statesync.yml +++ b/.github/workflows/statesync.yml @@ -1,6 +1,6 @@ # This is a basic workflow that is manually triggered -name: compile osmosis +name: State Sync # Controls when the action will run. Workflow runs when manually triggered using the UI # or API. From bf97971d47cb240de4bc83da89bf2fcbbf7898bd Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Tue, 24 Aug 2021 19:48:44 +0700 Subject: [PATCH 06/20] Update statesync.sh --- scripts/statesync.sh | 130 +++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 67 deletions(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 1bd2f035c93..337f4931077 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -1,88 +1,84 @@ + #!/bin/bash # Based on the work of Joe (Chorus-One) for Microtick - https://github.com/microtick/bounties/tree/main/statesync -# Further based on the work of Bitcanna. -# Adapted for osmosis by Jacob Gadikian of Notional Validation. -# For now this is a test script that ensures that state sync is working. # You need config in two peers (avoid seed servers) this values in app.toml: # [state-sync] # snapshot-interval = 1000 # snapshot-keep-recent = 10 -# Simplifications from: https://binary-star.plus/cosmos-sdk-state-sync-guide/ # Pruning should be fine tuned also, for this testings is set to nothing # pruning = "nothing" set -e # Change for your custom chain - - +BINARY="https://github.com/osmosis-labs/osmosis/releases/download/v3.1.0/osmosisd-3.1.0-linux-amd64" +GENESIS="https://cloudflare-ipfs.com/ipfs/QmXRvBT3hgoXwwPqbK6a2sXUuArGM8wPyo1ybskyyUwUxs" +APP="OSMOSISD: ~/.osmosisd" + +read -p "$APP folder, your keys and config will be erased, proced (y/n)? " -n 1 -r +if [[ $REPLY =~ ^[Yy]$ ]] +then + # BitCanna State Sync client config. + rm -f osmosisd #deletes a previous downloaded binary + rm -rf $HOME/.osmosisd/ #deletes previous installation + wget -nc $BINARY + mv osmosisd-3.1.0-linux-amd64 osmosisd + chmod +x osmosisd + ./osmosisd init test + rm -rf $HOME/.osmosisd/config/genesis.json #deletes the default created genesis + curl -s $GENESIS > $HOME/.osmosisd/config/genesis.json -NODE1_IP="144.76.183.180" -RPC1="http://$NODE1_IP" -P2P_PORT1=2000 -RPC_PORT1=2001 - -NODE2_IP="144.76.183.180" -RPC2="http://$NODE2_IP" -P2P_PORT2=2000 -RPC_PORT2=2001 - -#If you want to use a third StateSync Server... -#DOMAIN_3=seed1.bitcanna.io # If you want to use domain names -#NODE3_IP=$(dig $DOMAIN_1 +short -#RPC3="http://$NODE3_IP" -#RPC_PORT3=26657 -#P2P_PORT3=26656 - -INTERVAL=1000 - -LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height) -BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL)) - -echo "State syncing from $BLOCK_HEIGHT" + NODE1_IP="95.217.196.54" + RPC1="http://$NODE1_IP" + P2P_PORT1=2000 + RPC_PORT1=2001 + + NODE2_IP="144.76.183.180" + RPC2="http://$NODE2_IP" + P2P_PORT2=2000 + RPC_PORT2=2001 + + #If you want to use a third StateSync Server... + #DOMAIN_3=seed1.bitcanna.io # If you want to use domain names + #NODE3_IP=$(dig $DOMAIN_1 +short + #RPC3="http://$NODE3_IP" + #RPC_PORT3=26657 + #P2P_PORT3=26656 + + INTERVAL=1000 + + LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); + BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL)) -if [ $BLOCK_HEIGHT -eq 0 ]; then - echo "Error: Cannot state sync to block 0; Latest block is $LATEST_HEIGHT and must be at least $INTERVAL; wait a few blocks!" - exit 1 -fi - -TRUST_HASH=$(curl -s "$RPC1:$RPC_PORT1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) -if [ "$TRUST_HASH" == "null" ]; then - echo "Error: Cannot find block hash. This shouldn't happen :/" - exit 1 -fi - - -# Not needed because of embedded seeds - -echo "$RPC1:$RPC_PORT1/status" -echo "$RPC2:$RPC_PORT2/status" -NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) -NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) - -echo "Node 1 id is: $NODE1_ID" -echo "Node 2 id is: $NODE2_ID" -echo "Trust hash is: $TRUST_HASH" - - + if [ $BLOCK_HEIGHT -eq 0 ]; then + echo "Error: Cannot state sync to block 0; Latest block is $LATEST_HEIGHT and must be at least $INTERVAL; wait a few blocks!" + exit 1 + fi + + TRUST_HASH=$(curl -s "$RPC1:$RPC_PORT1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) + if [ "$TRUST_HASH" == "null" ]; then + echo "Error: Cannot find block hash. This shouldn't happen :/" + exit 1 + fi + + NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) + NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) #NODE3_ID=$(curl -s "$RPC3:$RPC_PORT3/status" | jq -r .result.node_info.id) -# [statesync] -# enable = true -# rpc_servers = "foo.net:26657,bar.com:26657" -# trust_height = 1964 -# trust_hash = "6FD28DAAAC79B77F589AE692B6CD403412CE27D0D2629E81951607B297696E5B" -# trust_period = "336h" # 2/3 of unbonding time + echo "NODE ONE: $NODE1_ID@$NODE1_IP:$P2P_PORT1" + echo "NODE TWO: $NODE2_ID@$NODE2_IP:$P2P_PORT2" -export OSMOSISD_STATESYNC_ENABLE=true -export OSMOSISD_STATESYNC_RPC_SERVERS="$RPC1:$RPC_PORT1/status,$RPC2:$RPC_PORT2/status" -export OSMOSISD_STATESYNC_TRUST_HEIGHT=$BLOCK_HEIGHT -export OSMOSISD_STATESYNC_TRUST_HASH=$TRUST_HASH -export OSMOSISD_STATESYNC_TRUST_PERIOD="224h" -export OSMOSISD_P2P_PERSISTENT_PEERS="$NODE1_ID@$NODE1_IP:$P2P_PORT1,$NODE2_ID@$NODE2_IP:$P2P_PORT2" + sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ + s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"http://$NODE1_IP:$RPC_PORT1,http://$NODE2_IP:$RPC_PORT2\"| ; \ + s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ + s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ + s|^(persistent_peers[[:space:]]+=[[:space:]]+).*$|\1\"${NODE1_ID}@${NODE1_IP}:${P2P_PORT1},${NODE2_ID}@${NODE2_IP}:${P2P_PORT2}\"|" $HOME/.osmosisd/config/config.toml + -osmosisd unsafe-reset-all -osmosisd start + ./osmosisd unsafe-reset-all + ./osmosisd start + echo If your node is synced considerate to create a service file. +fi From 18b51b26c8ba2e4c089d7e5a272986782e968d3d Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Tue, 24 Aug 2021 19:57:38 +0700 Subject: [PATCH 07/20] Update statesync.yml --- .github/workflows/statesync.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/statesync.yml b/.github/workflows/statesync.yml index 3c2d2878710..3cff5fbd4d0 100644 --- a/.github/workflows/statesync.yml +++ b/.github/workflows/statesync.yml @@ -14,17 +14,6 @@ jobs: name: osmosis state sync steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2.1.3 - with: - go-version: '^1.17' - - - name: Compile osmosis - run: go install ./... - - - name: init - run: | - osmosisd init test - wget -O ~/.osmosisd/config/genesis.json https://cloudflare-ipfs.com/ipfs/QmXRvBT3hgoXwwPqbK6a2sXUuArGM8wPyo1ybskyyUwUxs - name: state sync run: bash scripts/statesync.sh From d4911e39c01df668a46bda65a33c9c3a6921362e Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Tue, 24 Aug 2021 19:59:20 +0700 Subject: [PATCH 08/20] Update statesync.sh --- scripts/statesync.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 337f4931077..341358cdb59 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -15,9 +15,7 @@ BINARY="https://github.com/osmosis-labs/osmosis/releases/download/v3.1.0/osmosis GENESIS="https://cloudflare-ipfs.com/ipfs/QmXRvBT3hgoXwwPqbK6a2sXUuArGM8wPyo1ybskyyUwUxs" APP="OSMOSISD: ~/.osmosisd" -read -p "$APP folder, your keys and config will be erased, proced (y/n)? " -n 1 -r -if [[ $REPLY =~ ^[Yy]$ ]] -then + # BitCanna State Sync client config. rm -f osmosisd #deletes a previous downloaded binary rm -rf $HOME/.osmosisd/ #deletes previous installation @@ -80,5 +78,3 @@ then ./osmosisd unsafe-reset-all ./osmosisd start - echo If your node is synced considerate to create a service file. -fi From 4a2c9943f292de2264809a169e669101b55aec34 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 04:40:36 +0700 Subject: [PATCH 09/20] Update statesync.sh --- scripts/statesync.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 341358cdb59..20a8073c62b 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -16,15 +16,14 @@ GENESIS="https://cloudflare-ipfs.com/ipfs/QmXRvBT3hgoXwwPqbK6a2sXUuArGM8wPyo1ybs APP="OSMOSISD: ~/.osmosisd" - # BitCanna State Sync client config. - rm -f osmosisd #deletes a previous downloaded binary - rm -rf $HOME/.osmosisd/ #deletes previous installation + # Osmosis State Sync client config. + # rm -f osmosisd #deletes a previous downloaded binary + # rm -rf $HOME/.osmosisd/ #deletes previous installation wget -nc $BINARY mv osmosisd-3.1.0-linux-amd64 osmosisd chmod +x osmosisd ./osmosisd init test - rm -rf $HOME/.osmosisd/config/genesis.json #deletes the default created genesis - curl -s $GENESIS > $HOME/.osmosisd/config/genesis.json + wget -O $HOME/.osmosisd/config/genesis.json $GENESIS NODE1_IP="95.217.196.54" RPC1="http://$NODE1_IP" From ea93e7cb11d113f82ca4ff349666cb22e337e13d Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 05:00:52 +0700 Subject: [PATCH 10/20] Update statesync.sh --- scripts/statesync.sh | 67 ++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 20a8073c62b..ac1d7189a6f 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -19,21 +19,21 @@ APP="OSMOSISD: ~/.osmosisd" # Osmosis State Sync client config. # rm -f osmosisd #deletes a previous downloaded binary # rm -rf $HOME/.osmosisd/ #deletes previous installation - wget -nc $BINARY - mv osmosisd-3.1.0-linux-amd64 osmosisd - chmod +x osmosisd - ./osmosisd init test - wget -O $HOME/.osmosisd/config/genesis.json $GENESIS +wget -nc $BINARY +mv osmosisd-3.1.0-linux-amd64 osmosisd +chmod +x osmosisd +./osmosisd init test +wget -O $HOME/.osmosisd/config/genesis.json $GENESIS - NODE1_IP="95.217.196.54" - RPC1="http://$NODE1_IP" - P2P_PORT1=2000 - RPC_PORT1=2001 +NODE1_IP="95.217.196.54" +RPC1="http://$NODE1_IP" +P2P_PORT1=2000 +RPC_PORT1=2001 - NODE2_IP="144.76.183.180" - RPC2="http://$NODE2_IP" - P2P_PORT2=2000 - RPC_PORT2=2001 +NODE2_IP="162.55.132.230" +RPC2="http://$NODE2_IP" +P2P_PORT2=2000 +RPC_PORT2=2001 #If you want to use a third StateSync Server... #DOMAIN_3=seed1.bitcanna.io # If you want to use domain names @@ -42,38 +42,31 @@ APP="OSMOSISD: ~/.osmosisd" #RPC_PORT3=26657 #P2P_PORT3=26656 - INTERVAL=1000 +INTERVAL=1000 - LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); - BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL)) +LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); +BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL)) - if [ $BLOCK_HEIGHT -eq 0 ]; then - echo "Error: Cannot state sync to block 0; Latest block is $LATEST_HEIGHT and must be at least $INTERVAL; wait a few blocks!" - exit 1 - fi - TRUST_HASH=$(curl -s "$RPC1:$RPC_PORT1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) - if [ "$TRUST_HASH" == "null" ]; then - echo "Error: Cannot find block hash. This shouldn't happen :/" - exit 1 - fi - NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) - NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) - #NODE3_ID=$(curl -s "$RPC3:$RPC_PORT3/status" | jq -r .result.node_info.id) +NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) +NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) +#NODE3_ID=$(curl -s "$RPC3:$RPC_PORT3/status" | jq -r .result.node_info.id) - echo "NODE ONE: $NODE1_ID@$NODE1_IP:$P2P_PORT1" - echo "NODE TWO: $NODE2_ID@$NODE2_IP:$P2P_PORT2" +echo "TRUST HEIGHT: $BLOCK_HEIGHT" +echo "TRUST HASH: $TRUST_HASH" +echo "NODE ONE: $NODE1_ID@$NODE1_IP:$P2P_PORT1" +echo "NODE TWO: $NODE2_ID@$NODE2_IP:$P2P_PORT2" - sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ - s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"http://$NODE1_IP:$RPC_PORT1,http://$NODE2_IP:$RPC_PORT2\"| ; \ - s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ - s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ - s|^(persistent_peers[[:space:]]+=[[:space:]]+).*$|\1\"${NODE1_ID}@${NODE1_IP}:${P2P_PORT1},${NODE2_ID}@${NODE2_IP}:${P2P_PORT2}\"|" $HOME/.osmosisd/config/config.toml +sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ +s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"http://$NODE1_IP:$RPC_PORT1,http://$NODE2_IP:$RPC_PORT2\"| ; \ +s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ +s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ +s|^(persistent_peers[[:space:]]+=[[:space:]]+).*$|\1\"${NODE1_ID}@${NODE1_IP}:${P2P_PORT1},${NODE2_ID}@${NODE2_IP}:${P2P_PORT2}\"|" $HOME/.osmosisd/config/config.toml - ./osmosisd unsafe-reset-all - ./osmosisd start +./osmosisd unsafe-reset-all +./osmosisd start From c937dfe0e32e6f2f06d2fbe21a558b093f3af4b4 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 05:05:20 +0700 Subject: [PATCH 11/20] Update statesync.sh --- scripts/statesync.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index ac1d7189a6f..897c7a54583 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -46,6 +46,8 @@ INTERVAL=1000 LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL)) +TRUST_HASH=$(curl -s "$RPC1:$RPC_PORT1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) + From 690624f85a40b3a65749fcce7ad30407c46bdce9 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 06:31:46 +0700 Subject: [PATCH 12/20] Update statesync.sh --- scripts/statesync.sh | 49 +++++++++----------------------------------- 1 file changed, 10 insertions(+), 39 deletions(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 897c7a54583..2c297687879 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -11,46 +11,20 @@ set -e # Change for your custom chain -BINARY="https://github.com/osmosis-labs/osmosis/releases/download/v3.1.0/osmosisd-3.1.0-linux-amd64" -GENESIS="https://cloudflare-ipfs.com/ipfs/QmXRvBT3hgoXwwPqbK6a2sXUuArGM8wPyo1ybskyyUwUxs" -APP="OSMOSISD: ~/.osmosisd" +export GOPATH=~/go +export PATH=$PATH:~/go/bin +go install ./... - - # Osmosis State Sync client config. - # rm -f osmosisd #deletes a previous downloaded binary - # rm -rf $HOME/.osmosisd/ #deletes previous installation -wget -nc $BINARY -mv osmosisd-3.1.0-linux-amd64 osmosisd -chmod +x osmosisd -./osmosisd init test +osmosisd init test wget -O $HOME/.osmosisd/config/genesis.json $GENESIS -NODE1_IP="95.217.196.54" -RPC1="http://$NODE1_IP" -P2P_PORT1=2000 -RPC_PORT1=2001 - -NODE2_IP="162.55.132.230" -RPC2="http://$NODE2_IP" -P2P_PORT2=2000 -RPC_PORT2=2001 - #If you want to use a third StateSync Server... - #DOMAIN_3=seed1.bitcanna.io # If you want to use domain names - #NODE3_IP=$(dig $DOMAIN_1 +short - #RPC3="http://$NODE3_IP" - #RPC_PORT3=26657 - #P2P_PORT3=26656 - -INTERVAL=1000 +INTERVAL=1500 LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL)) TRUST_HASH=$(curl -s "$RPC1:$RPC_PORT1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) - - - NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) #NODE3_ID=$(curl -s "$RPC3:$RPC_PORT3/status" | jq -r .result.node_info.id) @@ -61,14 +35,11 @@ echo "NODE ONE: $NODE1_ID@$NODE1_IP:$P2P_PORT1" echo "NODE TWO: $NODE2_ID@$NODE2_IP:$P2P_PORT2" - -sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ -s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"http://$NODE1_IP:$RPC_PORT1,http://$NODE2_IP:$RPC_PORT2\"| ; \ -s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ -s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ -s|^(persistent_peers[[:space:]]+=[[:space:]]+).*$|\1\"${NODE1_ID}@${NODE1_IP}:${P2P_PORT1},${NODE2_ID}@${NODE2_IP}:${P2P_PORT2}\"|" $HOME/.osmosisd/config/config.toml - - +# export state sync vars +export OSMOSISD_STATESYNC_ENABLE=true +export OSMOSISD_STATESYNC_RPC_SERVERS="162.55.132.230:2001,162.55.132.230:2001" +export OSMOSISD_STATESYNC_TRUST_HEIGHT=$BLOCK_HEIGHT +export OSMOSISD_STATESYNC_TRUST_HASH=$TRUST_HASH ./osmosisd unsafe-reset-all ./osmosisd start From bbde208019ba1ff976608c35fc4dd02fb1efec42 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 06:33:49 +0700 Subject: [PATCH 13/20] Update statesync.sh --- scripts/statesync.sh | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 2c297687879..8514c1a4770 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -1,12 +1,7 @@ #!/bin/bash -# Based on the work of Joe (Chorus-One) for Microtick - https://github.com/microtick/bounties/tree/main/statesync -# You need config in two peers (avoid seed servers) this values in app.toml: -# [state-sync] -# snapshot-interval = 1000 -# snapshot-keep-recent = 10 -# Pruning should be fine tuned also, for this testings is set to nothing -# pruning = "nothing" +# microtick and bitcanna contributed significantly here. + set -e @@ -15,24 +10,24 @@ export GOPATH=~/go export PATH=$PATH:~/go/bin go install ./... + +# MAKE HOME FOLDER AND GET GENESIS osmosisd init test wget -O $HOME/.osmosisd/config/genesis.json $GENESIS INTERVAL=1500 +# GET TRUST HASH AND TRUST HEIGHT + LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL)) TRUST_HASH=$(curl -s "$RPC1:$RPC_PORT1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) -NODE1_ID=$(curl -s "$RPC1:$RPC_PORT1/status" | jq -r .result.node_info.id) -NODE2_ID=$(curl -s "$RPC2:$RPC_PORT2/status" | jq -r .result.node_info.id) -#NODE3_ID=$(curl -s "$RPC3:$RPC_PORT3/status" | jq -r .result.node_info.id) +# TELL USER WHAT WE ARE DOING echo "TRUST HEIGHT: $BLOCK_HEIGHT" echo "TRUST HASH: $TRUST_HASH" -echo "NODE ONE: $NODE1_ID@$NODE1_IP:$P2P_PORT1" -echo "NODE TWO: $NODE2_ID@$NODE2_IP:$P2P_PORT2" # export state sync vars @@ -41,5 +36,5 @@ export OSMOSISD_STATESYNC_RPC_SERVERS="162.55.132.230:2001,162.55.132.230:2001" export OSMOSISD_STATESYNC_TRUST_HEIGHT=$BLOCK_HEIGHT export OSMOSISD_STATESYNC_TRUST_HASH=$TRUST_HASH -./osmosisd unsafe-reset-all -./osmosisd start +osmosisd unsafe-reset-all +osmosisd start From e28d8327a74b5ee9c8d449a8d5053455e7c19da8 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 06:36:17 +0700 Subject: [PATCH 14/20] Update statesync.sh --- scripts/statesync.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 8514c1a4770..41c466a82a3 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -1,11 +1,8 @@ #!/bin/bash # microtick and bitcanna contributed significantly here. - - set -e -# Change for your custom chain export GOPATH=~/go export PATH=$PATH:~/go/bin go install ./... @@ -13,8 +10,7 @@ go install ./... # MAKE HOME FOLDER AND GET GENESIS osmosisd init test -wget -O $HOME/.osmosisd/config/genesis.json $GENESIS - +wget -O ~/.osmosisd/config/genesis.json https://cloudflare-ipfs.com/ipfs/QmXRvBT3hgoXwwPqbK6a2sXUuArGM8wPyo1ybskyyUwUxs INTERVAL=1500 From ae3d6e7f4ab5fd4f17c0f501275a42e874553b40 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 06:39:21 +0700 Subject: [PATCH 15/20] Update statesync.sh --- scripts/statesync.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 41c466a82a3..9016d79b8a3 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -16,9 +16,9 @@ INTERVAL=1500 # GET TRUST HASH AND TRUST HEIGHT -LATEST_HEIGHT=$(curl -s $RPC1:$RPC_PORT1/block | jq -r .result.block.header.height); +LATEST_HEIGHT=$(curl -s 162.55.132.230:2001/block | jq -r .result.block.header.height); BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL)) -TRUST_HASH=$(curl -s "$RPC1:$RPC_PORT1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) +TRUST_HASH=$(curl -s "$162.55.132.230:2001/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) # TELL USER WHAT WE ARE DOING From c5d8cda7c5cd2152848cbcb9bd8ab4691ce2b598 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 10:09:20 +0700 Subject: [PATCH 16/20] Update statesync.sh --- scripts/statesync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 9016d79b8a3..3c195d5bd24 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -18,7 +18,7 @@ INTERVAL=1500 LATEST_HEIGHT=$(curl -s 162.55.132.230:2001/block | jq -r .result.block.header.height); BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL)) -TRUST_HASH=$(curl -s "$162.55.132.230:2001/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) +TRUST_HASH=$(curl -s "162.55.132.230:2001/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) # TELL USER WHAT WE ARE DOING From 1861c784806ccdecda7a6e31f738a311bba2f8e1 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 10:22:27 +0700 Subject: [PATCH 17/20] Update statesync.sh --- scripts/statesync.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 3c195d5bd24..2a989250cdd 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -31,6 +31,7 @@ export OSMOSISD_STATESYNC_ENABLE=true export OSMOSISD_STATESYNC_RPC_SERVERS="162.55.132.230:2001,162.55.132.230:2001" export OSMOSISD_STATESYNC_TRUST_HEIGHT=$BLOCK_HEIGHT export OSMOSISD_STATESYNC_TRUST_HASH=$TRUST_HASH +export OSMOSISD_P2P_PERSISTENT_PEERS=162.55.132.230:2000 osmosisd unsafe-reset-all osmosisd start From 0e0080f44e35142e8ec442d8878da444aca879c0 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 10:27:04 +0700 Subject: [PATCH 18/20] Update statesync.sh --- scripts/statesync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index 2a989250cdd..b241e17e151 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -31,7 +31,7 @@ export OSMOSISD_STATESYNC_ENABLE=true export OSMOSISD_STATESYNC_RPC_SERVERS="162.55.132.230:2001,162.55.132.230:2001" export OSMOSISD_STATESYNC_TRUST_HEIGHT=$BLOCK_HEIGHT export OSMOSISD_STATESYNC_TRUST_HASH=$TRUST_HASH -export OSMOSISD_P2P_PERSISTENT_PEERS=162.55.132.230:2000 +export OSMOSISD_P2P_PERSISTENT_PEERS="40aafcd9b6959d58dd1c567d9daf2a82a23311cf162.55.132.230:2000" osmosisd unsafe-reset-all osmosisd start From 59dbb09590535394bf5d67f447a8761b9693dbf0 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Sep 2021 10:29:35 +0700 Subject: [PATCH 19/20] Update statesync.sh --- scripts/statesync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/statesync.sh b/scripts/statesync.sh index b241e17e151..3c71cfd9393 100644 --- a/scripts/statesync.sh +++ b/scripts/statesync.sh @@ -31,7 +31,7 @@ export OSMOSISD_STATESYNC_ENABLE=true export OSMOSISD_STATESYNC_RPC_SERVERS="162.55.132.230:2001,162.55.132.230:2001" export OSMOSISD_STATESYNC_TRUST_HEIGHT=$BLOCK_HEIGHT export OSMOSISD_STATESYNC_TRUST_HASH=$TRUST_HASH -export OSMOSISD_P2P_PERSISTENT_PEERS="40aafcd9b6959d58dd1c567d9daf2a82a23311cf162.55.132.230:2000" +export OSMOSISD_P2P_PERSISTENT_PEERS="40aafcd9b6959d58dd1c567d9daf2a82a23311cf@162.55.132.230:2000" osmosisd unsafe-reset-all osmosisd start From 1f550b5a77f6220fc1727d06acaadffab33038d9 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Wed, 6 Oct 2021 19:19:55 -0500 Subject: [PATCH 20/20] Update .github/workflows/statesync.yml --- .github/workflows/statesync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/statesync.yml b/.github/workflows/statesync.yml index 3cff5fbd4d0..71642ab7c16 100644 --- a/.github/workflows/statesync.yml +++ b/.github/workflows/statesync.yml @@ -4,7 +4,7 @@ name: State Sync # Controls when the action will run. Workflow runs when manually triggered using the UI # or API. -on: [push, pull_request, workflow_dispatch] +on: [workflow_dispatch] # This workflow makes x86_64 binaries for mac, windows, and linux.