Skip to content

Commit

Permalink
node: Refactor config to accept Firehose providers (and made Provider…
Browse files Browse the repository at this point in the history
… a little bit more extensible) (graphprotocol#2647)

There is a backward compatible handling of config that at some point should be converted to the new syntax form. The new syntax form is

```
{ label = "node0", details = { type = "web3", transport = "rpc", url = "...", features = [...] } }
```

While a Firehose provider now looks like:

```
{ label = "firehose0", details = { type = "firehose", url = "..." } }
```

This is for now undocumented and is first step towards Firehose integration in the codebase directly.
  • Loading branch information
maoueh authored and Matthieu Vachon committed Aug 11, 2021
1 parent 505a725 commit 6b50db1
Show file tree
Hide file tree
Showing 3 changed files with 521 additions and 65 deletions.
68 changes: 68 additions & 0 deletions node/resources/tests/full_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[general]
query = "query_node_.*"

[store]
[store.primary]
connection = "postgresql://postgres:1.1.1.1@test/primary"
pool_size = [
{ node = "index_node_1_.*", size = 2 },
{ node = "index_node_2_.*", size = 10 },
{ node = "index_node_3_.*", size = 10 },
{ node = "index_node_4_.*", size = 2 },
{ node = "query_node_.*", size = 10 }
]

[store.shard_a]
connection = "postgresql://postgres:1.1.1.1@test/shard-a"
pool_size = [
{ node = "index_node_1_.*", size = 2 },
{ node = "index_node_2_.*", size = 10 },
{ node = "index_node_3_.*", size = 10 },
{ node = "index_node_4_.*", size = 2 },
{ node = "query_node_.*", size = 10 }
]

[deployment]
# Studio subgraphs
[[deployment.rule]]
match = { name = "^prefix/" }
shard = "shard_a"
indexers = [ "index_prefix_0",
"index_prefix_1" ]

[[deployment.rule]]
match = { name = "^custom/.*" }
indexers = [ "index_custom_0" ]

[[deployment.rule]]
shard = "shard_a"
indexers = [ "index_node_1_a",
"index_node_2_a",
"index_node_3_a" ]

[chains]
ingestor = "index_0"

[chains.mainnet]
shard = "primary"
provider = [
{ label = "mainnet-0", url = "http://rpc.mainnet.io", features = ["archive", "traces"] }
]

[chains.ropsten]
shard = "primary"
provider = [
{ label = "ropsten-0", url = "http://rpc.ropsten.io", transport = "rpc", features = ["archive", "traces"] }
]

[chains.goerli]
shard = "primary"
provider = [
{ label = "goerli-0", url = "http://rpc.goerli.io", transport = "ipc", features = ["archive"] }
]

[chains.kovan]
shard = "primary"
provider = [
{ label = "kovan-0", url = "http://rpc.kovan.io", transport = "ws", features = [] }
]
Loading

0 comments on commit 6b50db1

Please sign in to comment.