Skip to content

Commit

Permalink
Env. vars. for forking (#4308)
Browse files Browse the repository at this point in the history
* adding env params for forking opts

* adding documentation

Co-authored-by: Jeff Wu <[email protected]>
  • Loading branch information
neysofu and jeffywu authored Jan 23, 2023
1 parent 83a3ecc commit 92670f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,7 @@ those.
copying or grafting should take. This limits how long transactions for
such long running operations will be, and therefore helps control bloat
in other tables. Value is in seconds and defaults to 180s.
- `GRAPH_START_BLOCK`: block hash:block number where the forked subgraph will start indexing at.
- `GRAPH_FORK_BASE`: api url for where the graph node will fork from, use `https://api.thegraph.com/subgraphs/id/`
for the hosted service.
- `GRAPH_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 {

#[clap(
long,
env = "GRAPH_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 @@ -217,11 +218,17 @@ pub struct Opt {
#[clap(
long,
value_name = "IPFS_HASH",
env = "GRAPH_DEBUG_FORK",
help = "IPFS hash of the subgraph manifest that you want to fork"
)]
pub debug_fork: Option<String>,

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

Expand Down

0 comments on commit 92670f2

Please sign in to comment.