{"id":25891609,"url":"https://github.com/lnbits/legend-regtest-enviroment","last_synced_at":"2025-03-02T20:28:43.760Z","repository":{"id":39340927,"uuid":"503786903","full_name":"lnbits/legend-regtest-enviroment","owner":"lnbits","description":"Easy docker LNbits regtest enviroment","archived":false,"fork":false,"pushed_at":"2025-01-09T13:23:52.000Z","size":140,"stargazers_count":13,"open_issues_count":1,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-09T14:37:45.316Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/lnbits.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":"2022-06-15T13:53:49.000Z","updated_at":"2025-01-09T13:23:56.000Z","dependencies_parsed_at":"2024-07-31T09:47:41.310Z","dependency_job_id":"632f91f8-40c0-40ec-94f5-3e18fb604b5e","html_url":"https://github.com/lnbits/legend-regtest-enviroment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2Flegend-regtest-enviroment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2Flegend-regtest-enviroment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2Flegend-regtest-enviroment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2Flegend-regtest-enviroment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lnbits","download_url":"https://codeload.github.com/lnbits/legend-regtest-enviroment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241567250,"owners_count":19983460,"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":[],"created_at":"2025-03-02T20:28:43.226Z","updated_at":"2025-03-02T20:28:43.727Z","avatar_url":"https://github.com/lnbits.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![TESTS](https://github.com/lnbits/legend-regtest-enviroment/actions/workflows/ci.yml/badge.svg)\n\n# nodes\n* lnd-1: for locally testing your current lnbits\n* lnd-2: used for boltz backend\n* lnd-3: used for lnbits inside docker\n* cln-1: for locally testing your current lnbits\n* cln-2: used for clightning-REST\n* eclair-1: for locally testing your current lnbits\n\n# Installing regtest\nget the regtest enviroment ready\n```sh\n# Install docker https://docs.docker.com/engine/install/\n# Make sure your user has permission to use docker 'sudo usermod -aG docker ${USER}' then reboot\n# Stop/start docker 'sudo systemctl stop docker' 'sudo systemctl start docker'\n\nsudo apt install jq\ngit clone https://github.com/lnbits/lnbits.git\ncd lnbits\ndocker build -t lnbits/lnbits .\nmkdir docker\ngit clone https://github.com/lnbits/legend-regtest-enviroment.git docker\ncd docker\nchmod +x ./tests\n./tests # start the regtest and also run tests\nsudo chown -R $USER ./data # Give the data file permissions for user\n```\n\n# Running LNbits on regtest\nadd this ENV variables to your `.env` file\n```sh\nDEBUG=true\n\n# LND\nLNBITS_BACKEND_WALLET_CLASS=\"LndRestWallet\"\nLND_REST_ENDPOINT=https://127.0.0.1:8081/\nLND_REST_CERT=/home/user/repos/lnbits/docker/data/lnd-1/tls.cert\nLND_REST_MACAROON=/home/user/repos/lnbits/docker/data/lnd-1/data/chain/bitcoin/regtest/admin.macaroon\n\n# CLN\nLNBITS_BACKEND_WALLET_CLASS=\"CoreLightningWallet\"\nCORELIGHTNING_RPC=./docker/data/clightning-1/regtest/lightning-rpc\n\n\n# Run LNbits\npoetry run lnbits\n\n# Run LNbits with hot reload\nmake dev\n```\n\n# testing\n```sh\nchmod +x ./tests\n./tests\n# short answer :)\n./tests \u0026\u0026 echo \"PASSED\" || echo \"FAILED\" \u003e /dev/null\n```\n\nusage of the `bitcoin-cli-sim`, `lightning-cli-sim` and `lncli-sim` aliases\n```sh\ncd ~/lnbits/docker\nsource docker-scripts.sh\n# use bitcoin core, mine a block\nbitcoin-cli-sim -generate 1\n\n# use c-lightning nodes\nlightning-cli-sim 1 newaddr | jq -r '.bech32' # use node 1\nlightning-cli-sim 2 getinfo # use node 2\nlightning-cli-sim 3 getinfo # use node 3\n\n# use lnd nodes\nlncli-sim 1 newaddr p2wsh\nlncli-sim 2 listpeers\n```\n\n# urls\n* mempool: http://localhost:8080/\n* boltz api: http://localhost:9001/\n* lnd-1 rest: http://localhost:8081/\n* lnbits: http://localhost:5001/\n\n# debugging docker logs\n```sh\ndocker logs lnbits-lnbits-1 -f\ndocker logs lnbits-boltz-1 -f\ndocker logs lnbits-clightning-1-1 -f\ndocker logs lnbits-lnd-2-1 -f\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnbits%2Flegend-regtest-enviroment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flnbits%2Flegend-regtest-enviroment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnbits%2Flegend-regtest-enviroment/lists"}