-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add getchannelfees
command
#4221
Comments
Because of the proportional fee, this requires that you provide a reference amount to be sent to the designated peer. We cannot "just" accumulate the fees along the way due to how the math works out. And if you want a Dijkstra algorithm, that already exists in |
My input on this:
Regarding
We could do that, but if we do we should have an array as output format, even when only a single channel is requested. The reason why I prefer an array here is that the alternative (mapping) would require some key and if a plugin uses this RPC command it needs to know what to look for. If the plugin requested a single channel it can safely do output format suggestion
|
So you mean only from us->peer direction? Since the symmetric command is
Yes, this is indeed what we do on a lot of our interfaces (and which we should do for all, not that I remember any interface that does not do this). Though we tend to use the terminology |
Yes, that was my intention, I just don't like to query gossip for local config data, which the fee settings are. What do you think about also adding this to the
The |
New command format
Not specifying New RPC format
|
Check out About the
I agree choosing |
It allows us to add more keys in the future, just in case. Note that all existing |
Ack on the outer object. @ZmnSCPxj See #4247 on the naming in the RPC output. I'm not sure if we should use more pregnant names ( |
After thinking about this we should recycle the same variable names as for the Using the gossip style ( |
You can get most of this information using my feereport plugin (although it will show that for all channels, not specific one; but as a bonus you also get summary of routing fee earnings in a day, week and month) |
@m-schmoock Yup, that's how I view this information currently. See my bash one-liner in the issue "Motivation" section. I strongly prefer to have 'msat' in the name of a field when the value it describes is in msat. I also think 'fee' should be in there, because although this is in the RPC response to a "fee" command, there are other fields in the object and we should be descriptive. I like how lnd calls it New new proposed RPC format
|
Actually, after thinking about it some more, I prefer just |
@0e319b6 So two things:
|
Oh, thanks for pointing that comment out. Agreed on |
Implements a `listchannelfee` command to complement `setchannelfee`. Fixes ElementsProject#4221.
I didn't meant |
So, I'm unclear. Would you prefer |
Go for |
I would like to add that it would be very useful to set fees on multiple but select channels. When you use |
Not sure I understand what the advantage over looping over channels and setting them individually is. We'd be doing that internally anyway if we provide such a batch rpc method. The Problem mostly is that these batch RPCs are very specialized and require the user to build valid json payloads, which not everyone can do. |
Motivation
Currently there is no good way to view channel fees, especially all in one condensed view. I have a hacky bash alias for this:
lightning-cli summary | awk '{print $2}' | egrep [0-9]{5}x[0-9]+x[0-9]); do echo $scid: ; lightning-cli listchannels $scid | grep fee; done
but that's obviously suboptimal.Proposed command format
The optional argument
id
is either a peerid pubkey of one of our channel peers, a channel id, or a short channel ID. If noid
is provided, fee data for all of our node's channels will be returned.Proposed RPC format
I propose this command returns an object with a field named
channel_fees
that is a list of objects of the following format:For each such object listed, if our node participates in the corresponding channel,
destination
shall be our corresponding channel peer's peerid. In the alternative,destination
may be the peerid of either of the channel peers; a potentialsource
field can be omitted as it is implied bydestination
andshort_channel_id
. The other fields should hopefully be self-explanatory.Each channel shall be represented by one such object with fee data for both directions.
In case of an error, the
channel_fees
list shall be empty.Optional extensions
We could also allow
id
to represent a peerid of a node who is not one of our node's channel peers. In this case, we can run Dijkstra's algorithm on the channel graph and return the lowest cumulative fees between our node andid
.A further extension would additionally allow an optional
[amount]
argument that, ifid
represents a peerid to which we are not peered, represents a minimum channel size for the above Dijkstra's algorithm. During the operation of that search, any channel with a capacity less thanamount
would be ignored.The text was updated successfully, but these errors were encountered: