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

run.sh: add snapshot destination in tar cmd #447

Closed

Conversation

CharlesJUDITH
Copy link
Contributor

When a SNAPSHOT_URL is specified, the content is stored in $PROJECT_ROOT/data/data. For example: -e SNAPSHOT_URL=https://snapshots.polkachu.com/snapshots/akash/akash_10400871.tar.lz4 And the earliest and latest block time are "earliest_block_time": "1970-01-01T00:00:00Z".

run.sh is deleting the current data directory, with the destitation in the tar command, the snapshot is stored in $PROJECT_ROOT/data and the block data are correct.

When a SNAPSHOT_URL is specified, the content is stored in $PROJECT_ROOT/data/data.
For example: -e SNAPSHOT_URL=https://snapshots.polkachu.com/snapshots/akash/akash_10400871.tar.lz4
And the earliest and latest block time are "earliest_block_time": "1970-01-01T00:00:00Z".

run.sh is deleting the current data directory, with the destitation in the tar command, the snapshot is stored in $PROJECT_ROOT/data and the block data are correct.
@CharlesJUDITH
Copy link
Contributor Author

How to reproduce:

docker run -e CHAIN_JSON=https://raw.githubusercontent.com/akash-network/net/master/mainnet/meta.json -e FASTSYNC_VERSION=v0  -e MONIKER=chuck-dev -e P2P_POLKACHU=1 -e STATESYNC_POLKACHU=1 -e MINIMUM_GAS_PRICES=0.025uakt -e SNAPSHOT_URL=https://snapshots.polkachu.com/snapshots/akash/akash_10400871.tar.lz4 -e DOWNLOAD_SNAPSHOT=1 -p 1317:1317 -p 26657:26657 -p 9090:9090 ghcr.io/akash-network/cosmos-omnibus:v0.3.27-akash-v0.20.0

@tombeynon
Copy link
Collaborator

Thanks for this @CharlesJUDITH! There is a reason for this behaviour - previously snapshots would often contain the data directory contents directly, rather than nesting a data folder. Since this can happen (although less common these days with the addition of the wasm directory) we need to extract into a known directory first and then move the directories as required.

You'll notice a few lines later we use SNAPSHOT_DATA_PATH and SNAPSHOT_WASM_PATH to control extracting of subdirectories correctly. There is an open issue #378 that suggests identifying the subdirectories automatically; that would be a better solution here if you're up for it? Should be pretty simple, I just haven't had a chance to look yet.

I'll close this for now but please reopen if required, and thank you again for the contribution!

@tombeynon tombeynon closed this Apr 4, 2023
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