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

Feature: add env based config for forking options #3408

Closed
Closed
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
4 changes: 4 additions & 0 deletions docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,7 @@ happens, subgraphs might process inconsistent data. Defaults to 250.
identified as unused, `graph-node` will wait at least this long before
actually deleting the data (value is in minutes, defaults to 360, i.e. 6
hours)
- `START_BLOCK`: block hash:block number where the forked subgraph will start indexing at
- `FORK_BASE`: api url for where the graph node will fork from, use `https://api.thegraph.com/subgraphs/id/`
for the hosted service.
- `DEBUG_FORK`: the IPFS hash id of the subgraph to fork
9 changes: 8 additions & 1 deletion node/src/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub struct Opt {

#[structopt(
long,
env = "START_BLOCK",
value_name = "BLOCK_HASH:BLOCK_NUMBER",
help = "block hash and number that the subgraph passed will start indexing at"
)]
Expand Down Expand Up @@ -207,11 +208,17 @@ pub struct Opt {
#[structopt(
long,
value_name = "IPFS_HASH",
env = "DEBUG_FORK",
help = "IPFS hash of the subgraph manifest that you want to fork"
)]
pub debug_fork: Option<String>,

#[structopt(long, value_name = "URL", help = "Base URL for forking subgraphs")]
#[structopt(
long,
value_name = "URL",
env = "FORK_BASE",
help = "Base URL for forking subgraphs"
)]
pub fork_base: Option<String>,
}

Expand Down