Networks

List Networks

List Networks

GET https://nchain.provide.services/api/v1/networks

Returns a list of networks; set to private networks by default

Query Parameters

Headers

[
    {
        "id": "deca2436-21ba-4ff5-b225-ad1b0b2f5c59",
        "created_at": "2018-01-13T22:00:47.947907Z",
        "name": "Ethereum mainnet",
        "description": "Ethereum mainnet",
        "enabled": null,
        "chain_id": "1",
        "config": {
            "block_explorer_url": "https://etherscan.io",
            "chainspec_url": "https://gist.githubusercontent.com/kthomas/3ac2e29ee1b2fb22d501ae7b52884c24/raw/161c6a9de91db7044fb93852aed7b0fa0e78e55f/mainnet.chainspec.json",
            "engine_id": "ethash",
            "is_ethereum_network": true,
            "json_rpc_url": "https://mainnet.infura.io/v3/fde5e81d5d3141a093def423db3eeb33",
            "native_currency": "ETH",
            "network_id": 1,
            "platform": "evm",
            "protocol_id": "pow",
            "security": {
                "egress": "*",
                "ingress": {
                    "0.0.0.0/0": {
                        "tcp": [
                            8050,
                            8051,
                            30300
                        ],
                        "udp": [
                            30300
                        ]
                    }
                }
            },
            "websocket_url": "wss://mainnet.infura.io/ws/v3/fde5e81d5d3141a093def423db3eeb33"
        }
    },
    {
        "id": "66d44f30-9092-4182-a3c4-bc02736d6ae5",
        "created_at": "2018-01-13T22:00:47.967657Z",
        "name": "Ethereum Ropsten testnet",
        "description": "Ropsten testnet",
        "enabled": null,
        "chain_id": "3",
        "config": {
            "chain": "ropsten",
            "chainspec_url": "https://",
            "client": "geth",
            "engine_id": "ethash",
            "is_ethereum_network": true,
            "json_rpc_url": "https://ropsten.infura.io/v3/fde5e81d5d3141a093def423db3eeb33",
            "native_currency": "ETH",
            "network_id": 3,
            "platform": "evm",
            "protocol_id": "pow",
            "security": {
                "egress": "*",
                "ingress": {
                    "0.0.0.0/0": {
                        "tcp": [
                            8050,
                            8051,
                            30300
                        ],
                        "udp": [
                            30300
                        ]
                    }
                }
            },
            "websocket_url": "wss://ropsten.infura.io/ws/v3/fde5e81d5d3141a093def423db3eeb33"
        }
    }
]
curl -i \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    https://nchain.provide.services/api/v1/networks
HTTP/2 200
date: Fri, 07 Jun 2019 21:49:17 GMT
content-type: application/json; charset=UTF-8
access-control-allow-credentials: true
access-control-allow-headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS
access-control-allow-origin: *
access-control-expose-headers: X-Total-Results-Count
x-total-results-count: 5

List available peer-to-peer networks and related configuration details.

Query Parameters

Create a Network

Configuring a new peer-to-peer network can be quite complex. Just how complex depends on the kind of network you intend to provision, and the clients and protocols you plan to support (both now, and in the future). Creating the configuration for a new logical network involves having deep understanding of your goals for the network and the underlying consensus and governance protocols. We plan to curate some examples demonstrating how to configure extensible new EVM- and Bitcoin-based networks and will update this documentation accordingly.

Create Network

POST https://nchain.provide.services/api/v1/networks

Creates a new network using the given parameters.

\

\

Configuring a new peer-to-peer network can be quite complex. Just how complex depends on the kind of network you intend to provision, and the clients and protocols you plan to support (both now, and in the future). Creating the configuration for a new logical network involves having deep understanding of your goals for the network and the underlying consensus and governance protocols.

Headers

Request Body

{
    "id": "8731f54b-e0fe-439e-9614-9fb1061010e2",
    "created_at": "2021-08-17T01:29:40.809857812Z",
    "user_id": "49a02f33-33f2-4d69-a301-ffb1933e77cc",
    "name": "Sample Testnet",
    "description": "Network detail",
    "enabled": true,
    "chain_id": "0x611b1104",
    "config": {
        "chain": "test",
        "chainspec": {
            "alloc": {},
            "coinbase": 0,
            "config": {
                "byzantiumBlock": 0,
                "constantinopleBlock": 0,
                "eip150Block": 0,
                "eip155Block": 0,
                "eip158Block": 0,
                "homesteadBlock": 0,
                "petersburgBlock": 0
            },
            "difficulty": 131072,
            "extraData": "",
            "gasLimit": 3141592,
            "mixhash": 0,
            "nonce": 66,
            "parentHash": 0,
            "timestamp": 0
        },
        "engine_id": "ethash",
        "native_currency": "TEST",
        "network_id": 1629163780,
        "platform": "evm",
        "protocol_id": "pow"
    }
}
curl -i -XPOST \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    -H 'Content-Type: application/json' \
    https://nchain.provide.services/api/v1/networks \
    -d '{
  "name": "baseline testnet",
  "cloneable": false,
  "config": {
    "native_currency": "TEST",
    "platform": "evm",
    "engine_id": "ethash",
    "chain": "test",
    "protocol_id": "pow",
    "chainspec": {
      "config": {
        "homesteadBlock": 0,
        "eip150Block": 0,
        "eip155Block": 0,
        "eip158Block": 0,
        "byzantiumBlock": 0,
        "constantinopleBlock": 0,
        "petersburgBlock": 0
      },
      "alloc": {},
      "coinbase": "0x0000000000000000000000000000000000000000",
      "difficulty": "0x20000",
      "extraData": "",
      "gasLimit": "0x2fefd8",
      "nonce": "0x0000000000000042",
      "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
      "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
      "timestamp": "0x00"
    }
  }
}'

Retrieve details for a network.

URL Parameters

Retrieve Network Status

Get Network Status

GET https://nchain.provide.services/api/v1/networks/:id/status

Returns the status of the specified network

Path Parameters

Headers

{
    "block": 9128214,
    "chain_id": "4",
    "last_block_at": 1629163878000,
    "meta": {
        "average_blocktime": 15,
        "blocktimes": [