You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1707 lines
34 KiB

8 years ago
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: SPVNode</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: SPVNode</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="module-node.html">node</a>.</span>SPVNode</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="SPVNode"><span class="type-signature"></span>new SPVNode<span class="signature">(options<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Create an spv node which only maintains
a chain, a pool, and a wallet database.</p>
</div>
<h5>Extends:</h5>
<ul>
<li>Node</li>
</ul>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last">
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>sslKey</code></td>
<td class="type">
<span class="param-type">Buffer</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>sslCert</code></td>
<td class="type">
<span class="param-type">Buffer</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>httpPort</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>httpHost</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>wallet</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Primary Wallet options.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>loaded</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>chain</code></td>
<td class="type">
<span class="param-type"><a href="Chain.html">Chain</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>pool</code></td>
<td class="type">
<span class="param-type"><a href="Pool.html">Pool</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>walletdb</code></td>
<td class="type">
<span class="param-type"><a href="WalletDB.html">WalletDB</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>http</code></td>
<td class="type">
<span class="param-type">HTTPServer</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line41">line 41</a>
</li></ul></dd>
</dl>
<h5>Fires:</h5>
<ul>
<li>SPVNode#event:block</li>
<li>SPVNode#event:tx</li>
<li>SPVNode#event:error</li>
</ul>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li>Node</li>
</ul>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="broadcast"><span class="type-signature"></span>broadcast<span class="type-signature"></span></h4>
<div class="description">
<p>Broadcast a transaction (note that this will <em>not</em> be verified
by the mempool - use with care, lest you get banned from
bitcoind nodes).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line281">line 281</a>
</li></ul></dd>
</dl>
<h4 class="name" id="scan"><span class="type-signature"></span>scan<span class="type-signature"></span></h4>
<div class="description">
<p>Scan for any missed transactions.
Note that this will replay the blockchain sync.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line217">line 217</a>
</li></ul></dd>
</dl>
<h4 class="name" id="watchBlock"><span class="type-signature"></span>watchBlock<span class="type-signature"></span></h4>
<div class="description">
<p>Handled watched block.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line256">line 256</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="_init"><span class="type-signature">(private) </span>_init<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Initialize the node.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line123">line 123</a>
</li></ul></dd>
</dl>
<h4 class="name" id="connect"><span class="type-signature"></span>connect<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
<p>Connect to the network.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line316">line 316</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="disconnect"><span class="type-signature"></span>disconnect<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
<p>Disconnect from the network.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line325">line 325</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="relay"><span class="type-signature"></span>relay<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
<p>Broadcast a transaction. Silence errors.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tx</code></td>
<td class="type">
<span class="param-type">TX</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line307">line 307</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="sendTX"><span class="type-signature"></span>sendTX<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
<p>Broadcast a transaction (note that this will <em>not</em> be verified
by the mempool - use with care, lest you get banned from
bitcoind nodes).</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tx</code></td>
<td class="type">
<span class="param-type">TX</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line297">line 297</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="startSync"><span class="type-signature"></span>startSync<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Start the blockchain sync.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line333">line 333</a>
</li></ul></dd>
</dl>
<h4 class="name" id="stopSync"><span class="type-signature"></span>stopSync<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Stop syncing the blockchain.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line341">line 341</a>
</li></ul></dd>
</dl>
<h4 class="name" id="watchUntil"><span class="type-signature"></span>watchUntil<span class="signature">(height, iter)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
<p>Watch the blockchain until a certain height.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>iter</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="node_spvnode.js.html">node/spvnode.js</a>, <a href="node_spvnode.js.html#line242">line 242</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
8 years ago
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-bcoin.html">bcoin</a></li><li><a href="module-bip70.html">bip70</a></li><li><a href="module-bip70_pk.html">bip70/pk</a></li><li><a href="module-bip70_x509.html">bip70/x509</a></li><li><a href="module-blockchain.html">blockchain</a></li><li><a href="module-blockchain_common.html">blockchain/common</a></li><li><a href="module-btc.html">btc</a></li><li><a href="module-coins.html">coins</a></li><li><a href="module-crypto.html">crypto</a></li><li><a href="module-crypto_chachapoly.html">crypto/chachapoly</a></li><li><a href="module-crypto_ec.html">crypto/ec</a></li><li><a href="module-crypto_pk.html">crypto/pk</a></li><li><a href="module-crypto_schnorr.html">crypto/schnorr</a></li><li><a href="module-crypto_siphash.html">crypto/siphash</a></li><li><a href="module-db.html">db</a></li><li><a href="module-hd.html">hd</a></li><li><a href="module-http.html">http</a></li><li><a href="module-mempool.html">mempool</a></li><li><a href="module-mining.html">mining</a></li><li><a href="module-net.html">net</a></li><li><a href="module-net_bip152.html">net/bip152</a></li><li><a href="module-net_common.html">net/common</a></li><li><a href="module-net_dns.html">net/dns</a></li><li><a href="module-net_packets.html">net/packets</a></li><li><a href="module-net_socks.html">net/socks</a></li><li><a href="module-net_tcp.html">net/tcp</a></li><li><a href="module-node.html">node</a></li><li><a href="module-node_config.html">node/config</a></li><li><a href="module-primitives.html">primitives</a></li><li><a href="module-protocol.html">protocol</a></li><li><a href="module-protocol_consensus.html">protocol/consensus</a></li><li><a href="module-protocol_errors.html">protocol/errors</a></li><li><a href="module-protocol_networks.html">protocol/networks</a></li><li><a href="module-protocol_policy.html">protocol/policy</a></li><li><a href="module-script.html">script</a></li><li><a href="module-script_common.html">script/common</a></li><li><a href="module-utils.html">utils</a></li><li><a href="module-utils_asn1.html">utils/asn1</a></li><li><a href="module-utils_base32.html">utils/base32</a></li><li><a href="module-utils_base58.html">utils/base58</a></li><li><a href="module-utils_co.html">utils/co</a></li><li><a href="module-utils_encoding.html">utils/encoding</a></li><li><a href="module-utils_ip.html">utils/ip</a></li><li><a href="module-utils_pem.html">utils/pem</a></li><li><a href="module-utils_protobuf.html">utils/protobuf</a></li><li><a href="module-utils_util.html">utils/util</a></li><li><a href="module-wallet.html">wallet</a></li><li><a href="module-wallet_common.html">wallet/common</a></li><li><a href="module-wallet_records.html">wallet/records</a></li><li><a href="module-workers.html">workers</a></li><li><a href="module-workers_jobs.html">workers/jobs</a></li><li><a href="module-workers_packets.html">workers/packets</a></li></ul><h3>Classes</h3><ul><li><a href="Environment.html">Environment</a></li><li><a href="module-bip70.Payment.html">Payment</a></li><li><a href="module-bip70.PaymentACK.html">PaymentACK</a></li><li><a href="module-bip70.PaymentDetails.html">PaymentDetails</a></li><li><a href="module-bip70.PaymentRequest.html">PaymentRequest</a></li><li><a href="module-blockchain.Chain.html">Chain</a></li><li><a href="module-blockchain.ChainDB.html">ChainDB</a></li><li><a href="module-blockchain.ChainEntry.html">ChainEntry</a></li><li><a href="module-blockchain.ChainFlags.html">ChainFlags</a></li><li><a href="module-blockchain.ChainOptions.html">ChainOptions</a></li><li><a href="module-blockchain.ChainState.html">ChainState</a></li><li><a href="module-blockchain.DeploymentState.html">DeploymentState</a></li><li><a href="module-blockchain.StateCache.html">StateCache</a></li><li><a href="module-btc.Amount.html">Amount</a></li><li><a href="module-btc.URI.html">URI</a></li><li><a href="module-coins.CoinEntry.html">CoinEntry</a></li><li><a href="module-coins.Coins.html">Coins</a></li><li><a href="module-coins.CoinView.html">CoinView</a></li><li><a href="module-coins.UndoCoi
8 years ago
</nav>
<br class="clear">
<footer>
8 years ago
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Fri Feb 10 2017 09:40:26 GMT-0800 (PST)
8 years ago
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>