From fbd3d036b8e94054b131941671294a23b4fc6a50 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 31 Jul 2024 18:15:09 +0530 Subject: [PATCH] Fixes for ping-pub stack --- .../data/compose/docker-compose-ping-pub.yml | 6 +++++- .../data/config/fixturenet-laconicd/create-fixturenet.sh | 4 ++++ .../cerc-ping-pub/scripts/update-explorer-config.sh | 7 ++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/stack_orchestrator/data/compose/docker-compose-ping-pub.yml b/stack_orchestrator/data/compose/docker-compose-ping-pub.yml index e2120bc2..3255a71c 100644 --- a/stack_orchestrator/data/compose/docker-compose-ping-pub.yml +++ b/stack_orchestrator/data/compose/docker-compose-ping-pub.yml @@ -4,5 +4,9 @@ services: ping-pub: image: cerc/ping-pub:local restart: always + environment: + LACONIC_LACONICD_CHAIN_ID: ${LACONIC_LACONICD_CHAIN_ID:-laconic_9000-1} + LACONIC_LACONICD_RPC_URL: ${LACONIC_LACONICD_RPC_URL:-http://localhost:26657} + LACONIC_LACONICD_API_URL: ${LACONIC_LACONICD_API_URL:-http://localhost:1317} ports: - - "5173:5173" + - 5173 diff --git a/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh b/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh index cb817a5c..46f1fbe5 100644 --- a/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh +++ b/stack_orchestrator/data/config/fixturenet-laconicd/create-fixturenet.sh @@ -89,6 +89,10 @@ 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 + sed -i 's/enabled-unsafe-cors.*$/enabled-unsafe-cors = true/' $HOME/.laconicd/config/app.toml + # Allocate genesis accounts (cosmos formatted addresses) # 10^30 alnt | 10^12 lnt laconicd genesis add-genesis-account $KEY 1000000000000000000000000000000$DENOM --keyring-backend $KEYRING diff --git a/stack_orchestrator/data/container-build/cerc-ping-pub/scripts/update-explorer-config.sh b/stack_orchestrator/data/container-build/cerc-ping-pub/scripts/update-explorer-config.sh index 812fa5bd..bc6dd598 100755 --- a/stack_orchestrator/data/container-build/cerc-ping-pub/scripts/update-explorer-config.sh +++ b/stack_orchestrator/data/container-build/cerc-ping-pub/scripts/update-explorer-config.sh @@ -22,10 +22,15 @@ fi # infers the directory from which to load chain configuration files # by the presence or absense of the substring "testnet" in the host name # (browser side -- the host name of the host in the address bar of the browser) -# Accordingly we configure our network in both directories in order to +# Accordingly we configure our network in both directories in order to # subvert this lunacy. explorer_mainnet_config_dir=/app/chains/mainnet explorer_testnet_config_dir=/app/chains/testnet + +# Create required directories +mkdir -p $explorer_mainnet_config_dir +mkdir -p $explorer_testnet_config_dir + config_template_file=/config/chains/laconic-chaindata-template.json chain_config_name=laconic.json mainnet_config_file=${explorer_mainnet_config_dir}/${chain_config_name}