diff --git a/tools/subgraph-example/README.md b/tools/subgraph-example/README.md index f76806c041..761c1780f2 100644 --- a/tools/subgraph-example/README.md +++ b/tools/subgraph-example/README.md @@ -144,3 +144,18 @@ The easiest way to run a local `graph-node` against `testnet`, `previewnet` or ` 3. In the `subgraph.yaml` file change the dataSources network with to the network you want to index. Also don't forget to update the address (and the startBlock). Advanced info on how to set up an indexer could be found in [The Graph Docs](https://thegraph.com/docs/en/indexing/operating-graph-node/) and the [official graph-node GitHub repository](https://github.com/graphprotocol/graph-node) + + +## TheGraph Node recommended configuration + +| Environment Variable | Description | Default | Recommended Value | +|------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-------------------| +| ETHEREUM_REORG_THRESHOLD | Maximum expected reorg size, if a larger reorg happens, subgraphs might process inconsistent data | 250 | 0 | +| ETHEREUM_POLLING_INTERVAL | how often to poll Ethereum for new blocks (in ms) | 1000 | 2500ms | +| GRAPH_ETHEREUM_TARGET_TRIGGERS_PER_BLOCK_RANGE | The ideal amount of triggers to be processed in a batch. If this is too small it may cause too many requests to the ethereum node, if it is too large it may cause unreasonably expensive calls to the ethereum node and excessive memory usage. | 100 | 10 | +| ETHEREUM_BLOCK_BATCH_SIZE | number of Ethereum blocks to request in parallel. Also limits other parallel requests such such as trace_filter. Defaults to 10. | 10 | 1 | +| GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE | Maximum number of blocks to scan for triggers in each request (Needs to be set explicitly, default varies and does not respect the 1000 value) | 1000 | 1000 | +| GRAPH_ETHEREUM_MAX_EVENT_ONLY_RANGE | Maximum range size for eth.getLogs requests that dont filter on contract address, only event signature (defaults to 500). | 500 | 50 | +| GRAPH_ETHEREUM_BLOCK_INGESTOR_MAX_CONCURRENT_JSON_RPC_CALLS_FOR_TXN_RECEIPTS | The maximum number of concurrent requests made against Ethereum for requesting transaction receipts during block ingestion. Defaults to 1,000. | 1000 | 100 | +| GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER | Specify genesis block number. If the flag is not set, the default value will be 0. | 0 | 0 | + diff --git a/tools/subgraph-example/docker-compose.yml b/tools/subgraph-example/docker-compose.yml index 65d8e267b8..93eadf7444 100644 --- a/tools/subgraph-example/docker-compose.yml +++ b/tools/subgraph-example/docker-compose.yml @@ -21,7 +21,15 @@ services: ipfs: "ipfs:5001" ethereum: "local:http://host.docker.internal:7546" GRAPH_LOG: debug + ETHEREUM_REORG_THRESHOLD: 0 + ETHEREUM_POLLING_INTERVAL: 1000 + GRAPH_ETHEREUM_TARGET_TRIGGERS_PER_BLOCK_RANGE: 10 + ETHEREUM_BLOCK_BATCH_SIZE: 1 + GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE: 1000 + GRAPH_ETHEREUM_MAX_EVENT_ONLY_RANGE: 50 + GRAPH_ETHEREUM_BLOCK_INGESTOR_MAX_CONCURRENT_JSON_RPC_CALLS_FOR_TXN_RECEIPTS: 100 GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER: 1 + restart: unless-stopped ipfs: image: ipfs/go-ipfs:v0.10.0 ports: