Is it possible to use bitcoind as a private blockchain?

0

For development or test purpose, is it possible to setup a bitcoind as a private bitcoin blockchain?

Satoshi Nakanishi

Posted 2015-12-25T01:57:40.183

Reputation: 527

Do you know about regtest mode?Nate Eldredge 2015-12-25T05:45:07.583

Answers

1

yes,very easy, you can use mainstream bitcoin client:bitcoin core, here is how:

start server: 
    bitcoind -regtest -daemon or bitcoind -regtest -printtoconsole
    you will find a regtest folder generated somewhere, example on ubuntu it's ~/.bitcoin/regtest
client: 
    generate blocks:  bitcoin-cli -regtest generate 101 (101 is because when you start this private chain, initially no blocks there and wallet balance is 0, and coinbase reward can only be spent after 100 confirm)
    checkbalance: bitcoin-cli -regtest getbalance
    others:
    bitcoin-cli -regtest getblockcount
    bitcoin-cli -regtest getblockhash 0

Bitcoin Core’s regression test mode (regtest mode) lets you instantly create a brand-new private block chain with the same basic rules as testnet—but one major difference: you choose when to create new blocks, so you have complete control over the environment.--https://bitcoin.org/en/developer-examples#testnet

~/.bitcoin/regtest

LIU YUE

Posted 2015-12-25T01:57:40.183

Reputation: 194

2

When run with no arguments, all Bitcoin Core programs default to Bitcoin’s main network (mainnet). However, for development, it’s safer and cheaper to use Bitcoin’s test network (testnet) where the satoshis spent have no real-world value. Testnet also relaxes some restrictions (such as standard transaction checks) so you can test functions which might currently be disabled by default on mainnet.

To use testnet, use the argument -testnet with bitcoin-cli, bitcoind or bitcoin-qt or add testnet=1 to your bitcoin.conf file as described earlier. To get free satoshis for testing, use Piotr Piasecki’s testnet faucet. Testnet is a public resource provided for free by members of the community, so please don’t abuse it.

https://bitcoin.org/en/developer-examples#testing-applications

If you need absolutely private network - just made it. Run a few clean wallets on few computers, generate bitcoins and so on.. It will be incompatible with bitcoin network, but will be completely functional in your private local network.

xbtc

Posted 2015-12-25T01:57:40.183

Reputation: 41

1Because of the checkpoints built in to the Bitcoin Core software, your suggestion to "just run a few clean wallets on a few computers" won't work unless you patch the source to remove the checkpoints. Also, by default those wallets will try to sync with the main Bitcoin network, so you'll need to prevent that from happening.Nate Eldredge 2015-12-25T05:46:52.810

I wrote "absolutely private network" - it means (I think) isolated local network.xbtc 2015-12-30T06:45:01.180

a simple recipe for bitcoin-testnet-box This is a private, difficulty 1 testnet in a box. https://github.com/greenaddress/bitcoin-testnet-box

xbtc 2016-02-24T18:38:59.523