Indexers Guide to Migrating from Kepler to Mainnet

This guide shows the migrations process from the SubQuery Kepler Network to the SubQuery Mainnet. This will start on Wednesday 21st Feb at 8am UTC when the final era of Kepler will finish.

The SubQuery Network data indexing projects are currently running on the Polygon mainnet. The network will be migrated to the Base mainnet. This guide will help you prepare for the migration.

Make sure you monitor the #network-indexer-announcements channel in Discord for alerts of new version numbers and when further steps can be made

Step 1 - Halt Projects

In the Indexer Admin App, under each project details page, you must first click the ‘Stop’ button to cease the project’s operation. Then, click the ‘Go Offline’ button to execute the transaction and signal the network that you are no longer indexing the project.

You can also remove all projects not on mainnet and delete their data: Exercise caution when removing projects that are not listed on Mainnet, as this action will permanently delete the project data from the database. You can see a list of projects on mainnet here: Initial Projects When Mainnet Launch

Step 2 - Unregister Indexer Account

Please make sure you have all the projects marked offline on the network before unregister indexer account

First, make sure you have withdrawn all tokens from the controller account (if any)

To unregister your indexer account from the Kepler network, visit the My Account page in the Indexer Admin App and click the ‘Unregister’ button. This will initiate a transaction to unregister the account. After the transaction is processed, this will free up staked tokens.

Step 3 - Prepare the migration script

Download the migration script to the path containing the docker-compose.yml file.

cd <path containing docker-compose.yml>
curl https://raw.githubusercontent.com/subquery/network-indexer-services/main/deploy/coordinator-migration-tool.sh -o coordinator-migration-tool.sh
chmod +x coordinator-migration-tool.sh

The migration script executes the following operations:

  • Confirms the MATIC balance of the indexer’s controller account is withdrawn
  • Confirms the indexer is unregistered
  • Checks for the presence of the docker-compose.yml file
  • Creates a backup of the docker-compose.yml file
  • Backups the docker-compose defined postgres database to the relative mounted directory
  • Deletes tables of the default schema in the postgres database
  • Replaces the old ws-endpoint with the new coordinator container key network-endpoint in the docker-compose.yml file
  • Removes the proxy container key host in the docker-compose.yml file
  • Replaces the old service-url with the new proxy container key coordinator-endpoint in the docker-compose.yml file
  • Sets value of the coordinator and proxy container key network to mainnet in the docker-compose.yml file
  • Updates the network-endpoint of the coordinator and proxy container to https://mainnet.base.org in the docker-compose.yml file, or to a user-provided custom value
  • Changes the coordinator image version to a new placeholder version in the docker-compose.yml file - version 2.0.0
  • Updates the proxy image version to a new placeholder version in the docker-compose.yml file - version 2.0.0

Step 4 - Run the migration script

Run the script to migrate the SubQuery Network projects to the Base mainnet.

./coordinator-migration-tool.sh

Follow the instructions in the script to complete the migration. See the migration script overview above for more details.

Step 5 - Swap kSQT Tokens for SQT

You will want to perform the following actions before continuing:

You will need to wait for mainnet launch on the 23rd Feb at 8am to continue

A guide on how to swap kSQT Tokens for SQT can be found here: Swap kSQT for SQT

Step 6 - Re-add the projects

After the mainnet launch, you will need to re-add the projects through the indexer admin apps. You can follow the guides here to setup node operator services - these are almost identical to that on the Kepler pre-mainnet How to Become a Node Operator | SubQuery Academy (Documentation)

Step 7 - Update Coordinator and Proxy Versions

3 Likes

We have just made final updates of our migration script and published version 2.0.0 of the Docker images for the Indexer Coordinator and Guide

1 Like