3 2. [Getting Started](#GettingStarted)
4 1. [Installation](#Installation)
5 1. [Windows](#WindowsInstallation)
6 2. [Linux/BSD/MacOSX/POSIX](#PosixInstallation)
7 1. [Gentoo Linux](#GentooInstallation)
8 2. [Configuration](#Configuration)
9 3. [Controlling and Querying btcd via btcctl](#BtcctlConfig)
12 1. [Startup](#Startup)
13 1. [Using bootstrap.dat](#BootstrapDat)
14 2. [Network Configuration](#NetworkConfig)
16 4. [Contact](#Contact)
18 2. [Mailing Lists](#MailingLists)
19 5. [Developer Resources](#DeveloperResources)
20 1. [Code Contribution Guidelines](#ContributionGuidelines)
21 2. [JSON-RPC Reference](#JSONRPCReference)
22 3. [The btcsuite Bitcoin-related Go Packages](#GoPackages)
28 btcd is a full node bitcoin implementation written in [Go](http://golang.org),
29 licensed under the [copyfree](http://www.copyfree.org) ISC License.
31 This project is currently under active development and is in a Beta state. It
32 is extremely stable and has been in production use since October 2013.
34 It properly downloads, validates, and serves the block chain using the exact
35 rules (including consensus bugs) for block acceptance as Bitcoin Core. We have
36 taken great care to avoid btcd causing a fork to the block chain. It includes a
37 full block validation testing framework which contains all of the 'official'
38 block acceptance tests (and some additional ones) that is run on every pull
39 request to help ensure it properly follows consensus. Also, it passes all of
40 the JSON test data in the Bitcoin Core code.
42 It also properly relays newly mined blocks, maintains a transaction pool, and
43 relays individual transactions that have not yet made it into a block. It
44 ensures all individual transactions admitted to the pool follow the rules
45 required by the block chain and also includes more strict checks which filter
46 transactions based on miner requirements ("standard" transactions).
48 One key difference between btcd and Bitcoin Core is that btcd does *NOT* include
49 wallet functionality and this was a very intentional design decision. See the
50 blog entry [here](https://blog.conformal.com/btcd-not-your-moms-bitcoin-daemon)
51 for more details. This means you can't actually make or receive payments
52 directly with btcd. That functionality is provided by the
53 [btcwallet](https://github.com/btcsuite/btcwallet) and
54 [Paymetheus](https://github.com/btcsuite/Paymetheus) (Windows-only) projects
55 which are both under active development.
57 <a name="GettingStarted" />
59 ### 2. Getting Started
61 <a name="Installation" />
65 The first step is to install btcd. See one of the following sections for
66 details on how to install on the supported operating systems.
68 <a name="WindowsInstallation" />
70 **2.1.1 Windows Installation**<br />
72 * Install the MSI available at: https://github.com/btcsuite/btcd/releases
73 * Launch btcd from the Start Menu
75 <a name="PosixInstallation" />
77 **2.1.2 Linux/BSD/MacOSX/POSIX Installation**
80 - Install Go according to the installation instructions here:
81 http://golang.org/doc/install
83 - Ensure Go was installed properly and is a supported version:
87 $ go env GOROOT GOPATH
90 NOTE: The `GOROOT` and `GOPATH` above must not be the same path. It is
91 recommended that `GOPATH` is set to a directory in your home directory such as
92 `~/goprojects` to avoid write permission issues. It is also recommended to add
93 `$GOPATH/bin` to your `PATH` at this point.
95 - Run the following commands to obtain btcd, all dependencies, and install it:
98 $ go get -u github.com/Masterminds/glide
99 $ git clone https://github.com/btcsuite/btcd $GOPATH/src/github.com/btcsuite/btcd
100 $ cd $GOPATH/src/github.com/btcsuite/btcd
102 $ go install . ./cmd/...
105 - btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did
106 not already add the bin directory to your system path during Go installation,
107 we recommend you do so now.
111 - Run the following commands to update btcd, all dependencies, and install it:
114 $ cd $GOPATH/src/github.com/btcsuite/btcd
115 $ git pull && glide install
116 $ go install . ./cmd/...
119 <a name="GentooInstallation" />
121 **2.1.2.1 Gentoo Linux Installation**
123 * Install Layman and enable the Bitcoin overlay.
124 * https://gitlab.com/bitcoin/gentoo
125 * Copy or symlink `/var/lib/layman/bitcoin/Documentation/package.keywords/btcd-live` to `/etc/portage/package.keywords/`
126 * Install btcd: `$ emerge net-p2p/btcd`
128 <a name="Configuration" />
130 **2.2 Configuration**
132 btcd has a number of [configuration](http://godoc.org/github.com/btcsuite/btcd)
133 options, which can be viewed by running: `$ btcd --help`.
135 <a name="BtcctlConfig" />
137 **2.3 Controlling and Querying btcd via btcctl**
139 btcctl is a command line utility that can be used to both control and query btcd
140 via [RPC](http://www.wikipedia.org/wiki/Remote_procedure_call). btcd does
141 **not** enable its RPC server by default; You must configure at minimum both an
142 RPC username and password or both an RPC limited username and password:
144 * btcd.conf configuration file
146 [Application Options]
148 rpcpass=SomeDecentp4ssw0rd
149 rpclimituser=mylimituser
150 rpclimitpass=Limitedp4ssw0rd
152 * btcctl.conf configuration file
154 [Application Options]
156 rpcpass=SomeDecentp4ssw0rd
160 [Application Options]
161 rpclimituser=mylimituser
162 rpclimitpass=Limitedp4ssw0rd
164 For a list of available options, run: `$ btcctl --help`
170 btcd supports the `getblocktemplate` RPC.
171 The limited user cannot access this RPC.
174 **1. Add the payment addresses with the `miningaddr` option.**
177 [Application Options]
179 rpcpass=SomeDecentp4ssw0rd
180 miningaddr=12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX
181 miningaddr=1M83ju3EChKYyysmM2FXtLNftbacagd8FR
184 **2. Add btcd's RPC TLS certificate to system Certificate Authority list.**
186 `cgminer` uses [curl](http://curl.haxx.se/) to fetch data from the RPC server.
187 Since curl validates the certificate by default, we must install the `btcd` RPC
188 certificate into the default system Certificate Authority list.
192 1. Copy rpc.cert to /usr/share/ca-certificates: `# cp /home/user/.btcd/rpc.cert /usr/share/ca-certificates/btcd.crt`
193 2. Add btcd.crt to /etc/ca-certificates.conf: `# echo btcd.crt >> /etc/ca-certificates.conf`
194 3. Update the CA certificate list: `# update-ca-certificates`
196 **3. Set your mining software url to use https.**
198 `$ cgminer -o https://127.0.0.1:8334 -u rpcuser -p rpcpassword`
208 Typically btcd will run and start downloading the block chain with no extra
209 configuration necessary, however, there is an optional method to use a
210 `bootstrap.dat` file that may speed up the initial block chain download process.
212 <a name="BootstrapDat" />
214 **3.1.1 bootstrap.dat**
216 * [Using bootstrap.dat](https://github.com/btcsuite/btcd/tree/master/docs/using_bootstrap_dat.md)
218 <a name="NetworkConfig" />
220 **3.1.2 Network Configuration**
222 * [What Ports Are Used by Default?](https://github.com/btcsuite/btcd/tree/master/docs/default_ports.md)
223 * [How To Listen on Specific Interfaces](https://github.com/btcsuite/btcd/tree/master/docs/configure_peer_server_listen_interfaces.md)
224 * [How To Configure RPC Server to Listen on Specific Interfaces](https://github.com/btcsuite/btcd/tree/master/docs/configure_rpc_server_listen_interfaces.md)
225 * [Configuring btcd with Tor](https://github.com/btcsuite/btcd/tree/master/docs/configuring_tor.md)
231 btcd was intentionally developed without an integrated wallet for security
232 reasons. Please see [btcwallet](https://github.com/btcsuite/btcwallet) for more
240 <a name="ContactIRC" />
244 * [irc.freenode.net](irc://irc.freenode.net), channel `#btcd`
246 <a name="MailingLists" />
248 **4.2 Mailing Lists**
250 * <a href="mailto:btcd+subscribe@opensource.conformal.com">btcd</a>: discussion
251 of btcd and its packages.
252 * <a href="mailto:btcd-commits+subscribe@opensource.conformal.com">btcd-commits</a>:
253 readonly mail-out of source code changes.
255 <a name="DeveloperResources" />
257 ### 5. Developer Resources
259 <a name="ContributionGuidelines" />
261 * [Code Contribution Guidelines](https://github.com/btcsuite/btcd/tree/master/docs/code_contribution_guidelines.md)
263 <a name="JSONRPCReference" />
265 * [JSON-RPC Reference](https://github.com/btcsuite/btcd/tree/master/docs/json_rpc_api.md)
266 * [RPC Examples](https://github.com/btcsuite/btcd/tree/master/docs/json_rpc_api.md#ExampleCode)
268 <a name="GoPackages" />
270 * The btcsuite Bitcoin-related Go Packages:
271 * [btcrpcclient](https://github.com/btcsuite/btcrpcclient) - Implements a
272 robust and easy to use Websocket-enabled Bitcoin JSON-RPC client
273 * [btcjson](https://github.com/btcsuite/btcjson) - Provides an extensive API
274 for the underlying JSON-RPC command and return values
275 * [wire](https://github.com/btcsuite/btcd/tree/master/wire) - Implements the
276 Bitcoin wire protocol
277 * [peer](https://github.com/btcsuite/btcd/tree/master/peer) -
278 Provides a common base for creating and managing Bitcoin network peers.
279 * [blockchain](https://github.com/btcsuite/btcd/tree/master/blockchain) -
280 Implements Bitcoin block handling and chain selection rules
281 * [blockchain/fullblocktests](https://github.com/btcsuite/btcd/tree/master/blockchain/fullblocktests) -
282 Provides a set of block tests for testing the consensus validation rules
283 * [txscript](https://github.com/btcsuite/btcd/tree/master/txscript) -
284 Implements the Bitcoin transaction scripting language
285 * [btcec](https://github.com/btcsuite/btcd/tree/master/btcec) - Implements
286 support for the elliptic curve cryptographic functions needed for the
288 * [database](https://github.com/btcsuite/btcd/tree/master/database) -
289 Provides a database interface for the Bitcoin block chain
290 * [mempool](https://github.com/btcsuite/btcd/tree/master/mempool) -
291 Package mempool provides a policy-enforced pool of unmined bitcoin
293 * [btcutil](https://github.com/btcsuite/btcutil) - Provides Bitcoin-specific
294 convenience functions and types
295 * [chainhash](https://github.com/btcsuite/btcd/tree/master/chaincfg/chainhash) -
296 Provides a generic hash type and associated functions that allows the
297 specific hash algorithm to be abstracted.
298 * [connmgr](https://github.com/btcsuite/btcd/tree/master/connmgr) -
299 Package connmgr implements a generic Bitcoin network connection manager.