dogecoin/qa/rpc-tests
mrbandrews f9ec3f0fad Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:

- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
  reasonably be met, with some assumptions about block sizes, orphan rates,
  etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
  mainnet; defined separately for mainnet, testnet, and regtest in chainparams
  as nPruneAfterHeight).

This unsets NODE_NETWORK if pruning is enabled.

Also included is an RPC test for pruning (pruning.py).

Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-04-22 15:53:48 -04:00
..
python-bitcoinrpc Fix python usage for arch's broken maintainers 2014-11-27 00:02:28 -05:00
.gitignore
bipdersig.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
conflictedbalance.sh Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
forknotify.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
getblocktemplate_longpoll.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
getblocktemplate_proposals.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
getchaintips.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
httpbasics.py [QA] fix httpbasic keep-alive test 2015-01-17 08:56:55 -08:00
invalidateblock.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
keypool.py Fix python usage for arch's broken maintainers 2014-11-27 00:02:28 -05:00
listtransactions.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
mempool_coinbase_spends.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
mempool_resurrect_test.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
mempool_spendcoinbase.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
netutil.py Fix python usage for arch's broken maintainers 2014-11-27 00:02:28 -05:00
proxy_test.py rpc-tests: Add proxy test 2015-04-20 15:04:33 +02:00
pruning.py Add block pruning functionality 2015-04-22 15:53:48 -04:00
README.md Fix README link from util.sh -> util.py. 2015-01-31 17:38:28 -05:00
receivedby.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
reindex.py Fix CheckBlockIndex for reindex. 2015-04-14 14:10:19 -04:00
rest.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
rpcbind_test.py Fix python usage for arch's broken maintainers 2014-11-27 00:02:28 -05:00
send.sh
smartfees.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
socks5.py rpc-tests: Add proxy test 2015-04-20 15:04:33 +02:00
test_framework.py fix tests for #5655 2015-01-14 09:50:00 -08:00
txn_doublespend.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
util.py Add block pruning functionality 2015-04-22 15:53:48 -04:00
util.sh
wallet.py Fix travis after merging #5957 2015-04-09 17:36:10 +02:00
walletbackup.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
zapwallettxes.py Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00

Regression tests of RPC interface

python-bitcoinrpc

Git subtree of https://github.com/jgarzik/python-bitcoinrpc. Changes to python-bitcoinrpc should be made upstream, and then pulled here using git subtree.

test_framework.py

Base class for new regression tests.

listtransactions.py

Tests for the listtransactions RPC call.

util.py

Generally useful functions.

Bash-based tests, to be ported to Python:

  • wallet.sh : Exercise wallet send/receive code.
  • walletbackup.sh : Exercise wallet backup / dump / import
  • txnmall.sh : Test proper accounting of malleable transactions
  • conflictedbalance.sh : More testing of malleable transaction handling

Notes

A 200-block -regtest blockchain and wallets for four nodes is created the first time a regression test is run and is stored in the cache/ directory. Each node has 25 mature blocks (25*50=1250 BTC) in their wallet.

After the first run, the cache/ blockchain and wallets are copied into a temporary directory and used as the initial test state.

If you get into a bad state, you should be able to recover with:

rm -rf cache
killall bitcoind