Commit feab0245 authored by bendanzhentan's avatar bendanzhentan Committed by GitHub

feat: improve logging of interop-devnet/create-chains.sh (#13352)

parent d386df32
...@@ -2,11 +2,16 @@ ...@@ -2,11 +2,16 @@
set -eu set -eu
export OP_INTEROP_MNEMONIC="test test test test test test test test test test test junk"
log_info() { echo "[INFO] $1"; }
log_error() { echo "[ERROR] $1" >&2; }
# Run this with workdir set as root of the repo # Run this with workdir set as root of the repo
if [ -f "../mise.toml" ]; then if [ -f "../mise.toml" ]; then
echo "Running create-chains script." log_info "Running create-chains script."
else else
echo "Cannot run create-chains script, must be in interop-devnet dir, but currently in:" log_error "Cannot run create-chains script, must be in interop-devnet dir, but currently in:"
pwd pwd
exit 1 exit 1
fi fi
...@@ -16,14 +21,12 @@ cd .. ...@@ -16,14 +21,12 @@ cd ..
# Check if already created # Check if already created
if [ -d ".devnet-interop" ]; then if [ -d ".devnet-interop" ]; then
echo "Already created chains." log_error "Already created chains. Cleanup .devnet-interop dir if you want to force a re-creation."
exit 1 exit 1
else else
echo "Creating new interop devnet chain configs" log_info "Creating new interop devnet chain configs"
fi fi
export OP_INTEROP_MNEMONIC="test test test test test test test test test test test junk"
go run ./op-node/cmd interop dev-setup \ go run ./op-node/cmd interop dev-setup \
--artifacts-dir=packages/contracts-bedrock/forge-artifacts \ --artifacts-dir=packages/contracts-bedrock/forge-artifacts \
--foundry-dir=packages/contracts-bedrock \ --foundry-dir=packages/contracts-bedrock \
...@@ -48,7 +51,7 @@ eth2-testnet-genesis deneb \ ...@@ -48,7 +51,7 @@ eth2-testnet-genesis deneb \
--eth1-withdrawal-address=0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ --eth1-withdrawal-address=0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
--eth1-match-genesis-time --eth1-match-genesis-time
echo "Writing env files now..." log_info "Writing env files now..."
# write env files for each L2 service # write env files for each L2 service
...@@ -74,4 +77,4 @@ echo "OP_PROPOSER_GAME_FACTORY_ADDRESS=$(jq -r .DisputeGameFactoryProxy .devnet- ...@@ -74,4 +77,4 @@ echo "OP_PROPOSER_GAME_FACTORY_ADDRESS=$(jq -r .DisputeGameFactoryProxy .devnet-
# batcher # batcher
echo "OP_BATCHER_PRIVATE_KEY=$($key_cmd --name=batcher)" >> "$chain_env/op-batcher.env" echo "OP_BATCHER_PRIVATE_KEY=$($key_cmd --name=batcher)" >> "$chain_env/op-batcher.env"
echo "Interop devnet setup is complete!" log_info "Interop devnet setup is complete!"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment