Peer

Peer




new Peer(settings) → {Peer}

Initialize the Peer

Parameters:
Name Type Description
settings Object
Properties
Name Type Attributes Default Description
ip Object

The IP address of the Flo Peer to connect to

agent Object <optional>
"js-oip fcoin Peer"

The "name" to display to nodes you connect to.

Source:
Returns:
Type:
Peer

Methods




announceTX(hex)

Announce the availability of a Transaction to the Peer

Parameters:
Name Type Description
hex String

The hex string of the transaction

Source:



(async) connect() → {Boolean}

Open a p2p connection to the Peer

Source:
Returns:

Returns the connection status

Type:
Boolean



handleGetData(getDataPacket)

Handle (respond to) a p2p getdata request

Parameters:
Name Type Description
getDataPacket GetDataPacket

The packet to respond to with data

Source:



onPacket(packet)

Handle incoming p2p packets

Parameters:
Name Type Description
packet Packet

The packet that is incoming

Source: