From 24cd88bbbe7e3df97595cabb00989a26e1c83194 Mon Sep 17 00:00:00 2001 From: Nabarun Date: Thu, 19 Oct 2023 08:59:08 +0530 Subject: [PATCH] Use deployed ERC20 contract in second Ponder indexer --- app/data/config/ponder/deploy-erc20-contract.sh | 11 +++++++---- app/data/config/ponder/ponder.indexer-2.config.ts | 2 +- app/data/stacks/fixturenet-payments/ponder-demo.md | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/data/config/ponder/deploy-erc20-contract.sh b/app/data/config/ponder/deploy-erc20-contract.sh index 4387bc19..ea8111bb 100755 --- a/app/data/config/ponder/deploy-erc20-contract.sh +++ b/app/data/config/ponder/deploy-erc20-contract.sh @@ -7,11 +7,16 @@ fi erc20_address_file="/app/deployment/erc20-address.json" -# Check and exit if a deployment already exists (on restarts) +echo ETH_RPC_URL=${CERC_ETH_RPC_ENDPOINT} > .env +echo ACCOUNT_PRIVATE_KEY=${CERC_PRIVATE_KEY_DEPLOYER} >> .env + +# Check and keep container running if a deployment already exists (on restarts) if [ -f ${erc20_address_file} ]; then echo "${erc20_address_file} already exists, skipping ERC20 contract deployment" cat ${erc20_address_file} - exit + + # Keep the container running + tail -f fi wait_for_chain_endpoint() { @@ -46,8 +51,6 @@ wait_for_chain_endpoint echo "Using CERC_PRIVATE_KEY_DEPLOYER from env" -echo ETH_RPC_URL=${CERC_ETH_RPC_ENDPOINT} > .env -echo ACCOUNT_PRIVATE_KEY=${CERC_PRIVATE_KEY_DEPLOYER} >> .env yarn token:deploy:docker --file ${erc20_address_file} # Keep the container running diff --git a/app/data/config/ponder/ponder.indexer-2.config.ts b/app/data/config/ponder/ponder.indexer-2.config.ts index 7195b3da..7d69dc5b 100644 --- a/app/data/config/ponder/ponder.indexer-2.config.ts +++ b/app/data/config/ponder/ponder.indexer-2.config.ts @@ -33,7 +33,7 @@ export const config: Config = { name: "AdventureGold", network: "fixturenet", abi: "./abis/AdventureGold.json", - address: "0x32353A6C91143bfd6C7d363B546e62a9A2489A20", + address: process.env.ERC20_CONTRACT, startBlock: 5, maxBlockRange: 100, }, diff --git a/app/data/stacks/fixturenet-payments/ponder-demo.md b/app/data/stacks/fixturenet-payments/ponder-demo.md index 629300ca..1dc01533 100644 --- a/app/data/stacks/fixturenet-payments/ponder-demo.md +++ b/app/data/stacks/fixturenet-payments/ponder-demo.md @@ -31,8 +31,8 @@ Stack components: # 12:57:03.751 INFO payment Nitro node setup with address 0x67D5b55604d1aF90074FcB69b8C51838FFF84f8d # laconic:payments Starting voucher subscription... +0ms # ... - # 09:58:54.288 INFO payment Creating ledger channel with nitro node 0x660a4bEF3fbC863Fcd8D3CDB39242aE513d7D92e - # 09:59:14.230 INFO payment Creating payment channel with nitro node 0x660a4bEF3fbC863Fcd8D3CDB39242aE513d7D92e + # 09:58:54.288 INFO payment Creating ledger channel with nitro node 0x660a4bEF3fbC863Fcd8D3CDB39242aE513d7D92e ... + # 09:59:14.230 INFO payment Creating payment channel with nitro node 0x660a4bEF3fbC863Fcd8D3CDB39242aE513d7D92e ... # 09:59:14.329 INFO payment Using payment channel 0x1ff59db391b7a55bed723b930ab53c80e7ce857487c1e58771aa5a0737d71625 ``` @@ -126,7 +126,7 @@ Stack components: # 11:23:22.436 INFO server Started responding as healthy ``` -* Check the terminal of the second indexer Ponder app. Logs of payment for `eth_getLogs` queries can be seen: +* Check the terminal of the second indexer Ponder app. Logs of payment for `getLogEvents` queries can be seen: ```bash # ...