diff --git a/README.md b/README.md index 998676bc..fa87f6df 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,21 @@ 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 +204,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..9c88c477 100644 --- a/spo-indexer/config.yaml +++ b/spo-indexer/config.yaml @@ -23,20 +23,11 @@ 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}" telemetry: tracing: