README.md 4.94 KB
Newer Older
Wladimir J. van der Laan's avatar
Wladimir J. van der Laan committed
1
Bitcoin Core integration/staging tree
2
=====================================
Colin Dean's avatar
Colin Dean committed
3

Trevin Hofmann's avatar
Trevin Hofmann committed
4
https://www.bitcoin.org
Colin Dean's avatar
Colin Dean committed
5

Telepatheic's avatar
Telepatheic committed
6
Copyright (c) 2009-2014 Bitcoin Core Developers
Colin Dean's avatar
Colin Dean committed
7
8
9
10
11
12
13

What is Bitcoin?
----------------

Bitcoin is an experimental new digital currency that enables instant payments to
anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate
with no central authority: managing transactions and issuing money are carried
Wladimir J. van der Laan's avatar
Wladimir J. van der Laan committed
14
out collectively by the network. Bitcoin Core is the name of open source
Colin Dean's avatar
Colin Dean committed
15
16
17
software which enables the use of this currency.

For more information, as well as an immediately useable, binary version of
Trevin Hofmann's avatar
Trevin Hofmann committed
18
the Bitcoin Core software, see https://www.bitcoin.org/en/download.
Colin Dean's avatar
Colin Dean committed
19
20
21
22

License
-------

Wladimir J. van der Laan's avatar
Wladimir J. van der Laan committed
23
Bitcoin Core is released under the terms of the MIT license. See [COPYING](COPYING) for more
Colin Dean's avatar
Colin Dean committed
24
information or see http://opensource.org/licenses/MIT.
Gavin Andresen's avatar
Gavin Andresen committed
25

26
Development process
Colin Dean's avatar
Colin Dean committed
27
-------------------
Gavin Andresen's avatar
Gavin Andresen committed
28

Colin Dean's avatar
Colin Dean committed
29
30
Developers work in their own trees, then submit pull requests when they think
their feature or bug fix is ready.
Jeff Garzik's avatar
Jeff Garzik committed
31

Colin Dean's avatar
Colin Dean committed
32
33
If it is a simple/trivial/non-controversial change, then one of the Bitcoin
development team members simply pulls it.
Jeff Garzik's avatar
Jeff Garzik committed
34

Colin Dean's avatar
Colin Dean committed
35
36
37
If it is a *more complicated or potentially controversial* change, then the patch
submitter will be asked to start a discussion (if they haven't already) on the
[mailing list](http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development).
Gavin Andresen's avatar
Gavin Andresen committed
38

Colin Dean's avatar
Colin Dean committed
39
40
The patch will be accepted if there is broad consensus that it is a good thing.
Developers should expect to rework and resubmit patches if the code doesn't
super3's avatar
super3 committed
41
match the project's coding conventions (see [doc/coding.md](doc/coding.md)) or are
Colin Dean's avatar
Colin Dean committed
42
controversial.
Gavin Andresen's avatar
Gavin Andresen committed
43

Colin Dean's avatar
Colin Dean committed
44
45
46
The `master` branch is regularly built and tested, but is not guaranteed to be
completely stable. [Tags](https://github.com/bitcoin/bitcoin/tags) are created
regularly to indicate new official, stable release versions of Bitcoin.
Gavin Andresen's avatar
Gavin Andresen committed
47

48
Testing
Colin Dean's avatar
Colin Dean committed
49
50
51
-------

Testing and code review is the bottleneck for development; we get more pull
52
53
requests than we can review and test on short notice. Please be patient and help out by testing
other people's pull requests, and remember this is a security-critical project where any mistake might cost people
Colin Dean's avatar
Colin Dean committed
54
55
56
lots of money.

### Automated Testing
Alex Waters's avatar
Alex Waters committed
57

Colin Dean's avatar
Colin Dean committed
58
Developers are strongly encouraged to write unit tests for new code, and to
super3's avatar
super3 committed
59
submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: `make check`
60

Colin Dean's avatar
Colin Dean committed
61
62
Every pull request is built for both Windows and Linux on a dedicated server,
and unit and sanity tests are automatically run. The binaries produced may be
63
64
used for manual QA testing — a link to them will appear in a comment on the
pull request posted by [BitcoinPullTester](https://github.com/BitcoinPullTester). See https://github.com/TheBlueMatt/test-scripts
Colin Dean's avatar
Colin Dean committed
65
for the build/test scripts.
66

Colin Dean's avatar
Colin Dean committed
67
### Manual Quality Assurance (QA) Testing
68

Colin Dean's avatar
Colin Dean committed
69
70
Large changes should have a test plan, and should be tested by somebody other
than the developer who wrote the code.
71
See https://github.com/bitcoin/QA/ for how to create a test plan.
72
73
74
75
76
77
78

Translations
------------

Changes to translations as well as new translations can be submitted to
[Bitcoin Core's Transifex page](https://www.transifex.com/projects/p/bitcoin/).

79
Translations are periodically pulled from Transifex and merged into the git repository. See the
80
81
[translation process](doc/translation_process.md) for details on how this works.

82
**Important**: We do not accept translation changes as GitHub pull requests because the next
83
pull from Transifex would automatically overwrite them again.
84

85
86
Translators should also subscribe to the [mailing list](https://groups.google.com/forum/#!forum/bitcoin-translators).

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
Development tips and tricks
---------------------------

**compiling for debugging**

Run configure with the --enable-debug option, then make. Or run configure with
CXXFLAGS="-g -ggdb -O0" or whatever debug flags you need.

**debug.log**

If the code is behaving strangely, take a look in the debug.log file in the data directory;
error and debugging message are written there.

The -debug=... command-line option controls debugging; running with just -debug will turn
on all categories (and give you a very large debug.log file).

The Qt code routes qDebug() output to debug.log under category "qt": run with -debug=qt
to see it.

**testnet and regtest modes**

Run with the -testnet option to run with "play bitcoins" on the test network, if you
are testing multi-machine code that needs to operate across the internet.

If you are testing something that can run on one machine, run with the -regtest option.
In regression test mode blocks can be created on-demand; see qa/rpc-tests/ for tests
that run in -regest mode.

**DEBUG_LOCKORDER**

Bitcoin Core is a multithreaded application, and deadlocks or other multithreading bugs
can be very difficult to track down. Compiling with -DDEBUG_LOCKORDER (configure
CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of what locks
are held, and adds warning to the debug.log file if inconsistencies are detected.