Skip to content

Instantly share code, notes, and snippets.

@cculianu
Last active May 5, 2020 08:53
Show Gist options
  • Save cculianu/20309e67ff82caa397b4460ec011ad54 to your computer and use it in GitHub Desktop.
Save cculianu/20309e67ff82caa397b4460ec011ad54 to your computer and use it in GitHub Desktop.
How to run the BCHN vs ABC benchmarks quick and dirty guide

Quick and Dirty Guide to Running the ABC vs BCHN Mining Benchmarks

This is in reference to the results published here: https://old.reddit.com/r/btc/comments/gdlapl/bchn_now_40_faster_at_mining_than_abc/

The benchmarks were thrown together quickly for me to characterize our progress. As such, these instructions are for advanced users. I am posting these instructions in the interests of transparency and so you can "see for yourself". These instructions assume Linux or OSX and do not work on Windows, as far as I know.

Requires: python3, cmake, ninja, boost, and libbdbdev. I forget what these are called on Linux packages -- consult our docs about how to build and requirements.

  1. Clone my BCHN repo:
    $ git clone -b lgbt_bench https://gitlab.com/cculianu/bitcoin-cash-node
    $ cd bitcoin-cash-node && mkdir build
  2. Run cmake. You may need to adjust these options:
    $ cd build
    $ cmake -DBUILD_BITCOIN_QT=OFF -DBUILD_BITCOIN_ZMQ=OFF -DENABLE_UPNP=OFF -DENABLE_QRCODE=OFF ..
  3. If the above works ok, build with ninja. If it doesn't, figure out why (likely boost or berkeley db libs are not found).
    $ ninja

How to run the test against BCHN:

The below will run the basic getblocktemplate test versus your BCHN node that you just built, using a regtest network. Run this while still in the build/ directory you created above and built the node in.

$ test/functional/test_runner.py bchn-bench-gbtl

It will run for a while and mention some .xml log file it created. You need to read this log file to see the results of the test. It's usually in a directory of the form: test/tmp/bitcoin_test_runner_YYYYMMDD_HHmmSS. View this file and see the bench timing.

How to run the test against ABC:

  1. Obtain bitcoin-abc binaries from somewhere, say https://download.bitcoinabc.org/
  2. Unpack the archive somewhere and remember the path to their bitcoind
  3. Run the above test, but this time specifying their BITCOIND as an env var:
$ BITCOIND=/path/to/abc/bitcoind test/functional/test_runner.py bchn-bench-gbtl
  1. Do the same as the previous section -- find where the log file got put (its path will be printed on the console), and examine the numbers in the file.

Questions? Comments? /u/NilacTheGrim

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