2015-01-18 18:16:43 +01:00
### Table of Contents
1. [About ](#About )
2. [Getting Started ](#GettingStarted )
1. [Installation ](#Installation )
1. [Windows ](#WindowsInstallation )
2. [Linux/BSD/MacOSX/POSIX ](#PosixInstallation )
2015-11-08 21:55:08 +01:00
1. [Gentoo Linux ](#GentooInstallation )
2015-01-18 18:16:43 +01:00
2. [Configuration ](#Configuration )
3. [Controlling and Querying btcd via btcctl ](#BtcctlConfig )
4. [Mining ](#Mining )
3. [Help ](#Help )
1. [Startup ](#Startup )
1. [Using bootstrap.dat ](#BootstrapDat )
2. [Network Configuration ](#NetworkConfig )
3. [Wallet ](#Wallet )
4. [Contact ](#Contact )
1. [IRC ](#ContactIRC )
2. [Mailing Lists ](#MailingLists )
5. [Developer Resources ](#DeveloperResources )
1. [Code Contribution Guidelines ](#ContributionGuidelines )
2. [JSON-RPC Reference ](#JSONRPCReference )
2015-05-01 08:28:01 +02:00
3. [The btcsuite Bitcoin-related Go Packages ](#GoPackages )
2015-01-18 18:16:43 +01:00
< a name = "About" / >
2017-05-03 20:59:47 +02:00
2015-01-18 18:16:43 +01:00
### 1. About
2017-05-03 20:59:47 +02:00
2015-01-18 18:16:43 +01:00
btcd is a full node bitcoin implementation written in [Go ](http://golang.org ),
licensed under the [copyfree ](http://www.copyfree.org ) ISC License.
2016-03-11 21:36:32 +01:00
This project is currently under active development and is in a Beta state. It
is extremely stable and has been in production use since October 2013.
2015-01-18 18:16:43 +01:00
2016-09-14 01:11:12 +02:00
It properly downloads, validates, and serves the block chain using the exact
rules (including consensus bugs) for block acceptance as Bitcoin Core. We have
taken great care to avoid btcd causing a fork to the block chain. It includes a
full block validation testing framework which contains all of the 'official'
block acceptance tests (and some additional ones) that is run on every pull
request to help ensure it properly follows consensus. Also, it passes all of
the JSON test data in the Bitcoin Core code.
2015-01-18 18:16:43 +01:00
It also properly relays newly mined blocks, maintains a transaction pool, and
2016-09-14 01:11:12 +02:00
relays individual transactions that have not yet made it into a block. It
2015-01-18 18:16:43 +01:00
ensures all individual transactions admitted to the pool follow the rules
2016-09-14 01:11:12 +02:00
required by the block chain and also includes more strict checks which filter
transactions based on miner requirements ("standard" transactions).
2015-01-18 18:16:43 +01:00
2016-03-11 21:36:32 +01:00
One key difference between btcd and Bitcoin Core is that btcd does *NOT* include
wallet functionality and this was a very intentional design decision. See the
2018-04-16 06:38:35 +02:00
blog entry [here ](https://web.archive.org/web/20171125143919/https://blog.conformal.com/btcd-not-your-moms-bitcoin-daemon )
2016-03-11 21:36:32 +01:00
for more details. This means you can't actually make or receive payments
directly with btcd. That functionality is provided by the
2015-01-18 18:16:43 +01:00
[btcwallet ](https://github.com/btcsuite/btcwallet ) and
2016-03-11 21:36:32 +01:00
[Paymetheus ](https://github.com/btcsuite/Paymetheus ) (Windows-only) projects
which are both under active development.
2015-01-18 18:16:43 +01:00
< a name = "GettingStarted" / >
2017-05-03 20:59:47 +02:00
2015-01-18 18:16:43 +01:00
### 2. Getting Started
< a name = "Installation" / >
2017-05-03 20:59:47 +02:00
**2.1 Installation**
2015-01-18 18:16:43 +01:00
The first step is to install btcd. See one of the following sections for
details on how to install on the supported operating systems.
< a name = "WindowsInstallation" / >
2017-05-03 20:59:47 +02:00
2015-01-18 18:16:43 +01:00
**2.1.1 Windows Installation**< br / >
2018-05-15 05:44:11 +02:00
* Install the MSI available at: https://github.com/btcsuite/btcd/releases
2015-01-18 18:16:43 +01:00
* Launch btcd from the Start Menu
< a name = "PosixInstallation" / >
2017-05-03 20:59:47 +02:00
**2.1.2 Linux/BSD/MacOSX/POSIX Installation**
2015-01-18 18:16:43 +01:00
2016-05-22 00:30:26 +02:00
- Install Go according to the installation instructions here:
http://golang.org/doc/install
- Ensure Go was installed properly and is a supported version:
```bash
$ go version
$ go env GOROOT GOPATH
```
NOTE: The `GOROOT` and `GOPATH` above must not be the same path. It is
recommended that `GOPATH` is set to a directory in your home directory such as
`~/goprojects` to avoid write permission issues. It is also recommended to add
`$GOPATH/bin` to your `PATH` at this point.
- Run the following commands to obtain btcd, all dependencies, and install it:
```bash
2018-05-15 05:44:11 +02:00
$ git clone https://github.com/btcsuite/btcd $GOPATH/src/github.com/btcsuite/btcd
$ cd $GOPATH/src/github.com/btcsuite/btcd
2019-03-15 21:16:42 +01:00
$ GO111MODULE=on go install -v . ./cmd/...
2016-05-22 00:30:26 +02:00
```
- btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did
not already add the bin directory to your system path during Go installation,
we recommend you do so now.
**Updating**
- Run the following commands to update btcd, all dependencies, and install it:
```bash
2018-05-15 05:44:11 +02:00
$ cd $GOPATH/src/github.com/btcsuite/btcd
2019-03-15 21:16:42 +01:00
$ git pull & & GO111MODULE=on go install -v . ./cmd/...
2016-05-22 00:30:26 +02:00
```
2015-01-18 18:16:43 +01:00
2015-11-08 21:55:08 +01:00
< a name = "GentooInstallation" / >
2017-05-03 20:59:47 +02:00
**2.1.2.1 Gentoo Linux Installation**
2015-11-08 21:55:08 +01:00
* Install Layman and enable the Bitcoin overlay.
* https://gitlab.com/bitcoin/gentoo
* Copy or symlink `/var/lib/layman/bitcoin/Documentation/package.keywords/btcd-live` to `/etc/portage/package.keywords/`
* Install btcd: `$ emerge net-p2p/btcd`
2015-01-18 18:16:43 +01:00
< a name = "Configuration" / >
2017-05-03 20:59:47 +02:00
**2.2 Configuration**
2015-01-18 18:16:43 +01:00
2018-05-15 05:44:11 +02:00
btcd has a number of [configuration ](http://godoc.org/github.com/btcsuite/btcd )
2015-01-18 18:16:43 +01:00
options, which can be viewed by running: `$ btcd --help` .
< a name = "BtcctlConfig" / >
2017-05-03 20:59:47 +02:00
**2.3 Controlling and Querying btcd via btcctl**
2015-01-18 18:16:43 +01:00
btcctl is a command line utility that can be used to both control and query btcd
via [RPC ](http://www.wikipedia.org/wiki/Remote_procedure_call ). btcd does
**not** enable its RPC server by default; You must configure at minimum both an
2015-03-30 19:45:31 +02:00
RPC username and password or both an RPC limited username and password:
2015-01-18 18:16:43 +01:00
* btcd.conf configuration file
```
[Application Options]
rpcuser=myuser
rpcpass=SomeDecentp4ssw0rd
2015-03-30 19:45:31 +02:00
rpclimituser=mylimituser
rpclimitpass=Limitedp4ssw0rd
2015-01-18 18:16:43 +01:00
```
* btcctl.conf configuration file
```
[Application Options]
rpcuser=myuser
rpcpass=SomeDecentp4ssw0rd
```
2015-03-30 19:45:31 +02:00
OR
```
[Application Options]
2015-05-06 18:46:04 +02:00
rpclimituser=mylimituser
rpclimitpass=Limitedp4ssw0rd
2015-03-30 19:45:31 +02:00
```
2015-01-18 18:16:43 +01:00
For a list of available options, run: `$ btcctl --help`
< a name = "Mining" / >
2017-05-03 20:59:47 +02:00
**2.4 Mining**
btcd supports the `getblocktemplate` RPC.
The limited user cannot access this RPC.
**1. Add the payment addresses with the `miningaddr` option.**
2015-01-18 18:16:43 +01:00
```
[Application Options]
rpcuser=myuser
rpcpass=SomeDecentp4ssw0rd
miningaddr=12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX
miningaddr=1M83ju3EChKYyysmM2FXtLNftbacagd8FR
```
2017-05-03 20:59:47 +02:00
**2. Add btcd's RPC TLS certificate to system Certificate Authority list.**
2015-01-18 18:16:43 +01:00
`cgminer` uses [curl ](http://curl.haxx.se/ ) to fetch data from the RPC server.
Since curl validates the certificate by default, we must install the `btcd` RPC
certificate into the default system Certificate Authority list.
2017-05-03 20:59:47 +02:00
**Ubuntu**
2015-01-18 18:16:43 +01:00
2017-05-03 20:59:47 +02:00
1. Copy rpc.cert to /usr/share/ca-certificates: `# cp /home/user/.btcd/rpc.cert /usr/share/ca-certificates/btcd.crt`
2. Add btcd.crt to /etc/ca-certificates.conf: `# echo btcd.crt >> /etc/ca-certificates.conf`
3. Update the CA certificate list: `# update-ca-certificates`
2015-01-18 18:16:43 +01:00
2017-05-03 20:59:47 +02:00
**3. Set your mining software url to use https.**
2015-01-18 18:16:43 +01:00
`$ cgminer -o https://127.0.0.1:8334 -u rpcuser -p rpcpassword`
< a name = "Help" / >
2017-05-03 20:59:47 +02:00
2015-01-18 18:16:43 +01:00
### 3. Help
< a name = "Startup" / >
2017-05-03 20:59:47 +02:00
**3.1 Startup**
2015-01-18 18:16:43 +01:00
Typically btcd will run and start downloading the block chain with no extra
configuration necessary, however, there is an optional method to use a
`bootstrap.dat` file that may speed up the initial block chain download process.
< a name = "BootstrapDat" / >
2017-05-03 20:59:47 +02:00
**3.1.1 bootstrap.dat**
2018-05-15 05:44:11 +02:00
* [Using bootstrap.dat ](https://github.com/btcsuite/btcd/tree/master/docs/using_bootstrap_dat.md )
2017-05-25 18:29:23 +02:00
2015-01-18 18:16:43 +01:00
< a name = "NetworkConfig" / >
2017-05-03 20:59:47 +02:00
**3.1.2 Network Configuration**
2018-05-15 05:44:11 +02:00
* [What Ports Are Used by Default? ](https://github.com/btcsuite/btcd/tree/master/docs/default_ports.md )
* [How To Listen on Specific Interfaces ](https://github.com/btcsuite/btcd/tree/master/docs/configure_peer_server_listen_interfaces.md )
* [How To Configure RPC Server to Listen on Specific Interfaces ](https://github.com/btcsuite/btcd/tree/master/docs/configure_rpc_server_listen_interfaces.md )
* [Configuring btcd with Tor ](https://github.com/btcsuite/btcd/tree/master/docs/configuring_tor.md )
2015-01-18 18:16:43 +01:00
< a name = "Wallet" / >
2017-05-03 20:59:47 +02:00
**3.1 Wallet**
2015-01-18 18:16:43 +01:00
btcd was intentionally developed without an integrated wallet for security
reasons. Please see [btcwallet ](https://github.com/btcsuite/btcwallet ) for more
information.
2017-05-03 20:59:47 +02:00
2015-01-18 18:16:43 +01:00
< a name = "Contact" / >
2017-05-03 20:59:47 +02:00
2015-01-18 18:16:43 +01:00
### 4. Contact
< a name = "ContactIRC" / >
2017-05-03 20:59:47 +02:00
**4.1 IRC**
* [irc.freenode.net ](irc://irc.freenode.net ), channel `#btcd`
2015-01-18 18:16:43 +01:00
< a name = "MailingLists" / >
2017-05-03 20:59:47 +02:00
**4.2 Mailing Lists**
2015-01-18 18:16:43 +01:00
* < a href = "mailto:btcd+subscribe@opensource.conformal.com" > btcd</ a > : discussion
of btcd and its packages.
* < a href = "mailto:btcd-commits+subscribe@opensource.conformal.com" > btcd-commits</ a > :
readonly mail-out of source code changes.
< a name = "DeveloperResources" / >
2017-05-03 20:59:47 +02:00
2015-01-18 18:16:43 +01:00
### 5. Developer Resources
< a name = "ContributionGuidelines" / >
2017-05-03 20:59:47 +02:00
2018-05-15 05:44:11 +02:00
* [Code Contribution Guidelines ](https://github.com/btcsuite/btcd/tree/master/docs/code_contribution_guidelines.md )
2017-05-03 20:59:47 +02:00
2015-01-18 18:16:43 +01:00
< a name = "JSONRPCReference" / >
2017-05-03 20:59:47 +02:00
2018-05-15 05:44:11 +02:00
* [JSON-RPC Reference ](https://github.com/btcsuite/btcd/tree/master/docs/json_rpc_api.md )
* [RPC Examples ](https://github.com/btcsuite/btcd/tree/master/docs/json_rpc_api.md#ExampleCode )
2017-05-03 20:59:47 +02:00
2015-01-18 18:16:43 +01:00
< a name = "GoPackages" / >
2017-05-03 20:59:47 +02:00
2015-05-01 08:28:01 +02:00
* The btcsuite Bitcoin-related Go Packages:
2018-02-04 15:55:31 +01:00
* [btcrpcclient ](https://github.com/btcsuite/btcd/tree/master/rpcclient ) - Implements a
2016-10-21 02:37:14 +02:00
robust and easy to use Websocket-enabled Bitcoin JSON-RPC client
2018-02-04 15:55:31 +01:00
* [btcjson ](https://github.com/btcsuite/btcd/tree/master/btcjson ) - Provides an extensive API
2016-10-21 02:37:14 +02:00
for the underlying JSON-RPC command and return values
2018-05-15 05:44:11 +02:00
* [wire ](https://github.com/btcsuite/btcd/tree/master/wire ) - Implements the
2016-10-21 02:37:14 +02:00
Bitcoin wire protocol
2018-05-15 05:44:11 +02:00
* [peer ](https://github.com/btcsuite/btcd/tree/master/peer ) -
2016-10-21 02:37:14 +02:00
Provides a common base for creating and managing Bitcoin network peers.
2018-05-15 05:44:11 +02:00
* [blockchain ](https://github.com/btcsuite/btcd/tree/master/blockchain ) -
2016-10-21 02:37:14 +02:00
Implements Bitcoin block handling and chain selection rules
2018-05-15 05:44:11 +02:00
* [blockchain/fullblocktests ](https://github.com/btcsuite/btcd/tree/master/blockchain/fullblocktests ) -
2016-10-21 02:37:14 +02:00
Provides a set of block tests for testing the consensus validation rules
2018-05-15 05:44:11 +02:00
* [txscript ](https://github.com/btcsuite/btcd/tree/master/txscript ) -
2016-10-21 02:37:14 +02:00
Implements the Bitcoin transaction scripting language
2018-05-15 05:44:11 +02:00
* [btcec ](https://github.com/btcsuite/btcd/tree/master/btcec ) - Implements
2016-10-21 02:37:14 +02:00
support for the elliptic curve cryptographic functions needed for the
Bitcoin scripts
2018-05-15 05:44:11 +02:00
* [database ](https://github.com/btcsuite/btcd/tree/master/database ) -
2016-10-21 02:37:14 +02:00
Provides a database interface for the Bitcoin block chain
2018-05-15 05:44:11 +02:00
* [mempool ](https://github.com/btcsuite/btcd/tree/master/mempool ) -
2016-10-24 02:38:52 +02:00
Package mempool provides a policy-enforced pool of unmined bitcoin
transactions.
2018-05-15 05:44:11 +02:00
* [btcutil ](https://github.com/btcsuite/btcutil ) - Provides Bitcoin-specific
2016-10-21 02:37:14 +02:00
convenience functions and types
2018-05-15 05:44:11 +02:00
* [chainhash ](https://github.com/btcsuite/btcd/tree/master/chaincfg/chainhash ) -
2016-10-21 02:37:14 +02:00
Provides a generic hash type and associated functions that allows the
specific hash algorithm to be abstracted.
2018-05-15 05:44:11 +02:00
* [connmgr ](https://github.com/btcsuite/btcd/tree/master/connmgr ) -
2016-10-21 02:37:14 +02:00
Package connmgr implements a generic Bitcoin network connection manager.