Namespace: version

bitmessage/messages. version

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
Name Type Attributes Description
services Object <optional>

Service features to be enabled for this connection (NODE_NETWORK by default)

time Date <optional>

Node time (current time by default)

remoteHost string

IPv4/IPv6 address of the node receiving this message

remotePort number

Port of the node receiving this message

port number <optional>

Incoming port of the node (8444 by default)

nonce Buffer <optional>

Random nonce used to detect connection to self (unique per node.js process by default)

userAgent Array | string | Buffer <optional>

User agent of the node (bitmessage's by default)

streamNumbers Array.<number> <optional>

Streams accepted by the node (1 by default)

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
version 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

Random nonce used to detect connection to self

userAgent Array | string | Buffer

User agent of the node

streamNumbers Array.<number>

Streams accepted by the node

length number

Real data length

Source: