2016-05-20 04:54:40 +00:00
### Table of Contents
1. [About ](#About )
2. [Getting Started ](#GettingStarted )
1. [Installation ](#Installation )
2. [Configuration ](#Configuration )
3. [Controlling and Querying dcrd via dcrctl ](#DcrctlConfig )
4. [Mining ](#Mining )
3. [Help ](#Help )
2018-09-11 23:26:56 +00:00
1. [Network Configuration ](#NetworkConfig )
2. [Wallet ](#Wallet )
2016-05-20 04:54:40 +00:00
4. [Contact ](#Contact )
2018-09-11 23:26:56 +00:00
1. [Community ](#ContactCommunity )
2016-05-20 04:54:40 +00:00
5. [Developer Resources ](#DeveloperResources )
1. [Code Contribution Guidelines ](#ContributionGuidelines )
2. [JSON-RPC Reference ](#JSONRPCReference )
2018-08-10 02:21:16 +00:00
3. [Go Modules ](#GoModules )
4. [Module Hierarchy ](#ModuleHierarchy )
2016-05-20 04:54:40 +00:00
< a name = "About" / >
2017-07-16 20:08:46 +00:00
2016-05-20 04:54:40 +00:00
### 1. About
2018-09-11 23:26:56 +00:00
2019-06-18 19:20:06 +00:00
dcrd is a full node Decred implementation written in [Go ](https://golang.org ),
2018-09-11 23:26:56 +00:00
and is licensed under the [copyfree ](http://www.copyfree.org ) ISC License.
2016-05-20 04:54:40 +00:00
2018-09-11 23:26:56 +00:00
This software is currently under active development. It is extremely stable and
has been in production use since February 2016.
2016-05-20 04:54:40 +00:00
It also properly relays newly mined blocks, maintains a transaction pool, and
2018-09-11 23:26:56 +00:00
relays individual transactions that have not yet made it into a block. It
2016-05-20 04:54:40 +00:00
ensures all individual transactions admitted to the pool follow the rules
required into the block chain and also includes the vast majority of the more
strict checks which filter transactions based on miner requirements ("standard"
transactions).
< a name = "GettingStarted" / >
2017-07-16 20:08:46 +00:00
2016-05-20 04:54:40 +00:00
### 2. Getting Started
< a name = "Installation" / >
2017-07-16 20:08:46 +00:00
2016-05-20 04:54:40 +00:00
**2.1 Installation**< br / >
2018-09-11 23:26:56 +00:00
The first step is to install dcrd. The installation instructions can be found
[here ](https://github.com/decred/dcrd/tree/master/README.md#Installation ).
2016-05-20 04:54:40 +00:00
< a name = "Configuration" / >
2017-07-16 20:08:46 +00:00
2016-05-20 04:54:40 +00:00
**2.2 Configuration**< br / >
2019-06-18 19:20:06 +00:00
dcrd has a number of [configuration ](https://godoc.org/github.com/decred/dcrd )
2016-05-20 04:54:40 +00:00
options, which can be viewed by running: `$ dcrd --help` .
< a name = "DcrctlConfig" / >
2017-07-16 20:08:46 +00:00
2016-05-20 04:54:40 +00:00
**2.3 Controlling and Querying dcrd via dcrctl**< br / >
dcrctl is a command line utility that can be used to both control and query dcrd
2019-06-18 19:20:06 +00:00
via [RPC ](https://www.wikipedia.org/wiki/Remote_procedure_call ). dcrd does
2016-05-20 04:54:40 +00:00
**not** enable its RPC server by default; You must configure at minimum both an
RPC username and password or both an RPC limited username and password:
* dcrd.conf configuration file
```
[Application Options]
rpcuser=myuser
rpcpass=SomeDecentp4ssw0rd
rpclimituser=mylimituser
rpclimitpass=Limitedp4ssw0rd
```
* dcrctl.conf configuration file
```
[Application Options]
rpcuser=myuser
rpcpass=SomeDecentp4ssw0rd
```
OR
```
[Application Options]
rpclimituser=mylimituser
rpclimitpass=Limitedp4ssw0rd
```
For a list of available options, run: `$ dcrctl --help`
< a name = "Mining" / >
2017-07-16 20:08:46 +00:00
2016-05-20 04:54:40 +00:00
**2.4 Mining**< br / >
2019-03-11 10:22:30 +00:00
dcrd supports the [getwork ](https://github.com/decred/dcrd/tree/master/docs/json_rpc_api.mediawiki#getwork )
2018-09-11 23:26:56 +00:00
RPC. The limited user cannot access this RPC.< br / >
2016-05-20 04:54:40 +00:00
**1. Add the payment addresses with the `miningaddr` option.**< br />
```
[Application Options]
rpcuser=myuser
rpcpass=SomeDecentp4ssw0rd
2018-09-11 23:26:56 +00:00
miningaddr=DsExampleAddress1
miningaddr=DsExampleAddress2
2016-05-20 04:54:40 +00:00
```
**2. Add dcrd's RPC TLS certificate to system Certificate Authority list.**< br / >
2019-06-18 19:20:06 +00:00
`cgminer` uses [curl ](https://curl.haxx.se/ ) to fetch data from the RPC server.
2016-05-20 04:54:40 +00:00
Since curl validates the certificate by default, we must install the `dcrd` RPC
certificate into the default system Certificate Authority list.
**Ubuntu**< br / >
1. Copy rpc.cert to /usr/share/ca-certificates: `# cp /home/user/.dcrd/rpc.cert /usr/share/ca-certificates/dcrd.crt` < br />
2. Add dcrd.crt to /etc/ca-certificates.conf: `# echo dcrd.crt >> /etc/ca-certificates.conf` < br />
3. Update the CA certificate list: `# update-ca-certificates` < br />
**3. Set your mining software url to use https.**< br / >
`$ cgminer -o https://127.0.0.1:9109 -u rpcuser -p rpcpassword`
< a name = "Help" / >
2017-07-16 20:08:46 +00:00
2016-05-20 04:54:40 +00:00
### 3. Help
< a name = "NetworkConfig" / >
2017-07-16 20:08:46 +00:00
2018-09-11 23:26:56 +00:00
**3.1 Network Configuration**< br / >
2016-05-20 04:54:40 +00:00
* [What Ports Are Used by Default? ](https://github.com/decred/dcrd/tree/master/docs/default_ports.md )
* [How To Listen on Specific Interfaces ](https://github.com/decred/dcrd/tree/master/docs/configure_peer_server_listen_interfaces.md )
* [How To Configure RPC Server to Listen on Specific Interfaces ](https://github.com/decred/dcrd/tree/master/docs/configure_rpc_server_listen_interfaces.md )
* [Configuring dcrd with Tor ](https://github.com/decred/dcrd/tree/master/docs/configuring_tor.md )
< a name = "Wallet" / >
2017-07-16 20:08:46 +00:00
2018-09-11 23:26:56 +00:00
**3.2 Wallet**< br / >
2016-05-20 04:54:40 +00:00
dcrd was intentionally developed without an integrated wallet for security
reasons. Please see [dcrwallet ](https://github.com/decred/dcrwallet ) for more
information.
< a name = "Contact" / >
2017-07-16 20:08:46 +00:00
2016-05-20 04:54:40 +00:00
### 4. Contact
2018-09-11 23:26:56 +00:00
< a name = "ContactCommunity" / >
2017-07-16 20:08:46 +00:00
2018-09-11 23:26:56 +00:00
**4.1 Community**< br / >
2016-05-20 04:54:40 +00:00
2018-09-11 23:26:56 +00:00
If you have any further questions you can find us at:
2017-07-16 20:08:46 +00:00
2018-09-11 23:26:56 +00:00
https://decred.org/community
2016-05-20 04:54:40 +00:00
< a name = "DeveloperResources" / >
2017-07-16 20:08:46 +00:00
2016-05-20 04:54:40 +00:00
### 5. Developer Resources
< a name = "ContributionGuidelines" / >
2017-07-16 20:08:46 +00:00
2018-08-10 02:21:16 +00:00
**5.1 Code Contribution Guidelines**
2016-05-20 04:54:40 +00:00
* [Code Contribution Guidelines ](https://github.com/decred/dcrd/tree/master/docs/code_contribution_guidelines.md )
2018-08-10 02:21:16 +00:00
2016-05-20 04:54:40 +00:00
< a name = "JSONRPCReference" / >
2017-07-16 20:08:46 +00:00
2018-08-10 02:21:16 +00:00
**5.2 JSON-RPC Reference**
2019-03-11 10:22:30 +00:00
* [JSON-RPC Reference ](https://github.com/decred/dcrd/tree/master/docs/json_rpc_api.mediawiki )
* [RPC Examples ](https://github.com/decred/dcrd/tree/master/docs/json_rpc_api.mediawiki#8-example-code )
2018-08-10 02:21:16 +00:00
< a name = "GoModules" / >
**5.3 Go Modules**
The following versioned modules are provided by dcrd repository:
2019-07-30 17:55:23 +00:00
* [rpcclient/v4 ](https://github.com/decred/dcrd/tree/master/rpcclient ) - Implements
2018-08-10 02:21:16 +00:00
a robust and easy to use Websocket-enabled Decred JSON-RPC client
2019-07-21 05:36:06 +00:00
* [dcrjson/v3 ](https://github.com/decred/dcrd/tree/master/dcrjson ) - Provides
infrastructure for working with Decred JSON-RPC APIs
* [rpc/jsonrpc/types ](https://github.com/decred/dcrd/tree/master/rpc/jsonrpc/types ) -
Provides concrete types via dcrjson for the chain server JSON-RPC commands,
return values, and notifications
2018-08-10 02:21:16 +00:00
* [wire ](https://github.com/decred/dcrd/tree/master/wire ) - Implements the
Decred wire protocol
2019-08-12 03:11:39 +00:00
* [peer/v2 ](https://github.com/decred/dcrd/tree/master/peer ) - Provides a common
2018-08-10 02:21:16 +00:00
base for creating and managing Decred network peers
2019-08-07 17:55:47 +00:00
* [blockchain/v2 ](https://github.com/decred/dcrd/tree/master/blockchain ) -
2018-08-10 02:21:16 +00:00
Implements Decred block handling and chain selection rules
2019-07-26 18:18:56 +00:00
* [stake/v2 ](https://github.com/decred/dcrd/tree/master/blockchain/stake ) -
2018-08-10 02:21:16 +00:00
Provides an API for working with stake transactions and other portions
related to the Proof-of-Stake (PoS) system
2019-08-07 04:24:31 +00:00
* [standalone ](https://github.com/decred/dcrd/tree/master/blockchain/standalone ) -
Provides standalone functions useful for working with the Decred blockchain
consensus rules
2019-06-19 04:51:28 +00:00
* [txscript/v2 ](https://github.com/decred/dcrd/tree/master/txscript ) -
2018-08-10 02:21:16 +00:00
Implements the Decred transaction scripting language
* [dcrec ](https://github.com/decred/dcrd/tree/master/dcrec ) - Provides constants
for the supported cryptographic signatures supported by Decred scripts
2019-10-08 04:42:22 +00:00
* [secp256k1/v2 ](https://github.com/decred/dcrd/tree/master/dcrec/secp256k1 ) -
2018-08-10 02:21:16 +00:00
Implements the secp256k1 elliptic curve
2019-06-14 16:32:21 +00:00
* [edwards/v2 ](https://github.com/decred/dcrd/tree/master/dcrec/edwards ) -
2018-08-10 02:21:16 +00:00
Implements the edwards25519 twisted Edwards curve
2019-07-23 00:31:34 +00:00
* [database/v2 ](https://github.com/decred/dcrd/tree/master/database ) -
2018-08-10 02:21:16 +00:00
Provides a database interface for the Decred block chain
2019-08-12 09:02:01 +00:00
* [mempool/v3 ](https://github.com/decred/dcrd/tree/master/mempool ) - Provides a
2018-08-10 02:21:16 +00:00
policy-enforced pool of unmined Decred transactions
2019-06-15 04:01:09 +00:00
* [dcrutil/v2 ](https://github.com/decred/dcrd/tree/master/dcrutil ) - Provides
2018-08-10 02:21:16 +00:00
Decred-specific convenience functions and types
2019-03-15 03:43:33 +00:00
* [chaincfg/v2 ](https://github.com/decred/dcrd/tree/master/chaincfg ) - Defines
2018-08-10 02:21:16 +00:00
chain configuration parameters for the standard Decred networks and allows
callers to define their own custom Decred networks for testing puproses
2017-12-30 17:41:50 +00:00
* [chainhash ](https://github.com/decred/dcrd/tree/master/chaincfg/chainhash ) -
Provides a generic hash type and associated functions that allows the
2018-08-10 02:21:16 +00:00
specific hash algorithm to be abstracted
* [certgen ](https://github.com/decred/dcrd/tree/master/certgen ) - Provides a
function for creating a new TLS certificate key pair, typically used for
encrypting RPC and websocket communications
* [addrmgr ](https://github.com/decred/dcrd/tree/master/addrmgr ) - Provides a
concurrency safe Decred network address manager
2019-08-09 20:26:11 +00:00
* [connmgr/v2 ](https://github.com/decred/dcrd/tree/master/connmgr ) - Implements
a generic Decred network connection manager
2019-03-25 19:10:45 +00:00
* [hdkeychain/v2 ](https://github.com/decred/dcrd/tree/master/hdkeychain ) -
Provides an API for working with Decred hierarchical deterministic extended
keys
2018-08-10 02:21:16 +00:00
* [gcs ](https://github.com/decred/dcrd/tree/master/gcs ) - Provides an API for
building and using Golomb-coded set filters useful for light clients such as
SPV wallets
2018-12-08 04:57:10 +00:00
* [fees ](https://github.com/decred/dcrd/tree/master/fees ) - Provides methods for
tracking and estimating fee rates for new transactions to be mined into the
network
2019-03-18 15:08:29 +00:00
* [lru ](https://github.com/decred/dcrd/tree/master/lru ) - Implements a generic
concurrent safe least-recently-used cache with near O(1) perf
2018-08-10 02:21:16 +00:00
< a name = "ModuleHierarchy" / >
**5.4 Module Hierarchy**
The following diagram shows an overview of the hierarchy for the modules
provided by the dcrd repository.
2019-06-18 19:20:06 +00:00
