Replace laconic2 with laconic and update genesis generation script (#5)
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675) - Allow requests from any origin - Replace `laconic2` with `laconic` - Update `nitro-rpc-client` usage in genesis generation script Co-authored-by: IshaVenikar <ishavenikar7@gmail.com> Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Reviewed-on: cerc-io/fixturenet-laconicd-stack#5
This commit is contained in:
parent
5206810eca
commit
fadebe363a
@ -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}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
5
stack-orchestrator/container-build/cerc-laconicd/build.sh
Executable file
5
stack-orchestrator/container-build/cerc-laconicd/build.sh
Executable 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
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user