This is my first attempt at building a strongly typed, yet ergonomic API for the c-lightning plugin API.
Implemented features:
- Command line options
- Custom RPC methods
- Event subscriptions
Missing features:
- Hooks
- Non-blocking RPC call/event execution
- Derive macros for
CmdOptions
andRpcMethodParams
traits and maybe a customDeserializeOptional
trait for RPC methods with optional parameters - Human readable error reporting
- Support for stable rust (currently nightly only)
The examples show how to use the following features:
hello_world | state | subscription | |
---|---|---|---|
Command line options | ✓ | ||
RPC methods | ✓ | ✓ | |
Optional RPC method arguments | ✓ | ||
State | ✓ | ||
Event subscriptions | ✓ | ||
Logging | ✓ |
You can test these plugins yourself by running lightningd --testnet --plugin target/debug/examples/<example_name>