Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 137 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ members = [
"plugins/wss-proxy-plugin",
"plugins/bip353-plugin",
"plugins/currencyrate-plugin",
"plugins/reckless-plugin",
]

[workspace.dependencies]
Expand Down
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,7 @@ ALL_NONGEN_SRCFILES := $(ALL_NONGEN_HEADERS) $(ALL_NONGEN_SOURCES)
BIN_PROGRAMS = \
cli/lightning-cli \
lightningd/lightningd \
tools/lightning-hsmtool\
tools/reckless
tools/lightning-hsmtool
PKGLIBEXEC_PROGRAMS = \
lightningd/lightning_channeld \
lightningd/lightning_closingd \
Expand Down Expand Up @@ -867,7 +866,7 @@ clean: obsclean

# See doc/contribute-to-core-lightning/contributor-workflow.md
PYLNS=client proto testing
update-versions: update-pyln-versions update-reckless-version update-dot-version # FIXME: update-doc-examples
update-versions: update-pyln-versions update-dot-version # FIXME: update-doc-examples
@uv lock

update-pyln-versions: $(PYLNS:%=update-pyln-version-%)
Expand Down Expand Up @@ -905,11 +904,6 @@ pyln-build-all: pyln-build pyln-build-bolts pyln-build-grpc-proto pyln-build-wss
update-lock:
uv sync --all-extras --all-groups

update-reckless-version:
@if [ -z "$(NEW_VERSION)" ]; then echo "Set NEW_VERSION!" >&2; exit 1; fi
@echo "Updating tools/reckless to $(NEW_VERSION)"
@$(SED) -i.bak "s/__VERSION__ = '.*'/__VERSION__ = '$(NEW_VERSION)'/" tools/reckless && rm tools/reckless.bak

update-dot-version:
@if [ -z "$(NEW_VERSION)" ]; then echo "Set NEW_VERSION!" >&2; exit 1; fi
echo $(NEW_VERSION) > .version
Expand Down
2 changes: 1 addition & 1 deletion contrib/pyln-testing/pyln/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ def __init__(self, node_id, lightning_dir, bitcoind, executor, may_fail=False,
if dsn is not None:
self.daemon.opts['wallet'] = dsn
if VALGRIND:
trace_skip_pattern = '*python*,*bitcoin-cli*,*elements-cli*,*cln-grpc*,*clnrest*,*wss-proxy*,*cln-bip353*,*reckless,*cln-currencyrate*'
trace_skip_pattern = '*python*,*bitcoin-cli*,*elements-cli*,*cln-grpc*,*clnrest*,*wss-proxy*,*cln-bip353*,*reckless,*cln-currencyrate*,*cln-reckless*'
if not valgrind_plugins:
trace_skip_pattern += ',*plugins*'
self.daemon.cmd_prefix = [
Expand Down
1 change: 1 addition & 0 deletions plugins/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ cln-xpay
cln-lsps-client
cln-lsps-service
cln-bwatch
cln-reckless
16 changes: 6 additions & 10 deletions plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ PLUGIN_FUNDER_HEADER := \
plugins/funder_policy.h
PLUGIN_FUNDER_OBJS := $(PLUGIN_FUNDER_SRC:.c=.o)

PLUGIN_RECKLESSRPC_SRC := plugins/recklessrpc.c
PLUGIN_RECKLESSRPC_OBJS := $(PLUGIN_RECKLESSRPC_SRC:.c=.o)

PLUGIN_ALL_SRC := \
$(PLUGIN_AUTOCLEAN_SRC) \
$(PLUGIN_chanbackup_SRC) \
Expand All @@ -106,8 +103,7 @@ PLUGIN_ALL_SRC := \
$(PLUGIN_PAY_LIB_SRC) \
$(PLUGIN_PAY_SRC) \
$(PLUGIN_SPENDER_SRC) \
$(PLUGIN_RECOVER_SRC) \
$(PLUGIN_RECKLESSRPC_SRC)
$(PLUGIN_RECOVER_SRC)

PLUGIN_ALL_HEADER := \
$(PLUGIN_PAY_HEADER) \
Expand All @@ -130,7 +126,6 @@ C_PLUGINS := \
plugins/keysend \
plugins/offers \
plugins/pay \
plugins/recklessrpc \
plugins/recover \
plugins/txprepare \
plugins/cln-renepay \
Expand All @@ -153,7 +148,7 @@ $(shell test -d plugins/clnrest && $(RM) -r plugins/clnrest || true)
$(shell test -d plugins/wss-proxy && $(RM) -r plugins/wss-proxy || true)

ifneq ($(RUST),0)
RUST_PLUGIN_NAMES := cln-grpc clnrest cln-lsps-client cln-lsps-service wss-proxy cln-bip353 cln-currencyrate
RUST_PLUGIN_NAMES := cln-grpc clnrest cln-lsps-client cln-lsps-service wss-proxy cln-bip353 cln-currencyrate cln-reckless

# Builtin plugins must be in this plugins dir to work when we're executed
# *without* make install.
Expand Down Expand Up @@ -218,8 +213,6 @@ plugins/funder: $(PLUGIN_FUNDER_OBJS) $(PLUGIN_LIB_OBJS) libcommon.a

plugins/recover: $(PLUGIN_RECOVER_OBJS) $(PLUGIN_LIB_OBJS) libcommon.a

plugins/recklessrpc: $(PLUGIN_RECKLESSRPC_OBJS) $(PLUGIN_LIB_OBJS) libcommon.a

# This covers all the low-level list RPCs which return simple arrays
SQL_LISTRPCS := listchannels listforwards listhtlcs listinvoices listnodes listoffers listpeers listpeerchannels listclosedchannels listtransactions listsendpays listchainmoves listchannelmoves bkpr-listaccountevents bkpr-listincome listnetworkevents
SQL_LISTRPCS_SCHEMAS := $(foreach l,$(SQL_LISTRPCS),doc/schemas/$l.json)
Expand Down Expand Up @@ -274,6 +267,7 @@ CLN_LSPS_PLUGIN_SRC = $(shell find plugins/lsps-plugin/src -name "*.rs")
CLN_WSS_PROXY_PLUGIN_SRC = $(shell find plugins/wss-proxy-plugin/src -name "*.rs")
CLN_BIP353_PLUGIN_SRC = $(shell find plugins/bip353-plugin/src -name "*.rs")
CLN_CURRENCYRATE_PLUGIN_SRC = $(shell find plugins/currencyrate-plugin/src -name "*.rs")
CLN_RECKLESS_PLUGIN_SRC = $(shell find plugins/reckless-plugin/src -name "*.rs")

$(RUST_TARGET_DIR)/cln-grpc: ${CLN_PLUGIN_SRC} ${CLN_GRPC_PLUGIN_SRC} $(MSGGEN_GENALL) $(MSGGEN_GEN_ALL)
$(CARGO) build ${CARGO_OPTS} --bin cln-grpc
Expand All @@ -289,11 +283,13 @@ $(RUST_TARGET_DIR)/cln-bip353: ${CLN_BIP353_PLUGIN_SRC}
$(CARGO) build ${CARGO_OPTS} --bin cln-bip353
$(RUST_TARGET_DIR)/cln-currencyrate: ${CLN_CURRENCYRATE_PLUGIN_SRC}
$(CARGO) build ${CARGO_OPTS} --bin cln-currencyrate
$(RUST_TARGET_DIR)/cln-reckless: ${CLN_RECKLESS_PLUGIN_SRC}
$(CARGO) build ${CARGO_OPTS} --bin cln-reckless

ifneq ($(RUST),0)
include plugins/rest-plugin/Makefile
include plugins/wss-proxy-plugin/Makefile
DEFAULT_TARGETS += $(CLN_PLUGIN_EXAMPLES) plugins/cln-grpc plugins/clnrest plugins/cln-lsps-client plugins/cln-lsps-service plugins/wss-proxy plugins/cln-bip353 plugins/cln-currencyrate
DEFAULT_TARGETS += $(CLN_PLUGIN_EXAMPLES) plugins/cln-grpc plugins/clnrest plugins/cln-lsps-client plugins/cln-lsps-service plugins/wss-proxy plugins/cln-bip353 plugins/cln-currencyrate plugins/cln-reckless
endif

clean: plugins-clean
Expand Down
32 changes: 32 additions & 0 deletions plugins/reckless-plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "cln-reckless"
version = "0.1.0"
edition = "2024"
license = "MIT"
description = "Install plugins from remote or local repositories"
homepage = "https://github.com/ElementsProject/lightning/tree/master/plugins"
repository = "https://github.com/ElementsProject/lightning"
rust-version.workspace = true

[dependencies]
anyhow = "1"
log = { version = "0.4", features = ['std'] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["fs", "process"] }
tokio-util = { version = "0.7", features = ["codec"] }

futures = "0.3"

log-panics = "2"

which = "8"
url = "2"
sha2 = "0.11"
chrono = "0.4"
hex = "0.4"

clap = { version = "4", features = ["derive"] }

cln-plugin = { workspace = true }
cln-rpc = { workspace = true }
7 changes: 7 additions & 0 deletions plugins/reckless-plugin/src/cmds.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pub mod enable;
pub mod install;
pub mod search;
pub mod source;
pub mod tip;
pub mod update;
pub mod version;
Loading
Loading