0

I'm setting up a regtest node on my Windows machine using bitcoin-qt. Here's my config:

regtest=1
txindex=1
server=1
[test]
rpcport=8332
rpcuser=ulu
rpcpassword=***

Next, I would like to run a transaction using RPC. However, I'm totally lost here: 1. What is the BTC address I could use for creating a transaction? 2. How do I "unlock" it to be able to send a transaction? 3. How do I add some BTC to it to be able to send it and/or pay for the transaction?

0
  1. What is the BTC address I could use for creating a transaction?

Any valid testnet address. You can get one from Bitcoin Core using the getnewaddress command.

  1. How do I "unlock" it to be able to send a transaction?

Use the walletpassphrase <passphrase> <timeout> command where <passphrase> is your passphrase and <timeout> is the amount of time you want the wallet to be unlocked for. The wallet will automatically lock itself after the number of seconds specified in <timeout>.

  1. How do I add some BTC to it to be able to send it and/or pay for the transaction?

To get regtest coins, you need to mine them yourself. Bitcoin Core can quickly and easily mine a bunch of blocks, just use the generatetoaddress command. Note that newly mined Bitcoin only become spendable after the coinbase transaction that produces them has 100 confirmations. So if you mine 101 blocks, you will be able to spend the 50 Bitcoin from the first block mined.


For help with the RPCs, there is a help command. You can use that to get a list of available commands. Their names are pretty self explanatory. You can then do help <command> where <command> is some command you need help with. This will give you a more detailed description of the RPC, the parameters it takes, and what the result it returns will look like.

  • Sorry, I wasn't clear. By regtest I meant I was running it on my own machine only, not connecting to other nodes. – ulu Aug 25 at 9:16
  • Ah, I missed that. I updated my answer with regtest instructions. – Andrew Chow Aug 25 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.