-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run multiple Ponder indexers in payment stack (#588)
* Separate ponder indexer and ponder watcher and add second ponder indexer * Handle review changes * Update config to point ponder watcher to indexer 2 to indexer 1 * Update Ponder demo * Use deployed ERC20 contract in second Ponder indexer * Add order by timestamp in Ponder watcher app entities query * Upgrade go-nitro version to v0.1.2-ts-port-0.1.9 * Decrease Ponder start block to process contract transfer event at deployment --------- Co-authored-by: Shreerang Kale <[email protected]>
- Loading branch information
1 parent
2402220
commit 4a90ced
Showing
11 changed files
with
326 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
version: '3.7' | ||
|
||
services: | ||
ponder-app-watcher: | ||
hostname: ponder-app-watcher | ||
depends_on: | ||
- ponder-app-indexer-1 | ||
restart: unless-stopped | ||
image: cerc/ponder:local | ||
working_dir: /app/examples/token-erc20 | ||
environment: | ||
CERC_PONDER_CHAIN_ID: ${PONDER_CHAIN_ID:-99} | ||
CERC_PONDER_NITRO_PK: ${CERC_PONDER_WATCHER_NITRO_PK:-febb3b74b0b52d0976f6571d555f4ac8b91c308dfa25c7b58d1e6a7c3f50c781} | ||
CERC_PONDER_NITRO_CHAIN_PK: ${CERC_PONDER_WATCHER_NITRO_CHAIN_PK:-be4aa664815ea3bc3d63118649a733f6c96b243744310806ecb6d96359ab62cf} | ||
CERC_PONDER_NITRO_CHAIN_URL: ${CERC_PONDER_NITRO_CHAIN_URL:-http://fixturenet-eth-geth-1:8546} | ||
CERC_RELAY_MULTIADDR: ${CERC_RELAY_MULTIADDR} | ||
CERC_INDEXER_GQL_ENDPOINT: ${CERC_INDEXER_GQL_ENDPOINT:-http://ponder-app-indexer-2:42070/graphql} | ||
CERC_INDEXER_NITRO_ADDRESS: ${CERC_INDEXER_NITRO_ADDRESS:-0xB2B22ec3889d11f2ddb1A1Db11e80D20EF367c01} | ||
CERC_INDEXER_NITRO_PAY_AMOUNT: ${CERC_INDEXER_NITRO_PAY_AMOUNT:-50} | ||
command: ["bash", "./ponder-start.sh"] | ||
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 | ||
- erc20_deployment:/erc20 | ||
- ponder_watcher_nitro_data:/app/examples/token-erc20/.ponder/nitro-db | ||
ports: | ||
- "127.0.0.1:42069:42069" | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
|
||
volumes: | ||
peers_ids: | ||
nitro_deployment: | ||
erc20_deployment: | ||
ponder_watcher_nitro_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { type Config, AppMode } from "@ponder/core"; | ||
|
||
import contractAddresses from "./nitro-addresses.json" assert { type: "json" }; | ||
|
||
export const config: Config = { | ||
networks: [ | ||
{ | ||
name: "fixturenet", | ||
chainId: Number(process.env.PONDER_CHAIN_ID), | ||
indexerUrl: process.env.INDEXER_GQL_ENDPOINT, | ||
maxRpcRequestConcurrency: 1, | ||
pollingInterval: 5000, | ||
payments: { | ||
nitro: { | ||
address: process.env.INDEXER_NITRO_ADDRESS!, | ||
fundingAmounts: { | ||
// TODO: Pass amounts from env | ||
directFund: "1000000000000", | ||
virtualFund: "1000000000", | ||
}, | ||
}, | ||
paidRPCMethods: [ | ||
"eth_getLogs", | ||
"eth_getBlockByNumber", | ||
"eth_getBlockByHash", | ||
], | ||
amount: process.env.UPSTREAM_NITRO_PAY_AMOUNT!, | ||
}, | ||
}, | ||
], | ||
contracts: [ | ||
{ | ||
name: "AdventureGold", | ||
network: "fixturenet", | ||
abi: "./abis/AdventureGold.json", | ||
address: process.env.ERC20_CONTRACT, | ||
startBlock: 1, | ||
maxBlockRange: 100, | ||
}, | ||
], | ||
options: { | ||
mode: AppMode.Indexer, | ||
}, | ||
nitro: { | ||
privateKey: process.env.PONDER_NITRO_PK!, | ||
chainPrivateKey: process.env.PONDER_NITRO_CHAIN_PK!, | ||
chainUrl: process.env.PONDER_NITRO_CHAIN_URL!, | ||
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, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.