{"id":17018376,"url":"https://github.com/darosior/regtest-manager","last_synced_at":"2026-04-19T15:01:34.170Z","repository":{"id":122838463,"uuid":"200293377","full_name":"darosior/regtest-manager","owner":"darosior","description":"Start a regtest environment with bitcoin-core + C-lightning","archived":false,"fork":false,"pushed_at":"2019-11-28T17:45:36.000Z","size":23,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T16:43:04.390Z","etag":null,"topics":["bitcoin-core","bitcoind","c-lightning","lightningd","regtest"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause-clear","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darosior.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":"2019-08-02T20:21:58.000Z","updated_at":"2022-08-03T15:47:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"a7501cb7-31a8-4cf1-b40e-904758ce7693","html_url":"https://github.com/darosior/regtest-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/darosior/regtest-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darosior%2Fregtest-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darosior%2Fregtest-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darosior%2Fregtest-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darosior%2Fregtest-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darosior","download_url":"https://codeload.github.com/darosior/regtest-manager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darosior%2Fregtest-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32010957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-core","bitcoind","c-lightning","lightningd","regtest"],"created_at":"2024-10-14T06:45:41.534Z","updated_at":"2026-04-19T15:01:34.146Z","avatar_url":"https://github.com/darosior.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# regtest-manager\n*Quick and dirties bash functions to start a Bitcoin and Lightning Network regtest*\n\n## Rationale\n\nSetup a regtest is both cumbersome (/repetitive) and pretty useful for a lot of Bitcoin / Lightning Network applications (e.g. you might need one for plugins). I needed that automation. So I did it and published it here.\nThis does not intend to be robust (or clean :-)), just an utility (source it in your bashrc). For a more complete solution, check out [lnet](https://github.com/cdecker/lnet).\n\n## Usage\nQuick setup:\n```\nsource regtest_manager\nstart_regtest 3 \u0026\u0026 fund_regtest # A minute later you have a fully set up LN regtest\n```\n\nBy sourcing the `regtest_manager` script you can use 2 functions to start a test network of any number of nodes.\n```bash\nsource regtest_manager\nstart_regtest # Default is 2 nodes, otherwise the number can be specified as an argument\n```\n==\u003e\n```bash\n$ start_regtest 3\n\nStarted bitcoind 1 with P2P port 10001, RPC port 9001 and datadir /home/darosior/projects/regtest_manager/regtest/bcdir1\nStarted lightningd on top of it with directory /home/darosior/projects/regtest_manager/regtest/lndir1\n==\u003e You can access the lighntingd startup command line with 'lnreg1', the bitcoind startup command line with 'bdreg1', the lightning CLI with 'lcreg1', and the bitcoin CLI with 'bcreg1'.\n\nStarted bitcoind 2 with P2P port 10002, RPC port 9002 and datadir /home/darosior/projects/regtest_manager/regtest/bcdir2\nStarted lightningd on top of it with directory /home/darosior/projects/regtest_manager/regtest/lndir2\n==\u003e You can access the lighntingd startup command line with 'lnreg2', the bitcoind startup command line with 'bdreg2', the lightning CLI with 'lcreg2', and the bitcoin CLI with 'bcreg2'.\n\nStarted bitcoind 3 with P2P port 10003, RPC port 9003 and datadir /home/darosior/projects/regtest_manager/regtest/bcdir3\nStarted lightningd on top of it with directory /home/darosior/projects/regtest_manager/regtest/lndir3\n==\u003e You can access the lighntingd startup command line with 'lnreg3', the bitcoind startup command line with 'bdreg3', the lightning CLI with 'lcreg3', and the bitcoin CLI with 'bcreg3'.\n\n\nStarted 3 pairs of bitcoind and lightningd nodes with rpc user \"test\" and pass \"test\" (and poor alias names).\n```\n```bash\n$ lcreg2 getinfo\n{\n   \"id\" : \"03b1762af584f80a1b644f029d7f13c1f58e4c53a54e0e0a944454813f76a86b2f\",\n   \"alias\" : \"testnode2\",\n   \"color\" : \"03b176\",\n   \"num_peers\" : 0,\n   \"num_pending_channels\" : 0,\n   \"num_active_channels\" : 0,\n   \"num_inactive_channels\" : 0,\n   \"address\" : [],\n   \"binding\" : [\n      {\n         \"type\" : \"ipv4\",\n         \"address\" : \"127.0.0.1\",\n         \"port\" : 11002\n      }\n   ],\n   \"version\" : \"v0.7.1-217-g913a1a9\",\n   \"blockheight\" : 0,\n   \"network\" : \"regtest\",\n   \"msatoshi_fees_collected\" : 0,\n   \"fees_collected_msat\" : \"0msat\"\n}\n```\nYou can fund a channel between all nodes (like l1 --\u003e l2 --\u003e l3) with:\n```bash\n$ fund_regtest\n\nGetting some bitcoins on both 'bitcoind' and 'lightningd' for each node\nFunding a channel between node 1 and node 2 :\nWaiting for lightningd to be aware of its bitcoins\n{\n   \"tx\" : \"020000000001012df2a1c4b192a2fc741f840e076b74c1506b4c0dc6f7ad8aac00c1a1b10fa93c0100000000ffffffff02a08601000000000022002033327d832c3d4a234c605c9ede6dbcb399440d6ae68bcb310be244a31a3839faa942993b00000000160014028d6e1310ab72afb6102859c0b289f686a7264602483045022100844bb79d9b007713cc7ea27ae78f9cef31829c892edcc5737311516c08142a3502207c329763740644128c0125e42421b6fa7e5e557663676af88a151eb036e95a350121026b1bf2a838e6e262d280c70007e0d1729d116f143053c35a3fffe174d9cc01a900000000\",\n   \"txid\" : \"6ef07a54f59131f31ab8ce2965dd33b316a20d30a7c114973fd959eac5947a09\",\n   \"channel_id\" : \"097a94c5ea59d93f9714c1a7300da216b333dd6529ceb81af33191f5547af06e\"\n}\n\nFunding a channel between node 2 and node 3 :\nWaiting for lightningd to be aware of its bitcoins\n{\n   \"tx\" : \"0200000000010111276268ef570cd98c32fa81985d746351535b94010959e8fbb8c77cb3689d690100000000ffffffff02a0860100000000002200201eef1f82e3f08951a7ed585ded129fbee0b56fae0663294e90ae824813245f35a942993b00000000160014d67ee0343bc0189c63b2d8f2e0cd63cb8683d8ea02483045022100e0875e1d1770c9a7c439b4bbe1065ed7e5ab9b74e06c6318106febc8f7f23ec602202f6da17be93f4b83bd2acd876e9b3647d3088be3aaa3a2b14de5db07aacb6631012102a5be7ce4872a3c50cb8ed05e59bc42bd54bf796c28754984fc9c4fbfc0823f8b00000000\",\n   \"txid\" : \"a7719bc2a6fc8afb604c79083b893e3cba3ab7528d64db5ea74eeb5e81c3ac72\",\n   \"channel_id\" : \"72acc3815eeb4ea75edb648d52b73aba3c3e893b08794c60fb8afca6c29b71a7\"\n}\n```\nNote that it will also start generating blocks in the background.\n\n\\\nYou can stop all daemons with (which deletes also data directories):\n```bash\n$ stop_regtest\n\nlightningd can take some time to stop. It will be fixed in v0.7.2\nlightningd 1 stopped\nbitcoind 1 stopped\nlightningd 2 stopped\nbitcoind 2 stopped\nlightningd 3 stopped\nbitcoind 3 stopped\n```\n\n\\\nYou can setup a fully connected network (needs a regtest of at least 3 nodes) with\n```bash\n$ fund_many_regtest\n```\nIf you have a network of, say, 5 nodes A B C D E, then `fund_regtest` will fund channels\nsuch as\n```\nA ==\u003e B ==\u003e C ==\u003e D ==\u003e E\n```\nAnd `fund_many_regtest` will fund channels such as\n```\nC ==\u003e A,   D ==\u003e B,   E ==\u003e C\n```\n\n\\\nYou can setup `lightningd` and `bitcoind` pathes, for example:\n```bash\nBITCOIND_PATH=$PWD/bitcoin/src/bitcoind LIGHTNINGD_PATH=$PWD/lightning/lightningd/lightningd start_regtest\n```\n\n\\\nThere exists a dirty function to cleanup in case of quirks, `kill_regtest`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarosior%2Fregtest-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarosior%2Fregtest-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarosior%2Fregtest-manager/lists"}