Skip to content

Instantly share code, notes, and snippets.

@danielribeiro
Forked from t4sk/regtest.md
Last active October 26, 2017 21:24
Show Gist options
  • Save danielribeiro/c28a28aead023f7e6bc8d833a9fe7fe3 to your computer and use it in GitHub Desktop.
Save danielribeiro/c28a28aead023f7e6bc8d833a9fe7fe3 to your computer and use it in GitHub Desktop.
How to get bitcoins for development using Regtest

How to get bitcoins for development using Regtest

Start bitcoind

> bitcoind -regtest -datadir=./ -printtoconsole

Generate block chain

> bitcoin-cli -regtest -datadir=./ generate 101

Check balance

> bitcoin-cli -regtest -datadir=./ getbalance
50.00000000

Spend some bitcoins

> bitcoin-cli -regtest -datadir=./ getnewaddress
mjBpxbvtBKwRVtdSZBHeGNydfBY2s6rNYp

> $NEW_ADDRESS = mjBpxbvtBKwRVtdSZBHeGNydfBY2s6rNYp

> bitcoin-cli -regtest -datadir=./ sendtoaddress $NEW_ADDRESS 10

Confirm transaction

> bitcoin-cli -regtest -datadir=./ listunspent 0

References

bitcoin.org

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