RPC Peer commands

peer/getBannedPeers

Gets (and optionally streams) banned peers from the node's peer network

Request

{
  stream?: boolean
}

Response

{
  peers: Array<{
    identity: string
    reason: string
  }>
}

peer/getPeer

Gets (and optionally streams) peer data from an identity

Request

{
  identity: string
  stream?: boolean
}

Response

{
  peer: {
    state: string
    identity: string | null
    version: number | null
    head: string | null
    sequence: number | null
    work: string | null
    agent: string | null
    name: string | null
    address: string | null
    port: number | null
    error: string | null
    connections: number
    connectionWebSocket:
      | { type: 'DISCONNECTED' }
      | { type: 'CONNECTING' }
      | { type: 'REQUEST_SIGNALING' }
      | { type: 'SIGNALING' }
      | { type: 'WAITING_FOR_IDENTITY' }
      | { type: 'CONNECTED'; identity: string }
    connectionWebSocketError: string
    connectionWebRTC:
      | { type: 'DISCONNECTED' }
      | { type: 'CONNECTING' }
      | { type: 'REQUEST_SIGNALING' }
      | { type: 'SIGNALING' }
      | { type: 'WAITING_FOR_IDENTITY' }
      | { type: 'CONNECTED'; identity: string }
    connectionWebRTCError: string
    networkId: number | null
    genesisBlockHash: string | null
    features: {
      syncing: null
    } | null
  } | null
}

peer/getPeerMessages

Gets (and optionally streams) peer messages from an identity

Request

{
  identity: string
  stream?: boolean
}

Response

{
  brokeringPeerDisplayName?: string
  direction: 'send' | 'receive'
  message: {
    payload: string
    type: string
  }
  timestamp: number
  type: 'WebSocket' | 'WebRtc'
}

peer/getPeers

Gets (and optionally streams) peers from the node's peer network

Request

{
  stream?: boolean
} | undefined

Response

{
  peers: Array<{
    state: string
    identity: string | null
    version: number | null
    head: string | null
    sequence: number | null
    work: string | null
    agent: string | null
    name: string | null
    address: string | null
    port: number | null
    error: string | null
    connections: number
    connectionWebSocket:
      | { type: 'DISCONNECTED' }
      | { type: 'CONNECTING' }
      | { type: 'REQUEST_SIGNALING' }
      | { type: 'SIGNALING' }
      | { type: 'WAITING_FOR_IDENTITY' }
      | { type: 'CONNECTED'; identity: string }
    connectionWebSocketError: string
    connectionWebRTC:
      | { type: 'DISCONNECTED' }
      | { type: 'CONNECTING' }
      | { type: 'REQUEST_SIGNALING' }
      | { type: 'SIGNALING' }
      | { type: 'WAITING_FOR_IDENTITY' }
      | { type: 'CONNECTED'; identity: string }
    connectionWebRTCError: string
    networkId: number | null
    genesisBlockHash: string | null
    features: {
      syncing: boolean
    } | null
  }>
}