Skip to content

Commit 7d8abd8

Browse files
authored
TheGraph environment variables recommended values for HashIO Relay (#1744)
* TheGraph node environment variables recommended values for HashIO Relay Signed-off-by: Alfredo Gutierrez <[email protected]> * ETHEREUM_REORG_THRESHOLD to 0 Signed-off-by: Alfredo Gutierrez <[email protected]> * update doc so ETHEREUM_POLLING_INTERVAL is without ms and to 1000 that way it works better Signed-off-by: Alfredo Gutierrez <[email protected]> --------- Signed-off-by: Alfredo Gutierrez <[email protected]>
1 parent 993bf0c commit 7d8abd8

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tools/subgraph-example/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,18 @@ The easiest way to run a local `graph-node` against `testnet`, `previewnet` or `
144144
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).
145145

146146
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)
147+
148+
149+
## TheGraph Node recommended configuration
150+
151+
| Environment Variable | Description | Default | Recommended Value |
152+
|------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-------------------|
153+
| ETHEREUM_REORG_THRESHOLD | Maximum expected reorg size, if a larger reorg happens, subgraphs might process inconsistent data | 250 | 0 |
154+
| ETHEREUM_POLLING_INTERVAL | how often to poll Ethereum for new blocks (in ms) | 1000 | 2500ms |
155+
| 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 |
156+
| 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 |
157+
| 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 |
158+
| 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 |
159+
| 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 |
160+
| GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER | Specify genesis block number. If the flag is not set, the default value will be 0. | 0 | 0 |
161+

tools/subgraph-example/docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ services:
2121
ipfs: "ipfs:5001"
2222
ethereum: "local:http://host.docker.internal:7546"
2323
GRAPH_LOG: debug
24+
ETHEREUM_REORG_THRESHOLD: 0
25+
ETHEREUM_POLLING_INTERVAL: 1000
26+
GRAPH_ETHEREUM_TARGET_TRIGGERS_PER_BLOCK_RANGE: 10
27+
ETHEREUM_BLOCK_BATCH_SIZE: 1
28+
GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE: 1000
29+
GRAPH_ETHEREUM_MAX_EVENT_ONLY_RANGE: 50
30+
GRAPH_ETHEREUM_BLOCK_INGESTOR_MAX_CONCURRENT_JSON_RPC_CALLS_FOR_TXN_RECEIPTS: 100
2431
GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER: 1
32+
restart: unless-stopped
2533
ipfs:
2634
image: ipfs/go-ipfs:v0.10.0
2735
ports:

0 commit comments

Comments
 (0)