mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
cln-plugin: Get started with the plugin interface
This commit is contained in:
committed by
Rusty Russell
parent
c0c826d2ee
commit
9ae1f33992
14
plugins/examples/cln-plugin-startup.rs
Normal file
14
plugins/examples/cln-plugin-startup.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
//! 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 tokio;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), anyhow::Error> {
|
||||
env_logger::init();
|
||||
|
||||
let (plugin, stdin) = Builder::new((), tokio::io::stdin(), tokio::io::stdout()).build();
|
||||
plugin.run(stdin).await;
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user