Skip to content

Latest commit

 

History

History
268 lines (206 loc) · 10.6 KB

README.md

File metadata and controls

268 lines (206 loc) · 10.6 KB

Table of Contents

  1. About
  2. Getting Started
    1. Installation
    2. Configuration
    3. Controlling and Querying dcrd via dcrctl
    4. Mining
  3. Help
    1. Network Configuration
    2. Wallet
  4. Contact
    1. Community
  5. Developer Resources
    1. Code Contribution Guidelines
    2. JSON-RPC Reference
    3. Go Modules
    4. Module Hierarchy
  6. Simulation Network (--simnet) Reference

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

This software is currently under active development. 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.1 Installation

The first step is to install dcrd. The installation instructions can be found here.

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 the getwork RPC. The limited user cannot access this RPC.

1. Add the payment addresses with the miningaddr option.

[Application Options]
rpcuser=myuser
rpcpass=SomeDecentp4ssw0rd
miningaddr=DsExampleAddress1
miningaddr=DsExampleAddress2

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.1 Network Configuration

3.2 Wallet

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

4.1 Community

If you have any further questions you can find us at:

https://decred.org/community/

5.1 Code Contribution Guidelines

5.2 JSON-RPC Reference

5.3 Go Modules

The following versioned modules are provided by dcrd repository:

  • rpcclient/v8 - Implements a robust and easy to use Websocket-enabled Decred JSON-RPC client
  • dcrjson/v4 - Provides infrastructure for working with Decred JSON-RPC APIs
  • rpc/jsonrpc/types/v4 - Provides concrete types via dcrjson for the chain server JSON-RPC commands, return values, and notifications
  • wire - Implements the Decred wire protocol
  • peer/v3 - Provides a common base for creating and managing Decred network peers
  • blockchain/v5 - Implements Decred block handling and chain selection rules
    • stake/v5 - Provides an API for working with stake transactions and other portions related to the Proof-of-Stake (PoS) system
    • standalone/v2 - Provides standalone functions useful for working with the Decred blockchain consensus rules
  • txscript/v4 - Implements the Decred transaction scripting language
  • dcrec - Provides constants for the supported cryptographic signatures supported by Decred scripts
    • secp256k1/v4 - Implements the secp256k1 elliptic curve
    • edwards/v2 - Implements the edwards25519 twisted Edwards curve
  • database/v3 - Provides a database interface for the Decred block chain
  • dcrutil/v4 - Provides Decred-specific convenience functions and types
  • chaincfg/v3 - Defines chain configuration parameters for the standard Decred networks and allows callers to define their own custom Decred networks for testing purposes
    • 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/v2 - Provides a concurrency safe Decred network address manager
  • connmgr/v3 - Implements a generic Decred network connection manager
  • hdkeychain/v3 - Provides an API for working with Decred hierarchical deterministic extended keys
  • gcs/v4 - Provides an API for building and using Golomb-coded set filters useful for light clients such as SPV wallets
  • container/apbf - Implements an optimized Age-Partitioned Bloom Filter
  • container/lru - Provides generic type and concurrent safe LRU data structures with near O(1) perf and optional time-based expiration support
  • crypto/blake256 - Implements 14-round BLAKE-256 and BLAKE-224 hash functions (SHA-3 candidate)
  • crypto/ripemd160 - Implements the RIPEMD-160 hash algorithm
  • crypto/rand - Implements a fast userspace CSPRNG that is periodically reseeded with entropy obtained from crypto/rand.
  • math/uint256 - Implements highly optimized fixed precision unsigned 256-bit integer arithmetic
  • mixing - Provides infrastructure for Decred's StakeShuffle decentralized mixing

5.4 Module Hierarchy

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

Module Hierarchy

6. Simulation Network (--simnet)

When developing Decred applications or testing potential changes, it is often extremely useful to have a test network where transactions are actually mined into blocks, difficulty levels are low enough to generate blocks on demand, it is possible to easily cause chain reorganizations for testing purposes, and otherwise have full control over the network.

In order to facilitate these scenarios, dcrd provides a simulation network (--simnet), where the difficulty starts extremely low to enable fast CPU mining of blocks. Simnet also has some modified functionality that helps developers avoid common issues early in development.

See the full reference for more details: