From f5ee771e6fedaa75bafc98b5a270839492cc08b0 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Fri, 7 Feb 2025 13:55:22 -0800 Subject: [PATCH 1/3] clnrest: Rename `cln-rest` to `rest-plugin` as per current naming standards --- Cargo.toml | 2 +- Makefile | 2 +- plugins/Makefile | 4 ++-- plugins/{cln-rest => rest-plugin}/Cargo.toml | 0 plugins/{cln-rest => rest-plugin}/Makefile | 0 plugins/{cln-rest => rest-plugin}/src/certs.rs | 0 plugins/{cln-rest => rest-plugin}/src/handlers.rs | 0 plugins/{cln-rest => rest-plugin}/src/main.rs | 0 plugins/{cln-rest => rest-plugin}/src/options.rs | 0 plugins/{cln-rest => rest-plugin}/src/shared.rs | 0 10 files changed, 4 insertions(+), 4 deletions(-) rename plugins/{cln-rest => rest-plugin}/Cargo.toml (100%) rename plugins/{cln-rest => rest-plugin}/Makefile (100%) rename plugins/{cln-rest => rest-plugin}/src/certs.rs (100%) rename plugins/{cln-rest => rest-plugin}/src/handlers.rs (100%) rename plugins/{cln-rest => rest-plugin}/src/main.rs (100%) rename plugins/{cln-rest => rest-plugin}/src/options.rs (100%) rename plugins/{cln-rest => rest-plugin}/src/shared.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index c72dca84a90f..ae9afb7bcf6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,5 +8,5 @@ members = [ "cln-grpc", "plugins", "plugins/grpc-plugin", - "plugins/cln-rest" + "plugins/rest-plugin" ] diff --git a/Makefile b/Makefile index 933765e47816..9c624b7f5724 100644 --- a/Makefile +++ b/Makefile @@ -377,7 +377,7 @@ ifneq ($(FUZZING),0) endif ifneq ($(RUST),0) include cln-rpc/Makefile - include plugins/cln-rest/Makefile + include plugins/rest-plugin/Makefile endif include cln-grpc/Makefile diff --git a/plugins/Makefile b/plugins/Makefile index db7d9f813d73..f11291b51929 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -296,11 +296,11 @@ CLN_PLUGIN_EXAMPLES := \ CLN_PLUGIN_SRC = $(shell find plugins/src -name "*.rs") CLN_GRPC_PLUGIN_SRC = $(shell find plugins/grpc-plugin/src -name "*.rs") -CLNREST_PLUGIN_SRC = $(shell find plugins/cln-rest/src -name "*.rs") +CLN_REST_PLUGIN_SRC = $(shell find plugins/rest-plugin/src -name "*.rs") target/${RUST_PROFILE}/cln-grpc: ${CLN_PLUGIN_SRC} ${CLN_GRPC_PLUGIN_SRC} $(MSGGEN_GENALL) $(MSGGEN_GEN_ALL) cargo build ${CARGO_OPTS} --bin cln-grpc -target/${RUST_PROFILE}/clnrest: ${CLNREST_PLUGIN_SRC} +target/${RUST_PROFILE}/clnrest: ${CLN_REST_PLUGIN_SRC} cargo build ${CARGO_OPTS} --bin clnrest ifneq ($(RUST),0) diff --git a/plugins/cln-rest/Cargo.toml b/plugins/rest-plugin/Cargo.toml similarity index 100% rename from plugins/cln-rest/Cargo.toml rename to plugins/rest-plugin/Cargo.toml diff --git a/plugins/cln-rest/Makefile b/plugins/rest-plugin/Makefile similarity index 100% rename from plugins/cln-rest/Makefile rename to plugins/rest-plugin/Makefile diff --git a/plugins/cln-rest/src/certs.rs b/plugins/rest-plugin/src/certs.rs similarity index 100% rename from plugins/cln-rest/src/certs.rs rename to plugins/rest-plugin/src/certs.rs diff --git a/plugins/cln-rest/src/handlers.rs b/plugins/rest-plugin/src/handlers.rs similarity index 100% rename from plugins/cln-rest/src/handlers.rs rename to plugins/rest-plugin/src/handlers.rs diff --git a/plugins/cln-rest/src/main.rs b/plugins/rest-plugin/src/main.rs similarity index 100% rename from plugins/cln-rest/src/main.rs rename to plugins/rest-plugin/src/main.rs diff --git a/plugins/cln-rest/src/options.rs b/plugins/rest-plugin/src/options.rs similarity index 100% rename from plugins/cln-rest/src/options.rs rename to plugins/rest-plugin/src/options.rs diff --git a/plugins/cln-rest/src/shared.rs b/plugins/rest-plugin/src/shared.rs similarity index 100% rename from plugins/cln-rest/src/shared.rs rename to plugins/rest-plugin/src/shared.rs From 4387776a87f89585972886f402565f0fe0db193a Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Fri, 7 Feb 2025 13:55:49 -0800 Subject: [PATCH 2/3] doc: Updated REST documentation --- doc/developers-guide/app-development/rest.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/doc/developers-guide/app-development/rest.md b/doc/developers-guide/app-development/rest.md index c15c5724b8db..b11bb10ec864 100644 --- a/doc/developers-guide/app-development/rest.md +++ b/doc/developers-guide/app-development/rest.md @@ -8,7 +8,7 @@ updatedAt: "2023-10-13T09:54:01.784Z" # CLNRest -CLNRest is a lightweight Python-based built-in Core Lightning plugin (from v23.08) that transforms RPC calls into a REST service. +CLNRest is a lightweight Rust-based built-in Core Lightning plugin (from v23.08) that transforms RPC calls into a REST service. It also broadcasts Core Lightning notifications to listeners connected to its websocket server. By generating REST API endpoints, it enables the execution of Core Lightning's RPC methods behind the scenes and provides responses in JSON format. @@ -35,9 +35,6 @@ An online demo for the REST interface is available at [REST API REFERENCE](ref:g ## Installation -The plugin is built-in with Core Lightning but its python dependencies are not, and must be installed separately. -Detailed installation instructions can be found [here](https://docs.corelightning.org/docs/installation#clnrest). - Note: if you have the older c-lightning-REST plugin, you can configure Core Lightning with `disable-plugin=clnrest` option to avoid confusion with this one. You can also run both plugins simultaneously till all your applications are not migrated to `clnrest`. From 3be93b000d55e49c21462db415bdf73a95046bee Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Fri, 7 Feb 2025 13:56:20 -0800 Subject: [PATCH 3/3] plugins: Delete old `clnrest` directory from plugins Changelog-None. --- plugins/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/Makefile b/plugins/Makefile index f11291b51929..31e06927635d 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -137,6 +137,9 @@ endif # This is non-python plugins (PY_PLUGINS need their whole directory!) PLUGINS := $(C_PLUGINS) +# Remove clnrest directory if exists which is the old python plugin code +$(shell test -d plugins/clnrest && $(RM) -r plugins/clnrest || true) + ifneq ($(RUST),0) # Builtin plugins must be in this plugins dir to work when we're executed # *without* make install.