-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create statesync.bash #264
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @faddat good catch thanks!
I just started working on this as well, we have some lock on fetchd preventing using statesync for now (due to wasmd not supporting it until recently), see #265
The script looks good! I guess just need to adjust URLs to point to some fetch nodes, and I'm wondering how much we want pebbledb
@@ -0,0 +1,49 @@ | |||
#!/bin/bash | |||
# microtick and bitcanna contributed significantly here. | |||
# Pebbledb state sync script for evmos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Pebbledb state sync script for evmos | |
# Pebbledb state sync script for fetchd |
export GOPATH=~/go | ||
export PATH=$PATH:~/go/bin | ||
|
||
# Install Juno with pebbledb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Install Juno with pebbledb | |
# Install fetchd with pebbledb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is pebbledb? I don't think it's required to have it but curious of its advantages over default db
|
||
# Get "trust_hash" and "trust_height". | ||
INTERVAL=1000 | ||
LATEST_HEIGHT="$(curl -s https://evmos-rpc.polkachu.com/block | jq -r .result.block.header.height)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LATEST_HEIGHT="$(curl -s https://evmos-rpc.polkachu.com/block | jq -r .result.block.header.height)" | |
LATEST_HEIGHT="$(curl -s https://rpc-fetchhub.fetch.ai/block | jq -r .result.block.header.height)" |
INTERVAL=1000 | ||
LATEST_HEIGHT="$(curl -s https://evmos-rpc.polkachu.com/block | jq -r .result.block.header.height)" | ||
BLOCK_HEIGHT="$((LATEST_HEIGHT-INTERVAL))" | ||
TRUST_HASH="$(curl -s "https://evmos-rpc.polkachu.com/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TRUST_HASH="$(curl -s "https://evmos-rpc.polkachu.com/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)" | |
TRUST_HASH="$(curl -s "https://rpc-fetchhub.fetch.ai//block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)" |
# Export state sync variables. | ||
export FETCHD_STATESYNC_ENABLE=true | ||
export FETCHD_P2P_MAX_NUM_OUTBOUND_PEERS=200 | ||
export FETCHD_STATESYNC_RPC_SERVERS="https://rpc-juno-ia.notional.ventures:443,https://juno-rpc.polkachu.com:443" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can discover these the same way we pull seeds below?
export FETCHD_STATESYNC_RPC_SERVERS="https://rpc-juno-ia.notional.ventures:443,https://juno-rpc.polkachu.com:443" | |
export FETCHD_STATESYNC_RPC_SERVERS="$(curl -s https://raw.githubusercontent.com/cosmos/chain-registry/master/fetchhub/chain.json | jq -r '[foreach .apis.rpc[] as $item (""; "\($item.address)")] | join(",")')" |
export FETCHD_P2P_SEEDS | ||
|
||
# Start chain. | ||
fetchd start --x-crisis-skip-assert-invariants --db_backend pebbledb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slow but safe?
fetchd start --x-crisis-skip-assert-invariants --db_backend pebbledb | |
fetchd start --db_backend pebbledb |
Fetch can now be fetched rapidly, and enjoys best in class endpoints.
https://github.com/cosmos/chain-registry/blob/master/fetchhub/chain.json