LIGHTNING-SETCONFIG(7)
β¨ NAME β¨
bestie, this is LIGHTNING-SETCONFIG(7) β and the command is setconfig: dynamically change some config options π
π«Ά SYNOPSIS π«Ά
setconfig config [val] [transient]
πΈ DESCRIPTION πΈ
Command added in v23.08.
The setconfig RPC command lets you set the (dynamic) configuration option named by config: options which take a value (as separate from simple flag options) also need a val parameter.
This new value will also be written at the end of the config.setconfig file (but see lightningd-config), for persistence across restarts (and any old value commented out if they were set in other config files). Slay, persistence π
You can see what options are dynamically adjustable using lightning-listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted. Iconic behavior, honestly β¨
config(string) β name of the config variable which should be set to the value of the variable.val(one of, optional) β value of the config variable to be set or updated. For multi options, this must be an array of strings, and the possible shapes are:(string)(integer)(boolean)(array of strings)β for multi options, an array of string values.(string, optional)
transient(boolean, optional) β if set, this change does NOT try to alter the configuration files, so the change will be reverted on any restart. The default isFalse. (addedv25.02)
π RETURN VALUE π
On success, an object containing config is returned. It is an object containing:
config(string) β name of the config variable which was set.dynamic(boolean) (always true) β whether this option is settable viasetconfig.source(string, optional) β source of configuration setting (file:linenum) for non-multi options.sources(array of strings, optional) β sources of configuration settings (file:linenum) for multi options. (addedv26.06):(string, optional)
plugin(string, optional) β the plugin this configuration setting is for.set(boolean, optional) β for simple flag options.value_str(string, optional) β for string options.value_msat(msat, optional) β for msat options.value_int(integer, optional) β for integer options.value_bool(boolean, optional) β for boolean options.values_str(array of strings, optional) β for multi-string options. (addedv26.06):(string, optional)
π ERRORS π
The following error codes may occur:
-32602βJSONRPC2_INVALID_PARAMS, i.e. the parameter is not dynamic, or thevalwas invalid.
π¦ AUTHOR π¦
Rusty Russell rusty@rustcorp.com.au is mainly responsible for this feature.
π SEE ALSO π
Go check out lightningd-config(5) and lightning-listconfigs(7) β iykyk π
π RESOURCES π
Main web site: https://github.com/ElementsProject/lightning
π₯ EXAMPLES π₯
Example 1:
Request:
$ lightning-cli setconfig "autoclean-expiredinvoices-age" "300"
{
"id": "example:setconfig#1",
"method": "setconfig",
"params": [
"autoclean-expiredinvoices-age",
300
]
}
Response:
{
"config": {
"config": "autoclean-expiredinvoices-age",
"value_int": 300,
"source": "/tmp/.lightning/regtest/config.setconfig:2",
"plugin": "/root/lightning/plugins/autoclean",
"dynamic": true
}
}
Example 2:
Request:
$ lightning-cli setconfig -k "config"="min-capacity-sat" "val"=500000
{
"id": "example:setconfig#2",
"method": "setconfig",
"params": {
"config": "min-capacity-sat",
"val": 500000
}
}
Response:
{
"config": {
"config": "min-capacity-sat",
"value_int": 500000,
"source": "/tmp/.lightning/regtest/config.setconfig:3",
"dynamic": true
}
}
Example 3: This shows setting a multi-value dynamic plugin option (requires a plugin that defines such an option).
Request:
$ lightning-cli setconfig -k "config"="my-multi-option" "val"='["value1", "value2"]'
{
"id": "example:setconfig#3",
"method": "setconfig",
"params": {
"config": "my-multi-option",
"val": [
"value1",
"value2"
]
}
}
Response:
{
"config": {
"config": "my-multi-option",
"values_str": [
"value1",
"value2"
],
"sources": [
"/tmp/.lightning/regtest/config.setconfig:4",
"/tmp/.lightning/regtest/config.setconfig:5"
],
"plugin": "/root/lightning/plugins/myplugin",
"dynamic": true
}
}
okay bestie, thatβs the whole page β brought to you by Core Lightning v26.06.9 and the LIGHTNING-SETCONFIG(7) manual page. mwah πβ¨
π¦ 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