From aba8d086f61b39ab5500b773e477298daf94d508 Mon Sep 17 00:00:00 2001 From: Nabarun Date: Wed, 4 Oct 2023 18:08:41 +0530 Subject: [PATCH] Changes required for ponder container and upgrade ts-nitro version --- app/data/compose/docker-compose-ponder.yml | 2 +- .../go-nitro/run-reverse-payment-proxy.sh | 2 +- app/data/config/ponder/ponder-start.sh | 2 ++ app/data/config/ponder/ponder.config.ts | 23 +++++++++++++++---- app/data/stacks/fixturenet-payments/stack.yml | 4 ++-- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/data/compose/docker-compose-ponder.yml b/app/data/compose/docker-compose-ponder.yml index 62d46b47..73cf14be 100644 --- a/app/data/compose/docker-compose-ponder.yml +++ b/app/data/compose/docker-compose-ponder.yml @@ -10,7 +10,7 @@ services: 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:8545} + CERC_PONDER_NITRO_CHAIN_URL: ${CERC_PONDER_NITRO_CHAIN_URL:-http://fixturenet-eth-geth-1:8546} CERC_RELAY_MULTIADDR: ${CERC_RELAY_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} diff --git a/app/data/config/go-nitro/run-reverse-payment-proxy.sh b/app/data/config/go-nitro/run-reverse-payment-proxy.sh index f884f20a..b0cd1ba5 100755 --- a/app/data/config/go-nitro/run-reverse-payment-proxy.sh +++ b/app/data/config/go-nitro/run-reverse-payment-proxy.sh @@ -11,4 +11,4 @@ echo "Using PROXY_NITRO_ENDPOINT ${PROXY_NITRO_ENDPOINT}" echo "Using PROXY_DESTINATION_URL ${PROXY_DESTINATION_URL}" echo "Using PROXY_COST_PER_BYTE ${PROXY_COST_PER_BYTE}" -./start-reverse-payment-proxy -proxyaddress ${PROXY_ADDRESS} -nitroendpoint=${PROXY_NITRO_ENDPOINT} -destinationurl=${PROXY_DESTINATION_URL} -costperbyte ${PROXY_COST_PER_BYTE} -enablepaidrpcmethods +./proxy -proxyaddress ${PROXY_ADDRESS} -nitroendpoint=${PROXY_NITRO_ENDPOINT} -destinationurl=${PROXY_DESTINATION_URL} -costperbyte ${PROXY_COST_PER_BYTE} -enablepaidrpcmethods diff --git a/app/data/config/ponder/ponder-start.sh b/app/data/config/ponder/ponder-start.sh index 5fa5c491..e928c73c 100755 --- a/app/data/config/ponder/ponder-start.sh +++ b/app/data/config/ponder/ponder-start.sh @@ -55,6 +55,8 @@ if [ -z "$CERC_RELAY_MULTIADDR" ]; then 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" diff --git a/app/data/config/ponder/ponder.config.ts b/app/data/config/ponder/ponder.config.ts index c3a80830..ceaa3161 100644 --- a/app/data/config/ponder/ponder.config.ts +++ b/app/data/config/ponder/ponder.config.ts @@ -9,6 +9,24 @@ export const config: Config = { chainId: Number(process.env.PONDER_CHAIN_ID), rpcUrl: process.env.PONDER_RPC_URL_1, maxRpcRequestConcurrency: 1, + pollingInterval: 5000, + payments: { + nitro: { + address: process.env.CERC_UPSTREAM_NITRO_ADDRESS!, + multiAddr: process.env.CERC_UPSTREAM_NITRO_MULTIADDR!, + fundingAmounts: { + // TODO: Pass amounts from env + directFund: "1000000000000", + virtualFund: "1000000000", + }, + }, + paidRPCMethods: [ + "eth_getLogs", + "eth_getBlockByNumber", + "eth_getBlockByHash", + ], + amount: process.env.CERC_UPSTREAM_NITRO_PAY_AMOUNT!, + }, }, ], contracts: [ @@ -28,10 +46,5 @@ export const config: Config = { contractAddresses, relayMultiAddr: process.env.CERC_RELAY_MULTIADDR!, store: "./.ponder/nitro-db", - rpcNitroNode: { - address: process.env.CERC_UPSTREAM_NITRO_ADDRESS!, - multiAddr: process.env.CERC_UPSTREAM_NITRO_MULTIADDR!, - }, - payAmount: process.env.CERC_UPSTREAM_NITRO_PAY_AMOUNT!, }, }; diff --git a/app/data/stacks/fixturenet-payments/stack.yml b/app/data/stacks/fixturenet-payments/stack.yml index 7e5be82b..63e73389 100644 --- a/app/data/stacks/fixturenet-payments/stack.yml +++ b/app/data/stacks/fixturenet-payments/stack.yml @@ -8,8 +8,8 @@ repos: - git.vdb.to/cerc-io/ipld-eth-db@v5 - git.vdb.to/cerc-io/ipld-eth-server@v1.11.6-statediff-v5 # nitro repos - - github.com/cerc-io/ts-nitro@v0.1.12 - - github.com/cerc-io/go-nitro@v0.1.0-ts-port-0.1.4 # TODO: Update after fixes + - github.com/cerc-io/ts-nitro@v0.1.13 + - github.com/cerc-io/go-nitro@parse-rpc-method # TODO: Update after fixes # mobymask watcher repos - github.com/cerc-io/watcher-ts@v0.2.61 - github.com/cerc-io/mobymask-v2-watcher-ts@v3 # TODO: Update after fixes