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

fix: forest binary reorg #216

Merged
merged 18 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions archival-snapshots-generate/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ 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");
}

env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();

let args = Args::parse();

info!("Analyzing the provided snapshot file");
let epochs = std::process::Command::new("forest-cli")
let epochs = std::process::Command::new("forest-tool")
.args([
"archive",
"info",
Expand Down
6 changes: 6 additions & 0 deletions terraform/modules/daily_snapshot/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ resource "digitalocean_firewall" "forest-firewall" {
source_addresses = var.source_addresses
}

inbound_rule {
protocol = "tcp"
port_range = "2345"
source_addresses = var.source_addresses
}

inbound_rule {
protocol = "tcp"
port_range = "80"
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 --chain $CHAIN --vendor filops

# 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 --config config.toml --chain "$CHAIN_NAME" --force
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
6 changes: 6 additions & 0 deletions terraform/modules/filecoin_node/firewall.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ resource "digitalocean_firewall" "forest_firewall" {
source_addresses = var.source_addresses
}

inbound_rule {
protocol = "tcp"
port_range = "2345"
source_addresses = var.source_addresses
}

inbound_rule {
protocol = "tcp"
port_range = "80"
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/filecoin_node/forest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ sudo --user="${NEW_USER}" -- \
--network=forest \
--name=forest-"${CHAIN}" \
--volume=/home/"${NEW_USER}"/forest_data:/home/"${NEW_USER}"/forest_data:z \
--publish=1234:1234 \
samuelarogbonlo marked this conversation as resolved.
Show resolved Hide resolved
--publish=2345:2345 \
--publish=6116:6116 \
--restart=always \
ghcr.io/chainsafe/forest:latest \
Expand Down
4 changes: 2 additions & 2 deletions terraform/modules/sync_check/service/sync_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def get_and_assert_env_variable(name)
client.post_message "✅ Sync check for #{hostname} passed. 🌲🌳🌲🌳🌲"
else
client.post_message "⛔ Sync check for #{hostname} fiascoed. 🔥🌲🔥"
SyncCheck.new.run_forest_cli("--chain #{network} db clean --force")
logger.info 'DB Cleaned'
SyncCheck.new.run_forest_cli("db destroy --chain #{network} --force")
elmattic marked this conversation as resolved.
Show resolved Hide resolved
elmattic marked this conversation as resolved.
Show resolved Hide resolved
logger.info 'DB Destroyed'
end
client.attach_files(LOG_HEALTH, LOG_SYNC, LOG_FOREST)

Expand Down