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.
arkeo_api: "http://localhost:1317"
tendermint_api: "http://localhost:26657"
tendermint_ws: "http://localhost:26657"
chain_id: "arkeo-main-v1"
bech32_pref_acc_addr: "arkeo"
bech32_pref_acc_pub: "arkeopub"
db:
host: "localhost" # Use your database host or IP here
port: 5432 # Standard PostgreSQL port
user: "arkeo_user" # Your database user
pass: "REPLACE_WITH_SECRET_PASSWORD" # <--- Set this securely!
name: "arkeo" # Database name
pool_max_conns: 20
pool_min_conns: 1
ssl_mode: "disable" # Set to "require" for production if possible
connection_timeout: 30
[database]
host = "localhost" # Use your database host or IP here
port = 5432 # Standard PostgreSQL port
database = "arkeo" # Database name
user = "postgres" # Database user
password = "REPLACE_WITH_SECURE_PASSWORD" # <--- Never commit real passwords!
version_table = "public.schema_version"
sslmode = "disable" # Use 'require' in production if possible
[data]
# Any fields in the data section are available in migration templates
# prefix = "foo" # Example custom field (uncomment as needed)
psql -h 100.28.199.0 -U postgres -d arkeo
CREATE USER arkeo_user WITH PASSWORD 'REPLACE_WITH_A_STRONG_PASSWORD';
psql -h 100.28.199.0 -U postgres -d arkeo
DO $$ DECLARE
r RECORD;
BEGIN
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = 'public') LOOP
EXECUTE 'ALTER TABLE public.' || quote_ident(r.tablename) || ' OWNER TO arkeo_user;';
END LOOP;
END $$;
DO $$ DECLARE
r RECORD;
BEGIN
FOR r IN (SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = 'public') LOOP
EXECUTE 'ALTER SEQUENCE public.' || quote_ident(r.sequence_name) || ' OWNER TO arkeo_user;';
END LOOP;
END $$;
DO $$
DECLARE
r RECORD;
BEGIN
FOR r IN (SELECT table_name FROM information_schema.views WHERE table_schema = 'public') LOOP
EXECUTE 'ALTER VIEW public.' || quote_ident(r.table_name) || ' OWNER TO arkeo_user;';
END LOOP;
END $$;
ALTER SCHEMA public OWNER TO arkeo_user;
ALTER DATABASE arkeo OWNER TO arkeo_user;
\dt+
\q
cd ~/go/bin
./indexer --config /Users/user/arkeo_providers/indexer_config_1.yaml
[Unit]
Description=Arkeo API Service
After=network-online.target
[Service]
User=user
WorkingDirectory=/home/user
ExecStart=/home/user/go/bin/api --config /home/user/arkeo_providers/api_config_1.yaml
Environment="LOG_LEVEL=info"
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
db:
host: "localhost" # Database host (update as needed)
port: 5432 # PostgreSQL port
user: "arkeo_user" # Database user
pass: "REPLACE_WITH_SECURE_PASSWORD" # <-- Use a strong password!
name: "arkeo" # Database name
pool_max_conns: 5
pool_min_conns: 1
ssl_mode: "disable" # Use "require" for production if possible
connection_timeout: 10
cd ~/go/bin
./api --config /Users/user/arkeo_providers/api_config_1.yaml