Enable Network Streaming

stream::network::enableAPI-v2stream::network::enable

Using this method, you can enable network events streaming to a specific client.

Request Parameters

Parameter Type Required Default Description
client_id integer 0 In the case of a single client, this defaults to 0. This ID can be used to access data via http://localhost:7783/event-stream?id=1
config object A standard StreamingConfig object.

Response Parameters

Parameter Type Required Description
streamer_id string An identifier for the data stream. This can be used later to disable streaming for the event with stream::disable.

📌 Examples

POST network_enable
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "stream::network::enable",
  "mmrpc": "2.0",
  "params": {
    "config": {
      "stream_interval_seconds": 60
    },
    "client_id": 1
  }
}
Show Response
{
    "mmrpc": "2.0",
    "result": {
        "streamer_id": "NETWORK"
    },
    "id": null
}

Here is an example of the stream data you should be able to see in http://localhost:7783/event-stream?id=1 at each stream interval:

data: {"_type":"NETWORK","message":{"directly_connected_peers":{"12D3KooWBhGrTVfaK9v12eA3Et84Y8Bc6ixfZVVGShsad2GBWzm3":["/ip4/162.55.5.83/tcp/42845"],"12D3KooWMjrYgoAVk5NKyqxPyYJUJyCY9nnZhFt7xwWjAe568PSN":["/ip4/65.108.252.86/tcp/42845/p2p/12D3KooWMjrYgoAVk5NKyqxPyYJUJyCY9nnZhFt7xwWjAe568PSN"]},"gossip_mesh":{"swap/4bfe3af7-dd62-4dbe-9c16-68697c4aa24d":[],"hcheck/12D3KooWEurexTFLmsiw2bQoKdrWuNZSQmjvTinoCMNmfRwfZUmW":[],"orbk/DOC:MARTY":[]},"gossip_peer_topics":{"12D3KooWMjrYgoAVk5NKyqxPyYJUJyCY9nnZhFt7xwWjAe568PSN":[],"12D3KooWBhGrTVfaK9v12eA3Et84Y8Bc6ixfZVVGShsad2GBWzm3":[]},"gossip_topic_peers":{},"relay_mesh":["12D3KooWMjrYgoAVk5NKyqxPyYJUJyCY9nnZhFt7xwWjAe568PSN","12D3KooWBhGrTVfaK9v12eA3Et84Y8Bc6ixfZVVGShsad2GBWzm3"]}}

Error Types

Parameter Type Required Description
UnknownClient string No client has an open connection using this client_id
ClientAlreadyListening string The requested events are already being sent to the client_id
Show Error Responses
Error Response (Unknown Client)
{
    "mmrpc": "2.0",
    "error": "UnknownClient",
    "error_path": "network",
    "error_trace": "network:35]",
    "error_type": "EnableError",
    "error_data": "UnknownClient",
    "id": null
}
Error (Client Already Listening)
{
    "mmrpc": "2.0",
    "error": "ClientAlreadyListening",
    "error_path": "network",
    "error_trace": "network:35]",
    "error_type": "EnableError",
    "error_data": "ClientAlreadyListening",
    "id": null
}