<p>I think the configuration you are missing is</p>

<p><code>memory: false</code></p>

<p>See the default full node application script here: <a href="https://github.com/bcoin-org/bcoin/blob/cec3c3e788834d3e9fc3c0b21bc3e340d573dcfd/bin/node#L31" rel="nofollow noreferrer">https://github.com/bcoin-org/bcoin/blob/cec3c3e788834d3e9fc3c0b21bc3e340d573dcfd/bin/node#L31</a></p>

<p>By default, bcoin objects (like <code>chain</code> and <code>walletDB</code>) run <em>in memory</em>.</p>

<p>So actually I'm curious what is taking up the 10GB in that directory? Could it be data from a previous run with a different configuration? There could be a bug, but just looking at the script you have posted here, I would expect the Full Node to run entirely in memory and therefore start over on each execution.</p>

CC BY-SA 4.0
2019-07-16T21:43:41.933Z
2019-07-16T21:43:41.933Z
pinhead
<p>I'm using bcoin and it's class FullNode to run a full Bitcoin Node.
Here's the configuration:</p>

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

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

<pre><code>(async () =&gt; {
        await node.open()
        await node.connect();

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

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

        node.startSync();
})().catch((err) =&gt; {
        console.error(err.stack);
        process.exit(1);
});
</code></pre>

<p>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?  </p>

<synchronization><full-node><bcoin>
Bcoin initial blockchain sync progress isn't saved
zabbir
# Bcoin initial blockchain sync progress isn't saved

(Asked by: username_0 on 2019-05-17)

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?

**Tags:** synchronization, full-node, bcoin


---

## 1 answers

### Answer by username_1 on 2019-07-16. Score: 1

I think the configuration you are missing is

`memory: false`

See the default full node application script here: <https://github.com/bcoin-org/bcoin/blob/cec3c3e788834d3e9fc3c0b21bc3e340d573dcfd/bin/node#L31>

By default, bcoin objects (like `chain` and `walletDB`) run *in memory*.

So actually I'm curious what is taking up the 10GB in that directory? Could it be data from a previous run with a different configuration? There could be a bug, but just looking at the script you have posted here, I would expect the Full Node to run entirely in memory and therefore start over on each execution.


---

