Skip to content

Commit

Permalink
docs: add config example with migration guide (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
gusinacio authored Oct 15, 2024
1 parent b1f984c commit fbdee8a
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/migration-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Migration guide

In case you want to quickly migrate from the old stack into the new stack, you can use the following two configurations to help you to migrate without changing too much fields.

You just need to drop the config, use it in the `--config` args and add some additional environment variables.

Please take a deeper look in the config, but 90% of the time you'll be safe just using it. If you find any issues using this config, feel free to open an issue.

## Missing configuration fields

The new stack requires you adding an escrow subgraph, similar to the current network subgraph field.

You can edit the config yourself and add the following fields:

```
[subgraphs.escrow]
query_url = "<escrow subgraph query url>"
deployment_id = "<escrow deployment id>"
```

You can also add these environment variables in your new setup:

```
INDEXER_SUBGRAPHS__ESCROW__QUERY_URL=<escrow subgraph query url>
INDEXER_SUBGRAPHS__ESCROW__DEPLOYMENT_ID=<escrow deployment id>
```

We recommend you migrating overtime to be fully in the configuration and don't need to provide multiple environment variables that can stay in plaintext, this will make your work easier.

## Booleans inside config

The configuration doesn't accept booleans as strings, so in case you had `INDEXER_SERVICE_SERVE_NETWORK_SUBGRAPH` environment variable, please update to `INDEXER_SERVICE__SERVE_NETWORK_SUBGRAPH` and use `true/false` as values (or you could update directly in the configuration).

Please update the config accordingly. Also, check it out the explanation for each field in [config/minimal-config-example.toml](config/minimal-config-example.toml) and also [config/maximal-config-example.toml](config/maximal-config-example.toml)
54 changes: 54 additions & 0 deletions docs/migration-config/arbitrum-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[indexer]
indexer_address = "${INDEXER_SERVICE_INDEXER_ADDRESS}"
operator_mnemonic = "${INDEXER_SERVICE_MNEMONIC}"

[database]
host = "${INDEXER_SERVICE_POSTGRES_HOST}"
user = "${INDEXER_SERVICE_POSTGRES_USERNAME}"
password = "${INDEXER_SERVICE_POSTGRES_PASSWORD}"
database = "${INDEXER_SERVICE_POSTGRES_DATABASE}"

[graph_node]
# URL to your graph-node's query endpoint
query_url = "${INDEXER_SERVICE_GRAPH_NODE_QUERY_ENDPOINT}"
# URL to your graph-node's status endpoint
status_url = "${INDEXER_SERVICE_GRAPH_NODE_STATUS_ENDPOINT}"

[subgraphs.network]
# Query URL for the Graph Network subgraph.
query_url = "${INDEXER_SERVICE_NETWORK_SUBGRAPH_ENDPOINT}"
deployment_id = "${INDEXER_SERVICE_NETWORK_SUBGRAPH_DEPLOYMENT}"

# [subgraphs.escrow]
# INDEXER_SUBGRAPHS__ESCROW__QUERY_URL
# query_url = ""
# INDEXER_SUBGRAPHS__ESCROW__DEPLOYMENT_ID
# deployment_id = ""

[blockchain]
chain_id = 42161
# Contract address of TAP's receipt aggregate voucher (RAV) verifier.
receipts_verifier_address = "0x33f9E93266ce0E108fc85DdE2f71dab555A0F05a"

##############################################
# Specific configurations to indexer-service #
##############################################
[service]
# Host and port to serve the indexer-service query endpoint. This one should have a
# public ingress.
host_and_port = "0.0.0.0:${INDEXER_SERVICE_PORT}"
# Serve the network subgraph on `common.server.host_and_port`/network
# INDEXER_SERVICE__SERVE_NETWORK_SUBGRAPH
# serve_network_subgraph = false
# Serve the escrow subgraph on `common.server.host_and_port`/escrow
# INDEXER_SERVICE__SERVE_ESCROW_SUBGRAPH
# serve_escrow_subgraph = false

free_query_auth_token = "${INDEXER_SERVICE_FREE_QUERY_AUTH_TOKEN}"

########################################
# Specific configurations to tap-agent #
########################################
[tap.sender_aggregator_endpoints]
# Key-Value of all senders and their aggregator endpoints
0xDDE4cfFd3D9052A9cb618fC05a1Cd02be1f2F467 = "https://tap-aggregator.network.thegraph.com"
54 changes: 54 additions & 0 deletions docs/migration-config/arbitrum-sepolia-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[indexer]
indexer_address = "${INDEXER_SERVICE_INDEXER_ADDRESS}"
operator_mnemonic = "${INDEXER_SERVICE_MNEMONIC}"

[database]
host = "${INDEXER_SERVICE_POSTGRES_HOST}"
user = "${INDEXER_SERVICE_POSTGRES_USERNAME}"
password = "${INDEXER_SERVICE_POSTGRES_PASSWORD}"
database = "${INDEXER_SERVICE_POSTGRES_DATABASE}"

[graph_node]
# URL to your graph-node's query endpoint
query_url = "${INDEXER_SERVICE_GRAPH_NODE_QUERY_ENDPOINT}"
# URL to your graph-node's status endpoint
status_url = "${INDEXER_SERVICE_GRAPH_NODE_STATUS_ENDPOINT}"

[subgraphs.network]
# Query URL for the Graph Network subgraph.
query_url = "${INDEXER_SERVICE_NETWORK_SUBGRAPH_ENDPOINT}"
deployment_id = "${INDEXER_SERVICE_NETWORK_SUBGRAPH_DEPLOYMENT}"

# [subgraphs.escrow]
# INDEXER_SUBGRAPHS__ESCROW__QUERY_URL
# query_url = ""
# INDEXER_SUBGRAPHS__ESCROW__DEPLOYMENT_ID
# deployment_id = ""

[blockchain]
chain_id = 421614
# Contract address of TAP's receipt aggregate voucher (RAV) verifier.
receipts_verifier_address = "0xfC24cE7a4428A6B89B52645243662A02BA734ECF"

##############################################
# Specific configurations to indexer-service #
##############################################
[service]
# Host and port to serve the indexer-service query endpoint. This one should have a
# public ingress.
host_and_port = "0.0.0.0:${INDEXER_SERVICE_PORT}"
# Serve the network subgraph on `common.server.host_and_port`/network
# INDEXER_SERVICE__SERVE_NETWORK_SUBGRAPH
# serve_network_subgraph = false
# Serve the escrow subgraph on `common.server.host_and_port`/escrow
# INDEXER_SERVICE__SERVE_ESCROW_SUBGRAPH
# serve_escrow_subgraph = false

free_query_auth_token = "${INDEXER_SERVICE_FREE_QUERY_AUTH_TOKEN}"

########################################
# Specific configurations to tap-agent #
########################################
[tap.sender_aggregator_endpoints]
# Key-Value of all senders and their aggregator endpoints
0xC3dDf37906724732FfD748057FEBe23379b0710D = "https://tap-aggregator.testnet.thegraph.com"

0 comments on commit fbdee8a

Please sign in to comment.