cln/plugins
Erik De Smedt 543e67495c Allow ConfigOption to be specified as const
This is the first part of two commits that attempts to simplify
the API that is used to retrieve configuration values.

Previously, we encouraged the following pattern to build a plugin.

```rust
let configured_plugin =
  Builder::new(
      tokio::io::stdin(),
      tokio::io::stdout())
  .option(ConfigOption::new_i64_with_default("some-option", 0, "Description"))
  .configure();

let value = configured_plugion.option("some-option");
match value {
  Some(Integer(i)) => {}, // Config provided
  None => {}, 		  // No config set
  _ => {}, 	          // This should never happened
}
```

This commit helps to move to the following pattern

```rust
const SOME_OPTION : ConfigOption<i64> = ConfigOption::new_i64_with_default(
                           "some-option",
			   "description");

async fn main() -> Result<()> {
    let plugin = Builder::new(tokio::io::stdin(), tokio::io::stdoout())
    	.option(SOME_OPTION)
	.configure()
	.await?;

    let value : i64 = plugin.option(SOME_OPTION)?;
}
```
2024-02-08 15:37:44 +01:00
..
bkpr Remove update_count from find_account_onchain_fees 2024-02-02 17:31:23 +01:00
clnrest clnrest: Import sys in except clause explicitly 2023-11-21 08:24:09 +01:00
examples Allow ConfigOption to be specified as const 2024-02-08 15:37:44 +01:00
grpc-plugin Allow ConfigOption to be specified as const 2024-02-08 15:37:44 +01:00
renepay fixed source (using raw millisatohis) 2024-02-02 11:28:47 +01:00
spender fundchannel_start & multifundchannel: add channel_type. 2024-01-29 13:40:34 +10:30
src Allow ConfigOption to be specified as const 2024-02-08 15:37:44 +01:00
test plugins/pay: use gossmods_from_listpeerchannels instead of private gossip_store records. 2023-12-14 09:16:56 +10:30
.gitignore meta: ignore renepay binary 2023-08-21 10:35:41 +09:30
autoclean.c libplugin: support version strings for deprecations. 2024-01-26 10:30:22 +10:30
bcli.c plugins/bcli: use per-command deprecation flags. 2024-01-26 10:30:22 +10:30
Cargo.toml cln-plugin: Switch from env_logger to tracing-subscriber 2024-01-16 18:36:12 +01:00
chanbackup.c chanbackup: even if they enable experimental-peer-storage, check peers 2023-03-08 18:46:21 -06:00
commando.c commando: use deprecation API for missing ids. 2024-01-26 10:30:22 +10:30
fetchinvoice.c lightningd: remove msatoshi alias for amount_msat. 2024-01-26 10:30:22 +10:30
funder.c funder: don't try to spend emergency_reserve 2024-02-08 06:32:01 +10:30
funder_policy.c libplugin: make set callback for options take plugin ptr, check correct type. 2023-06-20 20:08:25 +09:30
funder_policy.h libplugin: make set callback for options take plugin ptr, check correct type. 2023-06-20 20:08:25 +09:30
keysend.c lightningd: remove msatoshi alias for amount_msat. 2024-01-26 10:30:22 +10:30
libplugin-pay.c plugins/pay: use gossmods_from_listpeerchannels instead of private gossip_store records. 2023-12-14 09:16:56 +10:30
libplugin-pay.h plugins/pay: use gossmods_from_listpeerchannels instead of private gossip_store records. 2023-12-14 09:16:56 +10:30
libplugin.c libplugin: remove global deprecated_apis flag. 2024-01-26 10:30:22 +10:30
libplugin.h libplugin: remove global deprecated_apis flag. 2024-01-26 10:30:22 +10:30
Makefile spenderp: add channel_type parameter to fundchannel / multifundchannel. 2024-01-29 13:40:34 +10:30
offers.c plugins/offers: Extend the capability of decode to decrypt the contents of emergency.recover file. 2023-10-27 16:05:28 +10:30
offers.h common: update to latest onion message spec. 2022-10-26 11:29:06 +10:30
offers_inv_hook.c lightningd: re-add 'offerout' functionality, as 'invoicerequest'. 2022-11-09 15:08:03 +01:00
offers_inv_hook.h lightningd: re-add 'offerout' functionality, as 'invoicerequest'. 2022-11-09 15:08:03 +01:00
offers_invreq_hook.c offers: fix pay where we are using deprecated apis. 2023-02-03 16:59:51 +01:00
offers_invreq_hook.h offers: create a real blinded path, if necessary. 2022-11-09 15:08:03 +01:00
offers_offer.c lightningd: deprecate @-prefix hack for offer recurrence_base. 2024-02-07 09:21:00 +10:30
offers_offer.h lightningd: re-add 'offerout' functionality, as 'invoicerequest'. 2022-11-09 15:08:03 +01:00
pay.c lightningd: remove msatoshi alias for amount_msat. 2024-01-26 10:30:22 +10:30
README.md doc: fix wording in plugins/README.md 2020-01-06 12:57:59 +01:00
sql.c gossipd: strip private updates from gossip_store on startup. 2024-01-31 14:47:33 +10:30
topology.c gossipd: new routines to support gossmap compatibility. 2024-02-04 09:24:44 +10:30
txprepare.c plugins: remove #if DEVELOPER. 2023-09-21 20:08:24 +09:30

Plugin Directory

Any file in this directory which is executable and whose name only consists of alphanumeric characters, space, '.', '-' or '_' will be automatically loaded when lightningd starts (unless suppressed with commandline options).