new Peer(settings) → {Peer}
Initialize the Peer
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
settings |
Object |
Properties
|
- 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: