Module: network

Members

(static) address :Object

Base58Address constants.

Type:
  • Object
Properties:
Name Type Description
prefixes Number

Base58Address prefixes.

versions Number

Base58Address versions.

Source:

(static) address.prefixesByVal :RevMap

Base58Address prefixes by value.

Type:
Source:

(static) address.versionsByVal :RevMap

Base58Address versions by value.

Type:
Source:

(static, constant) alertKey :Buffer

Public key for verifying alert packets.

Type:
  • Buffer
Source:

(static) block :Number

Block constants.

Type:
  • Number
Properties:
Name Type Description
majorityEnforceUpgrade Number

Required versions to upgrade (see ChainBlock#IsUpgraded).

majorityRejectOutdated Number

Required versions to consider block outdated (see ChainBlock#IsOutdated).

majorityWindow Number

Majority window to check for upgraded and outdated blocks (see ChainBlock#IsSuperMajority).

bip34height Number

Height at which bip34 was activated. Used for avoiding bip30 checks.

bip34hash Number

Hash of the block that activated bip34.

pruneAfterHeight Number

Safe height to start pruning.

maxTipAge Number

Age used for the time delta to determine whether the chain is synced.

Default Value:
  • {"majorityEnforceUpgrade":750,"majorityRejectOutdated":950,"majorityWindow":1000,"bip34height":227931,"bip34hash":"b808089c756add1591b1d17bab44bba3fed9e02f942ab4894b02000000000000","pruneAfterHeight":100000,"maxTipAge":""}
Source:

(static, constant) checkpoints :Object

Checkpoint block list.

Type:
  • Object
Source:

(static, constant) deployments :Object

Deployments for versionbits.

Type:
  • Object
Default Value:
  • {"testdummy":"","csv":"","witness":""}
Source:

(static, constant) genesis :NakedBlock

Genesis block header.

Type:
Source:

(static, constant) genesisBlock :String

The network's genesis block in a hex string.

Type:
  • String
Source:

(static, constant) halvingInterval :Number

Type:
  • Number
Default Value:
  • 210000
Source:

(static, constant) height :Number

Expose the network height (will be updated the Chain). The only global variable currently in BCoin.

Type:
  • Number
Source:

(static, constant) magic :Number

Packet magic number.

Type:
  • Number
Default Value:
  • 3652501241
Source:

(static, constant) minerConfirmationWindow :Number

Confirmation window for versionbits.

Type:
  • Number
Default Value:
  • 2016
Source:

(static, constant) network.types :Array.<String>

Network type list.

Type:
  • Array.<String>
Default Value:
  • ["main","testnet","regtest","segnet3","segnet4"]
Source:

(static, constant) port :Number

Default network port.

Type:
  • Number
Default Value:
  • 8333
Source:

(static) pow :Number

POW-related constants.

Type:
  • Number
Properties:
Name Type Description
limit Buffer

Default target.

targetTimespan Number

Default retarget interval.

targetSpacing Number

Average block time.

allowMinDifficultyBlocks Boolean

Allow constant retargetting on testnet.

noRetargeting Boolean

Do not allow retargetting.

Default Value:
  • {"limit":"","targetTimespan":"","targetSpacing":"","allowMinDifficultyBlocks":false,"noRetargeting":false}
Source:

(static, constant) pow.retargetInterval :Number

Retarget interval in blocks.

Type:
  • Number
Source:

(static) prefixes :Number

Key prefixes.

Type:
  • Number
Properties:
Name Type Description
privkey Number
xpubkey Number
xprivkey Number
xprivkey58 Number
xpubkey58 Number
Default Value:
  • {"privkey":128,"xpubkey":76067358,"xprivkey":76066276,"xprivkey58":"xprv","xpubkey58":"xpub"}
Source:

(static, constant) ruleChangeActivationThreshold :Number

For versionbits.

Type:
  • Number
Default Value:
  • 1916
Source:

(static, constant) seeds :Array.<String>

Default seeds.

Type:
  • Array.<String>
Default Value:
  • ["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","bitseed.xf2.org","seed.bitcoin.jonasschnelli.ch"]
Source:

(static, constant) segwitHeight :Number

Height at which segwit is activated (segnet3).

Type:
  • Number
Default Value:
  • 2000000000
Source:

(static, constant) type :String

Symbolic network type.

Type:
  • String
Default Value:
  • main
Source:

(static, constant) witness :Boolean

Whether this is a segwit-enabled network.

Type:
  • Boolean
Source:

Methods

(static) network.get(type) → {Object}

Get a new network object by type.

Parameters:
Name Type Description
type String

Network type.

Source:
Returns:
Type
Object