[Experimental] ci test: sync w bitcoin core #759
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm currently working on #721 which requires upgrades to the on-the-wire protocol, and I need to make sure I stay in sync (and not get banned) from bitcoind nodes.
This PR is an attempt to integrate bitcoind compatibility into our CI pull-testing.
I made a series of scripts that connect any number of bcoin and bitcoind nodes and uses RPC commands to test headers-first sync (work-in-progress): https://github.com/pinheadmz/networktest. I copied one of those tests into this PR, which syncs bcoin and bitcoind, then triggers a reorg from bitcoind by invalidating a block and building a new chain from there. For now, I've left on all the logging output and you can see its output in the testing report.
For local testing, a new command is added to
package.json
. For CI testing, theconfig.yaml
has been updated to actually install bitcoind, and run an extra set of tests that connect it to bcoin.To test the CircleCI changes locally, you can install the circleCI CLI tool and run the command:
circleci local execute --job install
Unfortunately the local CI tool doesn't manage workflows like the online CI tester, so one command must be uncommented to work locally. (see the comments in
.circleci/config.yml
)Testing API changes
Not Affected
npm run test
npm run test-file
Added
npm run bitcoind-test
(only runs tests in
/test/bitcoind-sync/*-test.js
which requirebitcoind
to be installed and available as a command)Modified
npm run test-ci
(adds all files in
/test/bitcoind-sync/*-test.js
to "test" job, included in codecov)