Class: SPVNode

node~SPVNode(optionsnullable)

SPV Node Create an spv node which only maintains a chain, a pool, and an http server.

Constructor

new SPVNode(optionsnullable)

Create SPV node.

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>
Source:

Extends

  • Node

Methods

(async) broadcast(item) → {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
item TX | Block
Source:
Returns:
Type
Promise

(async) close() → {Promise}

Close the node, wait for the database to close.

Source:
Returns:
Type
Promise

connect() → {Promise}

Connect to the network.

Source:
Returns:
Type
Promise

disconnect() → {Promise}

Disconnect from the network.

Source:
Returns:
Type
Promise

(private) init()

Initialize the node.

Source:

(async) open() → {Promise}

Open the node and all its child objects, wait for the database to load.

Source:
Returns:
Type
Promise

relay(tx) → {Promise}

Broadcast a transaction. Silence errors.

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

(async) scan(start) → {Promise}

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

Parameters:
Name Type Description
start Number | Hash

Start block.

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: