forked from cerc-io/stack-orchestrator
Nabarun Gogoi
0bec51e96a
* Use ponder in watcher mode and indexer mode separately in payments stack * Refactor config file and configure env variables for watcher mode * Update demo.md for payments stack * Handle review changes * Setup config to pay for watcher to indexer GQL queries * Fix config in stack for making payments in watcher ponder app * Update demo for payment from watcher to indexer mode Ponder apps * Use laconic-esm brannch for ponder --------- Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
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),
|
|
rpcUrl: process.env.PONDER_RPC_URL_1,
|
|
maxRpcRequestConcurrency: 1,
|
|
pollingInterval: 5000,
|
|
payments: {
|
|
nitro: {
|
|
address: process.env.UPSTREAM_NITRO_ADDRESS!,
|
|
multiAddr: process.env.UPSTREAM_NITRO_MULTIADDR!,
|
|
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: "0x32353A6C91143bfd6C7d363B546e62a9A2489A20",
|
|
startBlock: 5,
|
|
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",
|
|
},
|
|
};
|