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 17 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
1 change: 1 addition & 0 deletions terraform/forest-calibnet/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module "calibnet" {
attach_volume = false
destination_addresses = var.destination_addresses
chain = var.chain
rpc_port = "2345"
project = var.project
fw_name = var.fw_name
NR_LICENSE_KEY = var.NR_LICENSE_KEY
Expand Down
1 change: 1 addition & 0 deletions terraform/forest-mainnet/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module "mainnet" {
initial_filesystem_type = var.initial_filesystem_type
volume_size = var.volume_size
attach_volume = false
rpc_port = "2345"
destination_addresses = var.destination_addresses
chain = var.chain
volume_name = var.volume_name
Expand Down
1 change: 1 addition & 0 deletions terraform/lotus-mainnet/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module "lotus-mainnet" {
fw_name = "lotus-mainnet-fw"
script = "lotus.sh"
forest_user = "forest"
rpc_port = "1234"
NR_LICENSE_KEY = var.NR_LICENSE_KEY
NEW_RELIC_API_KEY = var.NEW_RELIC_API_KEY
NEW_RELIC_ACCOUNT_ID = var.NEW_RELIC_ACCOUNT_ID
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/daily_snapshot/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ resource "digitalocean_firewall" "forest-firewall" {

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

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
2 changes: 1 addition & 1 deletion terraform/modules/filecoin_node/firewall.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "digitalocean_firewall" "forest_firewall" {

inbound_rule {
protocol = "tcp"
port_range = "1234"
port_range = var.rpc_port
source_addresses = var.source_addresses
}

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 @@ -56,7 +56,7 @@ sudo --user="${NEW_USER}" -- \
--name=forest-"${CHAIN}" \
--env "FOREST_GC_TRIGGER_FACTOR=1.4" \
--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
5 changes: 5 additions & 0 deletions terraform/modules/filecoin_node/variable.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ variable "destination_addresses" {
type = list(string)
}

variable "rpc_port" {
description = "RPC Port for nodes"
type = string
}

variable "chain" {
description = "The chain tag to apply to resources."
type = string
Expand Down
Loading