0

I'm using bcoin and it's class FullNode to run a full Bitcoin Node. Here's the configuration:

const node = new bcoin.FullNode({
        prefix: '/mnt/d/bcoin',
        network: 'testnet',
        indexTX: true,
        indexAddress: true
});

And then I start the node with this code, identical to the one they use in their official example.

(async () => {
        await node.open()
        await node.connect();

        node.on('connect', (entry, block) => {
                console.log('%s (%d) added to chain.', entry.rhash(), entry.height);
        });

        node.on('tx', (tx) => {
                 console.log('%s added to mempool.', tx.txid());
         });

        node.startSync();
})().catch((err) => {
        console.error(err.stack);
        process.exit(1);
});

It seems to be working fine, I get notifications of the blocks added in the console. the program crashes once in a while to the lack of memory, however, I found a fix to that. The progress of sync seems to never be saved, however. If I were to restart the app when it's on 1,000,000 blocks in (testnet) - the sync will start over. The files are created in the /mnt/d/bcoin folder and it's already 10 GB in size. In comparison to the official bitcoin node - it always carries on the sync that's already in progress. I have never been able to finish the inital blockchain download with bcoin because I run it in my PC and it always fails for various reasons. So is it expected behavior for bcoin to reset its IBD progress every time? Would it read the existing block files after IBD?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.