You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the current output of a successful rebalance:
Successful route:
17142485788721152 to 5-0221b5a1c10bc1ae (free, we usually charge 499ppm)
16104546812166144 to HelloJessica (fee 14,621 mSAT, 514ppm)
16104546812100608 to 4-0287a94a1c9be067 (fee 1,028 mSAT, 36ppm)
17185366742269953 to Links🗡️ (fee 1,028 mSAT, 36ppm)
In case I am compiling a database with all rebalance expenses, I would have to build a boring regex to extract the trunc of each "fee" and then sum them, with the risk of the output layout changing in the future for any reason.
Would it be possible to add a final line (literally last line of the output, maybe enabled with a switch on the commandline) where the parameters are reported in json format? Like "inchannel"=>"XXXXXXX", "outchannel"=>"YYYYYYYYY", "amount" => "ZZZZZZ", "fee"=>"FFFFFFFF" plus any other thing that might come to mind?
The text was updated successfully, but these errors were encountered:
I could do that, you could do that yourself, and I certainly see the point of this. But why don't you ask lnd about the details? The output fix is only shown once, whereas lnd keeps the underlying information in a database you can access at any time.
lnd already gives you access to all invoices and payments via lncli listinvoices and lncli listpayments. Rebalances are payments to an invoice you created yourself, and the r_hash of your invoice needs to match the payment_hash of your payment.
The payment details provide information about the route in htlcs.route.hops, where the first chan_id is your "outchannel", and the last chan_id is your "inchannel". You could check the invoice's memo: "Rebalance of channel with ID X" indicates that you explicitly invoked it for channel X, so that you can infer if it was a -f invocation for the first hop, or rather a -t invocation for the last hop - in case this detail is of any interest to you.
Last but not least, the fee is in htlcs.route.total_fees_msat, and the amount is in htlcs.route.total_amt_msat. You even get information about the fees/amounts sent along the route, i.e. you can see how much nodes get paid for your rebalance transactions.
Thanks for the superfast reply! It is a trove of information that alas goes beyond my skill level, as my experience is only with PHP, basically I'd rather parse the stdout instead as at least that's something I know how to do :)
This is the current output of a successful rebalance:
In case I am compiling a database with all rebalance expenses, I would have to build a boring regex to extract the trunc of each "fee" and then sum them, with the risk of the output layout changing in the future for any reason.
Would it be possible to add a final line (literally last line of the output, maybe enabled with a switch on the commandline) where the parameters are reported in json format? Like "inchannel"=>"XXXXXXX", "outchannel"=>"YYYYYYYYY", "amount" => "ZZZZZZ", "fee"=>"FFFFFFFF" plus any other thing that might come to mind?
The text was updated successfully, but these errors were encountered: