Skip to content

Instantly share code, notes, and snippets.

@max-mapper
Created February 19, 2021 17:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save max-mapper/1a172d659491f2b30fd4ffe67e94b964 to your computer and use it in GitHub Desktop.
Save max-mapper/1a172d659491f2b30fd4ffe67e94b964 to your computer and use it in GitHub Desktop.
Bitcoin Regtest Local Server Instructions
  1. Grab the latest bitcoin-core .tar.gz release and unpack it https://bitcoin.org/en/download
  2. Add the bin folder to your path
  3. Start the regtest server bitcoind -regtest
  4. Create a test wallet bitcoin-cli -regtest createwallet test
  5. Get a bcrt address for your wallet bitcoin-cli -regtest getnewaddress
  6. 'Mine' some regtest btc bitcoin-cli generatetoaddress 10 <address-from-previous-command>
  7. Make sure it worked `bitcoin-cli getblockcount
@mvayngrib
Copy link

on OSX, replace steps 1 and 2 with:

  1. download bitcoind from bitcoin.org: curl -O https://bitcoin.org/bin/bitcoin-core-0.21.0/bitcoin-0.21.0-osx64.tar.gz
  2. unzip it, add it's bin dir to your $PATH

@fponcedeleon
Copy link

fponcedeleon commented May 3, 2021

Got an error when running:
bitcoin-cli generatetoaddress 10 <address-from-previous-command>

Solution:
Add -regtest param:
bitcoin-cli -regtest generatetoaddress 10 <address-from-previous-command>

Also applies for the getblockcount:
bitcoin-cli -regtest getblockcount

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment