Skip to content

RPC API Reference

Soqucoin's JSON-RPC interface is compatible with Dogecoin Core RPC. All standard Bitcoin/Dogecoin RPC methods work as expected.

Connection

# Using soqucoin-cli
soqucoin-cli <method> [params...]

# Using curl
curl -u rpcuser:rpcpassword -d '{"method":"getblockchaininfo","params":[]}' http://127.0.0.1:44555/

Blockchain

Method Description
getblockchaininfo Chain state, sync progress, current height
getblockcount Current block height
getblockhash <height> Block hash at given height
getblock <hash> Block details by hash
getbestblockhash Hash of the chain tip
gettxout <txid> <n> Details about an unspent transaction output
verifychain Verify blockchain database integrity

Mining

Method Description
getmininginfo Current mining state (difficulty, hashrate, block reward)
getnetworkhashps Estimated network hashrate
getblocktemplate Block template for mining software
submitblock <hex> Submit a solved block
getauxblock AuxPoW block template (for merge mining)
submitauxblock <hash> <hex> Submit an AuxPoW solution
generatetoaddress <n> <addr> Generate blocks to address (regtest only)

Network

Method Description
getnetworkinfo Network protocol info (version, connections)
getpeerinfo Details about connected peers
getconnectioncount Number of active peer connections
addnode <ip> <add/remove> Manually add or remove a peer

Wallet

Method Description
getbalance Total confirmed balance
getnewaddress Generate a new receiving address
sendtoaddress <addr> <amount> Send SOQ to an address
listtransactions Recent transaction history
listunspent List unspent transaction outputs
dumpprivkey <addr> Export private key for an address
importprivkey <key> Import a private key

Utility

Method Description
validateaddress <addr> Check if an address is valid
estimatefee <nblocks> Estimate fee for confirmation in N blocks
uptime Node uptime in seconds
stop Shut down the node

Examples

Check Sync Status

$ soqucoin-cli getblockchaininfo
{
  "chain": "main",
  "blocks": 42150,
  "headers": 42150,
  "bestblockhash": "a1b2c3...",
  "difficulty": 1234.567,
  "verificationprogress": 1.0
}

Get Block Reward Info

$ soqucoin-cli getmininginfo
{
  "blocks": 42150,
  "difficulty": 1234.567,
  "networkhashps": 2450000000,
  "pooledtx": 3
}

Generate Test Blocks (Regtest)

$ soqucoin-cli -regtest generatetoaddress 10 $(soqucoin-cli -regtest getnewaddress)
[
  "hash1...",
  "hash2...",
  ...
]

Error Codes

Code Meaning
-1 General error
-3 Invalid address
-5 Invalid amount
-6 Insufficient funds
-13 Wallet is locked
-28 Still loading (node syncing)