Zcash Full Node and CLI

Zcashd & Zcash-cli allow you to run a full node and interact with it via a command-line interface. The zcashd full node downloads a copy of the Zcash blockchain, enforces rules of the Zcash network, and can execute all functionalities. The zcash-cli allows interactions with the node (e.g. to tell it to send a transaction).

../_images/zcashd_and_zcashcli.png

Zcashd & Zcash-cli are maintained by Electric Coin Company (the founding team for Zcash).

Install

Configuration

Zcashd requires a zcash.conf file to run.

A blank zcash.conf file will run with all default settings. To generate one, run:

mkdir -p ~/.zcash
touch ~/.zcash/zcash.conf

Zcashd can be configured in various ways to suit different use cases; see the Zcash.conf guide for an extensive list of options.

Use

Now, run zcashd!

./src/zcashd

If you are running Zcash for the first time, the Zcashd node needs to fully sync before using the RPC. This may take a day or so.

With a fully-synced running zcashd in the background, open a new terminal window and run:

./src/zcash-cli getinfo

See the available RPC commands for all the capabilities of Zcashd & Zcash-cli.

Every Zcashd comes with an embedded Zcash wallet. The private keys and transaction information are associated with this wallet are stored in:

~/.zcash/wallet.dat

Ensure this file is regularly backed up and permissions are private.

Try generating some addresses, then sending and receiving transparent and shielded transactions! Note that there are separate commands for transparent and shielded addresses/transactions.

If you’re running Zcashd for development, configure Zcashd to run on testnet, which takes significantly less time to sync than mainnet. Join Discord at Zcash to get test fund support or try a faucet

Upgrading

If you use zcashd but have not upgraded within 16 weeks of a release, it will reach the end-of-support (EOS) halt and exit with an error message. See the release cycle for details.

The node gives a warning two weeks in advance if you have the metrics screen enabled (and if there are no other overriding errors). A getdeprecationinfo RPC call will also return the block height at which the node will halt.

To upgrade Zcashd & Zcash-cli, fetch the latest updates:

 git fetch origin

Helpful tips:

  • Upgrading to v5.8.0 requires a build; try the following:

    git checkout v5.8.0
     ./zcutil/clean.sh
     ./zcutil/build.sh -j$(nproc)
    
  • Run Zcashd again and verify that the version number matches that of the source repository.

  • If parameters need re-running, try ./zcutil/fetch-params.sh. This is unlikely, and the node should tell you if this is necessary.

  • If you don’t have nproc, try sysctl -n hw.ncpu on macOS or if the build runs out of memory, try again without the -j argument, just ./zcutil/build.sh.

  • If you run into issues upgrading, please see the Network Upgrade Guide.

References

An extensive list of Zcashd & Zcash-cli pages, including ones linked inline in this page above.