Skip to content

Commit

Permalink
Merge pull request #107 from amazingdatamachine/sander/fix-relayer
Browse files Browse the repository at this point in the history
Give relayer parent auth token
  • Loading branch information
sanderpick authored Jul 4, 2024
2 parents 05f37e2 + 58d7d5a commit 6874efd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions scripts/deploy_subnet_under_calibration_net/.ipc/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

keystore_path = "~/.ipc"

# Filecoin Calibration
Expand All @@ -7,13 +6,15 @@ id = "/r314159"

[subnets.config]
network_type = "fevm"
provider_http = "https://calibration.filfox.info/rpc/v1"
provider_http = "https://calibration.node.glif.io/archive/lotus/rpc/v1"
# To be replaced by deploy.sh
auth_token = ""
# To be replaced by deploy.sh
gateway_addr = "0xBF7a836AF7F1A1EdB939Ff2230Cd41a5e8e5C387"
# To be replaced by deploy.sh
registry_addr = "0xb1110ba6507fb5f89E12Aff23C658449D11d8708"

# Subnet template - uncomment and adjust before using
# Subnet template
[[subnets]]
# To be replaced by deploy.sh
id = "/r314159/t410flp4jf7keqcf5bqogrkx4wpkygiskykcvpaigicq"
Expand Down
10 changes: 7 additions & 3 deletions scripts/deploy_subnet_under_calibration_net/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ do
echo "Export private key for ${wallet_addresses[i]} to ${IPC_CONFIG_FOLDER}/validator_${i}.sk"
done

# Step 4.2: Deploy IPC contracts
# Step 4.2: Update IPC config file with parent auth token
toml set ${IPC_CONFIG_FOLDER}/config.toml subnets[0].config.auth_token $PARENT_HTTP_AUTH_TOKEN > /tmp/config.toml.0
cp /tmp/config.toml.0 ${IPC_CONFIG_FOLDER}/config.toml

# Step 4.3: Deploy IPC contracts
cd ${IPC_FOLDER}/contracts
npm install
export RPC_URL=https://calibration.filfox.info/rpc/v1
Expand All @@ -186,7 +190,7 @@ parent_registry_address=$(echo "$deploy_contracts_output" | grep '"SubnetRegistr
echo "New parent gateway address: $parent_gateway_address"
echo "New parent registry address: $parent_registry_address"

# Step 4.3: Use the new parent gateway and registry address to update IPC config file
# Step 4.4: Use the new parent gateway and registry address to update IPC config file
toml set ${IPC_CONFIG_FOLDER}/config.toml subnets[0].config.gateway_addr $parent_gateway_address > /tmp/config.toml.1
toml set /tmp/config.toml.1 subnets[0].config.registry_addr $parent_registry_address > /tmp/config.toml.2
cp /tmp/config.toml.2 ${IPC_CONFIG_FOLDER}/config.toml
Expand Down Expand Up @@ -313,7 +317,7 @@ done
pkill -f "relayer" || true
# Start relayer
echo "$DASHES Start relayer process (in the background)"
nohup ipc-cli checkpoint relayer --subnet $subnet_id --submitter $default_wallet_address > nohup.out 2> nohup.err < /dev/null &
nohup ipc-cli checkpoint relayer --subnet $subnet_id --submitter 0xA08aE9E8c038CAf9765D7Db725CA63a92FCf12Ce > relayer.log &

# Step 11: Print a summary of the deployment
cat << EOF
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy_subnet_under_calibration_net/redeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ done
pkill -f "relayer" || true
# Start relayer
echo "$DASHES Start relayer process (in the background)"
nohup ipc-cli checkpoint relayer --subnet $subnet_id --submitter 0xA08aE9E8c038CAf9765D7Db725CA63a92FCf12Ce > nohup.out 2> nohup.err < /dev/null &
nohup ipc-cli checkpoint relayer --subnet $subnet_id --submitter 0xA08aE9E8c038CAf9765D7Db725CA63a92FCf12Ce > relayer.log &

# Step 7: Print a summary of the deployment
cat << EOF
Expand Down

0 comments on commit 6874efd

Please sign in to comment.