NetworkConfig

data class NetworkConfig(val network: MidnightNetwork, val indexerBaseUrl: String, val nodeRpcUrl: String, val proofServerUrl: String, val developmentMode: Boolean)

Configuration for a Midnight network environment.

URL Conventions:

  • indexerBaseUrl: Base URL for indexer API (without /graphql suffix)

  • IndexerClientImpl appends /graphql for HTTP and /graphql/ws for WebSocket

  • nodeRpcUrl: Full URL for node JSON-RPC endpoint

  • proofServerUrl: Full URL for proof server (appends /prove-tx internally)

Localhost host resolution (see DeviceType.localhostHost):

  • Emulator: 10.0.2.2 (Android emulator's special host alias)

  • Physical device: 127.0.0.1 (requires adb reverse tcp:<port> tcp:<port> for the indexer/node/proof-server ports). See ./gradlew adbReverseLocalnet.

The localnet (UNDEPLOYED) network uses this for all three services. PREPROD and PREVIEW use it only for the local proof server.

Constructors

Link copied to clipboard
constructor(network: MidnightNetwork, indexerBaseUrl: String, nodeRpcUrl: String, proofServerUrl: String, developmentMode: Boolean)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

If true, allows HTTP connections (for local testing only)

Link copied to clipboard

Indexer API base URL

Link copied to clipboard

The network this configuration is for

Link copied to clipboard

Node RPC URL

Link copied to clipboard

Proof server URL