Arkeo for Indexers

The Arkeo Indexer is a powerful two-part system that makes it easy to work with on-chain data from the Arkeo blockchain. It consists of two key applications:

The Indexer

A refactored and modernized version of Unchained, the Indexer connects directly to the Arkeo blockchain and parses on-chain data, storing it in a local PostgreSQL SQL database for fast, reliable queries. It keeps your database synced with the chain in near real-time, handling all the heavy lifting of extracting and organizing blockchain activity.

The API

The API is a lightweight web service that sits on top of your SQL database. It exposes all the indexed blockchain data via easy-to-use REST endpoints, making it simple for dApps, explorers, dashboards, and other services to access up-to-date Arkeo data without worrying about parsing the chain themselves.

With the Indexer and API together, you can:

  • Run your own private copy of all relevant Arkeo data.

  • Serve fast, flexible, and custom queries to your users or apps.

  • Stay in sync with the chain, with full control over data, uptime, and privacy.

Indexer Setup

Service Overview

The service used to launch the indexer contains any needed environmental variables and points at the config file.

[Unit]
Description=Arkeo Indexer Service
After=network-online.target

[Service]
User=user
WorkingDirectory=/home/user
ExecStart=/home/user/go/bin/indexer --config /home/user/arkeo_providers/indexer_config_1.yaml
Environment="LOG_LEVEL=info"
Restart=on-failure
RestartSec=5
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target

Config File

This contains the core values needed for the running of the indexer.

SQL Setup

You want to install Postgres SQL for the indexer.

With that installed, there is a setup for formatting the tables and adjusting access.

Make sure you did this command on your root arkeo directory from the command line:

This creates the TERN tool that is used to create the sql tables.

Do these commands on the server hosting the Postgres server.

Note that if you DROP DATABASE arkeo below, you will lose all your existing arkeo index data- but you probably know that.

Update the tern config in the arkeo directory.

Use TERN to update the sql data structure.

Note, that you don't want to leave your sensitive Postgres admin data in this directory- so remember to delete this info once you setup your database.

Tern is a bit confusing to install as Arkeo uses this version: https://github.com/jackc/tern

A long script of sql will run by as it updates your Postgres tables.

Now that there is a structure, you need to lower permissions for a user you want to use for the Indexer.

No let's apply the user to the tables that TERN made.

Testing

Now run your Indexer.

And as that works, you will see blocks flying by and data in the Postgres sql. If it looks good, then launch the background service.

API Setup

Service Overview

The service used to launch the api that exposes the indexer sql data on port 7777.

Config File

This contains the core values needed for the running of the api.

API Calls

Here are some calls for the Indexer API:

Health

Stats

Provider

Subscriber

Provider Feedback

As a provider, you can tell us what more is needed with the index and api.

Join our community on Discord:

  • Share your thoughts and suggestions.

  • Help newcomers who might be facing challenges you've already conquered.

  • Request features that you think could make Arkeo even better.

Your input helps shape the future of decentralized data, and we deeply appreciate your involvement.

Join our Data-Providers channel on Discord: Arkeo Discord, Data-Providers

Last updated