mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-24 08:14:19 +01:00
lightningd: new setchannel command.
Based on setchannelfee, but expanded to allow setting max htlc amount (and others in future?). The main differences: 1. It doesn't change values which are not specified (that would be hard to add fields to!) 2. It says exactly what all values are in any potentially changed channels. Changelog-Added: JSON-RPC: new `setchannel` command generalizes `setchannelfee`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -65,6 +65,7 @@ MANPAGES := doc/lightning-cli.1 \
|
||||
doc/lightning-sendonion.7 \
|
||||
doc/lightning-sendonionmessage.7 \
|
||||
doc/lightning-sendpay.7 \
|
||||
doc/lightning-setchannel.7 \
|
||||
doc/lightning-setchannelfee.7 \
|
||||
doc/lightning-sendcustommsg.7 \
|
||||
doc/lightning-signmessage.7 \
|
||||
|
||||
@@ -97,6 +97,7 @@ c-lightning Documentation
|
||||
lightning-sendonionmessage <lightning-sendonionmessage.7.md>
|
||||
lightning-sendpay <lightning-sendpay.7.md>
|
||||
lightning-sendpsbt <lightning-sendpsbt.7.md>
|
||||
lightning-setchannel <lightning-setchannel.7.md>
|
||||
lightning-setchannelfee <lightning-setchannelfee.7.md>
|
||||
lightning-signmessage <lightning-signmessage.7.md>
|
||||
lightning-signpsbt <lightning-signpsbt.7.md>
|
||||
|
||||
89
doc/lightning-setchannel.7.md
Normal file
89
doc/lightning-setchannel.7.md
Normal file
@@ -0,0 +1,89 @@
|
||||
lightning-setchannel -- Command for configuring fees / maximum htlc on a lightning channel
|
||||
===========================================================================================
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
|
||||
**setchannel** *id* [*feebase*] [*feeppm*] [*htlcmax*] [*enforcedelay*]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
||||
The **setchannel** RPC command sets channel specific routing fees, and
|
||||
`htlc_maximum_msat` as defined in BOLT \#7. The channel has to be in
|
||||
normal or awaiting state. This can be checked by **listpeers**
|
||||
reporting a *state* of CHANNELD\_NORMAL or CHANNELD\_AWAITING\_LOCKIN
|
||||
for the channel.
|
||||
|
||||
*id* is required and should contain a scid (short channel ID), channel
|
||||
id or peerid (pubkey) of the channel to be modified. If *id* is set to
|
||||
"all", the updates are applied to all channels in states
|
||||
CHANNELD\_NORMAL or CHANNELD\_AWAITING\_LOCKIN.
|
||||
|
||||
*feebase* is an optional value in millisatoshi that is added as base fee to
|
||||
any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole
|
||||
number ending in *msat* or *sat*, or a number with three decimal places
|
||||
ending in *sat*, or a number with 1 to 11 decimal places ending in
|
||||
*btc*.
|
||||
|
||||
*feeppm* is an optional value that is added proportionally per-millionths
|
||||
to any routed payment volume in satoshi. For example, if ppm is 1,000
|
||||
and 1,000,000 satoshi is being routed through the channel, an
|
||||
proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee.
|
||||
|
||||
*htlcmax* is an optional value that limits how large an HTLC we will
|
||||
send: if omitted, it is unchanged (the default is no effective
|
||||
limit). It can be a whole number, or a whole number ending in *msat*
|
||||
or *sat*, or a number with three decimal places ending in *sat*, or a
|
||||
number with 1 to 11 decimal places ending in *btc*.
|
||||
|
||||
*enforcedelay* is the number of seconds to delay before enforcing the
|
||||
new fees/htlc max (default 600, which is ten minutes). This gives the
|
||||
network a chance to catch up with the new rates and avoids rejecting
|
||||
HTLCs before they do. This only has an effect if rates are increased
|
||||
(we always allow users to overpay fees) or *htlcmax* is decreased, and
|
||||
only applied to a single rate increase per channel (we don't remember
|
||||
an arbitrary number of prior feerates) and if the node is restarted
|
||||
the updated configuration is enforced immediately.
|
||||
|
||||
RETURN VALUE
|
||||
------------
|
||||
|
||||
[comment]: # (GENERATE-FROM-SCHEMA-START)
|
||||
On success, an object containing **channels** is returned. It is an array of objects, where each object contains:
|
||||
- **peer_id** (pubkey): The node_id of the peer
|
||||
- **channel_id** (hex): The channel_id of the channel (always 64 characters)
|
||||
- **fee_base_msat** (msat): The resulting feebase (this is the BOLT #7 name)
|
||||
- **fee_proportional_millionths** (u32): The resulting feeppm (this is the BOLT #7 name)
|
||||
- **maximum_htlc_out_msat** (msat): The resulting htlcmax we will advertize (the BOLT #7 name is htlc_maximum_msat)
|
||||
- **short_channel_id** (short_channel_id, optional): the short_channel_id (if locked in)
|
||||
|
||||
[comment]: # (GENERATE-FROM-SCHEMA-END)
|
||||
|
||||
ERRORS
|
||||
------
|
||||
|
||||
The following error codes may occur:
|
||||
- -1: Channel is in incorrect state, i.e. Catchall nonspecific error.
|
||||
- -32602: JSONRPC2\_INVALID\_PARAMS, i.e. Given id is not a channel ID
|
||||
or short channel ID.
|
||||
|
||||
AUTHOR
|
||||
------
|
||||
|
||||
Michael Schmoock <<michael@schmoock.net>> is the author of this
|
||||
feature. Rusty Russell <<rusty@rustcorp.com.au>> is mainly
|
||||
responsible for the c-lightning project.
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
|
||||
lightningd-config(5), lightning-fundchannel(7),
|
||||
lightning-listchannels(7), lightning-listpeers(7)
|
||||
|
||||
RESOURCES
|
||||
---------
|
||||
|
||||
Main web site: <https://github.com/ElementsProject/lightning>
|
||||
|
||||
[comment]: # ( SHA256STAMP:25c6733af784e8a21a8eed4bcb0f12767ae49d16fe623187ae5313b5bb5cdd80)
|
||||
53
doc/schemas/setchannel.schema.json
Normal file
53
doc/schemas/setchannel.schema.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"channels"
|
||||
],
|
||||
"properties": {
|
||||
"channels": {
|
||||
"type": "array",
|
||||
"description": "channel(s) set, and their resulting configuration",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"peer_id",
|
||||
"channel_id",
|
||||
"fee_base_msat",
|
||||
"fee_proportional_millionths",
|
||||
"maximum_htlc_out_msat"
|
||||
],
|
||||
"properties": {
|
||||
"peer_id": {
|
||||
"type": "pubkey",
|
||||
"description": "The node_id of the peer"
|
||||
},
|
||||
"channel_id": {
|
||||
"type": "hex",
|
||||
"description": "The channel_id of the channel",
|
||||
"minLength": 64,
|
||||
"maxLength": 64
|
||||
},
|
||||
"short_channel_id": {
|
||||
"type": "short_channel_id",
|
||||
"description": "the short_channel_id (if locked in)"
|
||||
},
|
||||
"fee_base_msat": {
|
||||
"type": "msat",
|
||||
"description": "The resulting feebase (this is the BOLT #7 name)"
|
||||
},
|
||||
"fee_proportional_millionths": {
|
||||
"type": "u32",
|
||||
"description": "The resulting feeppm (this is the BOLT #7 name)"
|
||||
},
|
||||
"maximum_htlc_out_msat": {
|
||||
"type": "msat",
|
||||
"description": "The resulting htlcmax we will advertize (the BOLT #7 name is htlc_maximum_msat)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user