mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
cln-plugin: Add options to the getmanifest call
This commit is contained in:
committed by
Rusty Russell
parent
fe21b89b56
commit
249fa8675a
@@ -1,12 +1,19 @@
|
||||
//! This is a test plugin used to verify that we can compile and run
|
||||
//! plugins using the Rust API against c-lightning.
|
||||
|
||||
use cln_plugin::Builder;
|
||||
use cln_plugin::{options, Builder};
|
||||
use tokio;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), anyhow::Error> {
|
||||
let (plugin, stdin) = Builder::new((), tokio::io::stdin(), tokio::io::stdout()).build();
|
||||
let (plugin, stdin) = Builder::new((), tokio::io::stdin(), tokio::io::stdout())
|
||||
.option(options::ConfigOption::new(
|
||||
"test-option",
|
||||
options::Value::Integer(42),
|
||||
"a test-option with default 42",
|
||||
))
|
||||
.build();
|
||||
|
||||
tokio::spawn(async {
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(1000)).await;
|
||||
log::info!("Hello world");
|
||||
|
||||
Reference in New Issue
Block a user