Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Create statesync.bash #264

wants to merge 1 commit into from

Conversation

faddat
Copy link

@faddat faddat commented Aug 5, 2022

Fetch can now be fetched rapidly, and enjoys best in class endpoints.

https://github.com/cosmos/chain-registry/blob/master/fetchhub/chain.json

Copy link
Contributor

@daeMOn63 daeMOn63 left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Pebbledb state sync script for evmos
# Pebbledb state sync script for fetchd

export GOPATH=~/go
export PATH=$PATH:~/go/bin

# Install Juno with pebbledb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Install Juno with pebbledb
# Install fetchd with pebbledb

Copy link
Contributor

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)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"
Copy link
Contributor

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?

Suggested change
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://github.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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slow but safe?

Suggested change
fetchd start --x-crisis-skip-assert-invariants --db_backend pebbledb
fetchd start --db_backend pebbledb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants