dcrd/docs
Dave Collins ae9c2aae56
docs: Update docs for versioned modules.
This updates the overall docs README to include all of the new modules
as well as introduce a module hierarchy diagram.
2018-08-14 04:53:08 -05:00
..
assets docs: Update docs for versioned modules. 2018-08-14 04:53:08 -05:00
code_contribution_guidelines.md docs: document how to use go test -coverprofile 2018-03-01 20:26:39 -06:00
configure_peer_server_listen_interfaces.md docs: Remove carriage return. 2018-03-01 20:14:55 -06:00
configure_rpc_server_listen_interfaces.md docs: Remove carriage return. 2018-03-01 20:14:55 -06:00
configuring_tor.md multi: Update markdown files for GFM changes. 2017-07-16 15:33:12 -05:00
default_ports.md docs: Remove carriage return. 2018-03-01 20:14:55 -06:00
json_rpc_api.md multi: add amount field to TransactionInput. 2018-06-21 23:54:42 +00:00
README.md docs: Update docs for versioned modules. 2018-08-14 04:53:08 -05:00

Table of Contents

  1. About
  2. Getting Started
    1. Installation
      1. Windows
      2. Linux/BSD/MacOSX/POSIX
    2. Configuration
    3. Controlling and Querying dcrd via dcrctl
    4. Mining
  3. Help
    1. Startup
      1. Using bootstrap.dat
    2. Network Configuration
    3. Wallet
  4. Contact
    1. IRC
    2. Mailing Lists
  5. Developer Resources
    1. Code Contribution Guidelines
    2. JSON-RPC Reference
    3. Go Modules
    4. Module Hierarchy

1. About

dcrd is a full node Decred implementation written in Go, licensed under the copyfree ISC License.

This project is currently under active development and is in a Beta state. It is extremely stable and has been in production use since February 2016.

It also properly relays newly mined blocks, maintains a transaction pool, and relays individual transactions that have not yet made it into a block. It 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).

2. Getting Started

2.1 Installation

The first step is to install dcrd. See one of the following sections for details on how to install on the supported operating systems.

2.1.1 Windows Installation

  • Install the MSI available at: https://github.com/decred/dcrd/releases
  • Launch dcrd from the Start Menu

2.1.2 Linux/BSD/MacOSX/POSIX Installation

  • Install Go according to the installation instructions here: http://golang.org/doc/install
  • Run the following command to ensure your Go version is at least version 1.2: $ go version
  • Run the following command to obtain dcrd, its dependencies, and install it: $ go get github.com/decred/dcrd/...
    • To upgrade, run the following command: $ go get -u github.com/decred/dcrd/...
  • Run dcrd: $ dcrd

2.2 Configuration

dcrd has a number of configuration options, which can be viewed by running: $ dcrd --help.

2.3 Controlling and Querying dcrd via dcrctl

dcrctl is a command line utility that can be used to both control and query dcrd via RPC. dcrd does 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

2.4 Mining
dcrd supports both the getwork and getblocktemplate RPCs although the getwork RPC is deprecated and will likely be removed in a future release. The limited user cannot access these RPCs.

1. Add the payment addresses with the miningaddr option.

[Application Options]
rpcuser=myuser
rpcpass=SomeDecentp4ssw0rd
miningaddr=12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX
miningaddr=1M83ju3EChKYyysmM2FXtLNftbacagd8FR

2. Add dcrd's RPC TLS certificate to system Certificate Authority list.

cgminer uses curl to fetch data from the RPC server. Since curl validates the certificate by default, we must install the dcrd RPC certificate into the default system Certificate Authority list.

Ubuntu

  1. Copy rpc.cert to /usr/share/ca-certificates: # cp /home/user/.dcrd/rpc.cert /usr/share/ca-certificates/dcrd.crt
  2. Add dcrd.crt to /etc/ca-certificates.conf: # echo dcrd.crt >> /etc/ca-certificates.conf
  3. Update the CA certificate list: # update-ca-certificates

3. Set your mining software url to use https.

$ cgminer -o https://127.0.0.1:9109 -u rpcuser -p rpcpassword

3. Help

3.1 Startup

Typically dcrd 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.

3.1.1 bootstrap.dat

3.1.2 Network Configuration

3.1 Wallet

dcrd was intentionally developed without an integrated wallet for security reasons. Please see dcrwallet for more information.

4. Contact

4.1 IRC

4.2 Mailing Lists

  • dcrd: discussion of dcrd and its packages.
  • dcrd-commits: readonly mail-out of source code changes.

5. Developer Resources

5.1 Code Contribution Guidelines

5.2 JSON-RPC Reference

5.3 Go Modules

The following versioned modules are provided by dcrd repository:

  • rpcclient - Implements a robust and easy to use Websocket-enabled Decred JSON-RPC client
  • dcrjson - Provides an extensive API for the underlying JSON-RPC command and return values
  • wire - Implements the Decred wire protocol
  • peer - Provides a common base for creating and managing Decred network peers
  • blockchain - Implements Decred block handling and chain selection rules
    • stake - Provides an API for working with stake transactions and other portions related to the Proof-of-Stake (PoS) system
  • txscript - Implements the Decred transaction scripting language
  • dcrec - Provides constants for the supported cryptographic signatures supported by Decred scripts
    • secp256k1 - Implements the secp256k1 elliptic curve
    • edwards - Implements the edwards25519 twisted Edwards curve
  • database - Provides a database interface for the Decred block chain
  • mempool - Provides a policy-enforced pool of unmined Decred transactions
  • dcrutil - Provides Decred-specific convenience functions and types
  • chaincfg - Defines chain configuration parameters for the standard Decred networks and allows callers to define their own custom Decred networks for testing puproses
    • chainhash - Provides a generic hash type and associated functions that allows the specific hash algorithm to be abstracted
  • certgen - Provides a function for creating a new TLS certificate key pair, typically used for encrypting RPC and websocket communications
  • addrmgr - Provides a concurrency safe Decred network address manager
  • connmgr - Implements a generic Decred network connection manager
  • hdkeychain - Provides an API for working with Decred hierarchical deterministic extended keys
  • gcs - Provides an API for building and using Golomb-coded set filters useful for light clients such as SPV wallets

5.4 Module Hierarchy

The following diagram shows an overview of the hierarchy for the modules provided by the dcrd repository.

Module Hierarchy