Skip to main content

Launching a Node and Using RPC

This walkthrough takes you from a freshly installed ReddCoin Core to running RPC commands against your own node. It covers both reddcoind (the headless daemon) and reddcoin-qt (the GUI wallet, which embeds the same node), and shows the three common ways to reach the RPC interface: reddcoin-cli, the Debug Console inside reddcoin-qt, and raw HTTP from any HTTP client.

If you have not yet installed ReddCoin Core, read the Introduction first — it covers where to download the binaries. The rest of this page assumes you have reddcoind, reddcoin-qt, and reddcoin-cli on your PATH.

1. Where ReddCoin Core stores its files

reddcoind and reddcoin-qt both default to the same per-OS data directory — that's where reddcoin.conf, the wallet, and the synced blockchain all live. You'll be editing reddcoin.conf in the next step, so it's worth knowing exactly where to look:

OSDefault data directory
Linux~/.reddcoin/
macOS~/Library/Application Support/Reddcoin/
Windows%APPDATA%\Reddcoin\ (i.e. C:\Users\<You>\AppData\Roaming\Reddcoin\)

Inside that directory you'll find — once the node has run at least once — reddcoin.conf (the config file you create yourself; not present until you make it), wallet.dat (legacy wallet) or wallets/ (descriptor wallets), blocks/ (raw block data, the bulk of the disk usage — currently a few GB and growing), chainstate/ (UTXO database), debug.log, and a peers.dat cache. Mainnet uses the directory directly; testnet, signet, and regtest each get their own subdirectory (testnet3/, signet/, regtest/) so you can run multiple networks side by side without colliding.

If you want to put the data somewhere else — typically because the default location is on a small SSD and the blockchain is bigger than you'd like to host there — pass -datadir=/path/to/storage to every program. Be consistent: reddcoin-cli will not find the running node if it's pointed at a different -datadir than the daemon.

2. Configure RPC access

reddcoin-cli and reddcoin-qt's built-in console both authenticate to the local node automatically when they run as the same user (they read the same reddcoin.conf and share the auth cookie). External tools — anything making raw HTTP calls — need a username and password.

Add the following to reddcoin.conf in your data directory:

server=1
rpcuser=reddcoinrpc
rpcpassword=change_this_to_a_long_random_password

# Listen for RPC only on the loopback interface. Default is already 127.0.0.1;
# this line is here to make it explicit. Do NOT add rpcallowip=0.0.0.0 unless
# you also put TLS and a real authenticator in front of the port.
rpcbind=127.0.0.1

server=1 is required for reddcoind; reddcoin-qt enables the RPC server when this line is present and is otherwise GUI-only. After editing, restrict the file to your own user:

chmod 0600 reddcoin.conf
warning

Never expose the RPC port to the public internet. Even with a strong password the JSON-RPC endpoint is unencrypted and is not designed to be reachable from untrusted networks. If you need remote access, tunnel it over SSH (ssh -L 45443:127.0.0.1:45443 user@host) or put a TLS-terminating reverse proxy in front of it.

3. Launch reddcoind

Run the daemon in the background:

reddcoind -daemon
Reddcoin server starting

The first launch builds the block index and begins downloading headers and blocks; on a fresh install this takes a while. Confirm the node is up and check sync progress:

reddcoin-cli getblockchaininfo
{
"chain": "main",
"blocks": 4823917,
"headers": 4823917,
"verificationprogress": 0.99999998,
...
}

When blocks matches headers and verificationprogress is essentially 1, the node is fully synced.

To stop the daemon cleanly:

reddcoin-cli stop

Don't kill -9 it — that risks chainstate corruption and a long reindex on the next start.

4. Launch reddcoin-qt

reddcoin-qt runs the same node code as reddcoind plus a Qt-based wallet UI. Start it from your application launcher or the command line:

reddcoin-qt

It reads the same reddcoin.conf and uses the same data directory, so you can switch between reddcoind and reddcoin-qt between sessions — just don't run both at once against the same data directory.

To reach the RPC interface from inside the GUI:

  1. Open Help → Debug window.

  2. Switch to the Console tab.

  3. Type RPC commands directly. For example:

    getblockcount
    help getbalance
    getnewaddress "" legacy

The console runs commands against the local node's RPC endpoint on your behalf — no separate reddcoin-cli invocation needed, and the reddcoin-cli argument-quoting rules don't apply here (just type the arguments inline).

5. Talking to RPC from your own code

The console is convenient for ad-hoc commands; for programmatic access you have two options.

Option A — shell out to reddcoin-cli

Easiest if you're scripting in bash, make targets, or any language with a subprocess module:

reddcoin-cli getblockcount
4823917

reddcoin-cli getnewaddress "" legacy
RkW7N8...

reddcoin-cli reads reddcoin.conf itself, so as long as you run it as the same user as the node, no credentials need to be passed on the command line.

Option B — JSON-RPC over HTTP

The wire protocol is plain JSON-RPC 1.0 over HTTP. This is what reddcoin-cli and the Qt console use under the hood, and what every language-specific RPC client library wraps.

A node started with no -testnet or -regtest flag runs on mainnet and listens for RPC on http://127.0.0.1:45443/. Authenticate with HTTP Basic auth using the rpcuser and rpcpassword from reddcoin.conf:

curl --user reddcoinrpc:change_this_to_a_long_random_password \
--data-binary '{"jsonrpc":"1.0","id":"walkthrough","method":"getblockcount","params":[]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:45443/
{"result":4823917,"error":null,"id":"walkthrough"}

Methods with arguments take them as a JSON array in params:

curl --user reddcoinrpc:change_this_to_a_long_random_password \
--data-binary '{"jsonrpc":"1.0","id":"walkthrough","method":"getnewaddress","params":["","legacy"]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:45443/

Every method documented in the RPC reference is callable this way; the page for each method lists its parameters and result schema.

:::note Other networks Pass -testnet, -signet, or -regtest to reddcoind / reddcoin-qt / reddcoin-cli to target a different network. Each has its own RPC port and its own subdirectory of the data dir:

NetworkRPC portData subdirectory
testnet55443testnet3/
signet38332signet/
regtest56443regtest/

The rest of this walkthrough — the reddcoin.conf shape, the curl shape, the auth scheme — is identical, just on a different port. :::

6. Next steps

  • Browse the RPC reference for the full command list.
  • For development, prefer regtest mode — instant blocks, no real coins, and you can wipe and restart the chain at will.
  • For a higher-level wallet API in JavaScript or TypeScript, see the reddcoinjs-lib reference.