Preliminary Regtest Guide#51
Preliminary Regtest Guide#51jjgg22zh wants to merge 2 commits intobcoin-org:stagingfrom jjgg22zh:staging
Conversation
|
|
||
|
|
||
| ```javascript | ||
| const FullNode = require('bcoin/lib/node/fullnode'); |
There was a problem hiding this comment.
lets make the imports a little more generalized for different setups. In most of the guides we usually forst do const bcoin = require('bcoin') and then pull the modules from there (e.g. const FullNode = bcoin.fullnode; etc.) that way, people just need to change one line depending on where their version of bcoin is installed.
| persistent: true, | ||
| workers: true, | ||
| listen: true, | ||
| plugins: [require('bcoin/lib/wallet/plugin')] |
There was a problem hiding this comment.
Can you pull the wallet plugin import into the same section as the others and assign it a variable.
| await block2.refresh(true); | ||
| await node.chain.add(block2); | ||
|
|
||
| const nextEntry = await node.chain.getEntryByHeight(node.chain.height); |
There was a problem hiding this comment.
When I ran the script I got an error here because chain doesn't have a getEntryByHeight method. chainDB does though so node.chain.db.getEntryByHeight should be fine.
Also, it doesn't look like nextEntry is used anywhere
| await node.relay(node.chain.db.state); | ||
|
|
||
| const block2 = await node.miner.mineBlock(); | ||
| const tx2 = block2.txs[1]; |
There was a problem hiding this comment.
tx2 also doesn't look like it's used anywhere.
| await node.miner.addAddress(wdb.primary.getReceive()); | ||
|
|
||
| const tip = node.chain.tip; | ||
| const job = await node.miner.createJob(tip); |
There was a problem hiding this comment.
is the job variable used anywhere or can we just leave it as await node.miner.createJob(tip) without the variable assignment?
Markdown file added, will include updates / more features