All Projects → freewil → Bitcoin Testnet Box

freewil / Bitcoin Testnet Box

Licence: mit
Create your own private bitcoin testnet

Projects that are alternatives of or similar to Bitcoin Testnet Box

Unchained
My personal study of blockchain related technology.
Stars: ✭ 379 (-12.06%)
Mutual labels:  bitcoin
Ledgerjs
Ledger's JavaScript libraries
Stars: ✭ 397 (-7.89%)
Mutual labels:  bitcoin
Payment Gateway
Bitcoin/Altcoins PHP Payment Class. It supports Bitcoin BitcoinCash DASH Dogecoin Litecoin Reddcoin Feathercoin Vertcoin Potcoin Speedcoin. Install GoUrl php script - bitcoin api payment gateway on your site!
Stars: ✭ 406 (-5.8%)
Mutual labels:  bitcoin
Miningcore
Miningcore is a high-performance Mining-Pool Engine that runs on Linux and Windows and supports a variety of crypto-currencies.
Stars: ✭ 378 (-12.3%)
Mutual labels:  bitcoin
Cryptocurrency
Overview of top cryptocurrencies
Stars: ✭ 385 (-10.67%)
Mutual labels:  bitcoin
Xchange Stream
XChange-stream is a Java library providing a simple and consistent streaming API for interacting with Bitcoin and other crypto currency exchanges via WebSocket protocol. It is build on top of of XChange library providing new interfaces for streaming API. User can subscribe for live updates via reactive streams of RxJava library.
Stars: ✭ 402 (-6.73%)
Mutual labels:  bitcoin
Python Mnemonic
🐍 Mnemonic code for generating deterministic keys, BIP39
Stars: ✭ 369 (-14.39%)
Mutual labels:  bitcoin
Blockchain In Js
Build your own blockchain!
Stars: ✭ 425 (-1.39%)
Mutual labels:  bitcoin
Crypto Whale Watching App
Python Dash app that tracks whale activity in cryptocurrency markets.
Stars: ✭ 389 (-9.74%)
Mutual labels:  bitcoin
Plutus
An automated bitcoin wallet collider that brute forces random wallet addresses
Stars: ✭ 404 (-6.26%)
Mutual labels:  bitcoin
Mempool
An open-source explorer developed for the Bitcoin community, focusing on the emerging transaction fee market to help our transition into a multi-layer ecosystem.
Stars: ✭ 374 (-13.23%)
Mutual labels:  bitcoin
Electrs
An efficient re-implementation of Electrum Server in Rust
Stars: ✭ 380 (-11.83%)
Mutual labels:  bitcoin
Bitcoinj
A library for working with Bitcoin
Stars: ✭ 4,162 (+865.66%)
Mutual labels:  bitcoin
Crypto Bar
📈 A menu bar app that updates cryptocurrencies prices in real-time
Stars: ✭ 379 (-12.06%)
Mutual labels:  bitcoin
Chklinechart
纯Swift4.0代码编写的K线图表组件,支持:MA,EMA,BOLL,SAR,KDJ,MACD等技术指标显示。集成使用简单,二次开发扩展强大
Stars: ✭ 409 (-5.1%)
Mutual labels:  bitcoin
Forex Python
Foreign exchange rates, Bitcoin price index and currency conversion using ratesapi.io
Stars: ✭ 378 (-12.3%)
Mutual labels:  bitcoin
Ethereumkit
EthereumKit is a free, open-source Swift framework for easily interacting with the Ethereum.
Stars: ✭ 400 (-7.19%)
Mutual labels:  bitcoin
Blockchainstore
💰 Retail Store that runs on Ethereum
Stars: ✭ 425 (-1.39%)
Mutual labels:  bitcoin
Lets Build A Blockchain
A mini cryptocurrency in Ruby
Stars: ✭ 416 (-3.48%)
Mutual labels:  bitcoin
Techan
Technical Analysis Library for Golang
Stars: ✭ 404 (-6.26%)
Mutual labels:  bitcoin

bitcoin-testnet-box

docker pulls

Create your own private bitcoin testnet

You must have bitcoind and bitcoin-cli installed on your system and in the path unless running this within a Docker container (see below).

Large Git History

If you'd like to clone this git repository locally and disk space or bandwidth usage is of concern, it's suggested to do a shallow clone, excluding some earlier history of the repo, where some testnet data was included.

Regular clone: du -sh . 44M

Shallow clone: du -sh . 168K

Regular Clone

git clone [email protected]:freewil/bitcoin-testnet-box.git

Shallow Clone

git clone --shallow-since 2014-10-18 [email protected]:freewil/bitcoin-testnet-box.git

Starting the testnet-box

This will start up two nodes using the two datadirs 1 and 2. They will only connect to each other in order to remain an isolated private testnet. Two nodes are provided, as one is used to generate blocks and it's balance will be increased as this occurs (imitating a miner). You may want a second node where this behavior is not observed.

Node 1 will listen on port 19000, allowing node 2 to connect to it.

Node 1 will listen on port 19001 and node 2 will listen on port 19011 for the JSON-RPC server.

$ make start

Check the status of the nodes

$ make getinfo
bitcoin-cli -datadir=1  getinfo
{
    "version" : 90300,
    "protocolversion" : 70002,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 0,
    "timeoffset" : 0,
    "connections" : 1,
    "proxy" : "",
    "difficulty" : 0.00000000,
    "testnet" : false,
    "keypoololdest" : 1413617762,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00001000,
    "errors" : ""
}
bitcoin-cli -datadir=2  getinfo
{
    "version" : 90300,
    "protocolversion" : 70002,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 0,
    "timeoffset" : 0,
    "connections" : 1,
    "proxy" : "",
    "difficulty" : 0.00000000,
    "testnet" : false,
    "keypoololdest" : 1413617762,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00001000,
    "errors" : ""
}

Generating blocks

Normally on the live, real, bitcoin network, blocks are generated, on average, every 10 minutes. Since this testnet-in-box uses Bitcoin Core's (bitcoind) regtest mode, we are able to generate a block on a private network instantly using a simple command.

To generate a block:

$ make generate

To generate more than 1 block:

$ make generate BLOCKS=10

Need to generate at least 100 blocks before there will be a balance in the first wallet

$ make generate BLOCKS=200

Verify that there is a balance on the first wallet

$ make getinfo

Generate a wallet address for the second wallet

$ make address2

Sending bitcoins

To send bitcoins that you've generated to the second wallet: (be sure to change the ADDRESS value below to wallet address generated in the prior command)

$ make sendfrom1 ADDRESS=mxwPtt399zVrR62ebkTWL4zbnV1ASdZBQr AMOUNT=10

Does the balance show up?

Run the getinfo command again. Does the balance show up? Why not?

$ make getinfo

Generate another block

$ make generate

Stopping the testnet-box

$ make stop

To clean up any files created while running the testnet and restore to the original state:

$ make clean

Using with docker

This testnet-box can be used with Docker to run it in an isolated container.

Building docker image

Pull the image

  • docker pull freewil/bitcoin-testnet-box

or build it yourself from this directory

  • docker build -t bitcoin-testnet-box .

Running docker container

The docker image will run two bitcoin nodes in the background and is meant to be attached to allow you to type in commands. The image also exposes the two JSON-RPC ports from the nodes if you want to be able to access them from outside the container.

$ docker run -t -i -p 19001:19001 -p 19011:19011 freewil/bitcoin-testnet-box

or if you built the docker image yourself:

$ docker run -t -i -p 19001:19001 -p 19011:19011 bitcoin-testnet-box

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].