Skip to content

Commit

Permalink
update commands to support forest-0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lemmih committed Sep 8, 2023
1 parent 1132783 commit a48d14c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion archival-snapshots-generate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This tool will generate lite and diff snapshots provided a full snapshot.

# Installation
Install it with `cargo install --path .`. This tool also requires `forest-cli` in PATH. See more [here](https://github.com/ChainSafe/forest#installation).
Install it with `cargo install --path .`. This tool also requires `forest-tool` in PATH. See more [here](https://github.com/ChainSafe/forest#installation).

```
Usage: archival-snapshots-generate [OPTIONS] <SNAPSHOT_FILE>
Expand Down
7 changes: 2 additions & 5 deletions archival-snapshots-generate/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ struct Args {
}

fn main() -> anyhow::Result<()> {
if which::which("forest-cli").is_err() {
bail!("forest-cli is not installed");
}
if which::which("forest-tool").is_err() {
bail!("forest-tool is not installed");
}
Expand Down Expand Up @@ -129,7 +126,7 @@ fn generate_lite_snapshot(
snapshot_file: &Path,
) -> anyhow::Result<()> {
debug!("Generating lite snapshot for epoch {epoch}");
std::process::Command::new("forest-cli")
std::process::Command::new("forest-tool")
.args([
"archive",
"export",
Expand Down Expand Up @@ -168,7 +165,7 @@ fn generate_diff_snapshot(
return Ok(());
}

std::process::Command::new("forest-cli")
std::process::Command::new("forest-tool")
.args([
"archive",
"export",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ send_slack_alert() {

COMMANDS=$(cat << HEREDOC
set -eux
cd forest_db/filops && forest-cli --chain $CHAIN snapshot fetch --vendor filops
cd forest_db/filops && forest-tool snapshot fetch --vendor filops --chain $CHAIN
# Get the most recently downloaded snapshot's name
DOWNLOADED_SNAPSHOT_NAME=\$(basename \$(find . -name "filops_snapshot_$CHAIN*" -type f -print0 | xargs -r -0 ls -1 -t | head -1))
Expand Down
8 changes: 4 additions & 4 deletions terraform/modules/daily_snapshot/service/upload_snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ echo "Snapshot: $NEWEST_SNAPSHOT"
# spawn a task in the background to periodically write Prometheus metrics to a file
write_metrics &
forest-cli --config config.toml --chain "$CHAIN_NAME" db clean --force
forest-tool db destroy --force --config config.toml --chain "$CHAIN_NAME"
forest --config config.toml --chain "$CHAIN_NAME" --import-snapshot "$NEWEST_SNAPSHOT" --halt-after-import
forest --config config.toml --chain "$CHAIN_NAME" --no-gc --save-token=token.txt --detach
timeout "$SYNC_TIMEOUT" forest-cli --chain "$CHAIN_NAME" sync wait
Expand All @@ -68,10 +68,10 @@ forest-cli --token=\$(cat token.txt) shutdown --force
# Run full checks only for calibnet, given that it takes too long for mainnet.
if [ "$CHAIN_NAME" = "calibnet" ]; then
forest-cli snapshot validate --check-network "$CHAIN_NAME" forest_db/forest_snapshot_*.forest.car.zst
forest-tool snapshot validate --check-network "$CHAIN_NAME" forest_db/forest_snapshot_*.forest.car.zst
else
forest-cli archive info forest_db/forest_snapshot_*.forest.car.zst
forest-cli snapshot validate --check-links 0 --check-network "$CHAIN_NAME" --check-stateroots 5 forest_db/forest_snapshot_*.forest.car.zst
forest-tool archive info forest_db/forest_snapshot_*.forest.car.zst
forest-tool snapshot validate --check-links 0 --check-network "$CHAIN_NAME" --check-stateroots 5 forest_db/forest_snapshot_*.forest.car.zst
fi
Expand Down

0 comments on commit a48d14c

Please sign in to comment.