Skip to content

Preliminary Regtest Guide#51

Open
jjgg22zh wants to merge 2 commits intobcoin-org:stagingfrom
jjgg22zh:staging
Open

Preliminary Regtest Guide#51
jjgg22zh wants to merge 2 commits intobcoin-org:stagingfrom
jjgg22zh:staging

Conversation

@jjgg22zh
Copy link

Markdown file added, will include updates / more features



```javascript
const FullNode = require('bcoin/lib/node/fullnode');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the job variable used anywhere or can we just leave it as await node.miner.createJob(tip) without the variable assignment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants