-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move docs out of readme (#427)
More docs to come. This is mostly restructuring the ones that already existed (and updates/removes outdated information).
- Loading branch information
Showing
4 changed files
with
34 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Configuration | ||
|
||
Nearly all configuration is done via a single JSON configuration file, the path of which must be given as the first argument to the graph-gateway executable. e.g. `graph-gateway path/to/config.json`. The structure of the configuration file is defined in [config.rs](../graph-gateway/src/config.rs) (`graph_gateway::config::Config`). | ||
|
||
Logs filtering is set using the `RUST_LOG` environment variable. For example, if you would like to set the default log level to `info`, but want to set the log level for the `graph_gateway` module to `debug`, you would use `RUST_LOG="info,graph_gateway=debug"`. More details on evironment variable filtering: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Overview | ||
|
||
At a high level the gateway does 2 things: | ||
|
||
1. Route client requests to indexers | ||
2. Facilitate payments to indexers | ||
|
||
## Query Lifecycle | ||
|
||
1. The client GraphQL request arrives, including an auth token (API key or query key). The auth token is used to check associated allowlists, payment status, etc. | ||
2. Indexers are selected from the set allocated to the subgraph deployment being queried. For queries by subgraph ID (GNS ID), indexers are selected across the allocations on all associated deployments (subgraph versions). | ||
3. The request budget is determined based on the fees of available indexers and a target average fees per query. | ||
4. A subset of up to 3 indexers are selected based on a variety of selection factors including reliability, latency, subgraph version (if applicable), etc. | ||
5. The request is made deterministic by replacing block numbers with hashes for the chain being indexed by the subgraph. | ||
6. The request is forwarded to each selected indexer. | ||
7. Each indexer’s response, latency, etc. is fed back into indexer selection. | ||
8. The first valid indexer response is returned it to the client. If no indexers return a valid response goto step 3. | ||
|
||
## Design Principles | ||
|
||
- The gateway is designed to be a reliable system, to compensate for indexers being relatively unreliable. Indexers may become unresponsive, malicious, or otherwise unsuitable for serving queries at any time without warning. It is the responsibility of the gateway to maintain the highest possible quality of service(QoS) under these conditions. | ||
|
||
- The gateway's primary responsibilities are to serve client requests and to facilitate indexer payments. Other responsibilities, though important, are secondary and therefore their failure modes must have minimal impact on the primary responsibilities. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters