Skip to content

Network Endpoints ​

The API package owns the canonical endpoint profiles in packages/api/src/config-profiles.ts. This page is generated from that source so docs, examples, and stale-endpoint validation use the same defaults.

Profile Matrix ​

Runtime profileAPI classDID network segmentRuntime network idIndexer HTTP GraphQLIndexer WSNode RPCProof server
standaloneStandaloneConfig or ProfileConfig("standalone")undeployedundeployedhttp://127.0.0.1:8088/api/v4/graphqlws://127.0.0.1:8088/api/v4/graphql/wshttp://127.0.0.1:9944http://127.0.0.1:6300
testnet-localTestnetLocalConfig or ProfileConfig("testnet-local")testnettestnethttp://127.0.0.1:8088/api/v4/graphqlws://127.0.0.1:8088/api/v4/graphql/wshttp://127.0.0.1:9944http://127.0.0.1:6300
testnet-remoteTestnetRemoteConfig or ProfileConfig("testnet-remote")testnettestnethttps://indexer.testnet-02.midnight.network/api/v4/graphqlwss://indexer.testnet-02.midnight.network/api/v4/graphql/wshttps://rpc.testnet-02.midnight.networkhttp://127.0.0.1:6300
preprodPreprodConfig or ProfileConfig("preprod")preprodpreprodhttps://indexer.preprod.midnight.network/api/v4/graphqlwss://indexer.preprod.midnight.network/api/v4/graphql/wshttps://rpc.preprod.midnight.networkhttp://127.0.0.1:6300
mainnetMainnetConfig or ProfileConfig("mainnet")mainnetmainnethttps://indexer.mainnet.midnight.network/api/v4/graphqlwss://indexer.mainnet.midnight.network/api/v4/graphql/wshttps://rpc.mainnet.midnight.networkhttp://127.0.0.1:6300

Standalone and local testnet use the current standalone indexer path /api/v4/graphql and the local ports 8088, 9944, and 6300.

Environment Overrides ​

Runtime examples and smoke tests should use these variable names when overriding the selected profile:

Environment variableOverridesStandalone default
INDEXER_URLIndexer HTTP GraphQL endpointhttp://127.0.0.1:8088/api/v4/graphql
INDEXER_WS_URLIndexer WebSocket GraphQL endpointws://127.0.0.1:8088/api/v4/graphql/ws
NODE_RPC_URLMidnight node RPC endpointhttp://127.0.0.1:9944
PROOF_SERVER_URLProof server endpointhttp://127.0.0.1:6300

If only INDEXER_URL is supplied, examples that derive a WebSocket URL append /ws to the same GraphQL path. Keep INDEXER_WS_URL explicit in long-lived services so HTTP and WebSocket routing can evolve independently.

Ownership ​

ProfileConfig resolves the endpoint profile and applies the Midnight runtime network id before wallet or contract operations start. The named classes are thin profile-specific wrappers:

API surfaceOwns
MIDNIGHT_NETWORK_PROFILESprofile names, DID/runtime network ids, and default endpoint URLs
ProfileConfigdata-driven profile selection and endpoint overrides
StandaloneConfigstandalone local defaults for did:midnight:undeployed
TestnetLocalConfiglocal services configured as the testnet runtime network
TestnetRemoteConfigpublic testnet indexer and RPC with a local proof server
PreprodConfigpublic preprod indexer and RPC with a local proof server
MainnetConfigpublic mainnet indexer and RPC with a local proof server, plus optional endpoint overrides

The proof server default is local for every shipped profile. Controller-gated DID updates pass wallet-local authorization signatures to the proof server rather than the controller secret. Applications should still treat remote proving as transaction-authoring infrastructure and submit a fresh current- version authorization for each intended mutation.

GraphQL Versions ​

All shipped profiles currently use indexer GraphQL v4. Do not copy an endpoint between profiles just because the host name looks similar; the API version is part of the supported profile.

Historical examples can contain a legacy v1 GraphQL path or old standalone ports. Those values are stale for this repository's current standalone configuration and should be replaced with this page's profile defaults.

Preview ​

The DID method recognizes the preview network segment, but the API package does not currently ship a preview endpoint profile. Do not infer preview indexer, WebSocket, RPC, or proof-server URLs from other environments; add a profile to MIDNIGHT_NETWORK_PROFILES when a canonical preview deployment is available.

Midnight DID reference implementation