cln-plugin: Get started with the plugin interface

This commit is contained in:
Christian Decker
2022-01-17 12:59:09 +01:00
committed by Rusty Russell
parent c0c826d2ee
commit 9ae1f33992
7 changed files with 608 additions and 0 deletions

View 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(())
}