version
message.
Members
(static, constant) randomNonce :Buffer
Random nonce used to detect connections to self.
Type:
- Buffer
- Source:
Methods
(static) decode(buf) → {DecodeResult}
Decode version
message.
NOTE: nonce
is copied.
Parameters:
Name | Type | Description |
---|---|---|
buf |
Buffer | Message |
- Source:
Returns:
- Type
- DecodeResult
(static) decodePayload()
Decode version
message payload.
The same as decode.
- Source:
(static) encode(opts) → {Buffer}
Encode version
message.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object | Version options Properties
|
- Source:
Returns:
Encoded message.
- Type
- Buffer
(static) encodePayload()
Encode version
message payload.
The same as encode.
- Source:
Type Definitions
DecodeResult
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
protoVersion |
number | Identifies protocol version being used by the node. Should equal 3. Nodes should disconnect if the remote node's version is lower but continue with the connection if it is higher. |
services |
Object | Service features to be enabled for this connection |
time |
Date | Node time |
remoteHost |
string | IPv4/IPv6 address of the node receiving this message |
remotePort |
number | Port of the node receiving this message |
port |
number | Incoming port of the node sending this message |
nonce |
Buffer | An 8-byte random nonce used to detect connection to self |
userAgent |
string | User agent of the node |
streams |
Array.<number> | Streams accepted by the node |
length |
number | Real data length |
- Source: