github.com/dashpay/godash@v0.0.0-20160726055534-e038a21e0e3d/docs/README.md (about) 1 ### Table of Contents 2 1. [About](#About) 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) 10 4. [Mining](#Mining) 11 3. [Help](#Help) 12 1. [Startup](#Startup) 13 1. [Using bootstrap.dat](#BootstrapDat) 14 2. [Network Configuration](#NetworkConfig) 15 3. [Wallet](#Wallet) 16 4. [Contact](#Contact) 17 1. [IRC](#ContactIRC) 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) 23 24 <a name="About" /> 25 ### 1. About 26 btcd is a full node bitcoin implementation written in [Go](http://golang.org), 27 licensed under the [copyfree](http://www.copyfree.org) ISC License. 28 29 This project is currently under active development and is in a Beta state. It 30 is extremely stable and has been in production use since October 2013. 31 32 It currently properly downloads, validates, and serves the block chain using the 33 exact rules (including bugs) for block acceptance as the reference 34 implementation, [bitcoind](https://github.com/bitcoin/bitcoin). We have taken 35 great care to avoid btcd causing a fork to the block chain. It passes all of 36 the '[official](https://github.com/TheBlueMatt/test-scripts/)' block acceptance 37 tests. 38 39 It also properly relays newly mined blocks, maintains a transaction pool, and 40 relays individual transactions that have not yet made it into a block. It 41 ensures all individual transactions admitted to the pool follow the rules 42 required into the block chain and also includes the vast majority of the more 43 strict checks which filter transactions based on miner requirements ("standard" 44 transactions). 45 46 One key difference between btcd and Bitcoin Core is that btcd does *NOT* include 47 wallet functionality and this was a very intentional design decision. See the 48 blog entry [here](https://blog.conformal.com/btcd-not-your-moms-bitcoin-daemon) 49 for more details. This means you can't actually make or receive payments 50 directly with btcd. That functionality is provided by the 51 [btcwallet](https://github.com/btcsuite/btcwallet) and 52 [Paymetheus](https://github.com/btcsuite/Paymetheus) (Windows-only) projects 53 which are both under active development. 54 55 <a name="GettingStarted" /> 56 ### 2. Getting Started 57 58 <a name="Installation" /> 59 **2.1 Installation**<br /> 60 61 The first step is to install btcd. See one of the following sections for 62 details on how to install on the supported operating systems. 63 64 <a name="WindowsInstallation" /> 65 **2.1.1 Windows Installation**<br /> 66 67 * Install the MSI available at: https://github.com/dashpay/godash/releases 68 * Launch btcd from the Start Menu 69 70 <a name="PosixInstallation" /> 71 **2.1.2 Linux/BSD/MacOSX/POSIX Installation**<br /> 72 73 - Install Go according to the installation instructions here: 74 http://golang.org/doc/install 75 76 - Ensure Go was installed properly and is a supported version: 77 78 ```bash 79 $ go version 80 $ go env GOROOT GOPATH 81 ``` 82 83 NOTE: The `GOROOT` and `GOPATH` above must not be the same path. It is 84 recommended that `GOPATH` is set to a directory in your home directory such as 85 `~/goprojects` to avoid write permission issues. It is also recommended to add 86 `$GOPATH/bin` to your `PATH` at this point. 87 88 **NOTE:** If you are using Go 1.5, you must manually enable the vendor 89 experiment by setting the `GO15VENDOREXPERIMENT` environment variable to `1`. 90 This step is not required for Go 1.6. 91 92 - Run the following commands to obtain btcd, all dependencies, and install it: 93 94 ```bash 95 $ go get -u github.com/Masterminds/glide 96 $ git clone https://github.com/dashpay/godash $GOPATH/src/github.com/dashpay/godash 97 $ cd $GOPATH/src/github.com/dashpay/godash 98 $ glide install 99 $ go install . ./cmd/... 100 ``` 101 102 - btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did 103 not already add the bin directory to your system path during Go installation, 104 we recommend you do so now. 105 106 **Updating** 107 108 - Run the following commands to update btcd, all dependencies, and install it: 109 110 ```bash 111 $ cd $GOPATH/src/github.com/dashpay/godash 112 $ git pull && glide install 113 $ go install . ./cmd/... 114 ``` 115 116 <a name="GentooInstallation" /> 117 **2.1.2.1 Gentoo Linux Installation**<br /> 118 119 * Install Layman and enable the Bitcoin overlay. 120 * https://gitlab.com/bitcoin/gentoo 121 * Copy or symlink `/var/lib/layman/bitcoin/Documentation/package.keywords/btcd-live` to `/etc/portage/package.keywords/` 122 * Install btcd: `$ emerge net-p2p/btcd` 123 124 <a name="Configuration" /> 125 **2.2 Configuration**<br /> 126 127 btcd has a number of [configuration](http://godoc.org/github.com/dashpay/godash) 128 options, which can be viewed by running: `$ btcd --help`. 129 130 <a name="BtcctlConfig" /> 131 **2.3 Controlling and Querying btcd via btcctl**<br /> 132 133 btcctl is a command line utility that can be used to both control and query btcd 134 via [RPC](http://www.wikipedia.org/wiki/Remote_procedure_call). btcd does 135 **not** enable its RPC server by default; You must configure at minimum both an 136 RPC username and password or both an RPC limited username and password: 137 138 * btcd.conf configuration file 139 ``` 140 [Application Options] 141 rpcuser=myuser 142 rpcpass=SomeDecentp4ssw0rd 143 rpclimituser=mylimituser 144 rpclimitpass=Limitedp4ssw0rd 145 ``` 146 * btcctl.conf configuration file 147 ``` 148 [Application Options] 149 rpcuser=myuser 150 rpcpass=SomeDecentp4ssw0rd 151 ``` 152 OR 153 ``` 154 [Application Options] 155 rpclimituser=mylimituser 156 rpclimitpass=Limitedp4ssw0rd 157 ``` 158 For a list of available options, run: `$ btcctl --help` 159 160 <a name="Mining" /> 161 **2.4 Mining**<br /> 162 btcd supports both the `getwork` and `getblocktemplate` RPCs although the 163 `getwork` RPC is deprecated and will likely be removed in a future release. 164 The limited user cannot access these RPCs.<br /> 165 166 **1. Add the payment addresses with the `miningaddr` option.**<br /> 167 168 ``` 169 [Application Options] 170 rpcuser=myuser 171 rpcpass=SomeDecentp4ssw0rd 172 miningaddr=12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX 173 miningaddr=1M83ju3EChKYyysmM2FXtLNftbacagd8FR 174 ``` 175 176 **2. Add btcd's RPC TLS certificate to system Certificate Authority list.**<br /> 177 178 `cgminer` uses [curl](http://curl.haxx.se/) to fetch data from the RPC server. 179 Since curl validates the certificate by default, we must install the `btcd` RPC 180 certificate into the default system Certificate Authority list. 181 182 **Ubuntu**<br /> 183 184 1. Copy rpc.cert to /usr/share/ca-certificates: `# cp /home/user/.btcd/rpc.cert /usr/share/ca-certificates/btcd.crt`<br /> 185 2. Add btcd.crt to /etc/ca-certificates.conf: `# echo btcd.crt >> /etc/ca-certificates.conf`<br /> 186 3. Update the CA certificate list: `# update-ca-certificates`<br /> 187 188 **3. Set your mining software url to use https.**<br /> 189 190 `$ cgminer -o https://127.0.0.1:8334 -u rpcuser -p rpcpassword` 191 192 <a name="Help" /> 193 ### 3. Help 194 195 <a name="Startup" /> 196 **3.1 Startup**<br /> 197 198 Typically btcd will run and start downloading the block chain with no extra 199 configuration necessary, however, there is an optional method to use a 200 `bootstrap.dat` file that may speed up the initial block chain download process. 201 202 <a name="BootstrapDat" /> 203 **3.1.1 bootstrap.dat**<br /> 204 * [Using bootstrap.dat](https://github.com/dashpay/godash/tree/master/docs/using_bootstrap_dat.md) 205 206 <a name="NetworkConfig" /> 207 **3.1.2 Network Configuration**<br /> 208 * [What Ports Are Used by Default?](https://github.com/dashpay/godash/tree/master/docs/default_ports.md) 209 * [How To Listen on Specific Interfaces](https://github.com/dashpay/godash/tree/master/docs/configure_peer_server_listen_interfaces.md) 210 * [How To Configure RPC Server to Listen on Specific Interfaces](https://github.com/dashpay/godash/tree/master/docs/configure_rpc_server_listen_interfaces.md) 211 * [Configuring btcd with Tor](https://github.com/dashpay/godash/tree/master/docs/configuring_tor.md) 212 213 <a name="Wallet" /> 214 **3.1 Wallet**<br /> 215 216 btcd was intentionally developed without an integrated wallet for security 217 reasons. Please see [btcwallet](https://github.com/btcsuite/btcwallet) for more 218 information. 219 220 <a name="Contact" /> 221 ### 4. Contact 222 223 <a name="ContactIRC" /> 224 **4.1 IRC**<br /> 225 * [irc.freenode.net](irc://irc.freenode.net), channel #btcd 226 227 <a name="MailingLists" /> 228 **4.2 Mailing Lists**<br /> 229 * <a href="mailto:btcd+subscribe@opensource.conformal.com">btcd</a>: discussion 230 of btcd and its packages. 231 * <a href="mailto:btcd-commits+subscribe@opensource.conformal.com">btcd-commits</a>: 232 readonly mail-out of source code changes. 233 234 <a name="DeveloperResources" /> 235 ### 5. Developer Resources 236 237 <a name="ContributionGuidelines" /> 238 * [Code Contribution Guidelines](https://github.com/dashpay/godash/tree/master/docs/code_contribution_guidelines.md) 239 <a name="JSONRPCReference" /> 240 * [JSON-RPC Reference](https://github.com/dashpay/godash/tree/master/docs/json_rpc_api.md) 241 * [RPC Examples](https://github.com/dashpay/godash/tree/master/docs/json_rpc_api.md#ExampleCode) 242 <a name="GoPackages" /> 243 * The btcsuite Bitcoin-related Go Packages: 244 * [btcrpcclient](https://github.com/btcsuite/btcrpcclient) - Implements a 245 robust and easy to use Websocket-enabled Bitcoin JSON-RPC client 246 * [btcjson](https://github.com/btcsuite/btcjson) - Provides an extensive API 247 for the underlying JSON-RPC command and return values 248 * [wire](https://github.com/dashpay/godash/tree/master/wire) - Implements the 249 Bitcoin wire protocol 250 * [peer](https://github.com/dashpay/godash/tree/master/peer) - 251 Provides a common base for creating and managing Bitcoin network peers. 252 * [blockchain](https://github.com/dashpay/godash/tree/master/blockchain) - 253 Implements Bitcoin block handling and chain selection rules 254 * [txscript](https://github.com/dashpay/godash/tree/master/txscript) - 255 Implements the Bitcoin transaction scripting language 256 * [btcec](https://github.com/dashpay/godash/tree/master/btcec) - Implements 257 support for the elliptic curve cryptographic functions needed for the 258 Bitcoin scripts 259 * [database](https://github.com/dashpay/godash/tree/master/database) - 260 Provides a database interface for the Bitcoin block chain 261 * [btcutil](https://github.com/btcsuite/btcutil) - Provides Bitcoin-specific 262 convenience functions and types 263 * The dashpay Dash-related Go Packages: 264 * [dashgoutil](https://github.com/dashpay/dashgoutil) - Provides Dash-specific 265 convenience functions and types