-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Several improvents to deploy subnet script
- Fix relayer not starting due to missing argument - Fix bug when default-key was first in the json array - Streamline local deployment by introducing a prepare_local.sh script - Improve documentation for local deployment and document more known issues
- Loading branch information
Showing
4 changed files
with
66 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
scripts/deploy_subnet_under_calibration_net/prepare_local.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
# A script which resets your local .ipc folder so we can run the deploy.sh script for a local deployment | ||
# | ||
# To run: | ||
# 1. Run `./prepare_local.sh` | ||
# 2. Run `./deploy.sh` | ||
# | ||
# Known issues: | ||
# - The deploy.sh script does not run "make docker-build" which can cause errors if its outdated on your | ||
# machine. To fix this, run `make docker-build` in ipc/fendermint folder and rerun the deploy.sh script | ||
|
||
|
||
set -eo pipefail | ||
|
||
SCRIPT_DIR=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
echo "SCRIPT_DIR: $SCRIPT_DIR" | ||
|
||
echo "Removing existing .ipc folder" | ||
rm -rf ~/.ipc | ||
|
||
echo "Copying new .ipc folder" | ||
cp -r $SCRIPT_DIR/.ipc ~/.ipc | ||
|
||
echo "Fetching info about newest current deployment contracts" | ||
hash=$(curl -s https://raw.githubusercontent.com/consensus-shipyard/ipc/cd/contracts/deployments/r314159.json) | ||
echo $hash | jq | ||
|
||
echo "Parsing gateway and registry address..." | ||
gateway_addr=$(echo $hash | jq -r '.gateway_addr') | ||
echo "- Gateway address: $gateway_addr" | ||
registry_addr=$(echo $hash | jq -r '.registry_addr') | ||
echo "- Registry address: $registry_addr" | ||
|
||
echo "Updating config with new gateway and registry address" | ||
toml set ~/.ipc/config.toml subnets[0].config.gateway_addr $gateway_addr > ~/.ipc/config.toml.tmp | ||
toml set ~/.ipc/config.toml.tmp subnets[0].config.registry_addr $registry_addr > ~/.ipc/config.toml.tmp2 | ||
cp ~/.ipc/config.toml.tmp2 ~/.ipc/config.toml | ||
|
||
|
||
echo "Setting up wallets" | ||
wallet1=$(cargo run -q -p ipc-cli --release -- wallet new --wallet-type evm | tr -d '"') | ||
echo "- Wallet1: $wallet1" | ||
wallet2=$(cargo run -q -p ipc-cli --release -- wallet new --wallet-type evm | tr -d '"') | ||
echo "- Wallet2: $wallet2" | ||
wallet3=$(cargo run -q -p ipc-cli --release -- wallet new --wallet-type evm | tr -d '"') | ||
echo "- Wallet3: $wallet3" | ||
|
||
echo "--- GO TO Calibration faucet (https://faucet.calibnet.chainsafe-fil.io/) and get some tokens for the wallets ---" |