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

Name
Type
Description

public

boolean

when true, public networks are included in response

Headers

Name
Type
Description

authorization

string

bearer scoped to

Application

,

Organization

or

User

[
    {
        "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

Parameter
Description
Default

public

flag for displaying public networks

false

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

Name
Type
Description

authorization

string

bearer scoped to

Application

,

Organization

or

User

Request Body

Name
Type
Description

config

object

metadata required for the specified network being created; see below for

config

parameters

description

string

description of network being created

enabled

boolean

when true, network is available for use

name

string

name of network being created

{
    "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

Parameter
Description

id

id of the Network

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

Name
Type
Description

id

string

id of target network

Headers

Name
Type
Description

authorization

string

bearer scoped to

Application

,

Organization

or

User

{
    "block": 9128214,
    "chain_id": "4",
    "last_block_at": 1629163878000,
    "meta": {
        "average_blocktime": 15,
        "blocktimes": [
            15,
            15,
            15,
            15,
            15,
            15,
            15
        ],
        "last_block_hash": "0x56f5882b533357dd9582eed2b7f024a4e945ec934f1a28ebb25907257e67afd1",
        "last_block_header": {
            "difficulty": "0x1",
            "extraData": "0xd883010a06846765746888676f312e31362e36856c696e757800000000000000dcc62e7a7728ab2dba011b81ed64fc69f2cc16618ac1ce64527591ea171e4b5a6a928320565490838b60ef6910aa5021b1e5e8aebacd14f960cf0f78eb09935501",
            "gasLimit": "0x1c95111",
            "gasUsed": "0x1a4549",
            "hash": "0x56f5882b533357dd9582eed2b7f024a4e945ec934f1a28ebb25907257e67afd1",
            "logsBloom": "0x0c000020318000002008002000100005001104820000840088400060000040000000804000000000000004000200000000000000020008000800000000300000100000000000020000001108000060100800240000000000000000208000000000000000021000000006108002200800000000000080000100000030000000001001000080000080000008000000202000000001020400011080000000604800028000000000010208000101000000840800000000000008040100100000000080088002000000000008880002000201000000101800001000001080000020a00018009000000804000000000000000000800000028000400100800000804040",
            "miner": "0x0000000000000000000000000000000000000000",
            "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "nonce": "0x0000000000000000",
            "number": "0x8b4916",
            "parentHash": "0xb79f351863eb192f5d09d15b24a71e2ba0b546eb80a3d0f94d8749a8d6860382",
            "receiptsRoot": "0x60c71f1c3e89b570788459cb8a3bc6dbe484ee17eec63b4b6afbe56e2916b364",
            "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
            "stateRoot": "0x0afbd8c172a5308c9db74b3968de8233dc3192a4bc6e455833ae04ea99ab109b",
            "timestamp": "0x611b1166",
            "transactionsRoot": "0x700fbf0c82f529e3e3895fd4f970b086cfbad056ee081d78acf0eb9e62a5dd50"
        }
    }
}
curl -i \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    https://nchain.provide.services/api/v1/networks/024ff1ef-7369-4dee-969c-1918c6edb5d4/status
HTTP/2 200

Retrieve the syncing status and, if fully-synced, real-time network-specific metrics and metadata.

URL Parameters

Parameter
Description

id

id of the Network

Update a Network

Update Network

PUT https://nchain.provide.services/api/v1/networks/:id

Updates the specified network

Path Parameters

Name
Type
Description

id

string

id of target network

Headers

Name
Type
Description

authorization

string

bearer scoped to

Application

,

Organization

or

User

Request Body

Name
Type
Description

chain_id

string

id of network to be updated

description

string

description of network being updated

enabled

string

when true, network is available for use

name

string

name of network being updated

[]
curl -i -XPUT \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    https://nchain.provide.services/api/v1/networks/e5e0a051-6af7-4d1e-88cd-0ea1f67abd50 \
    -d '{"enabled": false}'
HTTP/2 204

Update the network.

URL Parameters

Parameter
Description

id

id of the Network

List Network Addresses

curl -i \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    https://nchain.provide.services/api/v1/networks/e5e0a051-6af7-4d1e-88cd-0ea1f67abd50/addresses
HTTP/2 501

This endpoint enumerates the addresses of the given Network.

(Not yet implemented)

URL Parameters

Parameter
Description

id

id of the Network

List Network Blocks

curl -i \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    https://nchain.provide.services/api/v1/networks/e5e0a051-6af7-4d1e-88cd-0ea1f67abd50/blocks
HTTP/2 501

This endpoint enumerates the blocks of the given Network.

(Not yet implemented)

URL Parameters

Parameter
Description

id

id of the Network

List Network Connectors

List connectors for the network.

Documentation forthcoming.

URL Parameters

Parameter
Description

id

id of the Network

List Network Bridges

Documentation forthcoming.

URL Parameters

Parameter
Description

id

id of the Network

List Network Oracles

Documentation forthcoming.

URL Parameters

Parameter
Description

id

id of the Network

List Network Contracts

curl -i \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    https://nchain.provide.services/api/v1/networks/e5e0a051-6af7-4d1e-88cd-0ea1f67abd50/contracts
HTTP/2 200

Retrieve a list of network contracts.

URL Parameters

Parameter
Description

id

id of the Network

List Network Token Contracts

curl -i \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    https://nchain.provide.services/api/v1/networks/024ff1ef-7369-4dee-969c-1918c6edb5d4/tokens
HTTP/2 200

List token contracts for the network.

URL Parameters

Parameter
Description

id

id of the Network

List Network Transactions

curl -i \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    https://nchain.provide.services/api/v1/networks/024ff1ef-7369-4dee-969c-1918c6edb5d4/transactions
HTTP/2 200

List network transactions.

URL Parameters

Parameter
Description

id

id of the Network

Retrieve Network Contract

curl -i \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    https://nchain.provide.services/api/v1/networks/e5e0a051-6af7-4d1e-88cd-0ea1f67abd50/contracts/752eadfa-f138-4c73-a9b9-822a5bfb4dc6
HTTP/2 200

Retrieve details for a specific network contract.

URL Parameters

Parameter
Description

id

id of the Network

contract_id

id of the specified Contract

Retrieve Network Transaction

curl -i \
    -H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fSwiZXhwIjpudWxsLCJpYXQiOjE1NTk4Nzg1NzQsImp0aSI6IjYzYTJkY2QzLWI5OTgtNDZjNC1hNzFkLTQ5MjU4YTBhYmEyMyIsInN1YiI6ImFwcGxpY2F0aW9uOmNiMjAzN2Y3LTc5ZmMtNDBmNC05NzIwLWFkYTYzNmRhNDE4MyJ9.NQLm__LbMWor-9GMG0LPcH4yQIbu9Uw70kJfRt1KP64' \
    https://nchain.provide.services/api/v1/networks/024ff1ef-7369-4dee-969c-1918c6edb5d4/transactions/f1125746-fa73-4392-a935-7a57faf3f7b0
HTTP/2 200

This endpoint retrieves the details of the Network’s specified Transaction.

URL Parameters

Parameter
Description

id

id of the Network

transaction_id

id of the Transaction

Network Types

Parameter
Description
Required

id

id of the Network

--

chain_id

globally-unique chain identifier for the network

--

config

network configuration object

yes

description

network description

no

name

network name

yes

Network Configuration Object

Parameter
Description
Required

block_explorer_url

url of the block explorer for the network, if one is configured

no

chain

name of the chain

yes

chainspec

network-specific chainspec object; (i.e., genesis.json)

yes

chainspec_url

external url where the chainspec lives; overridden by chainspec

no

chainspec_abi

optional network-specific chainspec ABI object

no

chainspec_abi_url

optional network-specific chainspec ABI url; overridden by chainspec_abi

no

client

default p2p client to be used on the network (i.e., parity, geth)

yes

engine_id

consensus engine to be used for the chain (i.e., ethash, poa, ibft)

yes

native_currency

symbol representing the native currency on the network (i.e., ETH)

yes

platform

platform type (i.e., evm, bcoin)

yes

protocol_id

type of consensus mechanism (i.e., pow, poa)

yes

Last updated