diff --git a/docs/Examples/miner-configs.js b/docs/Examples/miner-configs.js deleted file mode 100644 index 949334a6..00000000 --- a/docs/Examples/miner-configs.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -const bcoin = require('../..'); - -const key = bcoin.wallet.WalletKey.generate('regtest'); - -const workers = new bcoin.WorkerPool({ - enabled: true -}); - -const chain = new bcoin.Chain({ - network: 'regtest', - workers: workers -}); - -const miner = new bcoin.Miner({ - chain: chain, - addresses: [key.getAddress()], - coinbaseFlags: 'my-miner' -}); - -(async () => { - await miner.open(); - await chain.open(); - - const tmpl = await miner.createBlock(); - - console.log('Block template:'); - console.log(tmpl); - - const job = await miner.createJob(); - const block = await job.mineAsync(); - - console.log('Mined block:'); - console.log(block); - - console.log('Coinbase transaction:'); - console.log(block.txs[0]); - - await chain.add(block); - - console.log('New tip:'); - console.log(chain.tip); - - await workers.close(); -})().catch((err) => { - console.error(err.stack); - process.exit(1); -}); diff --git a/docs/README.md b/docs/README.md index 5534ebb0..37ae4427 100644 --- a/docs/README.md +++ b/docs/README.md @@ -23,7 +23,6 @@ with minimal configuration. - [SPV Sync](Examples/spv-sync-wallet.js) - A transaction matching the SPV node's bloom filter is broadcast by a minimal full node to the SPV node. - [Plugin Example](Examples/peers-plugin.js) - Demonstrates the `plugin` feature of bcoin's `node` object. - [Client API Usage](Examples/client-api.js) - Demonstrates usage of the node and wallet API. -- [Miner with WorkerPool](Examples/miner-configs.js) - Creates a regtest `chain` and `miner`, which mines a block using workers. - [Create and Sign TX](Examples/create-sign-tx.js) - Demonstrates how to use `mtx` and `keyring` modules to sign a transaction. - [Get Transaction from Chain](Examples/get-tx-from-chain.js) - Connects to live testnet network and syncs the first 1000 blocks with tx indexing active. - [Create Watch Only Wallet](Examples/watch-only-wallet.js) - Imports an `xpub` into a new watch-only wallet that can derive addresses.