Class: SPVNode

node.SPVNode

new SPVNode(optionsnullable)

Create an spv node which only maintains a chain, a pool, and a wallet database.

Extends:
  • Node
Parameters:
Name Type Attributes Description
options Object <nullable>
Properties
Name Type Attributes Description
sslKey Buffer <nullable>
sslCert Buffer <nullable>
httpPort Number <nullable>
httpHost String <nullable>
wallet Object <nullable>

Primary Wallet options.

Properties:
Name Type Description
loaded Boolean
chain Chain
pool Pool
walletdb WalletDB
http HTTPServer
Source:
Fires:
  • SPVNode#event:block
  • SPVNode#event:tx
  • SPVNode#event:error

Extends

  • Node

Members

broadcast

Broadcast a transaction (note that this will not be verified by the mempool - use with care, lest you get banned from bitcoind nodes).

Source:

scan

Scan for any missed transactions. Note that this will replay the blockchain sync.

Source:

watchBlock

Handled watched block.

Source:

Methods

(private) _init()

Initialize the node.

Source:

connect() → {Promise}

Connect to the network.

Source:
Returns:
Type
Promise

disconnect() → {Promise}

Disconnect from the network.

Source:
Returns:
Type
Promise

relay(tx) → {Promise}

Broadcast a transaction. Silence errors.

Parameters:
Name Type Description
tx TX
Source:
Returns:
Type
Promise

sendTX(tx) → {Promise}

Broadcast a transaction (note that this will not be verified by the mempool - use with care, lest you get banned from bitcoind nodes).

Parameters:
Name Type Description
tx TX
Source:
Returns:
Type
Promise

startSync()

Start the blockchain sync.

Source:

stopSync()

Stop syncing the blockchain.

Source:

watchUntil(height, iter) → {Promise}

Watch the blockchain until a certain height.

Parameters:
Name Type Description
height Number
iter function
Source:
Returns:
Type
Promise