{ "info": { "author": "bitromortac", "author_email": "bitromortac@protonmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "lndmanage\n---------\n\nlndmanage is a command line tool for advanced channel management of an \n[`LND`](https://github.com/lightningnetwork/lnd) node.\n\nCurrent feature list (use the ```--help``` flag for subcommands):\n\n* __Activity reports ```report```__\n* __Display the node summary ```status```__\n* __Advanced channel listings ```listchannels```__\n * ```listchannels rebalance```: list channels for rebalancing\n * ```listchannels inactive```: list inactive channels for channel hygiene \n * ```listchannels forwardings```: list forwarding statistics for each channel \n* __Rebalancing command ```rebalance```__\n * different rebalancing strategies can be chosen\n * a target 'balancedness' can be specified (e.g. to empty the channel)\n* __Circular self-payments ```circle```__\n* __Recommendation of good nodes ```recommend-nodes```__\n\n**DISCLAIMER: This is BETA software, so please be careful (All actions are \n executed as a dry run unless you call lndmanage with the ```--reckless``` \n flag though). No warranty is given.**\n\nCommand line options\n--------------------\n```\nusage: lndmanage.py [-h] [--loglevel {INFO,DEBUG}]\n {status,listchannels,rebalance,circle} ...\n\nLightning network daemon channel management tool.\n\npositional arguments:\n {status,listchannels,rebalance,circle}\n circle circular self-payment\n listchannels lists channels with extended information [see also\n subcommands with -h]\n rebalance rebalance a channel\n recommend-nodes recommends nodes [see also subcommands with -h]\n report displays reports of activity on the node\n status display node status\n```\n\nActivity Report\n---------------\nWith lndmanage you can get a compact overview of what happened during the last\nday(s). It will show you forwarding activity (total forwardings, forwarding fees,\nand forwarding amounts) as well as channel opening and closing events by invoking\n\n`$ lndmanage report`\n\nDifferent time intervals can be specified with the `--from-days-ago` and \n`--to-days-ago` flags.\n\nHere is a sample report for one of the subreports. The activity histogram for \nthe time interval is displayed as a one-line histogram, which consists of \nBraille-like characters.\n```\nReport from yyyy-mm-dd hh:mm to yyyy-mm-dd hh:mm\n\nForwardings:\n activity (\u28ff represents 8 forwardings):\n\n |\u2800\u2800\u2840\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u28c4\u2800\u28c0\u2800\u28e6\u28c0\u2800\u2840\u2840\u2800\u2840\u2840\u2800\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u28c0\u28c0\u2840\u28c0\u2840\u2840\u28c0\u2800\u28c0\u2840\u28c4|\n\n total forwardings: 37\n forwardings per day: 37\n\n channels with most outgoing forwardings:\n cidxxxxxxxxxxxxxxx: 10\n cidxxxxxxxxxxxxxxx: 6\n cidxxxxxxxxxxxxxxx: 4\n cidxxxxxxxxxxxxxxx: 3\n cidxxxxxxxxxxxxxxx: 3\n```\n\nRebalancing a channel\n---------------------\nThe workflow for rebalancing a channel goes as follows:\n\n* take a look at all your unbalanced channels with:\n\n ```$ lndmanage listchannels rebalance```\n\n The output will look like:\n ```\n -------- Description --------\n ub unbalancedness (see --help)\n cap channel capacity [sat]\n lb local balance [sat]\n rb remote balance [sat]\n bf peer base fee [msat]\n fr peer fee rate\n cid channel id\n a alias\n\n -------- Channels --------\n cid ub cap lb rb bf fr a \n xxxxxxxxxxxxxxxxxx -0.78 1000000 888861 99480 10 0.000200 abc \n xxxxxxxxxxxxxxxxxx -0.63 1000000 814537 173768 300 0.000010 def\n xxxxxxxxxxxxxxxxxx 0.55 2000000 450792 1540038 35 0.000002 ghi\n xxxxxxxxxxxxxxxxxx 0.59 400000 81971 306335 400 0.000101 jkl\n ...\n ```\n* the ```ub``` field tells you how unbalanced your channel is \n and in which direction\n* take a channel_id from the list you wish\n to rebalance (target is a 50:50 balance)\n* do a dry run to see what's waiting for you\n\n ```$ lndmanage rebalance --max-fee-sat 20 --max-fee-rate 0.00001 channel_id```\n\n* read the output and if everything looks well, \n then run with the ```--reckless``` flag\n* in order to increase the success probability of your rebalancing you\n can try to do it in smaller chunks, which can be set by the flag\n `--chunksize 0.5` (in this example only half the amounts are used)\n\nChannel hygiene\n---------------------\nInactive channels lock up capital, which can be used elsewhere. \nIn order to close those channels it is useful to take a look\nat the inactive channels with ```$ lndmanage listchannels inactive```.\n\nYou will get an output like:\n\n```\n-------- Description --------\np true if private channel\nini true if we opened channel\nlup last update time [days ago]\nage channel age [days]\ncap capacity [sat]\nlb local balance [sat]\nsr/w satoshis sent + received per week of lifespan\ncid channel id\na alias\n\n-------- Channels --------\n cid p ini lup age cap lb sr/w a \nxxxxxxxxxxxxxxxxxx F F 66 71 2000000 10000 100 abc\nxxxxxxxxxxxxxxxxxx T F 20 113 40000 0 0 def\nxxxxxxxxxxxxxxxxxx F T 19 21 1200000 1000 0 ghi\n...\n```\nChannels, which were updated a long time ago (```lup```) are likely to be \ninactive in the future and may be closed.\n\nAnother way to see if funds have to be reallocated is to have a look at\nthe forwarding statistics of, e.g., the last two months of the individual \nchannels with ```$lndmanage listchannels forwardings --from-days-ago 60 --sort-by='fees'```\n (here sorted by total fees, but it can be sorted by any column field).\n\nThe output will look like:\n```\n-------- Description --------\ncid channel id\nnfwd number of forwardings\nage channel age [days]\nfees fees total [sat]\nf/w fees per week [sat]\nub unbalancedness\nflow flow direction (positive is outwards)\nbwd bandwidth demand: capacity / max(mean_in, mean_out)\nr rebalance required if marked with X\ncap channel capacity [sat]\nin total forwardings inwards [sat]\nimean mean forwarding inwards [sat]\nimax largest forwarding inwards [sat]\nout total forwardings outwards [sat]\nomean mean forwarding outwards [sat]\nomax largest forwarding outwards [sat]\na alias\n\n-------- Channels --------\n cid nfwd age fees f/w ub flow bwd r cap in imean imax out omean omax a\nxxxxxxxxxxxxxxxxxx 6 103 907 106.950 0.30 1.00 0.00 X 6000000 0 nan nan 1935309 20000 1800902 abc\nxxxxxxxxxxxxxxxxxx 3 82 300 35.374 0.74 -0.08 0.70 1000000 700008 700008 700008 600000 600000 600000 def\nxxxxxxxxxxxxxxxxxx 4 32 216 25.461 0.38 0.42 0.17 X 6000000 993591 993591 993591 2450000 750000 1000000 ghi\n...\n```\n\nChannel opening strategies\n--------------------------\nWhich nodes best to connect to in the Lightning Network is ongoing research. \nThis also depends on your personal use case, whether you are a paying user, \na routing node operator or a service provider (or subsets of those). Therefore\nwe need to empirically test, what _good nodes_ mean to us. lndmanage gives you a\nfew options to chose nodes from the network based on several heuristics:\n\n* ```recommend-nodes good-old```: Based on historic forwardings of closed\nchannels, a list of nodes is compiled with which your node has already\nhad a good relationship. Due to that relationship, good interaction with that\nnode in the future is likely.\n* ```recommend-nodes flow-analysis```: If your node has already routed\npayments, you can use this information to your favor. If you want to improve\nyour position in the Lightning Network for routing, you may want to look for\n need of inbound liquidity. This can be achieved by estimating the \n probability where the payments you routed were ending up. If you connect to\n those nodes directly you bypass outher routing nodes.\n* ```recommend-nodes external-source```: This command lets you access text-based\nlists of nodes, which are associated with economic activity. You can provide a\nURL, which is parsed for node public keys and suggests nodes to connect to\n(defaults to the list of [lightning networkstores](http://lightningnetworkstores.com)).\nAnother example of the command using 'bos-scores' is \n`$ lndmanage recommend-nodes external-source --source https://nodes.lightning.computer/availability/v1/btc.json`.\n* ```recommend-nodes channel-openings```: When lightning nodes of new services\n are bootstrapped by opening a bunch of channels at the same time,\n we can detect this. Typically, a node with a large number of channel\n fluctuation signals economic activity. As the newly opened channels will \n predominantly be of outbound type, the node will have a large\n demand for inbound liquidity, which is something you want to exploit as a\n routing node.\n\nlndmanage supports a __channel annotation functionality__. This serves for\n remembering why a certain channel was opened. By adding the funding\ntransaction id or channel id to the config file `~/.lndmanage/config.ini`\nunder the `annotations` section (as specified in \n[`config_sample.ini`](lndmanage/templates/config_sample.ini)), annotations\ncan be saved. These annotations will then appear in the `listchannels` views.\n\nSetup\n-----\nlndmanage will be developed in lockstep with lnd and tagged accordingly. \nIf you are running an older version of lnd checkout the according \n[tag](https://github.com/bitromortac/lndmanage/releases).\n\nRequirements: python3.6, lnd v0.8.0-beta\n\nIf you run this tool from a different host than the lnd host, \nmake sure to copy `/path/to/.lnd/data/chain/bitcoin/mainnet/admin.macaroon`\n and `/path/to/.lnd/tls.cert` to your local machine, which you need for later\n configuration.\n\n**Linux:**\n\nYou can install lndmanage via two methods:\n\n1\\. Install with pip (recommended):\n```\n$ python3 -m venv venv\n$ source venv/bin/activate\n$ python3 -m pip install lndmanage\n```\n2\\. Install from source:\n```\n$ git clone https://github.com/bitromortac/lndmanage\n$ cd lndmanage\n$ python3 -m venv venv\n$ source venv/bin/activate\n$ python3 setup.py install\n```\n\n**Windows (powershell):**\nInstall [python3](https://www.python.org/downloads/release/python-374/),\n[git](https://git-scm.com/download/win), and\n [visual studio build tools](https://visualstudio.microsoft.com/de/downloads/?q=build+tools).\n\nYou need to set the environment variable `PYTHONIOENCODING` for proper encoding to:\n`$env:PYTHONIOENCODING=\"UTF-8\"`\n\n1\\. Install with pip (recommended):\n```\n$ py -m venv venv\n$ .\\venv\\Scripts\\activate\n$ python -m pip install lndmanage\n```\n\n2\\. Install from source:\n```\n$ git clone https://github.com/bitromortac/lndmanage\n$ cd lndmanage\n$ py -m venv venv\n$ .\\venv\\Scripts\\activate\n$ python setup.py install\n```\n**Configuration:**\n\nWhen starting lndmanage for the first time, it will create a runtime folder \n`/home/user/.lndmanage`, where the configuration `config.ini` and log files\n reside. This folder location can be overwritten by setting an environment \n variable `LNDMANAGE_HOME`. If you run this tool from a remote host to the lnd\n host, you need to configure `config.ini`.\n\n**Running lndmanage**\n\nThe installation process created an executable `lndmanage`, which will\nonly be available if the created python environment is active (your prompt \nshould have an `(venv)` in front):\n```\n$ source venv/bin/activate\n```\nthen run\n```\n(venv) $ lndmanage status\n```\nIf it works, you should see the node status.\n\nTesting\n-------\nRequirements are an installation of [lnregtest](https://github.com/bitromortac/lnregtest)\nand links to bitcoind, bitcoin-cli, lnd, and lncli in the `test/bin` folder.\n\nTests can be run with\n`python3 -m unittest discover test`\nfrom the root folder.\n\nDocker\n------\n**Due to restructuring of the project, this option is currently defunct.**\n\nIf you prefer to run `lndmanage` from a docker container, `cd docker` \nand follow [`README`](docker/README.md) there.\n\nCompiling grpc in python [development]\n----------------------------------------------------\n```\n$ cd grpc_compiled\n$ pip install grpcio grpcio-tools googleapis-common-protos\n$ git clone https://github.com/googleapis/googleapis.git\n$ curl -o rpc.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/rpc.proto\n$ python -m grpc_tools.protoc --proto_path=googleapis:. --python_out=. --grpc_python_out=. rpc.proto\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bitromortac/lndmanage", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "lndmanage", "package_url": "https://pypi.org/project/lndmanage/", "platform": "", "project_url": "https://pypi.org/project/lndmanage/", "project_urls": { "Homepage": "https://github.com/bitromortac/lndmanage" }, "release_url": "https://pypi.org/project/lndmanage/0.8.0/", "requires_dist": [ "cycler (==0.10.0)", "decorator (==4.4.0)", "googleapis-common-protos (==1.5.9)", "grpcio-tools (==1.13.0)", "grpcio (==1.19.0)", "kiwisolver (==1.0.1)", "networkx (==2.2)", "numpy (==1.16.2)", "protobuf (==3.7.1)", "pyparsing (==2.4.0)", "python-dateutil (==2.8.0)", "six (==1.12.0)", "wheel" ], "requires_python": "", "summary": "Channel management tool for lightning network daemon (LND) operators.", "version": "0.8.0" }, "last_serial": 5981538, "releases": { "0.7.0": [ { "comment_text": "", "digests": { "md5": "23d13aebdb30febf15b0abbb1fdf1815", "sha256": "35d76e2c6f317a14450d201c50ddcbe37e8f34648311c0f2f2099fc63f39da29" }, "downloads": -1, "filename": "lndmanage-0.7.0-py3-none-any.whl", "has_sig": false, "md5_digest": "23d13aebdb30febf15b0abbb1fdf1815", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 100493, "upload_time": "2019-09-26T06:53:58", "url": "https://files.pythonhosted.org/packages/69/a3/a95d1706a171c339c8fbebae862e5e795d9b222fbe6feeab800a67d7f8f7/lndmanage-0.7.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9978aae684f9f1c5763cfdb90f7aa085", "sha256": "7f5b51725b75864235fda5db3add2b55c21e65aecbf693fb61c166ed738bbd08" }, "downloads": -1, "filename": "lndmanage-0.7.0.tar.gz", "has_sig": false, "md5_digest": "9978aae684f9f1c5763cfdb90f7aa085", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 92981, "upload_time": "2019-09-26T06:54:01", "url": "https://files.pythonhosted.org/packages/23/8e/4435a258dacb1cf136134b896fc53494d191b1c7b621748a05cdb277c08f/lndmanage-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "1bb73ed2f1f05eb51af2eb4536d52415", "sha256": "4682ad5e70df1b0e2392089efba518995f99b7578b20a4dab929a23594c97538" }, "downloads": -1, "filename": "lndmanage-0.7.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1bb73ed2f1f05eb51af2eb4536d52415", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 100828, "upload_time": "2019-09-30T06:03:35", "url": "https://files.pythonhosted.org/packages/1c/40/b8ac90dcb585577a396a7c10eb300c7d821da97ed60d1ca1938baf5aaa7a/lndmanage-0.7.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2c7dfda7fa84d0d45f83e3f7122d4c29", "sha256": "953f0c833f721d17512ea5a91a15a783181391084d0a2b56dca843f2638544e8" }, "downloads": -1, "filename": "lndmanage-0.7.1.tar.gz", "has_sig": false, "md5_digest": "2c7dfda7fa84d0d45f83e3f7122d4c29", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 93328, "upload_time": "2019-09-30T06:03:40", "url": "https://files.pythonhosted.org/packages/13/26/23cf77e2b354e5bb0ab7b32c8e7e89c7e92f2a1dc326925ffd4492dde572/lndmanage-0.7.1.tar.gz" } ], "0.7.1.1": [ { "comment_text": "", "digests": { "md5": "e65c0c974eb89ae261be289b4efe0490", "sha256": "b7d119985df58b048877ef360999cdcd5b5bb85e34bb11e3c3612b3d44cc51ea" }, "downloads": -1, "filename": "lndmanage-0.7.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e65c0c974eb89ae261be289b4efe0490", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 109021, "upload_time": "2019-10-15T05:49:38", "url": "https://files.pythonhosted.org/packages/1d/9c/7776a829b14dc6c56d241e48334cf3b26fecee717271cb90772760f6ccce/lndmanage-0.7.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9d47162d649d5cfc3680a06bea375277", "sha256": "006741a9a2bbfab10701782ca7258e4405730fe1568b8f1f2d8088b184c8994b" }, "downloads": -1, "filename": "lndmanage-0.7.1.1.tar.gz", "has_sig": false, "md5_digest": "9d47162d649d5cfc3680a06bea375277", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 100638, "upload_time": "2019-10-15T05:49:41", "url": "https://files.pythonhosted.org/packages/70/1e/efc1aacf2f7a5f05c6ad3322da61641449dd00d3954b17171ca3968e620a/lndmanage-0.7.1.1.tar.gz" } ], "0.7.1.2": [ { "comment_text": "", "digests": { "md5": "fc489c4ca19ece496f9449e36034c0c8", "sha256": "1092be39f2eb850240978c86aa38e7c021b2bfc7a38ddbe94c6d742f75850559" }, "downloads": -1, "filename": "lndmanage-0.7.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "fc489c4ca19ece496f9449e36034c0c8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 111330, "upload_time": "2019-10-16T06:21:47", "url": "https://files.pythonhosted.org/packages/fb/c6/f9002f3ed5338b97d47b1793a6850a6204c4153328c7ca69de96be6d422f/lndmanage-0.7.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12df8860272496b87ec82bec57678da5", "sha256": "35b497b61a189951cebfa89253797d80706f5227ae6a1ae78278911d7ad43022" }, "downloads": -1, "filename": "lndmanage-0.7.1.2.tar.gz", "has_sig": false, "md5_digest": "12df8860272496b87ec82bec57678da5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102885, "upload_time": "2019-10-16T06:21:49", "url": "https://files.pythonhosted.org/packages/ac/8d/a3f6ed27131a52336006b95249f6317216d2b08e0bab9a719b95b63451ad/lndmanage-0.7.1.2.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "1b2da901742b4599a5fe4a7d3a4ad4f8", "sha256": "445558ebc618b88aa000ddff7ac87c32c0eea1ecc158e1f07a8396352fbf0ac3" }, "downloads": -1, "filename": "lndmanage-0.8.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1b2da901742b4599a5fe4a7d3a4ad4f8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 111304, "upload_time": "2019-10-16T06:56:30", "url": "https://files.pythonhosted.org/packages/e6/fb/24d256394022e37854529b9ef1a212f6b6bb4ea083cdd149b1efbd963faf/lndmanage-0.8.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "42c7679304a68f580f2567d15274e732", "sha256": "5d5210eb27126186424a5076eb907146b44c6c2798ba2b24fc47d62b4216dafe" }, "downloads": -1, "filename": "lndmanage-0.8.0.tar.gz", "has_sig": false, "md5_digest": "42c7679304a68f580f2567d15274e732", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102888, "upload_time": "2019-10-16T06:56:32", "url": "https://files.pythonhosted.org/packages/07/8a/9eb3bfd68f45da8b3bbcc0e90b20d457a9df2259de9603aa557dd539a229/lndmanage-0.8.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1b2da901742b4599a5fe4a7d3a4ad4f8", "sha256": "445558ebc618b88aa000ddff7ac87c32c0eea1ecc158e1f07a8396352fbf0ac3" }, "downloads": -1, "filename": "lndmanage-0.8.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1b2da901742b4599a5fe4a7d3a4ad4f8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 111304, "upload_time": "2019-10-16T06:56:30", "url": "https://files.pythonhosted.org/packages/e6/fb/24d256394022e37854529b9ef1a212f6b6bb4ea083cdd149b1efbd963faf/lndmanage-0.8.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "42c7679304a68f580f2567d15274e732", "sha256": "5d5210eb27126186424a5076eb907146b44c6c2798ba2b24fc47d62b4216dafe" }, "downloads": -1, "filename": "lndmanage-0.8.0.tar.gz", "has_sig": false, "md5_digest": "42c7679304a68f580f2567d15274e732", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102888, "upload_time": "2019-10-16T06:56:32", "url": "https://files.pythonhosted.org/packages/07/8a/9eb3bfd68f45da8b3bbcc0e90b20d457a9df2259de9603aa557dd539a229/lndmanage-0.8.0.tar.gz" } ] }