[][src]Struct ckb_jsonrpc_types::LocalNode

pub struct LocalNode {
    pub version: String,
    pub node_id: String,
    pub active: bool,
    pub addresses: Vec<NodeAddress>,
    pub protocols: Vec<LocalNodeProtocol>,
    pub connections: Uint64,
}

The information of the node itself.

Examples

{
  "active": true,
  "addresses": [
    {
      "address": "/ip4/192.168.0.2/tcp/8112/p2p/QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS",
      "score": "0xff"
    },
    {
      "address": "/ip4/0.0.0.0/tcp/8112/p2p/QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS",
      "score": "0x1"
    }
  ],
  "connections": "0xb",
  "node_id": "QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS",
  "protocols": [
    {
      "id": "0x0",
      "name": "/ckb/ping",
      "support_versions": [
        "0.0.1"
      ]
    },
    {
      "id": "0x1",
      "name": "/ckb/discovery",
      "support_versions": [
        "0.0.1"
      ]
    }
  ],
  "version": "0.34.0 (f37f598 2020-07-17)"
}

Fields

version: String

CKB node version.

Example: "version": "0.34.0 (f37f598 2020-07-17)"

node_id: String

The unique node ID derived from the p2p private key.

The private key is generated randomly on the first boot.

active: bool

Whether this node is active.

An inactive node ignores incoming p2p messages and drops outgoing messages.

addresses: Vec<NodeAddress>

P2P addresses of this node.

A node can have multiple addresses.

protocols: Vec<LocalNodeProtocol>

Supported protocols.

connections: Uint64

Count of currently connected peers.

Trait Implementations

impl Clone for LocalNode[src]

impl Debug for LocalNode[src]

impl Default for LocalNode[src]

impl<'de> Deserialize<'de> for LocalNode[src]

impl Eq for LocalNode[src]

impl Hash for LocalNode[src]

impl PartialEq<LocalNode> for LocalNode[src]

impl Serialize for LocalNode[src]

impl StructuralEq for LocalNode[src]

impl StructuralPartialEq for LocalNode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.