Your first testnet transaction
Time to move actual (play-money) DOGE. In this lesson you'll receive coins from a faucet, watch confirmations arrive in real time, send coins back out, and dissect the result like a developer – the full lifecycle every payment feature is built on.
Step 1: Get funded
Generate a fresh receiving address on your testnet node and give it to a faucet (current faucets are listed around r/dogecoindev):
$ dogecoin-cli getnewaddress
nfLKxjXXfW3JCkCTvyU2VqCbFy8uHkNkNo <- yours will differ
Step 2: Watch the payment arrive
Within a minute or two of the faucet sending, your wallet sees the transaction. Poll it:
$ dogecoin-cli listtransactions
[
{
"account": "",
"address": "nfLKxjX...",
"category": "receive",
"amount": 100.00000000,
"confirmations": 0, <- in the mempool, not yet mined
"txid": "b17f0a3c9d4e..."
}
]
Run it again a minute later and confirmations ticks up: 1, 2, 3... Each number is another block mined on top of the one containing your transaction – the "settling concrete" from the transactions lesson, visible live. Meanwhile:
$ dogecoin-cli getbalance
0.00000000 <- unconfirmed funds don't count yet
$ dogecoin-cli getbalance "*" 0 # include 0-conf
100.00000000
$ dogecoin-cli getbalance # after a confirmation
100.00000000
Step 3: Send some back
Faucets usually publish a return address (be a good citizen – testnet coins are a shared resource). Sending is one call; the wallet picks UTXOs, computes the fee, and creates change automatically:
$ dogecoin-cli sendtoaddress "nFaucetReturnAddr..." 25
77ac9e5d21c4b8f0... <- the new transaction's txid
Or from Python, with the wrapper from the quickstart:
txid = rpc.call("sendtoaddress", "nFaucetReturnAddr...", 25.0)
print("sent, txid:", txid)
Step 4: Read the transaction like a developer
$ dogecoin-cli gettransaction 77ac9e5d21c4b8f0...
{
"amount": -25.00000000,
"fee": -0.00226000, <- fraction of a DOGE, sized by bytes
"confirmations": 1,
"details": [ { "category": "send", "amount": -25.0, ... } ],
...
}
Now decode the raw transaction and find your change:
$ dogecoin-cli getrawtransaction 77ac9e5d21c4b8f0... 1
{
"vin": [ { "txid": "b17f0a3c...", "vout": 0, ... } ], <- spent the faucet's 100
"vout": [
{ "value": 25.0, ... }, <- the payment
{ "value": 74.99774, ... } <- change back to your wallet
]
}
There is the whole UTXO story in one object: the 100-DOGE note was spent in full – 25 to the recipient, ~74.998 back to you as change, and the 0.00226 difference is the miner's fee. You can also paste the txid into a public explorer like Blockchair (switch it to testnet) to see the same data as the rest of the world sees it.
If sendtoaddress fails with "Insufficient funds" while listtransactions shows your deposit: you're spending faster than confirmations arrive. Wait for 1 confirmation of the faucet payment – by default the wallet only spends confirmed UTXOs. This exact confusion is half of all first-timer questions on r/dogecoindev.
Key takeaways
- Receive = give out a fresh address, then watch
confirmationsclimb inlisttransactions. sendtoaddressdoes coin selection, fees, and change for you – one call, one txid.gettransaction(wallet view) andgetrawtransaction ... 1(chain view) are your microscopes.- Unconfirmed funds don't count toward
getbalanceand can't be spent by default.