Skip to main content

Node endpoints

You have the option to run your own node for interacting with the Midnight network via various user interfaces (UIs) and programmatically. Alternatively, you can connect to public endpoints provided by infrastructure and API service providers. For development convenience, you may use the following public endpoints. These endpoints can be utilized with APIs to interact with the Midnight network and its test environments.

Network endpoints

Testnet network

NetworkURL
Testnethttps://rpc.testnet.midnight.network/
Explorer (temporary)https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.testnet.midnight.network#/explorer

Example query of a Midnight node:

curl -X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "system_chain",
"params": [],
"id": 1
}' \
https://rpc.testnet.midnight.network/

Query available RPC methods into a readable file rpc_methods.json:

curl \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"rpc_methods","params":[],"id":1}' \
https://rpc.testnet.midnight.network/ \
> rpc_methods.json

Insomnia API Collection

insomnia_app_screenshot

To facilitate interaction with the Midnight Node, we have prepared an Insomnia API collection. This collection contains pre-configured requests that you can use to test and interact with the node's various endpoints.

  1. Download the collection

  2. Open Insomnia

  3. Import the collection

    • Open Insomnia.
    • Go to the main menu and select Import/Export.
    • Choose Import Data > From File.
    • Locate and select the downloaded Insomnia.json file.
  4. Use the collection

    • Once imported, you will see the Midnight Node collection in your Insomnia workspace.
    • Expand the collection to view and utilize the available requests.
    • Configure any necessary environment variables if prompted, such as API keys or server URLs.