From 1d7464a24cb940c2b3214c3c1c8990f460246351 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 3 Oct 2023 14:13:44 +0530 Subject: [PATCH] Handle review comments --- app/data/compose/docker-compose-go-nitro.yml | 4 +-- .../docker-compose-mobymask-app-v3.yml | 2 +- .../docker-compose-nitro-contracts.yml | 2 +- app/data/compose/docker-compose-ponder.yml | 8 ++--- .../docker-compose-watcher-mobymask-v3.yml | 10 +++--- app/data/config/nitro-contracts/deploy.sh | 1 - app/data/stacks/fixturenet-payments/README.md | 36 +++++++++---------- 7 files changed, 30 insertions(+), 33 deletions(-) diff --git a/app/data/compose/docker-compose-go-nitro.yml b/app/data/compose/docker-compose-go-nitro.yml index b338f2e6..414a83ce 100644 --- a/app/data/compose/docker-compose-go-nitro.yml +++ b/app/data/compose/docker-compose-go-nitro.yml @@ -11,8 +11,8 @@ services: condition: service_completed_successfully environment: NITRO_CHAIN_URL: ${NITRO_CHAIN_URL:-ws://fixturenet-eth-geth-1:8546} - NITRO_PK: ${NITRO_PK} - NITRO_CHAIN_PK: ${NITRO_CHAIN_PK} + NITRO_PK: ${NITRO_PK:-2d999770f7b5d49b694080f987b82bbc9fc9ac2b4dcc10b0f8aba7d700f69c6d} + NITRO_CHAIN_PK: ${NITRO_CHAIN_PK:-570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597} NITRO_USE_DURABLE_STORE: ${NITRO_USE_DURABLE_STORE:-true} NITRO_DURABLE_STORE_FOLDER: ${NITRO_DURABLE_STORE_FOLDER:-/app/data/nitro-store} CERC_NA_ADDRESS: ${CERC_NA_ADDRESS} diff --git a/app/data/compose/docker-compose-mobymask-app-v3.yml b/app/data/compose/docker-compose-mobymask-app-v3.yml index 381b71c1..244fb29b 100644 --- a/app/data/compose/docker-compose-mobymask-app-v3.yml +++ b/app/data/compose/docker-compose-mobymask-app-v3.yml @@ -19,7 +19,7 @@ services: CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS} CERC_CA_ADDRESS: ${CERC_CA_ADDRESS} CERC_APP_WATCHER_URL: ${CERC_APP_WATCHER_URL} - CERC_PAYMENT_NITRO_ADDRESS: ${CERC_PAYMENT_NITRO_ADDRESS} + CERC_PAYMENT_NITRO_ADDRESS: ${CERC_PAYMENT_NITRO_ADDRESS:-0xBBB676f9cFF8D242e9eaC39D063848807d3D1D94} CERC_SNAP_URL: ${CERC_SNAP_URL} working_dir: /app command: ["bash", "/scripts/mobymask-app-start.sh"] diff --git a/app/data/compose/docker-compose-nitro-contracts.yml b/app/data/compose/docker-compose-nitro-contracts.yml index 6d757582..8357d25a 100644 --- a/app/data/compose/docker-compose-nitro-contracts.yml +++ b/app/data/compose/docker-compose-nitro-contracts.yml @@ -8,7 +8,7 @@ services: environment: CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT:-http://fixturenet-eth-geth-1:8545} - CERC_PRIVATE_KEY_DEPLOYER: ${CERC_PRIVATE_KEY_DEPLOYER} + CERC_PRIVATE_KEY_DEPLOYER: ${CERC_PRIVATE_KEY_DEPLOYER:-0x888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218} CERC_NA_ADDRESS: ${CERC_NA_ADDRESS} CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS} CERC_CA_ADDRESS: ${CERC_CA_ADDRESS} diff --git a/app/data/compose/docker-compose-ponder.yml b/app/data/compose/docker-compose-ponder.yml index 4a6602e4..62d46b47 100644 --- a/app/data/compose/docker-compose-ponder.yml +++ b/app/data/compose/docker-compose-ponder.yml @@ -8,12 +8,12 @@ services: environment: PONDER_CHAIN_ID: ${PONDER_CHAIN_ID:-99} PONDER_RPC_URL_1: ${PONDER_RPC_URL_1:-http://nitro-reverse-payment-proxy:8081} - CERC_PONDER_NITRO_PK: ${CERC_PONDER_NITRO_PK} - CERC_PONDER_NITRO_CHAIN_PK: ${CERC_PONDER_NITRO_CHAIN_PK} + 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:8545} CERC_RELAY_MULTIADDR: ${CERC_RELAY_MULTIADDR} - CERC_UPSTREAM_NITRO_ADDRESS: ${CERC_UPSTREAM_NITRO_ADDRESS} - CERC_UPSTREAM_NITRO_MULTIADDR: ${CERC_UPSTREAM_NITRO_MULTIADDR} + CERC_UPSTREAM_NITRO_ADDRESS: ${CERC_UPSTREAM_NITRO_ADDRESS:-0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE} + CERC_UPSTREAM_NITRO_MULTIADDR: ${CERC_UPSTREAM_NITRO_MULTIADDR:-/dns4/go-nitro/tcp/5005/ws/p2p/16Uiu2HAmSjXJqsyBJgcBUU2HQmykxGseafSatbpq5471XmuaUqyv} CERC_UPSTREAM_NITRO_PAY_AMOUNT: ${CERC_UPSTREAM_NITRO_PAY_AMOUNT:-5000} command: ["bash", "./ponder-start.sh"] volumes: diff --git a/app/data/compose/docker-compose-watcher-mobymask-v3.yml b/app/data/compose/docker-compose-watcher-mobymask-v3.yml index 8010ed89..92c030f4 100644 --- a/app/data/compose/docker-compose-watcher-mobymask-v3.yml +++ b/app/data/compose/docker-compose-watcher-mobymask-v3.yml @@ -33,7 +33,7 @@ services: CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} ENV: "PROD" CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT} - CERC_PRIVATE_KEY_DEPLOYER: ${CERC_PRIVATE_KEY_DEPLOYER} + CERC_PRIVATE_KEY_DEPLOYER: ${CERC_PRIVATE_KEY_DEPLOYER:-0x888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218} CERC_MOBYMASK_APP_BASE_URI: ${CERC_MOBYMASK_APP_BASE_URI} CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT} command: ["bash", "-c", "./deploy-and-generate-invite.sh"] @@ -83,11 +83,11 @@ services: CERC_NA_ADDRESS: ${CERC_NA_ADDRESS} CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS} CERC_CA_ADDRESS: ${CERC_CA_ADDRESS} - CERC_PRIVATE_KEY_PEER: ${CERC_PRIVATE_KEY_PEER} - CERC_WATCHER_NITRO_PK: ${CERC_WATCHER_NITRO_PK} + CERC_PRIVATE_KEY_PEER: ${CERC_PRIVATE_KEY_PEER:-111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f} + CERC_WATCHER_NITRO_PK: ${CERC_WATCHER_NITRO_PK:-0279651921cd800ac560c21ceea27aab0107b67daf436cdd25ce84cad30159b4} CERC_PEER_ID: ${CERC_PEER_ID} - CERC_UPSTREAM_NITRO_ADDRESS: ${CERC_UPSTREAM_NITRO_ADDRESS} - CERC_UPSTREAM_NITRO_MULTIADDR: ${CERC_UPSTREAM_NITRO_MULTIADDR} + CERC_UPSTREAM_NITRO_ADDRESS: ${CERC_UPSTREAM_NITRO_ADDRESS:-0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE} + CERC_UPSTREAM_NITRO_MULTIADDR: ${CERC_UPSTREAM_NITRO_MULTIADDR:-/dns4/go-nitro/tcp/5005/ws/p2p/16Uiu2HAmSjXJqsyBJgcBUU2HQmykxGseafSatbpq5471XmuaUqyv} CERC_UPSTREAM_NITRO_PAY_AMOUNT: ${CERC_UPSTREAM_NITRO_PAY_AMOUNT} command: ["bash", "./start-server.sh"] volumes: diff --git a/app/data/config/nitro-contracts/deploy.sh b/app/data/config/nitro-contracts/deploy.sh index b48eb869..f4c896f7 100755 --- a/app/data/config/nitro-contracts/deploy.sh +++ b/app/data/config/nitro-contracts/deploy.sh @@ -51,7 +51,6 @@ while true; do fi done -# TODO: Fetch pk from ACCOUNTS_CSV_URL? 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} diff --git a/app/data/stacks/fixturenet-payments/README.md b/app/data/stacks/fixturenet-payments/README.md index 0dfdf360..2525b6d6 100644 --- a/app/data/stacks/fixturenet-payments/README.md +++ b/app/data/stacks/fixturenet-payments/README.md @@ -18,12 +18,10 @@ laconic-so --stack fixturenet-payments build-containers ### Configuration -Create an env file with contents from [.env.fixturenet](./.env.fixturenet) to be used in the next step - -### Deploy the stack: +Deploy the stack: ```bash -laconic-so --stack fixturenet-payments deploy --cluster [CLUSTER_NAME] --env-file up +laconic-so --stack fixturenet-payments deploy --cluster payments up # Exposed on host ports: # 5005: go-nitro node's p2p msg port @@ -35,38 +33,38 @@ laconic-so --stack fixturenet-payments deploy --cluster [CLUSTER_NAME] --env-fil # 3004: MobyMask v3 app ``` -* Check the logs of the MobyMask contract deployment container to get the deployed contract's address and generated root invite link: +Check the logs of the MobyMask contract deployment container to get the deployed contract's address and generated root invite link: - ```bash - docker logs -f $(docker ps -aq --filter name="mobymask-1") - ``` +```bash +docker logs -f $(docker ps -aq --filter name="mobymask-1") +``` -* Check the reverse payment proxy container logs: +Check the reverse payment proxy container logs: - ```bash - docker logs -f $(docker ps -aq --filter name="nitro-reverse-payment-proxy") - ``` +```bash +docker logs -f $(docker ps -aq --filter name="nitro-reverse-payment-proxy") +``` -* Run the ponder app: +Run the ponder app: - ```bash - docker exec -it payments-ponder-app-1 bash -c "pnpm start" - ``` +```bash +docker exec -it payments-ponder-app-1 bash -c "pnpm start" +``` ## Clean up Stop all the services running in background: ```bash -laconic-so --stack fixturenet-payments deploy --cluster [CLUSTER_NAME] down 30 +laconic-so --stack fixturenet-payments deploy --cluster payments down 30 ``` Clear volumes created by this stack: ```bash # List all relevant volumes -docker volume ls -q --filter "name=[CLUSTER_NAME]" +docker volume ls -q --filter "name=[payments" # Remove all the listed volumes -docker volume rm $(docker volume ls -q --filter "name=[CLUSTER_NAME]") +docker volume rm $(docker volume ls -q --filter "name=[payments") ```