Skip to content

Commit b3b74d8

Browse files
committed
docs: Rename sharding.md to config.md
Also document configuring http headers.
1 parent 54c3e30 commit b3b74d8

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

docs/sharding.md renamed to docs/config.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
# Support for Multiple Databases (experimental)
1+
# Advanced Graph Node configuration
22

33
**This feature is considered experimental. In particular, the format of the configuration file might still change in backwards-incompatible ways**
44

5+
A TOML configuration file can be used to set more complex configurations than those exposed in the
6+
CLI. The location of the file is passed with the `--config` command line switch. When using a
7+
configuration file, it is not possible to use the options `--postgres-url`,
8+
`--postgres-secondary-hosts`, and `--postgres-host-weights`.
9+
10+
The TOML file consists of four sections:
11+
* `[chains]` sets the endpoints to blockchain clients.
12+
* `[store]` describes the available databases.
13+
* `[ingestor]` sets the name of the node responsible for block ingestion.
14+
* `[deployment]` describes how to place newly deployed subgraphs.
15+
16+
## Configuring Multiple Databases
17+
518
For most use cases, a single Postgres database is sufficient to support a
619
`graph-node` instance. When a `graph-node` instance outgrows a single
720
Postgres database, it is possible to split the storage of `graph-node`'s
821
data across multiple Postgres databases. All databases together form the
922
store of the `graph-node` instance. Each individual database is called a
1023
_shard_.
1124

12-
Support for multiple databases is configured through a TOML configuration
13-
file. The location of the file is passed with the `--config` command line
14-
switch. When using a configuration file, it is not possible to use the
15-
options `--postgres-url`, `--postgres-secondary-hosts`, and
16-
`--postgres-host-weights`.
17-
18-
The TOML file consists of three sections:
19-
* `[store]` describes the available databases
20-
* `[ingestor]` sets the name of the node responsible for block ingestion
21-
* `[deployment]` describes how to place newly deployed subgraphs
22-
23-
## Configuring Multiple Databases
24-
2525
The `[store]` section must always have a primary shard configured, which
2626
must be called `primary`. Each shard can have additional read replicas that
2727
are used for responding to queries. Only queries are processed by read
@@ -108,10 +108,11 @@ chain. For each provider, the following information must be given:
108108

109109
* `label`: a label that is used when logging information about that
110110
provider (not implemented yet)
111-
* `transport`: one of `rpc`, `ws`, and `ipc`. Defaults to `rpc`
111+
* `transport`: one of `rpc`, `ws`, and `ipc`. Defaults to `rpc`.
112112
* `url`: the URL for the provider
113113
* `features`: an array of features that the provider supports, either empty
114114
or any combination of `traces` and `archive`
115+
* `headers`: HTTP headers to be added on every request. Defaults to none.
115116

116117
The following example configures two chains, `mainnet` and `kovan`, where
117118
blocks for `mainnet` are stored in the `vip` shard and blocks for `kovan`
@@ -124,7 +125,7 @@ ingestor = "block_ingestor_node"
124125
[chains.mainnet]
125126
shard = "vip"
126127
provider = [
127-
{ label = "mainnet1", url = "http://..", features = [] },
128+
{ label = "mainnet1", url = "http://..", features = [], headers = { Authorization = "Bearer foo" } },
128129
{ label = "mainnet2", url = "http://..", features = [ "archive", "traces" ] }
129130
]
130131
[chains.kovan]

0 commit comments

Comments
 (0)