Module: net/common

Members

(static, constant) BAN_SCORE :Number

Ban score threshold before ban is placed in effect.

Type:
  • Number
Default Value:
  • 100
Source:

(static, constant) BAN_TIME :Number

Amount of time to ban misbheaving peers.

Type:
  • Number
Source:

(static, constant) BLOOM_VERSION :Number

Minimum version for bip37.

Type:
  • Number
Default Value:
  • 70011
Source:

(static, constant) COMPACT_VERSION :Number

Minimum version for bip152.

Type:
  • Number
Default Value:
  • 70014
Source:

(static, constant) COMPACT_WITNESS_VERSION :Number

Minimum version for bip152+segwit.

Type:
  • Number
Default Value:
  • 70015
Source:

(static, constant) HEADERS_VERSION :Number

Minimum version for getheaders.

Type:
  • Number
Default Value:
  • 31800
Source:

(static, constant) LOCAL_SERVICES :Number

Bcoin's services (we support everything).

Type:
  • Number
Source:

(static, constant) MAX_BLOCK_REQUEST :Number

Maximum number of block requests.

Type:
  • Number
Source:

(static, constant) MAX_INV :Number

Maximum inv/getdata size.

Type:
  • Number
Default Value:
  • 50000
Source:

(static, constant) MAX_MESSAGE :Number

Max message size (~4mb with segwit, formerly 2mb)

Type:
  • Number
Source:

(static, constant) MAX_REQUEST :Number

Maximum number of requests.

Type:
  • Number
Default Value:
  • 5000
Source:

(static, constant) MAX_TX_REQUEST :Number

Maximum number of tx requests.

Type:
  • Number
Default Value:
  • 10000
Source:

(static, constant) MIN_VERSION :Number

Minimum protocol version we're willing to talk to.

Type:
  • Number
Default Value:
  • 70001
Source:

(static, constant) PONG_VERSION :Number

Minimum version for pong.

Type:
  • Number
Default Value:
  • 60000
Source:

(static, constant) PROTOCOL_VERSION :Number

Default protocol version.

Type:
  • Number
Default Value:
  • 70015
Source:

(static, constant) REQUIRED_SERVICES :Number

Required services (network and segwit).

Type:
  • Number
Source:

(static, constant) SENDHEADERS_VERSION :Number

Minimum version for bip152.

Type:
  • Number
Default Value:
  • 7012
Source:

(static) services :Number

Service bits.

Type:
  • Number
Properties:
Name Type Description
NETWORK Number

Whether network services are enabled.

GETUTXO Number

Whether the peer supports the getutxos packet.

BLOOM Number

Whether the peer supports BIP37.

WITNESS Number

Whether the peer supports segregated witness.

Default Value:
  • {"NETWORK":"","GETUTXO":"","BLOOM":"","WITNESS":""}
Source:

(static, constant) USER_AGENT :String

Default user agent: /bcoin:[version]/.

Type:
  • String
Source:

(static, constant) ZERO_KEY :Buffer

A compressed pubkey of all zeroes.

Type:
  • Buffer
Source:

(static, constant) ZERO_NONCE :Buffer

8 zero bytes.

Type:
  • Buffer
Source:

(static, constant) ZERO_SIG :Buffer

A 64 byte signature of all zeroes.

Type:
  • Buffer
Source:

Methods

(static) nonce() → {Buffer}

Create a nonce.

Source:
Returns:
Type
Buffer