Demo build. This is a software product for sale — not an investment, token sale, or financial service. Coins shown run on testnet and have no monetary value. Buyers are responsible for their own licensing, compliance and any mainnet launch.

Demo pool testnet only no real mining revenue
BTC testnet XMR testnet ETC testnet RVN testnet KAS testnet GCC testnet

JSON-RPC API reference.

The fastest path from "I have a GPU or ASIC" to "shares are landing" on the testnet demo. Five steps.

01 The transport

GCC is a Litecoin Core v0.21.5.5 fork, so its control interface is the Bitcoin/Litecoin Core JSON-RPC API, unchanged. If you have written code against bitcoind or litecoind, it will talk to gccd with nothing more than a different port and different credentials. Every method, parameter and result shape on this page is the upstream Core behaviour — this reference simply pins down the ones an operator of the demo chain actually reaches for, with GCC-specific values (port 9332, gcc1… addresses, 50 GCC reward, 60-second blocks) baked into the examples.

The wire format is JSON-RPC 1.0 over HTTP. You POST a JSON body to the node’s RPC endpoint; the node replies with a JSON object carrying result, error and id. A request body has four fields:

  • jsonrpc — the string "1.0".
  • id — any value you choose; echoed back so you can match replies to requests.
  • method — the RPC method name, e.g. "getblockcount".
  • params — an array of positional arguments (empty array if the method takes none).

The endpoint is http://127.0.0.1:9332/ for node-level calls. Wallet calls go to a wallet-scoped path, http://127.0.0.1:9332/wallet/<walletname>, because a node can load several wallets at once — more on that in section 04.

02 Authentication and the curl pattern

The RPC uses HTTP Basic authentication. The username and password are the rpcuser/rpcpassword you set in gcc.conf (or a rpcauth salted hash). curl sends them with --user user:pass. The canonical shape of every call on this page is:

bash
curl --user gccrpc:PASS \
--data-binary '{"jsonrpc":"1.0","id":"x","method":"METHOD","params":[]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:9332/

Substitute the method, fill in params, and point the path at /wallet/<name> for wallet methods. For readability the examples below show the JSON body and a trimmed result; in practice you would pipe the response through jq to pretty-print it. The equivalent gcc-cli form is always gcc-cli METHOD arg1 arg2 … and is quicker for interactive use — the raw curl form is what you embed in scripts and services.

03 Blockchain methods

These read chain state. They are wallet-independent, so they go to the bare / endpoint.

getblockchaininfo — overall chain status: name, height, best hash, difficulty, verification progress. The single best health check for a node.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"getblockchaininfo","params":[]}' \
http://127.0.0.1:9332/
{"result":{"chain":"main","blocks":3614,"headers":3614,
"bestblockhash":"a1c4…e0f2","difficulty":0.00024414,
"verificationprogress":0.99999,"initialblockdownload":false},
"error":null,"id":"1"}

getblockcount — the height of the most-work chain tip, as a bare integer. Cheap; safe to poll.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"getblockcount","params":[]}' \
http://127.0.0.1:9332/
{"result":3614,"error":null,"id":"1"}

getblockhash — the block hash at a given height. Params: [height]. Use it to turn a height into a hash you can then pass to getblock.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"getblockhash","params":[3600]}' \
http://127.0.0.1:9332/
{"result":"b7f2…91ad","error":null,"id":"1"}

getblock — a block’s contents. Params: [blockhash, verbosity]. Verbosity 1 (default) returns a decoded header plus the list of txids; verbosity 2 additionally decodes every transaction; verbosity 0 returns the raw serialised hex.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"getblock","params":["b7f2…91ad",1]}' \
http://127.0.0.1:9332/
{"result":{"hash":"b7f2…91ad","height":3600,"version":536870912,
"merkleroot":"5d9c…","time":1747008000,"nonce":248913,
"bits":"1e0ffff0","difficulty":0.00024414,
"previousblockhash":"3a01…","tx":["c0ff…","a17e…"]},
"error":null,"id":"1"}

getblocktemplate — the assembled candidate a miner works on: target, height, the transactions to include and the coinbase value. This is the method a stratum pool calls to build work; for GCC it returns Scrypt-targeted parameters. Params take a capabilities object, e.g. [{"rules":["segwit"]}].

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"getblocktemplate","params":[{"rules":["segwit"]}]}' \
http://127.0.0.1:9332/
{"result":{"version":536870912,"height":3615,
"previousblockhash":"a1c4…e0f2","target":"00000fff…",
"bits":"1e0ffff0","curtime":1747008060,
"coinbasevalue":5000000000,"transactions":[…]},
"error":null,"id":"1"}

coinbasevalue is in the smallest unit (1 GCC = 100,000,000 base units), so 5000000000 is the 50 GCC block reward before any fees.

04 Wallet methods

Wallet methods touch keys and funds, so they are addressed to a wallet-scoped path: http://127.0.0.1:9332/wallet/<walletname>. The default wallet is often just "" (the empty name), in which case the path is /wallet/. A node can hold several wallets — miner, faucet, a per-tenant wallet — and the path selects which one the call operates on.

getnewaddress — derive a fresh receiving address. Params: [label, address_type]. For GCC, address_type may be bech32 (native SegWit, gcc1…), p2sh-segwit, or legacy (G…). bech32 is the default and what the wallet uses.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"getnewaddress","params":["payout","bech32"]}' \
http://127.0.0.1:9332/wallet/miner
{"result":"gcc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4","error":null,"id":"1"}

getbalance — the confirmed, spendable balance of the wallet, as a number in GCC. Remember coinbase outputs are not spendable until 100 confirmations; immature rewards do not count here.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"getbalance","params":[]}' \
http://127.0.0.1:9332/wallet/miner
{"result":500.00000000,"error":null,"id":"1"}

listunspent — the wallet’s spendable outputs (UTXOs). Params: [minconf, maxconf, [addresses]]. Each entry carries the txid, vout, address, amount and confirmation count — this is what you read to build a transaction by hand or to audit what the wallet can spend.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"listunspent","params":[1,9999999]}' \
http://127.0.0.1:9332/wallet/miner
{"result":[{"txid":"c0ff…","vout":0,
"address":"gcc1qw508…f3t4","amount":50.00000000,
"confirmations":214,"spendable":true}],"error":null,"id":"1"}

sendtoaddress — build, sign and broadcast a payment in one call. Params: [address, amount, comment]. Returns the txid. The amount is in GCC. The wallet selects inputs and a change output for you.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"sendtoaddress","params":["gcc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",2.5]}' \
http://127.0.0.1:9332/wallet/faucet
{"result":"e3b0…a1d9","error":null,"id":"1"}

This is exactly how the GCC faucet pays a claim: a sendtoaddress from the faucet wallet to the address the claimant supplied. The returned txid is what the explorer then shows.

generatetoaddress — mine N blocks to an address (private/regtest networks only). Params: [nblocks, address]. Covered in depth on the Running a testnet node page; the call shape:

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"generatetoaddress","params":[1,"gcc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"]}' \
http://127.0.0.1:9332/wallet/miner
{"result":["0f91…2206"],"error":null,"id":"1"}

05 Network and mining methods

getmininginfo — mining-side view: current height, difficulty, network hashrate estimate and mempool size. Useful for a pool or a dashboard.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"getmininginfo","params":[]}' \
http://127.0.0.1:9332/
{"result":{"blocks":3614,"difficulty":0.00024414,
"networkhashps":18452.7,"pooledtx":0,"chain":"main"},
"error":null,"id":"1"}

getnetworkinfo — the node’s networking state: protocol version, subversion string, connection count and the local addresses it is advertising.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"getnetworkinfo","params":[]}' \
http://127.0.0.1:9332/
{"result":{"version":210205,"subversion":"/GCC:0.21.5.5/",
"protocolversion":70015,"connections":2,
"networkactive":true},"error":null,"id":"1"}

The subversion carries the GCC fork identity; connections is your peer count — 0 on a node with addnode set points at a P2P-port reachability problem on 9433.

submitblock — submit a fully-solved block for validation and propagation. Params: [hexdata]. This is the other half of the mining loop: a miner gets work from getblocktemplate, finds a nonce that satisfies the Scrypt target, serialises the block and submits it here. A null result means accepted; a string result is the rejection reason.

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"submitblock","params":["00000020a1c4…"]}' \
http://127.0.0.1:9332/
{"result":null,"error":null,"id":"1"}

A result of null here is success — the block was accepted onto the chain. If you instead see "high-hash", the submitted block’s Scrypt hash did not meet the target; "duplicate" means that block is already known.

06 Errors and batching

When a call fails, result is null and error is an object with a numeric code and a message:

bash
curl --user gccrpc:PASS --data-binary \
'{"jsonrpc":"1.0","id":"1","method":"getblockhash","params":[999999]}' \
http://127.0.0.1:9332/
{"result":null,"error":{"code":-8,"message":"Block height out of range"},"id":"1"}

Codes you will meet often: -8 (invalid parameter), -5 (invalid address or key), -6 (insufficient funds), -32601 (method not found — usually a typo or a wallet method sent to the bare / path), and -28 (the node is still warming up / in initial block download — back off and retry). An HTTP 401 means the Basic-auth credentials were wrong, before the JSON layer was even reached.

You can also send a batch: an array of request objects in one POST. The node returns an array of replies, matched by id. Useful when a dashboard needs height, difficulty and peer count together:

bash
curl --user gccrpc:PASS --data-binary \
'[{"jsonrpc":"1.0","id":"h","method":"getblockcount","params":[]},
{"jsonrpc":"1.0","id":"n","method":"getconnectioncount","params":[]}]' \
http://127.0.0.1:9332/
[{"result":3614,"error":null,"id":"h"},
{"result":2,"error":null,"id":"n"}]

07 Security

The RPC is the keys to the chain. Hold these rules:

  • Loopback only. rpcbind=127.0.0.1, rpcallowip=127.0.0.1, and a 127.0.0.1:9332:9332 Docker publish. Never bind to 0.0.0.0 and never widen rpcallowip to the open internet. If a remote service needs RPC, tunnel it over SSH rather than exposing the port.
  • Strong, rotated credentials. Use a long random rpcpassword or the rpcauth salted hash so no plaintext sits in the config. Rotate immediately if a credential is printed to a log, committed, or shared. Keep --user user:pass out of shell history and process lists.
  • Per-service least privilege. Give a faucet service its own wallet (/wallet/faucet) with only the funds it needs, not the miner wallet. The path scoping is your blast-radius control.
  • Firewall behind the bind. On the reference stack the host firewall DROPs the RPC port for any non-operator source, so a configuration slip cannot open it to the world. Do the same.