Namespace: net_addr

bitmessage/structs. net_addr

Methods

(static) decode(buf, optsopt) → {DecodeResult}

Decode net_addr.

Parameters:
Name Type Attributes Description
buf Buffer

A buffer that contains encoded net_addr

opts Object <optional>

Decoding options; use short option to decode net_addr from version message

Source:
Returns:
Type
DecodeResult

(static) encode(opts) → {Buffer}

Encode net_addr.

Parameters:
Name Type Description
opts Object

Encoding options

Properties
Name Type Attributes Description
short boolean <optional>

Encode net_addr for version message (false by default)

time Date <optional>

Time the node was last active, not included in short mode (current time by default)

stream number <optional>

Stream number of the node, not included in short mode (1 by default)

services Object | Buffer <optional>

Services provided by the node (NODE_NETWORK by default)

host string

IPv4/IPv6 address of the node

port number

Incoming port of the node

Source:
Returns:

Encoded net_addr.

Type
Buffer

Type Definitions

DecodeResult

Type:
  • Object
Properties:
Name Type Description
time Date

Time the node was last active, not included in short mode

stream number

Stream number of the node, not included in short mode

services Object

Services provided by the node

host string

IPv4/IPv6 address of the node

port number

Incoming port of the node

Source: