-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Workflow testing for state sync * Added state sync script * State sync script (WIP) * Update statesync.yml * Update statesync.yml * Update statesync.sh * Update statesync.yml * Update statesync.sh * Update statesync.sh * Update statesync.sh * Update statesync.sh * Update statesync.sh * Update statesync.sh * Update statesync.sh * Update statesync.sh * Update statesync.sh * Update statesync.sh * Update statesync.sh * Update statesync.sh * Update .github/workflows/statesync.yml Co-authored-by: Dev Ojha <[email protected]>
- Loading branch information
1 parent
9f1e0c7
commit 17eda92
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This is a basic workflow that is manually triggered | ||
|
||
name: State Sync | ||
|
||
# Controls when the action will run. Workflow runs when manually triggered using the UI | ||
# or API. | ||
on: [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 | ||
|
||
- name: state sync | ||
run: bash scripts/statesync.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
#!/bin/bash | ||
# microtick and bitcanna contributed significantly here. | ||
set -e | ||
|
||
export GOPATH=~/go | ||
export PATH=$PATH:~/go/bin | ||
go install ./... | ||
|
||
|
||
# MAKE HOME FOLDER AND GET GENESIS | ||
osmosisd init test | ||
wget -O ~/.osmosisd/config/genesis.json https://cloudflare-ipfs.com/ipfs/QmXRvBT3hgoXwwPqbK6a2sXUuArGM8wPyo1ybskyyUwUxs | ||
|
||
INTERVAL=1500 | ||
|
||
# GET TRUST HASH AND TRUST 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 "162.55.132.230:2001/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) | ||
|
||
|
||
# TELL USER WHAT WE ARE DOING | ||
echo "TRUST HEIGHT: $BLOCK_HEIGHT" | ||
echo "TRUST HASH: $TRUST_HASH" | ||
|
||
|
||
# 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 | ||
export OSMOSISD_P2P_PERSISTENT_PEERS="[email protected]:2000" | ||
|
||
osmosisd unsafe-reset-all | ||
osmosisd start |