Replace laconic2 with laconic and update genesis generation script #5

Merged
nabarun merged 6 commits from iv-cors into main 2024-07-23 12:26:15 +00:00
8 changed files with 25 additions and 25 deletions

View File

@ -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}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <stage0-deployment-dir-absolute>"
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <bridge-deployment-dir-absolute> <stage0-deployment-dir-absolute>"
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

View File

@ -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

View File

@ -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