<p>There is the test-only <code>-fastprune</code> bitcoind option, which results in a much smaller maximum blockfile size (16 kb) and a lower minimum prune height. If that option is used, you could just <code>bitcoin-cli -generate</code> a couple hundred empty blocks and then use the <code>pruneblockchain</code> RPC to prune some blockfiles manually.
It's being used in some of the functional tests, for example.</p>

CC BY-SA 4.0
2023-05-05T13:39:26.420Z
Is that documented somewhere? I'm interested in what the range values for `-fastprune` may be, given it looks like it's not simply a flag.
sr_gi
CC BY-SA 4.0
2023-05-05T14:18:23.377Z
it is simply a boolean flag (and the option is hidden and not documented well, because it's basically just a hack for devs to be able to tests pruning better, nothing any user should ever do). Probably the best way is to grep for fastprune in the codebase.
Lightlike
CC BY-SA 4.0
2023-05-05T15:11:27.627Z
So just for completeness, the easiest way of doing so is using both `-fastprune` and manually pruning with `bitcoin-cli pruneblockchain`
sr_gi
CC BY-SA 4.0
2023-05-05T13:14:33.127Z
2023-05-05T14:14:06.117Z
2023-05-05T14:14:06.117Z
Lightlike
<p>I'd like to test pruning logic using <code>bitcoind</code> in regtest mode, however, given the nature of regtest, blocks are rather empty (if not fully). Is there any way of easily generating full blocks so the pruning logic can kick in?</p>
<p>I'm interested in solutions involving only <code>bitcoin-cli</code>.</p>

<bitcoin-core><bitcoind><bitcoin-cli><regtest><pruning>
Testing pruning logic with bitcoind
sr_gi
# Testing pruning logic with bitcoind

(Asked by: username_0 on 2023-05-04)

I'd like to test pruning logic using `bitcoind` in regtest mode, however, given the nature of regtest, blocks are rather empty (if not fully). Is there any way of easily generating full blocks so the pruning logic can kick in?

I'm interested in solutions involving only `bitcoin-cli`.

**Tags:** bitcoin-core, bitcoind, bitcoin-cli, regtest, pruning


---

## 1 answers

### Answer by username_1 on 2023-05-05. Score: 7 | Accepted answer

There is the test-only `-fastprune` bitcoind option, which results in a much smaller maximum blockfile size (16 kb) and a lower minimum prune height. If that option is used, you could just `bitcoin-cli -generate` a couple hundred empty blocks and then use the `pruneblockchain` RPC to prune some blockfiles manually.
It's being used in some of the functional tests, for example.

> **Comments:**
> **username_0**: Is that documented somewhere? I'm interested in what the range values for `-fastprune` may be, given it looks like it's not simply a flag.  
> **username_1**: it is simply a boolean flag (and the option is hidden and not documented well, because it's basically just a hack for devs to be able to tests pruning better, nothing any user should ever do). Probably the best way is to grep for fastprune in the codebase.  
> **username_0**: So just for completeness, the easiest way of doing so is using both `-fastprune` and manually pruning with `bitcoin-cli pruneblockchain`  

---

