The Bitcoin ABC project welcomes contributors!
This guide is intended to help developers contribute effectively to Bitcoin ABC.
To get in contact with ABC developers, we monitor a telegram supergroup. The intent of this group is specifically to facilitate development of Bitcoin-ABC, and to welcome people who wish to participate.
Join the ABC Development telegram group
Acceptable use of this supergroup includes the following:
- Introducing yourself to other ABC developers.
- Getting help with your development environment.
- Discussing how to complete a patch.
It is not for:
- Market discussion
- Non-constructive criticism
Bitcoin ABC aims for fast iteration and continuous integration.
This means that there should be quick turnaround for patches to be proposed, reviewed, and committed. Changes should not sit in a queue for long.
Here are some tips to help keep the development working as intended. These are guidelines for the normal and expected development process. Developers can use their judgement to deviate from these guidelines when they have a good reason to do so.
- Keep each change small and self-contained.
- Reach out for a 1-on-1 review so things move quickly.
- Land the Diff quickly after it is accepted.
- Don't amend changes after the Diff accepted, new Diff for another fix.
- Review Diffs from other developers as quickly as possible.
- Large changes should be broken into logical chunks that are easy to review, and keep the code in a functional state.
- Do not mix moving stuff around with changing stuff. Do changes with renames on their own.
- Sometimes you want to replace one subsystem by another implementation, in which case it is not possible to do things incrementally. In such cases, you keep both implementations in the codebase for a while, as described here.
- There are no "development" branches, all Diffs apply to the master branch, and should always improve it (no regressions).
- Don't break the build, it is important to keep master green as much as possible. If a Diff is landed, and breaks the build, fix it quickly. If it cannot be fixed quickly, it should be reverted, and re-applied later when it no longer breaks the build.
- As soon as you see a bug, you fix it. Do not continue on. Fixing the bug becomes the top priority, more important than completing other tasks.
- Automate as much as possible, and spend time on things only humans can do.
Here are some handy links for development practices aligned with Bitcoin ABC:
- Developer Notes
- Statement of Bitcoin ABC Values and Visions
- How to Do Code Reviews Like a Human - Part 1
- How to Do Code Reviews Like a Human - Part 2
- Large Diffs Are Hurting Your Ability To Ship
- Stacked Diffs: Keeping Phabricator Diffs Small
- Parallel Implementations
- The Pragmatic Programmer: From Journeyman to Master
- Advantages of monolithic version control
- The importance of fixing bugs immediately
- Slow Deployment Causes Meetings
- Good Work, Great Work, and Right Work
- Accelerate: The Science of Lean Software and DevOps
- Facebook Engineering Process with Kent Beck
-
Create an account at reviews.bitcoinabc.org
-
Install Git and Arcanist on your machine
Git documentation can be found at git-scm.com.
For Arcanist documentation, you can read Arcanist Quick Start and the Arcanist User Guide.
To install these packages on Debian or Ubuntu, type: sudo apt-get install git arcanist
- If you do not already have an SSH key set up, follow these steps:
Type: ssh-keygen -t rsa -b 4096 -C "[email protected]"
Enter a file in which to save the key (/home/username/.ssh/id_rsa): [Press enter]
- Upload your SSH public key to https://reviews.bitcoinabc.org
-
Go to:
https://reviews.bitcoinabc.org/settings/user/*username*/page/ssh/
-
Under "SSH Key Actions", Select "Upload Public Key"
Paste contents from: /home/*username*/.ssh/id_rsa.pub
- Clone the repository and install Arcanist certificate:
git clone ssh://[email protected]:2221/source/bitcoin-abc.git
cd bitcoin-abc
arc install-certificate
Note: Arcanist tooling will tend to fail if your remote origin is set to something other than the above. A common mistake is to clone from Github and then forget to update your remotes.
Follow instructions provided by arc install-certificate
to provide your API token.
- Code formatting tools
During submission of patches, arcanist will automatically run arc lint
to
enforce Bitcoin ABC code formatting standards, and often suggests changes.
If code formatting tools do not install automatically on your system, you
will have to install the following:
On Ubuntu (>= 18.04+updates):
sudo apt-get install clang-format-8 clang-tidy-8 clang-tools-8 cppcheck python-autopep8 flake8 php-codesniffer yamllint
On Debian (>= 10), the clang-8 family of tools is available from the buster-backports
repository:
echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install cppcheck python-autopep8 flake8 php-codesniffer
sudo apt-get -t buster-backports install clang-format-8 clang-tidy-8 clang-tools-8
If not available in the distribution, clang-format-8
and clang-tidy
can be
installed from https://releases.llvm.org/download.html or https://apt.llvm.org.
For example, for macOS:
curl http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz | tar -xJv
ln -s $PWD/clang+llvm-8.0.0-x86_64-apple-darwin/bin/clang-format /usr/local/bin/clang-format
ln -s $PWD/clang+llvm-8.0.0-x86_64-apple-darwin/bin/clang-tidy /usr/local/bin/clang-tidy
If you are modifying a shell script, you will need to install the shellcheck
linter.
A recent version is required and may not be packaged for your distribution.
Standalone binaries are available for download on
the project's github release page.
Note: In order for arcanist to detect the shellcheck
executable, you need to make it available in your PATH
;
if another version is already installed, make sure the recent one is found first.
Arcanist will tell you what version is expected and what is found when running arc lint
against a shell script.
If you are running Debian 10, it is also available in the backports repository:
sudo apt-get -t buster-backports install shellcheck
A typical workflow would be:
-
Create a topic branch in Git for your changes
git checkout -b 'my-topic-branch'
-
Make your changes, and commit them
git commit -a -m 'my-commit'
-
Create a differential with Arcanist
arc diff
You should add suggested reviewers and a test plan to the commit message. Note that Arcanist is set up to look only at the most-recent commit message, So all you changes for this Diff should be in one Git commit.
-
For large changes, break them into several Diffs, as described in this guide. You can also include "Depends on Dxxx" in the Arcanist message to indicate dependence on other Diffs.
-
Log into Phabricator to see review and feedback.
-
Make changes as suggested by the reviewers. You can simply edit the files with my-topic-branch checked out, and then type
arc diff
. Arcanist will give you the option to add uncommited changes. Or, alternatively, you can commit the changes usinggit commit -a --am
to add them to the last commit, or squash multiple commits by typinggit rebase -i master
. If you squash, make sure the commit message has the information needed for arcanist (such as the Diff number, reviewers, etc.). -
Update your Diff by typing
arc diff
again. -
When reviewers approve your Diff, it should be listed as "ready to Land" in Phabricator. When you want to commit your diff to the repository, check out type my-topic-branch in git, then type
arc land
. You have now successfully committed a change to the Bitcoin ABC repository. -
When reviewing a Diff, apply the changeset on your local by using
arc patch D{NNNN}
-
You will likely be re-writing git histories multiple times, which causes timestamp changes that require re-building a significant number of files. It's highly recommended to install
ccache
(re-run cmake if you install it later), as this will help cut your re-build times from several minutes to under a minute, in many cases.
If you are looking for a useful task to contribute to the project, a good place to start is the list of tasks at https://reviews.bitcoinabc.org/maniphest.
You could also try backporting some code from Bitcoin Core.
By contributing to this repository, you agree to license your work under the
MIT license unless specified otherwise in contrib/debian/copyright
or at
the top of the file itself. Any work contributed where you are not the original
author must contain its license header with the original author(s) and source.
See DISCLOSURE_POLICY.