Difference between revisions of "Node Management"
Jump to navigation
Jump to search
MiltonPusser (talk | contribs) |
|||
(6 intermediate revisions by one other user not shown) | |||
Line 6: | Line 6: | ||
= Actions = | = Actions = | ||
== Opening channels (outgoing) == | |||
== Getting incoming | See [[Opening channels]] | ||
[[Incoming liquidity]] | |||
== Getting incoming liquidity== | |||
See [[Incoming liquidity]] | |||
== Balancing channels == | == Balancing channels == | ||
Line 22: | Line 24: | ||
[[Keys and backups]] | [[Keys and backups]] | ||
= Commands = | |||
==lnd== | |||
===Debugging=== | |||
[[Debugging LND]] | |||
===Aliases=== | |||
<pre>alias lchannelcaps='lncli describegraph | jq '\''.nodes[].total_channel_capacities=0 | foreach .nodes[] as ( . ; foreach .edges[] as ( . ; if .node1_pub==.pub_key then (|.total_channel_capacities=.total_channel_capacity+(.capacity|tonumber)) else empty end ; .) ; . )'\''' | |||
alias lnactive='lncli listchannels | jq '\''[ .channels | .[] | select(.active==true) ] | length'\''' | |||
alias lnchaninfo='lncli listchannels | jq '\''[ .channels | .[] | { "remote_pubkey": .remote_pubkey, "capacity": .capacity|tonumber, "local_balance": .local_balance|tonumber, "remote_balance": .remote_balance| | |||
tonumber, "distribution_pct": ( ( .local_balance|tonumber ) / ( (.remote_balance|tonumber ) + ( .local_balance|tonumber ) ) ), "total_satoshis_sent": .total_satoshis_sent|tonumber, "total_satoshis_received": .total_satoshis_received|tonumber } ]'\''' | |||
alias lndist='lncli listchannels | jq '\''[ .channels | .[] | { "remote_pubkey": .remote_pubkey, "capacity": .capacity, "distribution_pct": ( ( .local_balance|tonumber ) / ( (.remote_balance|tonumber ) + ( .local_balance|tonumber ) ) ) } ]'\''' | |||
alias lnforcegraph='lncli describegraph | jq -c '\''{ "nodes": .nodes | map({ "id": .pub_key, "alias": .alias|match("[^\u0000]+")| .string, "group": 1, "color": .color, "addresses": .addresses }), "links": .edges | map({"source": .node1_pub, "target": .node2_pub, "capacity": .capacity|tonumber }) }'\''' | |||
alias lninactive='lncli listchannels | jq '\''[ .channels | .[] | select(.active==false) ] | length'\''' | |||
alias lnlimbo='lncli pendingchannels | jq '\''.total_limbo_balance|tonumber'\''' | |||
alias lnnodeinfo='lncli listchannels | jq -r .channels[].remote_pubkey | while read p; do lncli getnodeinfo "$p"; done' | |||
alias lnoffchain='lncli listchannels | jq '\''[ .channels | .[] | select(.num_updates|tonumber>0) ]'\''' | |||
alias lnoffchainupdates='lncli listchannels | jq '\''.channels | map(.num_updates|tonumber) | add'\''' | |||
alias lnpendingc='lncli pendingchannels | jq '\''.pending_close_channels|length'\''' | |||
alias lnpendingf='lncli pendingchannels | jq '\''.pending_force_closing_channels|length'\''' | |||
alias lnpendingo='lncli pendingchannels | jq '\''.pending_open_channels|length'\''' | |||
alias lnreceivedbal='lncli listchannels | jq '\''.channels | map(.total_satoshis_received|tonumber) | add'\''' | |||
alias lnrecv='lncli listchannels | jq '\''[ .channels | .[] | select(.total_satoshis_received|tonumber>0) ]'\''' | |||
alias lnremotebal='lncli listchannels | jq '\''.channels | map(.remote_balance|tonumber) | add'\''' | |||
alias lnsentbal='lncli listchannels | jq '\''.channels | map(.total_satoshis_sent|tonumber) | add'\''' | |||
alias lntopchannels='lncli describegraph | jq '\''[ .edges | sort_by(.capacity|tonumber) | reverse | .[] | { "node1_pub": .node1_pub, "node2_pub": .node2_pub, "Capacity": .capacity|tonumber, } ]'\''' | |||
alias lntotalcap='lncli listchannels | jq '\''.channels | map(.capacity|tonumber) | add'\''' | |||
alias lnunsettled='lncli listchannels | jq '\''[ .channels | .[] | select(.unsettled_balance|tonumber>0) ]'\''' | |||
alias lnunsettledbal='lncli listchannels | jq '\''.channels | map(.unsettled_balance|tonumber) | add'\''' | |||
alias lnunusedchannels='lncli listchannels | jq '\''[ .channels[] | select(.total_satoshis_sent=="0" and .total_satoshis_received=="0") ]| {"unused channels": map({"channel_point": .channel_point, "local_balance": .local_balance|tonumber, "num_updates": .num_updates|tonumber, "active": .active, "private": .private}) | sort_by(.local_balance) | reverse }'\''' | |||
alias lrecv='lncli listchannels | jq '\''[ .channels | .[] | select(.total_satoshis_received|tonumber>0) ]'\'''</pre> | |||
(by vegard) | |||
= Frontends = | = Frontends = | ||
== Web frontends == | == Web frontends == | ||
* [[LNDash]] | * [[LNDash]] | ||
* [https://github.com/ShahanaFarooqui/RTL Ride The Lightning dashboard] | |||
* [https://github.com/qbert911/lnd-watcher lnd-watcher], simple script | |||
* [https://github.com/M-D-Br/FlaskBitcoinDashboard/ Flask Bitcoin Dashboard] | |||
== CLI == | |||
* [https://github.com/edouardparis/lntop lntop\ |
Latest revision as of 20:21, 15 April 2019
Generic information
- Keep your node online
- Connect to the right peers
- Balance your channels
- Lightning Channel Management on youtube
Actions
Opening channels (outgoing)
See Opening channels
Getting incoming liquidity
Balancing channels
There is a nice script to rebalance a lnd node, see rebalance-lnd
Changing fees
Checking routing
Backups
Commands
lnd
Debugging
Aliases
alias lchannelcaps='lncli describegraph | jq '\''.nodes[].total_channel_capacities=0 | foreach .nodes[] as ( . ; foreach .edges[] as ( . ; if .node1_pub==.pub_key then (|.total_channel_capacities=.total_channel_capacity+(.capacity|tonumber)) else empty end ; .) ; . )'\''' alias lnactive='lncli listchannels | jq '\''[ .channels | .[] | select(.active==true) ] | length'\''' alias lnchaninfo='lncli listchannels | jq '\''[ .channels | .[] | { "remote_pubkey": .remote_pubkey, "capacity": .capacity|tonumber, "local_balance": .local_balance|tonumber, "remote_balance": .remote_balance| tonumber, "distribution_pct": ( ( .local_balance|tonumber ) / ( (.remote_balance|tonumber ) + ( .local_balance|tonumber ) ) ), "total_satoshis_sent": .total_satoshis_sent|tonumber, "total_satoshis_received": .total_satoshis_received|tonumber } ]'\''' alias lndist='lncli listchannels | jq '\''[ .channels | .[] | { "remote_pubkey": .remote_pubkey, "capacity": .capacity, "distribution_pct": ( ( .local_balance|tonumber ) / ( (.remote_balance|tonumber ) + ( .local_balance|tonumber ) ) ) } ]'\''' alias lnforcegraph='lncli describegraph | jq -c '\''{ "nodes": .nodes | map({ "id": .pub_key, "alias": .alias|match("[^\u0000]+")| .string, "group": 1, "color": .color, "addresses": .addresses }), "links": .edges | map({"source": .node1_pub, "target": .node2_pub, "capacity": .capacity|tonumber }) }'\''' alias lninactive='lncli listchannels | jq '\''[ .channels | .[] | select(.active==false) ] | length'\''' alias lnlimbo='lncli pendingchannels | jq '\''.total_limbo_balance|tonumber'\''' alias lnnodeinfo='lncli listchannels | jq -r .channels[].remote_pubkey | while read p; do lncli getnodeinfo "$p"; done' alias lnoffchain='lncli listchannels | jq '\''[ .channels | .[] | select(.num_updates|tonumber>0) ]'\''' alias lnoffchainupdates='lncli listchannels | jq '\''.channels | map(.num_updates|tonumber) | add'\''' alias lnpendingc='lncli pendingchannels | jq '\''.pending_close_channels|length'\''' alias lnpendingf='lncli pendingchannels | jq '\''.pending_force_closing_channels|length'\''' alias lnpendingo='lncli pendingchannels | jq '\''.pending_open_channels|length'\''' alias lnreceivedbal='lncli listchannels | jq '\''.channels | map(.total_satoshis_received|tonumber) | add'\''' alias lnrecv='lncli listchannels | jq '\''[ .channels | .[] | select(.total_satoshis_received|tonumber>0) ]'\''' alias lnremotebal='lncli listchannels | jq '\''.channels | map(.remote_balance|tonumber) | add'\''' alias lnsentbal='lncli listchannels | jq '\''.channels | map(.total_satoshis_sent|tonumber) | add'\''' alias lntopchannels='lncli describegraph | jq '\''[ .edges | sort_by(.capacity|tonumber) | reverse | .[] | { "node1_pub": .node1_pub, "node2_pub": .node2_pub, "Capacity": .capacity|tonumber, } ]'\''' alias lntotalcap='lncli listchannels | jq '\''.channels | map(.capacity|tonumber) | add'\''' alias lnunsettled='lncli listchannels | jq '\''[ .channels | .[] | select(.unsettled_balance|tonumber>0) ]'\''' alias lnunsettledbal='lncli listchannels | jq '\''.channels | map(.unsettled_balance|tonumber) | add'\''' alias lnunusedchannels='lncli listchannels | jq '\''[ .channels[] | select(.total_satoshis_sent=="0" and .total_satoshis_received=="0") ]| {"unused channels": map({"channel_point": .channel_point, "local_balance": .local_balance|tonumber, "num_updates": .num_updates|tonumber, "active": .active, "private": .private}) | sort_by(.local_balance) | reverse }'\''' alias lrecv='lncli listchannels | jq '\''[ .channels | .[] | select(.total_satoshis_received|tonumber>0) ]'\'''
(by vegard)
Frontends
Web frontends
- LNDash
- Ride The Lightning dashboard
- lnd-watcher, simple script
- Flask Bitcoin Dashboard