Skip to content
/ dcrctl Public

Command-line client for interacting with the JSON-RPC servers of dcrd and dcrwallet

License

Notifications You must be signed in to change notification settings

decred/dcrctl

Repository files navigation

dcrctl

Build Status ISC License Go Report Card

Dcrctl is a command-line client for interacting with the JSON-RPC servers of dcrd and dcrwallet.

Usage

In its default configuration, dcrctl connects to dcrd's mainnet RPC port on localhost. The --wallet and --testnet flags change these defaults to the dcrwallet RPC port and/or testnet ports. The --rpcserver/-s flag can be used to specify other hostnames or IP addresses of the server, and can also be used to override the port defaults.

Dcrctl will attempt to read dcrd and dcrwallet config files for the user/password authentication. If these fields cannot be read, dcrctl must be manually configured with the correct authentication. Permanent configuration changes may be written to a config file in a platform-specific location:

  • macOS: ~/Library/Application Support/Dcrctl/dcrctl.conf
  • Windows: %LOCALAPPDATA%\Dcrctl\dcrctl.conf
  • Linux and other Unix: ~/.dcrctl/dcrctl.conf

Build and installation

  • Install Go 1.21 or higher version

    Installation instructions can be found here: https://golang.org/doc/install. Ensure Go was installed properly and is a supported version:

    $ go version
    $ go env GOROOT GOPATH

    NOTE: if GOROOT and GOPATH are initialized they must not be on the same path. It is recommended to add $GOPATH/bin to your PATH according to the Golang.org instructions.

  • Build or Update dcrctl

    The latest release of dcrctl may be built in a single command without cloning this repository:

    $ go install decred.org/dcrctl@release-v2.0.4

    Using @master instead will perform a release build using the latest code from the master branch. This may be useful to execute RPC methods not yet found in the latest Decred release:

    $ go install decred.org/dcrctl@master

    Alternatively, a development build can be performed by running go install in a locally checked-out repository.

    If you want to easily access dcrctl from the command-line without having to type the full path to the binary every time, ensure the bin directory rooted at the path reported by go env GOPATH is added to your system path:

Developing

When developing either the dcrd or dcrwallet RPC servers and making modifications to the RPC methods, you may want to build a development version of dcrctl supporting these changes. Due to dcrctl being built around package-global method registrations and reflection, supporting these changes only requires building with the updated packages.

This can be easily achieved by making use of a local Go workspace that uses the development versions of dcrd and dcrwallet as follows:

$ go work init .
$ go work use ../dcrd/rpc/jsonrpc/types ../dcrwallet

Contact

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

https://decred.org/community

Issue Tracker

The integrated github issue tracker is used for this project.

License

dcrctl is licensed under the copyfree ISC License.

About

Command-line client for interacting with the JSON-RPC servers of dcrd and dcrwallet

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages