Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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=<your-blockfrost-api-key> # only required for spo-indexer
```

### Required Configuration for private Repositories
Expand Down
3 changes: 1 addition & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
10 changes: 1 addition & 9 deletions spo-indexer/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this line altogether, like we do for other secrets. Also no comment. Consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


telemetry:
tracing:
Expand Down
Loading