Use deployed ERC20 contract in second Ponder indexer

This commit is contained in:
Nabarun 2023-10-19 08:59:08 +05:30
parent 704a0b68d7
commit 24cd88bbbe
3 changed files with 11 additions and 8 deletions

View File

@ -7,11 +7,16 @@ fi
erc20_address_file="/app/deployment/erc20-address.json" 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 if [ -f ${erc20_address_file} ]; then
echo "${erc20_address_file} already exists, skipping ERC20 contract deployment" echo "${erc20_address_file} already exists, skipping ERC20 contract deployment"
cat ${erc20_address_file} cat ${erc20_address_file}
exit
# Keep the container running
tail -f
fi fi
wait_for_chain_endpoint() { wait_for_chain_endpoint() {
@ -46,8 +51,6 @@ wait_for_chain_endpoint
echo "Using CERC_PRIVATE_KEY_DEPLOYER from env" 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} yarn token:deploy:docker --file ${erc20_address_file}
# Keep the container running # Keep the container running

View File

@ -33,7 +33,7 @@ export const config: Config = {
name: "AdventureGold", name: "AdventureGold",
network: "fixturenet", network: "fixturenet",
abi: "./abis/AdventureGold.json", abi: "./abis/AdventureGold.json",
address: "0x32353A6C91143bfd6C7d363B546e62a9A2489A20", address: process.env.ERC20_CONTRACT,
startBlock: 5, startBlock: 5,
maxBlockRange: 100, maxBlockRange: 100,
}, },

View File

@ -31,8 +31,8 @@ Stack components:
# 12:57:03.751 INFO payment Nitro node setup with address 0x67D5b55604d1aF90074FcB69b8C51838FFF84f8d # 12:57:03.751 INFO payment Nitro node setup with address 0x67D5b55604d1aF90074FcB69b8C51838FFF84f8d
# laconic:payments Starting voucher subscription... +0ms # laconic:payments Starting voucher subscription... +0ms
# ... # ...
# 09:58:54.288 INFO payment Creating ledger 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.230 INFO payment Creating payment channel with nitro node 0x660a4bEF3fbC863Fcd8D3CDB39242aE513d7D92e ...
# 09:59:14.329 INFO payment Using payment channel 0x1ff59db391b7a55bed723b930ab53c80e7ce857487c1e58771aa5a0737d71625 # 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 # 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 ```bash
# ... # ...