LIGHTNING-SETCHANNEL(7)
π
setchannel β like, the manual page for lightning-setchannel(7) β¨
okay bestie, buckle up β this is lightning-setchannel(7) and it's genuinely one of the most useful little gremlins in the whole Lightning toolbox. it's the command that lets you go "actually, this channel charges these fees, thank you very much" π
β¨ NAME β¨
setchannel β the command for configuring fees and the HTLC range that get advertized for a channel. yes, that's how the original spells it, we love a quirky spelling era π«Ά
πΈ SYNOPSIS πΈ
setchannel id [feebase] [feeppm] [htlcmin] [htlcmax] [enforcedelay]
[ignorefeelimits]
everything in brackets is optional, everything else is not, no cap π
π¦ DESCRIPTION π¦
so the setchannel RPC command sets channel-specific routing fees, plus htlc_minimum_msat or htlc_maximum_msat as defined in BOLT #7. iconic behavior honestly.
the channel has to be in normal or awaiting state, which you can verify by checking listpeers β it'll report a state of CHANNELD_NORMAL or CHANNELD_AWAITING_LOCKIN for the channel. no state, no service, sorry bestie π
these changes (for a public channel) will get broadcast to the rest of the network. though β heads up β many nodes limit the rate of such changes they'll accept: we allow 2 a day, with a few extra occasionally. so like, don't spam it, it's giving rate limit energy π
id(string) β should contain ascid(short channel ID), channel id or peerid (pubkey) of the channel to be modified. Ifidis set toall, the updates are applied to all channels in statesCHANNELD_NORMAL,CHANNELD_AWAITING_LOCKINorDUALOPEND_AWAITING_LOCKIN. Ifidis a peerid, all channels with the +peer in those states are changed. (yes,allis the main character here π)feebase(msat, 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 inmsatorsat, or a number with three decimal places ending insat, or a number with 1 to 11 decimal places ending inbtc. so many formats, pick your fighter πfeeppm(u32, optional) β value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is1,000and1,000,000satoshi is being routed through the channel, an proportional fee of1,000satoshi is added, resulting in a 0.1% fee. math ate, honestly β¨htlcmin(msat, optional) β value that limits how small an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending inmsatorsat, or a number with three decimal places ending insat, or a number with 1 to 11 decimal places ending inbtc. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note thathtlcminonly applies to forwarded HTLCs β we can still send smaller payments ourselves, we're built different π The default is no lower limit.htlcmax(msat, optional) β value that limits how large an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending inmsatorsat, or a number with three decimal places ending insat, or a number with 1 to 11 decimal places ending inbtc. Note thathtlcmaxonly applies to forwarded HTLCs β we can still send larger payments ourselves. The default is no effective limit.enforcedelay(u32, optional) β number of seconds to delay before enforcing the new fees/htlc max. 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) orhtlcmaxis 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. The default is600, which is ten minutes. a lil grace period, we love to see it π§ignorefeelimits(boolean, optional) β if set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want, up to a maximum of1000000perkw(4000 sat/vB). This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the globalignore_fee_limitssetting overrides this). (added v23.08)
β οΈ bestie please read that ignorefeelimits one twice. it's literally labeled dangerous in the source material. unenforcable HTLCs and unrelayable commitment transactions are not a vibe π
π RETURN VALUE π
on success, an object containing channels is returned. It is an array of objects, where each object contains:
peer_id(pubkey) β thenode_idof the peer.channel_id(hash) β thechannel_idof the channel.fee_base_msat(msat) β the resultingfeebase(this is the BOLT #7 name).fee_proportional_millionths(u32) β the resultingfeeppm(this is the BOLT #7 name).ignore_fee_limits(boolean) β if we are now allowing peer to set feerate on commitment transaction without restriction. (added v23.08)minimum_htlc_out_msat(msat) β the resultinghtlcminwe will advertize (the BOLT #7 name ishtlc_minimum_msat).maximum_htlc_out_msat(msat) β the resultinghtlcmaxwe will advertize (the BOLT #7 name ishtlc_maximum_msat).short_channel_id(short_channel_id, optional) β theshort_channel_id(if locked in).- the following warnings are possible:
warning_htlcmin_too_lowβ the requestedhtlcminwas too low for this peer, so we set it to the minimum they will allow.warning_htlcmax_too_highβ the requestedhtlcmaxwas greater than the channel capacity, so we set it to the channel capacity.
π₯ ERRORS π₯
the following error codes may occur:
-1β channel is in incorrect state, i.e. catchall nonspecific error. the classic "something's off but we're not elaborating" π-32602βJSONRPC2_INVALID_PARAMS, i.e. givenidis not a channel ID or short channel ID.
π AUTHOR π
Michael Schmoock michael@schmoock.net is the author of this feature. thank you michael, king behavior π
β SEE ALSO β
lightningd-config(5), lightning-fundchannel(7), lightning-listchannels(7), lightning-listpeers(7)
π RESOURCES π
main web site: https://github.com/ElementsProject/lightning
πΈ EXAMPLES πΈ
example 1:
request:
$ lightning-cli setchannel -k "id"="123x1x1" "ignorefeelimits"=True
{
"id": "example:setchannel#1",
"method": "setchannel",
"params": {
"id": "123x1x1",
"ignorefeelimits": true
}
}
response:
{
"channels": [
{
"peer_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
"channel_id": "channelid0230200230200230200230200230200230200230200230200230200",
"short_channel_id": "123x1x1",
"fee_base_msat": 1,
"fee_proportional_millionths": 10,
"minimum_htlc_out_msat": 0,
"maximum_htlc_out_msat": 990000000,
"ignore_fee_limits": true
}
]
}
example 2:
request:
$ lightning-cli setchannel -k "id"="115x1x1" "feebase"=4000 "feeppm"=300 "enforcedelay"=0
{
"id": "example:setchannel#2",
"method": "setchannel",
"params": {
"id": "115x1x1",
"feebase": 4000,
"feeppm": 300,
"enforcedelay": 0
}
}
response:
{
"channels": [
{
"peer_id": "nodeid050505050505050505050505050505050505050505050505050505050505",
"channel_id": "channelid0250000250000250000250000250000250000250000250000250000",
"short_channel_id": "115x1x1",
"fee_base_msat": 4000,
"fee_proportional_millionths": 300,
"minimum_htlc_out_msat": 0,
"maximum_htlc_out_msat": 990000000,
"ignore_fee_limits": false
}
]
}
okay that's the whole page, go forth and set your fees bestie π
this masterpiece comes to you courtesy of Core Lightning v26.06.9, and yes the page header is LIGHTNING-SETCHANNEL(7) β slay, go configure some channels β¨ππΈ
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms