Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TheGraph environment variables recommended values for HashIO Relay #1744

Merged
merged 3 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading