Interacting with a Dogecoin Node
How to interact with the Dogecoin Network?
You recently setup a dogecoin node on a distant server and you want to build something or just interact with it from your computer?
The dogecoin daemon exposes a JSON-RPC API. This is how you
can interact with the node and query or send transactions to it.
The RPC API is enabled by default, but you need to configure the
dogecoind
daemon to listen for RPC connections:
server=1
listen=1
maxconnections=50
rpcbind=0.0.0.0
rpcallowip=0.0.0.0/0
rpcport=22555
rpcuser=shibetoshi
rpcpassword=impossibletoguesspassword
The rpcallowip
option allows connections from
any IP address. The rpcport
is the port on which
the RPC server will listen for connections. The
rpcuser
and rpcpassword
are the
credentials for the RPC server.
The default path for the dogecoind
configuration
file is .dogecoin/dogecoin.conf
(or wherever you
installed the node data directory).
You can then try to cURL the RPC server:
curl --user shibetoshi --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": []}' -H 'Content-Type: application/json' http://<your-node-ip>:22555
The precedent comment will prompt for the password. If the node is running and the credentials are correct, you should get a response like this:
{
"result": {
"version": 1140600,
"protocolversion": 70015,
"walletversion": 130000,
"balance": 0E-8,
"blocks": 5474701,
"timeoffset": 0,
"connections": 29,
"proxy": "",
"difficulty": 14030611.64003879,
"testnet": false,
"keypoololdest": 1732174492,
"keypoolsize": 100,
"paytxfee": 0.01000000,
"relayfee": 0.00100000,
"errors": ""
},
"error": null,
"id": "curltest"
}
Conclusion
You now know how to interact with a Dogecoin node. You can now build your own application or interact with the network.
Here is the list of the available RPC methods (run
dogecoin-cli help
on your node to get the full
list):
== Blockchain ==
getbestblockhash
getblock "blockhash" ( verbose )
getblockchaininfo
getblockcount
getblockhash height
getblockheader "hash" ( verbose )
getchaintips
getdifficulty
getmempoolancestors txid (verbose)
getmempooldescendants txid (verbose)
getmempoolentry txid
getmempoolinfo
getrawmempool ( verbose )
gettxout "txid" n ( include_mempool )
gettxoutproof ["txid",...] ( blockhash )
gettxoutsetinfo
preciousblock "blockhash"
pruneblockchain
verifychain ( checklevel nblocks )
verifytxoutproof "proof"
== Control ==
getinfo
getmemoryinfo
help ( "command" )
stop
== Generating ==
generate nblocks ( maxtries auxpow )
generatetoaddress nblocks address (maxtries auxpow)
== Mining ==
createauxblock <address>
getauxblock (hash auxpow)
getblocktemplate ( TemplateRequest )
getmininginfo
getnetworkhashps ( nblocks height )
prioritisetransaction <txid> <priority delta> <fee delta>
submitauxblock <hash> <auxpow>
submitblock "hexdata" ( "jsonparametersobject" )
== Network ==
addnode "node" "add|remove|onetry"
clearbanned
disconnectnode "address"
getaddednodeinfo ( "node" )
getconnectioncount
getnettotals
getnetworkinfo
getpeerinfo
listbanned
ping
setban "subnet" "add|remove" (bantime) (absolute)
setmaxconnections
setnetworkactive true|false
== Rawtransactions ==
createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} ( locktime )
decoderawtransaction "hexstring"
decodescript "hexstring"
fundrawtransaction "hexstring" ( options )
getrawtransaction "txid" ( verbose )
sendrawtransaction "hexstring" ( allowhighfees )
signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )
== Util ==
createmultisig nrequired ["key",...]
estimatefee nblocks
estimatepriority nblocks
estimatesmartfee nblocks
estimatesmartpriority nblocks
signmessagewithprivkey "privkey" "message"
validateaddress "address"
verifymessage "address" "signature" "message"
== Wallet ==
abandontransaction "txid"
addmultisigaddress nrequired ["key",...] ( "account" )
addwitnessaddress "address"
backupwallet "destination"
bumpfee "txid" ( options )
dumpprivkey "address"
dumpwallet "filename"
encryptwallet "passphrase"
getaccount "address"
getaccountaddress "account"
getaddressesbyaccount "account"
getbalance ( "account" minconf include_watchonly )
getnewaddress ( "account" )
getrawchangeaddress
getreceivedbyaccount "account" ( minconf )
getreceivedbyaddress "address" ( minconf )
gettransaction "txid" ( include_watchonly )
getunconfirmedbalance
getwalletinfo
importaddress "address" ( "label" rescan p2sh )
importmulti "requests" "options"
importprivkey "dogecoinprivkey" ( "label" ) ( rescan )
importprunedfunds
importpubkey "pubkey" ( "label" rescan )
importwallet "filename"
keypoolrefill ( newsize )
listaccounts ( minconf include_watchonly)
listaddressgroupings
listlockunspent
listreceivedbyaccount ( minconf include_empty include_watchonly)
listreceivedbyaddress ( minconf include_empty include_watchonly)
listsinceblock ( "blockhash" target_confirmations include_watchonly)
liststucktransactions ( verbose include_watchonly )
listtransactions ( "account" count skip include_watchonly)
listunspent ( minconf maxconf ["addresses",...] [include_unsafe] [query_options])
lockunspent unlock ([{"txid":"txid","vout":n},...])
move "fromaccount" "toaccount" amount ( minconf "comment" )
removeprunedfunds "txid"
rescan ( "height" )
sendfrom "fromaccount" "toaddress" amount ( minconf "comment" "comment_to" )
sendmany "fromaccount" {"address":amount,...} ( minconf "comment" ["address",...] )
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount )
setaccount "address" "account"
settxfee amount
signmessage "address" "message"