From 547b7951114e39126ae0fe81af6dd2554d5bd53f Mon Sep 17 00:00:00 2001 From: Nabarun Date: Wed, 4 Oct 2023 20:30:56 +0530 Subject: [PATCH] Fix empty CERC_RELAY_MULTIADDR env variable --- app/data/compose/docker-compose-ponder.yml | 4 ++-- app/data/config/nitro-contracts/deploy.sh | 2 +- app/data/config/ponder/ponder-start.sh | 21 +++++++++++-------- app/data/config/ponder/ponder.config.ts | 14 ++++++------- .../cerc-nitro-contracts/Dockerfile | 4 ++-- app/data/stacks/fixturenet-payments/stack.yml | 2 +- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/app/data/compose/docker-compose-ponder.yml b/app/data/compose/docker-compose-ponder.yml index 73cf14be..d0ea29e6 100644 --- a/app/data/compose/docker-compose-ponder.yml +++ b/app/data/compose/docker-compose-ponder.yml @@ -6,8 +6,8 @@ services: image: cerc/ponder:local working_dir: /app/examples/token-erc20 environment: - PONDER_CHAIN_ID: ${PONDER_CHAIN_ID:-99} - PONDER_RPC_URL_1: ${PONDER_RPC_URL_1:-http://nitro-reverse-payment-proxy:8081} + CERC_PONDER_CHAIN_ID: ${PONDER_CHAIN_ID:-99} + CERC_PONDER_RPC_URL_1: ${PONDER_RPC_URL_1:-http://nitro-reverse-payment-proxy:8081} CERC_PONDER_NITRO_PK: ${CERC_PONDER_NITRO_PK:-58368d20ff12f17669c06158c21d885897aa56f9be430edc789614bf9851d53f} CERC_PONDER_NITRO_CHAIN_PK: ${CERC_PONDER_NITRO_CHAIN_PK:-fb1e9af328c283ca3e2486e7c24d13582b7912057d8b9542ff41503c85bc05c0} CERC_PONDER_NITRO_CHAIN_URL: ${CERC_PONDER_NITRO_CHAIN_URL:-http://fixturenet-eth-geth-1:8546} diff --git a/app/data/config/nitro-contracts/deploy.sh b/app/data/config/nitro-contracts/deploy.sh index f4c896f7..758837b8 100755 --- a/app/data/config/nitro-contracts/deploy.sh +++ b/app/data/config/nitro-contracts/deploy.sh @@ -53,5 +53,5 @@ done echo "Using CERC_PRIVATE_KEY_DEPLOYER from env" -yarn test:deploy-contracts --chainurl ${CERC_ETH_RPC_ENDPOINT} --key ${CERC_PRIVATE_KEY_DEPLOYER} --addressesFilePath ${nitro_addresses_file} +yarn test:deploy-contracts --chainUrl ${CERC_ETH_RPC_ENDPOINT} --key ${CERC_PRIVATE_KEY_DEPLOYER} --addressesFilePath ${nitro_addresses_file} cat ${nitro_addresses_file} diff --git a/app/data/config/ponder/ponder-start.sh b/app/data/config/ponder/ponder-start.sh index e928c73c..36db6837 100755 --- a/app/data/config/ponder/ponder-start.sh +++ b/app/data/config/ponder/ponder-start.sh @@ -57,15 +57,18 @@ fi env_file='.env.local' echo "PONDER_TELEMETRY_DISABLED=true" >> "$env_file" echo "PONDER_LOG_LEVEL=debug" >> "$env_file" -echo "PONDER_CHAIN_ID=\"$PONDER_CHAIN_ID\"" > "$env_file" -echo "PONDER_RPC_URL_1=\"$PONDER_RPC_URL_1\"" >> "$env_file" -echo "CERC_PONDER_NITRO_PK=\"$CERC_PONDER_NITRO_PK\"" >> "$env_file" -echo "CERC_PONDER_NITRO_CHAIN_PK=\"$CERC_PONDER_NITRO_CHAIN_PK\"" >> "$env_file" -echo "CERC_PONDER_NITRO_CHAIN_URL=\"$CERC_PONDER_NITRO_CHAIN_URL\"" >> "$env_file" -echo "CERC_RELAY_MULTIADDR=\"$CERC_RELAY_MULTIADDR\"" >> "$env_file" -echo "CERC_UPSTREAM_NITRO_ADDRESS=\"$CERC_UPSTREAM_NITRO_ADDRESS\"" >> "$env_file" -echo "CERC_UPSTREAM_NITRO_MULTIADDR=\"$CERC_UPSTREAM_NITRO_MULTIADDR\"" >> "$env_file" -echo "CERC_UPSTREAM_NITRO_PAY_AMOUNT=\"$CERC_UPSTREAM_NITRO_PAY_AMOUNT\"" >> "$env_file" +echo "PONDER_CHAIN_ID=\"$CERC_PONDER_CHAIN_ID\"" > "$env_file" +echo "PONDER_RPC_URL_1=\"$CERC_PONDER_RPC_URL_1\"" >> "$env_file" +echo "PONDER_NITRO_PK=\"$CERC_PONDER_NITRO_PK\"" >> "$env_file" +echo "PONDER_NITRO_CHAIN_PK=\"$CERC_PONDER_NITRO_CHAIN_PK\"" >> "$env_file" +echo "PONDER_NITRO_CHAIN_URL=\"$CERC_PONDER_NITRO_CHAIN_URL\"" >> "$env_file" +echo "RELAY_MULTIADDR -> ${CERC_RELAY_MULTIADDR}" +echo "RELAY_MULTIADDR=\"$CERC_RELAY_MULTIADDR\"" >> "$env_file" +echo "UPSTREAM_NITRO_ADDRESS=\"$CERC_UPSTREAM_NITRO_ADDRESS\"" >> "$env_file" +echo "UPSTREAM_NITRO_MULTIADDR=\"$CERC_UPSTREAM_NITRO_MULTIADDR\"" >> "$env_file" +echo "UPSTREAM_NITRO_PAY_AMOUNT=\"$CERC_UPSTREAM_NITRO_PAY_AMOUNT\"" >> "$env_file" + +cat "$env_file" # Keep the container running tail -f diff --git a/app/data/config/ponder/ponder.config.ts b/app/data/config/ponder/ponder.config.ts index ceaa3161..51d8ca5b 100644 --- a/app/data/config/ponder/ponder.config.ts +++ b/app/data/config/ponder/ponder.config.ts @@ -12,8 +12,8 @@ export const config: Config = { pollingInterval: 5000, payments: { nitro: { - address: process.env.CERC_UPSTREAM_NITRO_ADDRESS!, - multiAddr: process.env.CERC_UPSTREAM_NITRO_MULTIADDR!, + address: process.env.UPSTREAM_NITRO_ADDRESS!, + multiAddr: process.env.UPSTREAM_NITRO_MULTIADDR!, fundingAmounts: { // TODO: Pass amounts from env directFund: "1000000000000", @@ -25,7 +25,7 @@ export const config: Config = { "eth_getBlockByNumber", "eth_getBlockByHash", ], - amount: process.env.CERC_UPSTREAM_NITRO_PAY_AMOUNT!, + amount: process.env.UPSTREAM_NITRO_PAY_AMOUNT!, }, }, ], @@ -40,11 +40,11 @@ export const config: Config = { }, ], nitro: { - privateKey: process.env.CERC_PONDER_NITRO_PK!, - chainPrivateKey: process.env.CERC_PONDER_NITRO_CHAIN_PK!, - chainURL: process.env.CERC_PONDER_NITRO_CHAIN_URL!, + privateKey: process.env.PONDER_NITRO_PK!, + chainPrivateKey: process.env.PONDER_NITRO_CHAIN_PK!, + chainURL: process.env.PONDER_NITRO_CHAIN_URL!, contractAddresses, - relayMultiAddr: process.env.CERC_RELAY_MULTIADDR!, + relayMultiAddr: process.env.RELAY_MULTIADDR!, store: "./.ponder/nitro-db", }, }; diff --git a/app/data/container-build/cerc-nitro-contracts/Dockerfile b/app/data/container-build/cerc-nitro-contracts/Dockerfile index 23c95886..4ed5192d 100644 --- a/app/data/container-build/cerc-nitro-contracts/Dockerfile +++ b/app/data/container-build/cerc-nitro-contracts/Dockerfile @@ -7,6 +7,6 @@ WORKDIR /app COPY . . RUN echo "Installing dependencies" && \ - yarn + yarn && yarn build:node -WORKDIR /app/packages/nitro-util +WORKDIR /app/packages/nitro-node diff --git a/app/data/stacks/fixturenet-payments/stack.yml b/app/data/stacks/fixturenet-payments/stack.yml index 63e73389..aa7dd5dc 100644 --- a/app/data/stacks/fixturenet-payments/stack.yml +++ b/app/data/stacks/fixturenet-payments/stack.yml @@ -18,7 +18,7 @@ repos: - github.com/cerc-io/mobymask-snap - github.com/cerc-io/mobymask-ui@v0.2.0 # ponder repo - - github.com/cerc-io/ponder@laconic + - github.com/cerc-io/ponder@ng-nitro-config # TODO: Update after fixes containers: # fixturenet images - cerc/go-ethereum