From d2ed59035122ffc6d88a3dbfb51cc706ff37e070 Mon Sep 17 00:00:00 2001 From: Sean Kwak Date: Thu, 5 Feb 2026 10:49:53 +0000 Subject: [PATCH 1/3] chore: add spo-indexer docs, clean up unused NATS config and misleading blockfrost placeholder --- README.md | 20 +++++++++++++++++++- justfile | 3 +-- spo-indexer/config.yaml | 10 +--------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 998676bc..9bb2a168 100644 --- a/README.md +++ b/README.md @@ -93,10 +93,11 @@ For the full set of configuration options see [config.yaml](indexer-standalone/c ### Cloud Mode -The Chain Indexer, Indexer API and Wallet Indexer can be run as separate executables, interacting with a PostgreSQL database and a NATS messaging system. Running PostgreSQL and NATS is out of scope of this document. The respective Docker images are: +The Chain Indexer, Indexer API, Wallet Indexer and SPO Indexer can be run as separate executables, interacting with a PostgreSQL database and a NATS messaging system. Running PostgreSQL and NATS is out of scope of this document. The respective Docker images are: - [`chain-indexer`](https://hub.docker.com/r/midnightntwrk/chain-indexer) - [`indexer-api`](https://hub.docker.com/r/midnightntwrk/indexer-api) - [`wallet-indexer`](https://hub.docker.com/r/midnightntwrk/wallet-indexer) +- [`spo-indexer`](https://hub.docker.com/r/midnightntwrk/spo-indexer) #### `chain-indexer` Configuration @@ -148,6 +149,22 @@ For the full set of configuration options see [config.yaml](indexer-api/config.y For the full set of configuration options see [config.yaml](wallet-indexer/config.yaml). +#### `spo-indexer` Configuration + +| Env Var | Meaning | Default | +|---|---|---| +| APP__APPLICATION__NETWORK_ID | Network ID | `undeployed` | +| APP__INFRA__STORAGE__HOST | PostgreSQL host | `localhost` | +| APP__INFRA__STORAGE__PORT | PostgreSQL port | `5432` | +| APP__INFRA__STORAGE__DBNAME | PostgreSQL database name | `indexer` | +| APP__INFRA__STORAGE__USER | PostgreSQL database user | `indexer` | +| APP__INFRA__NODE__URL | WebSocket Endpoint of Midnight Node | `ws://localhost:9944` | +| APP__INFRA__NODE__BLOCKFROST_ID | Blockfrost API key for Cardano stake queries | - | + +The Blockfrost API key is required for stake distribution queries against Cardano. Without it, spo-indexer will still index committee membership, epoch data, and D-parameter changes, but stake-related data (pool metadata, stake distribution) will not be available. + +For the full set of configuration options see [config.yaml](spo-indexer/config.yaml). + ### Running Locally For development, you can use Docker Compose or run components manually: @@ -188,6 +205,7 @@ export APP__INFRA__STORAGE__PASSWORD=postgres export APP__INFRA__PUB_SUB__PASSWORD=nats export APP__INFRA__LEDGER_STATE_STORAGE__PASSWORD=nats export APP__INFRA__SECRET=303132333435363738393031323334353637383930313233343536373839303132 +# export APP__INFRA__NODE__BLOCKFROST_ID= # only required for spo-indexer ``` ### Required Configuration for private Repositories diff --git a/justfile b/justfile index b94e0f89..78897c1d 100644 --- a/justfile +++ b/justfile @@ -109,12 +109,11 @@ run-indexer-api network_id="undeployed": cargo run -p indexer-api --bin indexer-api --features {{feature}} run-spo-indexer node="ws://localhost:9944" network_id="undeployed": - docker compose up -d --wait postgres nats + docker compose up -d --wait postgres RUST_LOG=spo_indexer=debug,indexer_common=debug,fastrace_opentelemetry=off,info \ CONFIG_FILE=spo-indexer/config.yaml \ APP__APPLICATION__NETWORK_ID={{network_id}} \ APP__INFRA__NODE__URL={{node}} \ - APP__INFRA__PUB_SUB__URL=localhost:4222 \ cargo run -p spo-indexer --features {{feature}} run-indexer-standalone node="ws://localhost:9944" network_id="undeployed": diff --git a/spo-indexer/config.yaml b/spo-indexer/config.yaml index 3daf328d..dd9d164f 100644 --- a/spo-indexer/config.yaml +++ b/spo-indexer/config.yaml @@ -23,20 +23,12 @@ infra: idle_timeout: "1m" max_lifetime: "5m" - pub_sub: - url: "nats:4222" - username: "indexer" - - ledger_state_storage: - url: "nats:4222" - username: "indexer" - node: url: "wss://rpc.preview.midnight.network" genesis_protocol_version: 16000 reconnect_max_delay: "10s" # 10ms, 100ms, 1s, 10s reconnect_max_attempts: 30 # Roughly 5m - blockfrost_id: "${BLOCKFROST_PROJECT_ID}" + blockfrost_id: "" # provide via APP__INFRA__NODE__BLOCKFROST_ID env var telemetry: tracing: From 34acd20d0543d6b5d301e8aeea053140b6688751 Mon Sep 17 00:00:00 2001 From: Sean Kwak Date: Thu, 5 Feb 2026 11:04:57 +0000 Subject: [PATCH 2/3] chore: remove blockfrost_id from config.yaml for consistency --- spo-indexer/config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/spo-indexer/config.yaml b/spo-indexer/config.yaml index dd9d164f..9c88c477 100644 --- a/spo-indexer/config.yaml +++ b/spo-indexer/config.yaml @@ -28,7 +28,6 @@ infra: genesis_protocol_version: 16000 reconnect_max_delay: "10s" # 10ms, 100ms, 1s, 10s reconnect_max_attempts: 30 # Roughly 5m - blockfrost_id: "" # provide via APP__INFRA__NODE__BLOCKFROST_ID env var telemetry: tracing: From 9736a3969dbdcd45f02af1b016888ef8a4af6dd1 Mon Sep 17 00:00:00 2001 From: Sean Kwak Date: Thu, 5 Feb 2026 13:27:05 +0000 Subject: [PATCH 3/3] Apply suggestion from @cosmir17 --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 9bb2a168..fa87f6df 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,6 @@ For the full set of configuration options see [config.yaml](indexer-api/config.y For the full set of configuration options see [config.yaml](wallet-indexer/config.yaml). #### `spo-indexer` Configuration - | Env Var | Meaning | Default | |---|---|---| | APP__APPLICATION__NETWORK_ID | Network ID | `undeployed` |