diff --git a/stack-orchestrator/compose/docker-compose-fixturenet-laconicd.yml b/stack-orchestrator/compose/docker-compose-fixturenet-laconicd.yml index 5d8e73f..528831a 100644 --- a/stack-orchestrator/compose/docker-compose-fixturenet-laconicd.yml +++ b/stack-orchestrator/compose/docker-compose-fixturenet-laconicd.yml @@ -1,7 +1,7 @@ services: laconicd: restart: unless-stopped - image: cerc/laconic2d:local + image: cerc/laconicd:local command: ["bash", "/docker-entrypoint-scripts.d/create-fixturenet.sh"] environment: TEST_AUCTION_ENABLED: ${TEST_AUCTION_ENABLED:-false} diff --git a/stack-orchestrator/config/fixturenet-laconicd/create-fixturenet.sh b/stack-orchestrator/config/fixturenet-laconicd/create-fixturenet.sh index d9de757..5e24c0f 100644 --- a/stack-orchestrator/config/fixturenet-laconicd/create-fixturenet.sh +++ b/stack-orchestrator/config/fixturenet-laconicd/create-fixturenet.sh @@ -89,6 +89,9 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then sed -i 's/prometheus = false/prometheus = true/g' $HOME/.laconicd/config/config.toml fi + # Run this to allow requests from any origin + sed -i 's/cors_allowed_origins.*$/cors_allowed_origins = ["*"]/' $HOME/.laconicd/config/config.toml + # Allocate genesis accounts (cosmos formatted addresses) laconicd genesis add-genesis-account $KEY 100000000000000000000000000photon --keyring-backend $KEYRING diff --git a/stack-orchestrator/container-build/cerc-laconic2d/build.sh b/stack-orchestrator/container-build/cerc-laconic2d/build.sh deleted file mode 100755 index 2265c85..0000000 --- a/stack-orchestrator/container-build/cerc-laconic2d/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Build cerc/laconic2d -source ${CERC_CONTAINER_BASE_DIR}/build-base.sh -docker build -t cerc/laconic2d:local ${build_command_args} ${CERC_REPO_BASE_DIR}/laconic2d diff --git a/stack-orchestrator/container-build/cerc-laconicd/build.sh b/stack-orchestrator/container-build/cerc-laconicd/build.sh new file mode 100755 index 0000000..65bab74 --- /dev/null +++ b/stack-orchestrator/container-build/cerc-laconicd/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Build cerc/laconicd +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh +docker build -t cerc/laconicd:local ${build_command_args} ${CERC_REPO_BASE_DIR}/laconicd diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/README.md b/stack-orchestrator/stacks/fixturenet-laconicd/README.md index 356950d..38eea37 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/README.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/README.md @@ -33,10 +33,10 @@ Instructions for running a laconicd fixturenet along with registry CLI and conso This should create the following docker images locally: - * `cerc/laconic2d` - * `cerc/laconic2-registry-cli` + * `cerc/laconicd` + * `cerc/laconic-registry-cli` * `cerc/webapp-base` - * `cerc/laconic2-console-host` + * `cerc/laconic-console-host` ## Create a deployment diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/scripts/generate-stage1-genesis.sh b/stack-orchestrator/stacks/fixturenet-laconicd/scripts/generate-stage1-genesis.sh index 33f7080..6f827b9 100755 --- a/stack-orchestrator/stacks/fixturenet-laconicd/scripts/generate-stage1-genesis.sh +++ b/stack-orchestrator/stacks/fixturenet-laconicd/scripts/generate-stage1-genesis.sh @@ -2,17 +2,16 @@ # Exit on error set -e - -# Prerequisite: nitro-rpc-client package installed globally -# https://github.com/cerc-io/go-nitro/blob/main/packages/nitro-rpc-client/readme.md#global-install +set -u # Check args -if [ "$#" -ne 1 ]; then - echo "Usage: $0 " +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " exit 1 fi -STAGE0_DEPLOYMENT_DIR="$1" +BRIDGE_DEPLOYMENT_DIR="$1" +STAGE0_DEPLOYMENT_DIR="$2" STAGE1_GENESIS_DIR=stage1-genesis # Create a temporary target directory @@ -22,11 +21,8 @@ mkdir -p $STAGE1_GENESIS_DIR # Fetch ETH account holdings from the bridge node -# Trust locally-trusted development certificates created by mkcert -export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem" - # Run the nitro-rpc-client command and process the output with jq -eth_account_holdings=$(nitro-rpc-client get-all-l2-channels -p 4006 | jq -s '[.[] | {nitro_address: .Balance.Them, balance: .Balance.TheirBalance}]') +eth_account_holdings=$(laconic-so deployment --dir $BRIDGE_DEPLOYMENT_DIR exec nitro-rpc-client "nitro-rpc-client get-all-l2-channels -p 4006 -h nitro-bridge" | jq -s '[.[] | {nitro_address: .Balance.Them, balance: .Balance.TheirBalance}]') echo "Fetched Ethereum account holdings" @@ -37,7 +33,7 @@ echo "Fetched Ethereum account holdings" onboarding_state_file="$STAGE1_GENESIS_DIR/stage0-onboarding-state.json" docker run -it \ -v ${STAGE0_DEPLOYMENT_DIR}/data/laconicd-data:/root/stage0-deployment/.laconicd \ - cerc/laconic2d:local bash -c "laconicd export --home /root/stage0-deployment/.laconicd" \ + cerc/laconicd:local bash -c "laconicd export --home /root/stage0-deployment/.laconicd" \ | jq .app_state.onboarding > "$onboarding_state_file" stage0_participants=$(cat "$onboarding_state_file" | jq .participants) @@ -64,12 +60,12 @@ echo "Calculated allocations for stage 1 chain" # -------- -# Run a script with cerc/laconic2d:local to generate the genesis file +# Run a script with cerc/laconicd:local to generate the genesis file # with onboarding module state and given allocations docker run -it \ -v ./stage1-genesis:/root/.laconicd \ -v ./scripts:/scripts \ - cerc/laconic2d:local bash -c "/scripts/genesis.sh" + cerc/laconicd:local bash -c "/scripts/genesis.sh" # Copy over the genesis file to output folder OUTPUT_DIR=output diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/scripts/genesis.sh b/stack-orchestrator/stacks/fixturenet-laconicd/scripts/genesis.sh index e45326c..a92c67f 100755 --- a/stack-orchestrator/stacks/fixturenet-laconicd/scripts/genesis.sh +++ b/stack-orchestrator/stacks/fixturenet-laconicd/scripts/genesis.sh @@ -2,8 +2,9 @@ # Exit on error set -e +set -u -# Note: Needs to be run in a docker container with image cerc/laconic2d:local +# Note: Needs to be run in a docker container with image cerc/laconicd:local CHAINID="laconic_9000-1" STAGE1_MONIKER=localtestnet-stage-1 diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/stack.yml b/stack-orchestrator/stacks/fixturenet-laconicd/stack.yml index 85c2ba1..191dcec 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/stack.yml +++ b/stack-orchestrator/stacks/fixturenet-laconicd/stack.yml @@ -2,8 +2,8 @@ version: "1.0" name: fixturenet-laconicd description: "A laconicd fixturenet" repos: - - git.vdb.to/cerc-io/laconic2d + - git.vdb.to/cerc-io/laconicd containers: - - cerc/laconic2d + - cerc/laconicd pods: - fixturenet-laconicd