From e26a05f2c7e33912c875b56dfca71ee158ce4a7a Mon Sep 17 00:00:00 2001 From: Nabarun Gogoi Date: Tue, 17 Oct 2023 16:21:40 +0530 Subject: [PATCH] Add Ponder indexer queries payment config (#586) * Add support to pass ratesFile in config * Change branch for ponder to laconic-esm * Fix repo name for ponder --------- Co-authored-by: Shreerang Kale --- app/data/compose/docker-compose-ponder.yml | 2 ++ app/data/config/ponder/base-rates-config.json | 8 ++++++++ app/data/config/ponder/ponder.indexer.config.ts | 12 ++++++++++++ app/data/config/ponder/ponder.watcher.config.ts | 12 ++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 app/data/config/ponder/base-rates-config.json diff --git a/app/data/compose/docker-compose-ponder.yml b/app/data/compose/docker-compose-ponder.yml index d5308873..03c53040 100644 --- a/app/data/compose/docker-compose-ponder.yml +++ b/app/data/compose/docker-compose-ponder.yml @@ -20,6 +20,7 @@ services: volumes: - ../config/ponder/ponder-start.sh:/app/examples/token-erc20/ponder-start.sh - ../config/ponder/ponder.indexer.config.ts:/app/examples/token-erc20/ponder.config.ts + - ../config/ponder/base-rates-config.json:/app/examples/token-erc20/base-rates-config.json - peers_ids:/peers - nitro_deployment:/nitro - ponder_indexer_nitro_data:/app/examples/token-erc20/.ponder/nitro-db @@ -48,6 +49,7 @@ services: volumes: - ../config/ponder/ponder-start.sh:/app/examples/token-erc20/ponder-start.sh - ../config/ponder/ponder.watcher.config.ts:/app/examples/token-erc20/ponder.config.ts + - ../config/ponder/base-rates-config.json:/app/examples/token-erc20/base-rates-config.json - peers_ids:/peers - nitro_deployment:/nitro - ponder_watcher_nitro_data:/app/examples/token-erc20/.ponder/nitro-db diff --git a/app/data/config/ponder/base-rates-config.json b/app/data/config/ponder/base-rates-config.json new file mode 100644 index 00000000..5012f980 --- /dev/null +++ b/app/data/config/ponder/base-rates-config.json @@ -0,0 +1,8 @@ +{ + "freeQueriesLimit": 10, + "freeQueriesList": [], + "queries": { + "getLogEvents": "50" + }, + "mutations": {} +} diff --git a/app/data/config/ponder/ponder.indexer.config.ts b/app/data/config/ponder/ponder.indexer.config.ts index ddce62d2..218417c0 100644 --- a/app/data/config/ponder/ponder.indexer.config.ts +++ b/app/data/config/ponder/ponder.indexer.config.ts @@ -49,5 +49,17 @@ export const config: Config = { contractAddresses, relayMultiAddr: process.env.RELAY_MULTIADDR!, store: "./.ponder/nitro-db", + payments: { + cache: { + maxAccounts: 1000, + accountTTLInSecs: 1800, + maxVouchersPerAccount: 1000, + voucherTTLInSecs: 300, + maxPaymentChannels: 10000, + paymentChannelTTLInSecs: 1800, + }, + ratesFile: "./base-rates-config.json", + requestTimeoutInSecs: 10, + }, }, }; diff --git a/app/data/config/ponder/ponder.watcher.config.ts b/app/data/config/ponder/ponder.watcher.config.ts index 72c795cc..a5615f86 100644 --- a/app/data/config/ponder/ponder.watcher.config.ts +++ b/app/data/config/ponder/ponder.watcher.config.ts @@ -42,5 +42,17 @@ export const config: Config = { contractAddresses, relayMultiAddr: process.env.RELAY_MULTIADDR!, store: "./.ponder/nitro-db", + payments: { + cache: { + maxAccounts: 1000, + accountTTLInSecs: 1800, + maxVouchersPerAccount: 1000, + voucherTTLInSecs: 300, + maxPaymentChannels: 10000, + paymentChannelTTLInSecs: 1800, + }, + ratesFile: "./base-rates-config.json", + requestTimeoutInSecs: 10, + }, } };