cln_plugin: Example package subscribing to "*"

Creates an example package that subscribes to all notifications and logs
them. This is useful for testing the behavior of subscribing to "*".

I've also edited the Makefile to ensure that `make` builds the example
and that `make clean` removes the example
This commit is contained in:
Erik De Smedt
2024-02-23 09:29:03 +01:00
committed by Alex Myers
parent ff7efec723
commit 95b98cf0ee
2 changed files with 40 additions and 1 deletions

View File

@@ -254,10 +254,14 @@ PLUGIN_BASES := $(PLUGINS:plugins/%=%) $(PY_PLUGINS:plugins/%=%)
plugins/list_of_builtin_plugins_gen.h: plugins/Makefile Makefile config.vars
@$(call VERBOSE,GEN $@,echo "static const char *list_of_builtin_plugins[] = { $(PLUGIN_BASES:%=\"%\",) NULL };" > $@)
target/${RUST_PROFILE}/examples/cln-subscribe-wildcard: ${CLN_PLUGIN_SRC} plugins/examples/cln-subscribe-wildcard.rs
cargo build ${CARGO_OPTS} --example cln-subscribe-wildcard
CLN_PLUGIN_EXAMPLES := \
target/${RUST_PROFILE}/examples/cln-plugin-startup \
target/${RUST_PROFILE}/examples/cln-plugin-reentrant \
target/${RUST_PROFILE}/examples/cln-rpc-getinfo
target/${RUST_PROFILE}/examples/cln-rpc-getinfo \
target/${RUST_PROFILE}/examples/cln-subscribe-wildcard
CLN_PLUGIN_SRC = $(shell find plugins/src -name "*.rs")