{"id":13464037,"url":"https://github.com/freewil/bitcoin-testnet-box","last_synced_at":"2025-05-16T17:07:16.905Z","repository":{"id":37385127,"uuid":"3983167","full_name":"freewil/bitcoin-testnet-box","owner":"freewil","description":"Create your own private bitcoin testnet","archived":false,"fork":false,"pushed_at":"2024-04-13T13:20:39.000Z","size":46050,"stargazers_count":613,"open_issues_count":11,"forks_count":285,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-04-12T15:58:35.898Z","etag":null,"topics":["bitcoin","docker","testnet"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/freewil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-04-10T14:32:15.000Z","updated_at":"2025-04-09T12:11:49.000Z","dependencies_parsed_at":"2024-07-31T14:02:29.330Z","dependency_job_id":null,"html_url":"https://github.com/freewil/bitcoin-testnet-box","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freewil%2Fbitcoin-testnet-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freewil%2Fbitcoin-testnet-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freewil%2Fbitcoin-testnet-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freewil%2Fbitcoin-testnet-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freewil","download_url":"https://codeload.github.com/freewil/bitcoin-testnet-box/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254573588,"owners_count":22093731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","docker","testnet"],"created_at":"2024-07-31T14:00:32.589Z","updated_at":"2025-05-16T17:07:16.858Z","avatar_url":"https://github.com/freewil.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# bitcoin-testnet-box\n[![docker pulls](https://img.shields.io/docker/pulls/freewil/bitcoin-testnet-box.svg?style=flat)](https://hub.docker.com/r/freewil/bitcoin-testnet-box/)\n\nCreate your own private bitcoin testnet\n\nYou must have `bitcoind` and `bitcoin-cli` installed on your system and in the\npath unless running this within a [Docker](https://www.docker.com) container\n(see [below](#using-with-docker)).\n\n## Large Git History\nIf you'd like to clone this git repository locally and disk space or bandwidth\nusage is of concern, it's suggested to do a shallow clone, excluding some\nearlier history of the repo, where some testnet data was included.\n\n\u003e Regular clone: `du -sh .` 44M\n\n\u003e Shallow clone: `du -sh .` 168K\n\n### Regular Clone\n```\ngit clone git@github.com:freewil/bitcoin-testnet-box.git\n```\n\n### Shallow Clone\n```\ngit clone --shallow-since 2014-10-18 git@github.com:freewil/bitcoin-testnet-box.git\n```\n\n## Starting the testnet-box\n\nThis will start up two nodes using the two datadirs `1` and `2`. They\nwill only connect to each other in order to remain an isolated private testnet.\nTwo nodes are provided, as one is used to generate blocks and it's balance\nwill be increased as this occurs (imitating a miner). You may want a second node\nwhere this behavior is not observed.\n\nNode `1` will listen on port `19000`, allowing node `2` to connect to it.\n\nNode `1` will listen on port `19001` and node `2` will listen on port `19011`\nfor the JSON-RPC server.\n\n\n```\n$ make start\n```\n\n## Check the status of the nodes\n\n```\n$ make getinfo\nbitcoin-cli -datadir=1  getinfo\n{\n    \"version\" : 90300,\n    \"protocolversion\" : 70002,\n    \"walletversion\" : 60000,\n    \"balance\" : 0.00000000,\n    \"blocks\" : 0,\n    \"timeoffset\" : 0,\n    \"connections\" : 1,\n    \"proxy\" : \"\",\n    \"difficulty\" : 0.00000000,\n    \"testnet\" : false,\n    \"keypoololdest\" : 1413617762,\n    \"keypoolsize\" : 101,\n    \"paytxfee\" : 0.00000000,\n    \"relayfee\" : 0.00001000,\n    \"errors\" : \"\"\n}\nbitcoin-cli -datadir=2  getinfo\n{\n    \"version\" : 90300,\n    \"protocolversion\" : 70002,\n    \"walletversion\" : 60000,\n    \"balance\" : 0.00000000,\n    \"blocks\" : 0,\n    \"timeoffset\" : 0,\n    \"connections\" : 1,\n    \"proxy\" : \"\",\n    \"difficulty\" : 0.00000000,\n    \"testnet\" : false,\n    \"keypoololdest\" : 1413617762,\n    \"keypoolsize\" : 101,\n    \"paytxfee\" : 0.00000000,\n    \"relayfee\" : 0.00001000,\n    \"errors\" : \"\"\n}\n```\n## Creating wallets\n\n```\nbitcoin-cli -datadir=1 createwallet wallet1\n```\n\n```\nbitcoin-cli -datadir=2 createwallet wallet2\n```\n\n## Generating blocks\n\nNormally on the live, real, bitcoin network, blocks are generated, on average,\nevery 10 minutes. Since this testnet-in-box uses Bitcoin Core's (bitcoind)\nregtest mode, we are able to generate a block on a private network\ninstantly using a simple command.\n\nTo generate a block:\n\n```\n$ make generate\n```\n\nTo generate more than 1 block:\n\n```\n$ make generate BLOCKS=10\n```\n\n## Need to generate at least 100 blocks before there will be a balance in the first wallet\n```\n$ make generate BLOCKS=200\n```\n\n## Verify that there is a balance on the first wallet\n```\n$ make getinfo\n```\n\n## Generate a wallet address for the second wallet\n```\n$ make address2\n```\n\n## Sending bitcoins\nTo 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)\n\n```\n$ make sendfrom1 ADDRESS=mxwPtt399zVrR62ebkTWL4zbnV1ASdZBQr AMOUNT=10\n```\n\n## Does the balance show up?\nRun the getinfo command again. Does the balance show up? Why not?\n```\n$ make getinfo\n```\n\n## Generate another block\n```\n$ make generate\n```\n\n## Stopping the testnet-box\n\n```\n$ make stop\n```\n\nTo clean up any files created while running the testnet and restore to the\noriginal state:\n\n```\n$ make clean\n```\n\n## Using with docker\nThis testnet-box can be used with [Docker](https://www.docker.com/) to run it in\nan isolated container.\n\n### Building docker image\n\nPull the image\n  * `docker pull freewil/bitcoin-testnet-box`\n\nor build it yourself from this directory\n  * `docker build -t bitcoin-testnet-box .`\n\n### Running docker container\nThe docker image will run two bitcoin nodes in the background and is meant to be\nattached to allow you to type in commands. The image also exposes\nthe two JSON-RPC ports from the nodes if you want to be able to access them\nfrom outside the container.\n      \n   `$ docker run -t -i -p 19001:19001 -p 19011:19011 freewil/bitcoin-testnet-box`\n\nor if you built the docker image yourself:\n\n   `$ docker run -t -i -p 19001:19001 -p 19011:19011 bitcoin-testnet-box`\n\n## Running without docker\nTo run without docker, one should download the supported Bitcoin core version. \nTo find the supported version, search for the `BITCOIN_CORE_VERSION` environment variable\nin the `Dockerfile` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreewil%2Fbitcoin-testnet-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreewil%2Fbitcoin-testnet-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreewil%2Fbitcoin-testnet-box/lists"}