Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Net

Manage and access the nodes network related activities and resources.

export
class

Net

extends

{Namespace}

Hierarchy

Index

Constructors

constructor

Properties

Protected client

client: RPCClient

Methods

addPeer

  • addPeer(peerAddress: string): Promise<boolean>
  • Add an address to the node. The node will attempt to connect to this address when it needs more connections.

    memberof

    Net

    Parameters

    • peerAddress: string

    Returns Promise<boolean>

dumpPeers

  • dumpPeers(): Promise<boolean>
  • Delete all known peer addresses in memory and on disk.

    memberof

    Net

    Returns Promise<boolean>

getActivePeers

  • getActivePeers(): Promise<ActivePeer[]>
  • getActivePeers returns the peers that are connected to the node.

    memberof

    Net

    Returns Promise<ActivePeer[]>

getBroadcasters

  • getBroadcasters(): Promise<any>
  • Get the peers that the node will regularly broadcast messages to.

    memberof

    Net

    Returns Promise<any>

getPeers

  • getPeers(): Promise<Peer[]>
  • Get all peers known to the client.

    memberof

    Net

    Returns Promise<Peer[]>

getStats

  • getStats(): Promise<NetStat>
  • Get the node's connection statistics

    memberof

    Net

    Returns Promise<NetStat>

join

  • join(peerAddress: string[]): Promise<boolean>
  • Connect to one or more addresses immediately.

    memberof

    Net

    Parameters

    • peerAddress: string[]

      array of addresses to be connected to

    Returns Promise<boolean>

noNet

  • noNet(): Promise<boolean>
  • Prevents inbound or outbound connections by shutting down the client's network function. Note that this does not affect RPC service and connections.

    memberof

    Net

    Returns Promise<boolean>