Skip to content

Commit 2ea9cb8

Browse files
authored
Fixes for Indexing Section (#971)
* removing section * amending language * Update website/src/pages/en/indexing/tooling/graph-node.mdx * format fix
1 parent 039319d commit 2ea9cb8

File tree

2 files changed

+6
-37
lines changed

2 files changed

+6
-37
lines changed

website/src/pages/en/indexing/overview.mdx

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -708,42 +708,6 @@ Note that supported action types for allocation management have different input
708708

709709
Cost models provide dynamic pricing for queries based on market and query attributes. The Indexer Service shares a cost model with the gateways for each Subgraph for which they intend to respond to queries. The gateways, in turn, use the cost model to make Indexer selection decisions per query and to negotiate payment with chosen Indexers.
710710

711-
#### Agora
712-
713-
The Agora language provides a flexible format for declaring cost models for queries. An Agora price model is a sequence of statements that execute in order for each top-level query in a GraphQL query. For each top-level query, the first statement which matches it determines the price for that query.
714-
715-
A statement is comprised of a predicate, which is used for matching GraphQL queries, and a cost expression which when evaluated outputs a cost in decimal GRT. Values in the named argument position of a query may be captured in the predicate and used in the expression. Globals may also be set and substituted in for placeholders in an expression.
716-
717-
Example cost model:
718-
719-
```
720-
# This statement captures the skip value,
721-
# uses a boolean expression in the predicate to match specific queries that use `skip`
722-
# and a cost expression to calculate the cost based on the `skip` value and the SYSTEM_LOAD global
723-
query { pairs(skip: $skip) { id } } when $skip > 2000 => 0.0001 * $skip * $SYSTEM_LOAD;
724-
725-
# This default will match any GraphQL expression.
726-
# It uses a Global substituted into the expression to calculate cost
727-
default => 0.1 * $SYSTEM_LOAD;
728-
```
729-
730-
Example query costing using the above model:
731-
732-
| Query | Price |
733-
| ---------------------------------------------------------------------------- | ------- |
734-
| { pairs(skip: 5000) { id } } | 0.5 GRT |
735-
| { tokens { symbol } } | 0.1 GRT |
736-
| { pairs(skip: 5000) { id } tokens { symbol } } | 0.6 GRT |
737-
738-
#### Applying the cost model
739-
740-
Cost models are applied via the Indexer CLI, which passes them to the Indexer Management API of the Indexer agent for storing in the database. The Indexer Service will then pick them up and serve the cost models to gateways whenever they ask for them.
741-
742-
```sh
743-
indexer cost set variables '{ "SYSTEM_LOAD": 1.4 }'
744-
indexer cost set model my_model.agora
745-
```
746-
747711
## Interacting with the network
748712

749713
### Stake in the protocol

website/src/pages/en/indexing/tooling/graph-node.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ When it is running Graph Node exposes the following ports:
8585
| 8030 | Subgraph indexing status API | /graphql | --index-node-port | - |
8686
| 8040 | Prometheus metrics | /metrics | --metrics-port | - |
8787

88-
> **Important**: Be careful about exposing ports publicly - **administration ports** should be kept locked down. This includes the the Graph Node JSON-RPC endpoint.
88+
> **WARNING: Never expose Graph Node's administrative ports to the public**.
89+
>
90+
> - Exposing Graph Node's internal ports can lead to a full system compromise.
91+
> - These ports must remain **private**: JSON-RPC Admin endpoint, Indexing Status API, and PostgreSQL.
92+
> - Do not expose 8000 (GraphQL HTTP) and 8001 (GraphQL WebSocket) directly to the internet. Even though these are used for GraphQL queries, they should ideally be proxied though `indexer-agent` and served behind a production-grade proxy.
93+
> - Lock everything else down with firewalls or private networks.
8994
9095
## Advanced Graph Node configuration
9196

0 commit comments

Comments
 (0)