Skip to content

Commit

Permalink
TheGraph environment variables recommended values for HashIO Relay (#…
Browse files Browse the repository at this point in the history
…1744)

* TheGraph node environment variables recommended values for HashIO Relay

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>

* ETHEREUM_REORG_THRESHOLD to 0

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>

* update doc so ETHEREUM_POLLING_INTERVAL is without ms and to 1000 that way it works better

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>

---------

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>
Signed-off-by: ebadiere <ebadiere@gmail.com>
  • Loading branch information
AlfredoG87 authored and ebadiere committed Sep 20, 2023
1 parent ed187f7 commit 8ceba0f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/subgraph-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

8 changes: 8 additions & 0 deletions tools/subgraph-example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8ceba0f

Please sign in to comment.