Class: FullNode

node.FullNode

new FullNode(optionsnullable)

Respresents a fullnode complete with a chain, mempool, miner, wallet, etc.

Extends:
  • Node
Parameters:
Name Type Attributes Description
options Object <nullable>
Properties:
Name Type Description
chain Chain
fees PolicyEstimator
mempool Mempool
pool Pool
miner Miner
walletdb WalletDB
http HTTPServer
Source:
Fires:
  • FullNode#event:block
  • FullNode#event:tx
  • FullNode#event:connect
  • FullNode#event:disconnect
  • FullNode#event:reset
  • FullNode#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:

getCoinsByAddress

Get coins that pertain to an address from the mempool or chain database. Takes into account spent coins in the mempool.

Source:

getMeta

Retrieve a transaction from the mempool or chain database.

Source:

getMetaByAddress

Retrieve transactions pertaining to an address from the mempool or chain database.

Source:

getTX

Retrieve a transaction from the mempool or chain database.

Source:

getTXByAddress

Retrieve transactions pertaining to an address from the mempool or chain database.

Source:

relay

Add transaction to mempool, broadcast. Silence errors.

Source:

sendTX

Add transaction to mempool, broadcast.

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

getBlock(hash) → {Promise}

Retrieve a block from the chain database.

Parameters:
Name Type Description
hash Hash
Source:
Returns:
Type
Promise

getCoin(hash, index) → {Promise}

Retrieve a coin from the mempool or chain database. Takes into account spent coins in the mempool.

Parameters:
Name Type Description
hash Hash
index Number
Source:
Returns:
  • Returns Coin.
Type
Promise

hasTX(hash) → {Promise}

Test whether the mempool or chain contains a transaction.

Parameters:
Name Type Description
hash Hash
Source:
Returns:
  • Returns Boolean.
Type
Promise

scan(start, filter, iter) → {Promise}

Rescan for any missed transactions.

Parameters:
Name Type Description
start Number | Hash

Start block.

filter Bloom
iter function

Iterator.

Source:
Returns:
Type
Promise

startSync()

Start the blockchain sync.

Source:

stopSync()

Stop syncing the blockchain.

Source: