dashd is the Full Node service for Digital Cash (DASH)

To update or switch versions, run webi dashd@stable (or @v0.19, @beta, etc).

  • 100GB+ Block Storage
  • 8GB RAM
  • 4 vCPUs
  • 30 hours for initial indexing

Files

These are the files / directories that are created and/or modified with this install:

~/.config/envman/PATH.env
~/.dashcore/dash.conf
~/.dashcore/wallets/
~/.local/bin/dashd-hd-service-install
~/.local/opt/dashcore/
/mnt/<BLK_VOL>/dashcore/

dashcore-utils will also be installed if not present.

Cheat Sheet

A DASH Full Node syncs and indexes the DASH blockchain and can be used to broadcast transactions (sending money) and retrieve information about transactions, balances, etc. This "Dash Core" implementation is maintained by DCG.

To install as a system service with reasonable defaults,
you can use these convenience scripts provided by Webi:

# USAGE
# dashd-hd-service-install [storage-volume] [testnet]
#
# EXAMPLE
dashd-hd-service-install

QuickStart

  1. Check that you have enough Storage and RAM
    • mainnet: 100GB+ Storage, 8GB RAM
    • testnet: 20GB+ Storage, 2GB RAM
  2. Create a mount for your storage volume
    sudo mkdir -p /mnt/100gb-vol/
    sudo mount /dev/vda1 /mnt/100gb-vol/
    
  3. Create a correctly permissioned dashcore directory
    sudo mkdir -p /mnt/100g-vol/dashcore/
    sudo chown -R "$(id -u -n):$(id -g -n)" /mnt/100gb-vol/dashcore/
    
  4. Register dashd with the system launcher
    dashd-hd-service-install
    
  5. Wait about 30 hours for initial sync and indexing to complete
  6. Test with the DashCore CLI
    dash-cli getaddresstxids '{
      "addresses": ["XchrTJFPGFiror4zjXQRR7XTSN25YtLYhC"],
      "start": 0,
      "end":1000000000
    }'
    

How to use DashCore CLI

After it completes the initial sync (about 4 hours),
you can query address information:

# Balances
dash-cli getaddressbalance '{"addresses": ["XchrTJFPGFiror4zjXQRR7XTSN25YtLYhC"]}'

# UTXOs
dash-cli getaddressutxos '{"addresses": ["XpLVjhDd6vNJamtcJXcrpQYA1sE6fmxVDa"]}'

# TXes
dash-cli getaddresstxids '{
    "addresses": ["XchrTJFPGFiror4zjXQRR7XTSN25YtLYhC"],
    "start": 0,
    "end":1000000000
}'

# Broadcast TX
dash-cli -testnet sendrawtransaction 01000000...0c0226b428a488ac00000000

How to Run dashd Manually

To run in the foreground:
(add -testnet to run on testnet)

dashd \
    -usehd \
    -conf="$HOME/.dashcore/dash.conf" \
    -settings="$HOME/.dashcore/settings.json" \
    -walletdir="$HOME/.dashcore/wallets/" \
    -datadir="/mnt/100gb/dashcore/_data/" \
    -blocksdir="/mnt/100gb/dashcore/_caches/" \
    -addressindex=1 \
    -timestampindex=1 \
    -txindex=1 \
    -spentindex=1

Warning: killing the process with ctrl+c before the first full sync may corrupt the data and require starting over (see below)

Server Requirements

150MB for Applications on OS Storage

For mainnet:

  • 100GB Block Storage Volume \
    • minimum of 40GB (blockchain) + 50GB (indexes) as of 2023
    • plus 4-8GB per year
  • 8GB RAM
    (min 4GB RAM + 4GB swap, otherwise it crashes during indexing)
  • 4 vCPUs
    (min 2x 2.0GHz vCPUs, higher clock speed is better than more cors)
  • 100 megabit network
  • 28-30 hours to sync and index in ideal conditions
    • minimum of 4 hours to sync
    • approximately 28 hours to index regardless of sync time

For testnet:

  • 20GB Block Storage Volume \
    • min 4GB (blockchain) + 5 GB (indexes) as of 2022
    • plus 0.5-1GB/year
  • 2GB RAM
  • 1 vCPU
  • 4 hours to sync and index in ideal conditions
    • 1 hour to sync
    • about 4 hours to index regardless of sync time

How to configure dash.conf

You can set options for main, test, and regtest.

If you intend to use the various RPCs you must enable indexes.

txindex=1
addressindex=1
timestampindex=1
spentindex=1

[main]
rpcuser=alice
rpcpassword=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
bind=127.0.0.1:9999
rpcbind=127.0.0.1:9998
rpcconnect=127.0.0.1:9998
rpcallowip=127.0.0.1/16
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubrawtxlock=tcp://127.0.0.1:28332
zmqpubrawchainlock=tcp://127.0.0.1:28332
zmqpubhashchainlock=tcp://127.0.0.1:28332

[test]
rpcuser=alice-test
rpcpassword=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
bind=127.0.0.1:19999
rpcbind=127.0.0.1:19998
rpcconnect=127.0.0.1:19998
rpcallowip=127.0.0.1/16
zmqpubrawtx=tcp://127.0.0.1:18009
zmqpubrawtxlock=tcp://127.0.0.1:18009
zmqpubrawchainlock=tcp://127.0.0.1:18009
zmqpubhashchainlock=tcp://127.0.0.1:18009

See also:

How to Separate Caches from Data

You can make your data much safer by separating it from the caches you may need to delete by setting:

  • -walletdir= your money!!
  • -settings= desktop app settings!
  • -conf= server settings
  • -datadir= generic caches
dashd \
    -usehd \
    -conf="$HOME/.config/dashcore/dash.conf" \
    -walletdir="$HOME/.config/dashcore/wallets/" \
    -datadir="/mnt/dashcore/dashcore/"

How to Run as a System Service

You can use serviceman:

Linux

sudo env PATH="$PATH" \
    serviceman add \
        --system \
        --username "$(id -n -u)" \
        --path "$PATH" \
        --name dashd \
        --force \
        -- \
    dashd \
        -usehd \
        -conf="$HOME/.dashcore/dash.conf" \
        -settings="$HOME/.dashcore/settings.json" \
        -walletdir="$HOME/.dashcore/wallets/" \
        -datadir="/mnt/100gb/dashcore/_data/" \
        -blocksdir="/mnt/100gb/dashcore/_caches/"

Mac

serviceman add \
    --path "$PATH" \
    --name dashd \
    --force \
    -- \
    dashd \
        -usehd \
        -conf="$HOME/.dashcore/dash.conf" \
        -settings="$HOME/.dashcore/settings.json" \
        -walletdir="$HOME/.dashcore/wallets/" \
        -datadir="/Volumes/100gb/dashcore/_data/" \
        -blocksdir="/Volumes/100gb/dashcore/_caches/"

Windows

(be sure modify variables appropriately for cmd.exe or powershell)

& serviceman add \
    --name dashd \
    --force \
    -- \
    dashd \
        -usehd \
        -conf="$Env:UserProfile/.dashcore/dash.conf" \
        -settings="$Env:UserProfile/.dashcore/settings.json" \
        -walletdir="$Env:UserProfile/.dashcore/wallets/" \
        -datadir="D:/100gb/dashcore/_data/" \
        -blocksdir="D:/100gb/dashcore/_caches/"

How to Trim Excessive Storage

If the service crashes during the initial syncing and indexing (such as when using less than 4GB RAM + 4GB Swap) it will not resume (typically).

Instead it will create duplicate new data, and not clean up the old data.

You may need to delete /mnt//dashcore/ and start from scratch (being careful not to delete any wallet information, if you have any).

Generally I wouldn't recommend storing money on a Full Node -since it's primarily used for creating APIs for transactions and validations - but if you do, please always make sure to use -usehd and print out your Wallet Phrase as a failsafe.

More Tools

In particular, you may find these useful:

  • dashphrase for generating secure Wallet Phrases
  • dashsight for inspecting balances, transactions, etc via API (without downloading the indexes)

More Documentation

All of the command line flags and options for the Dash Core Desktop Wallet are documented between these two pages:

The config files dash.conf (mainly for Full Nodes) and settings.json (mainly for Desktop Wallets) are documented at:

Contribute

Report an Issue Submit Installer Star on GitHub