@@ -100,33 +100,52 @@ time the configuration is changed to make sure that the connection pools
100
100
are what is expected. Here, ` $all_nodes ` should be a list of all the node
101
101
names that will use this configuration file.
102
102
103
- ## Configuring Ethereum Providers
103
+ ## Configuring Chains
104
104
105
- The ` [chains] ` section controls the ethereum providers that ` graph-node `
105
+ The ` [chains] ` section controls the providers that ` graph-node `
106
106
connects to, and where blocks and other metadata for each chain are
107
107
stored. The section consists of the name of the node doing block ingestion
108
- (currently not used), and a list of chains. The configuration for a chain
109
- ` name ` is specified in the section ` [chains.<name>] ` , and consists of the
110
- ` shard ` where chain data is stored and a list of providers for that
111
- chain. For each provider, the following information must be given:
108
+ (currently not used), and a list of chains.
112
109
113
- - ` label ` : a label that is used when logging information about that
114
- provider (not implemented yet)
110
+ The configuration for a chain ` name ` is specified in the section
111
+ ` [chains.<name>] ` , with the following:
112
+
113
+ - ` shard ` : where chain data is stored
114
+ - ` protocol ` : the protocol type being indexed, default ` ethereum `
115
+ (alternatively ` near ` , ` cosmos ` ,` arweave ` ,` starknet ` )
116
+ - ` polling_interval ` : the polling interval for the block ingestor (default 500ms)
117
+ - ` provider ` : a list of providers for that chain
118
+
119
+ A ` provider ` is an object with the following characteristics:
120
+
121
+ - ` label ` : the name of the provider, which will appear in logs
122
+ - ` details ` : provider details
123
+
124
+ ` details ` includes the following:
125
+
126
+ - ` type ` : one of ` web3 ` (default), ` firehose ` , ` substreams ` or ` web3call `
115
127
- ` transport ` : one of ` rpc ` , ` ws ` , and ` ipc ` . Defaults to ` rpc ` .
116
128
- ` url ` : the URL for the provider
117
129
- ` features ` : an array of features that the provider supports, either empty
118
- or any combination of ` traces ` and ` archive `
130
+ or any combination of ` traces ` and ` archive ` for Web3 providers, or
131
+ ` compression ` and ` filters ` for Firehose providers
119
132
- ` headers ` : HTTP headers to be added on every request. Defaults to none.
120
133
- ` limit ` : the maximum number of subgraphs that can use this provider.
121
134
Defaults to unlimited. At least one provider should be unlimited,
122
135
otherwise ` graph-node ` might not be able to handle all subgraphs. The
123
136
tracking for this is approximate, and a small amount of deviation from
124
137
this value should be expected. The deviation will be less than 10.
138
+ - ` token ` : bearer token, for Firehose and Substreams providers
139
+
140
+ Note that for backwards compatibility, Web3 provider ` details ` can be specified at the "top level" of
141
+ the ` provider ` .
125
142
126
- The following example configures two chains, ` mainnet ` and ` kovan ` , where
127
- blocks for ` mainnet ` are stored in the ` vip ` shard and blocks for ` kovan `
143
+ The following example configures three chains, ` mainnet ` , ` sepolia ` and ` near-mainnet ` , where
144
+ blocks for ` mainnet ` are stored in the ` vip ` shard and blocks for ` sepolia `
128
145
are stored in the primary shard. The ` mainnet ` chain can use two different
129
- providers, whereas ` kovan ` only has one provider.
146
+ providers, whereas ` sepolia ` only has one provider. The ` near-mainnet ` chain expects data from
147
+ the ` near ` protocol via a Firehose, where the Firehose offers the ` compression ` and ` filters `
148
+ optimisations.
130
149
131
150
``` toml
132
151
[chains ]
@@ -137,9 +156,14 @@ provider = [
137
156
{ label = " mainnet1" , url = " http://.." , features = [], headers = { Authorization = " Bearer foo" } },
138
157
{ label = " mainnet2" , url = " http://.." , features = [ " archive" , " traces" ] }
139
158
]
140
- [chains .kovan ]
159
+ [chains .sepolia ]
141
160
shard = " primary"
142
- provider = [ { label = " kovan" , url = " http://.." , features = [] } ]
161
+ provider = [ { label = " sepolia" , url = " http://.." , features = [] } ]
162
+
163
+ [chains .near-mainnet ]
164
+ shard = " blocks_b"
165
+ protocol = " near"
166
+ provider = [ { label = " near" , details = { type = " firehose" , url = " https://.." , token = " " , features = [" compression" , " filters" ] } } ]
143
167
```
144
168
145
169
### Controlling the number of subgraphs using a provider
0 commit comments