curl
Explore Dogecoin RPC examples using curl. Learn to execute commands like getblockchaininfo, getnewaddress, and getbalance with clear JSON-RPC requests.
Dogecoin RPC Examples
This page provides examples of how to interact with the Dogecoin network using JSON-RPC commands via curl
. Understanding these examples can help developers integrate with the Dogecoin blockchain for various applications. To get help on specific JSON-RPC commands, you can often generate them from the dogecoin-cli help
command, for instance, dogecoin-cli help sendtoaddress
.
Dogecoin RPC Commands with Curl
Below are common Dogecoin RPC commands demonstrated with curl
. Each example shows the JSON-RPC request structure, including authentication, method, parameters, and the target URL.
Blockchain Information
Retrieve general information about the Dogecoin blockchain's current state.
getblockchaininfo
curl -u "user:pass" -d '{"jsonrpc": "1.0", "id": "curl", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:44555/
Node Information
Get information about the running Dogecoin node.
getinfo
curl -u "user:pass" -d '{"jsonrpc": "1.0", "id": "curl", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:44555/
Address Management
Generate a new Dogecoin address for a specific account.
getnewaddress
curl -u "user:pass" -d '{"jsonrpc": "1.0", "id": "curl", "method": "getnewaddress", "params": ["main"]}' -H 'content-type: text/plain;' http://127.0.0.1:44555/
Get an address for a specific account name.
getaccountaddress
curl -u "user:pass" -d '{"jsonrpc": "1.0", "id": "curl", "method": "getaccountaddress", "params": ["main"]}' -H 'content-type: text/plain;' http://127.0.0.1:44555/
Retrieve all Dogecoin addresses associated with a given account.
getaddressesbyaccount
curl -u "user:pass" -d '{"jsonrpc": "1.0", "id": "curl", "method": "getaddressesbyaccount", "params": ["main"]}' -H 'content-type: text/plain;' http://127.0.0.1:44555/
Account Management
List all accounts and their balances.
listaccounts
curl -u "user:pass" -d '{"jsonrpc": "1.0", "id": "curl", "method": "listaccounts", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:44555/
Balance Information
Fetch the Dogecoin balance for a specific account or all accounts.
getbalance
curl -s -u "user:pass" -d '{"jsonrpc": "1.0", "id": "curl", "method": "getbalance", "params": ["*", 6]}' -H 'content-type: text/plain;' http://127.0.0.1:44555/
Further Resources
For more in-depth information on Dogecoin RPC commands and JSON-RPC specifications, refer to the following resources: