2022-10-17 11:07:05 +10:30
|
|
|
PLUGIN_PAY_SRC := plugins/pay.c
|
2023-04-11 06:57:45 +09:30
|
|
|
PLUGIN_PAY_HEADER :=
|
2019-01-15 14:44:27 +10:30
|
|
|
PLUGIN_PAY_OBJS := $(PLUGIN_PAY_SRC:.c=.o)
|
|
|
|
|
2019-05-21 17:02:39 +09:30
|
|
|
PLUGIN_AUTOCLEAN_SRC := plugins/autoclean.c
|
|
|
|
PLUGIN_AUTOCLEAN_OBJS := $(PLUGIN_AUTOCLEAN_SRC:.c=.o)
|
|
|
|
|
2022-06-24 06:59:36 +05:30
|
|
|
PLUGIN_chanbackup_SRC := plugins/chanbackup.c
|
|
|
|
PLUGIN_chanbackup_OBJS := $(PLUGIN_chanbackup_SRC:.c=.o)
|
|
|
|
|
2021-06-15 06:37:38 +09:30
|
|
|
PLUGIN_TOPOLOGY_SRC := plugins/topology.c
|
|
|
|
PLUGIN_TOPOLOGY_OBJS := $(PLUGIN_TOPOLOGY_SRC:.c=.o)
|
|
|
|
|
2020-08-28 12:01:57 +09:30
|
|
|
PLUGIN_TXPREPARE_SRC := plugins/txprepare.c
|
|
|
|
PLUGIN_TXPREPARE_OBJS := $(PLUGIN_TXPREPARE_SRC:.c=.o)
|
|
|
|
|
2020-01-02 21:04:03 +01:00
|
|
|
PLUGIN_BCLI_SRC := plugins/bcli.c
|
|
|
|
PLUGIN_BCLI_OBJS := $(PLUGIN_BCLI_SRC:.c=.o)
|
|
|
|
|
2022-07-16 22:48:21 +09:30
|
|
|
PLUGIN_COMMANDO_SRC := plugins/commando.c
|
|
|
|
PLUGIN_COMMANDO_OBJS := $(PLUGIN_COMMANDO_SRC:.c=.o)
|
|
|
|
|
2020-03-27 14:31:00 +01:00
|
|
|
PLUGIN_KEYSEND_SRC := plugins/keysend.c
|
|
|
|
PLUGIN_KEYSEND_OBJS := $(PLUGIN_KEYSEND_SRC:.c=.o)
|
|
|
|
|
2020-08-05 22:01:20 +08:00
|
|
|
PLUGIN_LIB_SRC := plugins/libplugin.c
|
|
|
|
PLUGIN_LIB_HEADER := plugins/libplugin.h
|
2019-01-15 14:43:27 +10:30
|
|
|
PLUGIN_LIB_OBJS := $(PLUGIN_LIB_SRC:.c=.o)
|
|
|
|
|
2020-08-05 22:01:20 +08:00
|
|
|
PLUGIN_PAY_LIB_SRC := plugins/libplugin-pay.c
|
|
|
|
PLUGIN_PAY_LIB_HEADER := plugins/libplugin-pay.h
|
|
|
|
PLUGIN_PAY_LIB_OBJS := $(PLUGIN_PAY_LIB_SRC:.c=.o)
|
|
|
|
|
2022-11-09 13:02:01 +10:30
|
|
|
PLUGIN_OFFERS_SRC := plugins/offers.c plugins/offers_offer.c plugins/offers_invreq_hook.c plugins/offers_inv_hook.c
|
2020-12-16 13:43:23 +10:30
|
|
|
PLUGIN_OFFERS_OBJS := $(PLUGIN_OFFERS_SRC:.c=.o)
|
2021-01-08 05:05:47 +10:30
|
|
|
PLUGIN_OFFERS_HEADER := $(PLUGIN_OFFERS_SRC:.c=.h)
|
2020-12-16 13:43:23 +10:30
|
|
|
|
2020-12-16 13:48:00 +10:30
|
|
|
PLUGIN_FETCHINVOICE_SRC := plugins/fetchinvoice.c
|
|
|
|
PLUGIN_FETCHINVOICE_OBJS := $(PLUGIN_FETCHINVOICE_SRC:.c=.o)
|
2022-11-09 13:02:01 +10:30
|
|
|
PLUGIN_FETCHINVOICE_HEADER :=
|
2020-12-16 13:48:00 +10:30
|
|
|
|
2023-01-30 16:54:17 +10:30
|
|
|
PLUGIN_SQL_SRC := plugins/sql.c
|
2023-04-11 06:57:45 +09:30
|
|
|
PLUGIN_SQL_HEADER :=
|
2023-01-30 16:54:17 +10:30
|
|
|
PLUGIN_SQL_OBJS := $(PLUGIN_SQL_SRC:.c=.o)
|
|
|
|
|
2020-09-09 19:55:20 +09:30
|
|
|
PLUGIN_SPENDER_SRC := \
|
2020-08-21 17:58:20 +08:00
|
|
|
plugins/spender/fundchannel.c \
|
2020-09-09 19:56:14 +09:30
|
|
|
plugins/spender/main.c \
|
2020-08-21 17:31:33 +08:00
|
|
|
plugins/spender/multifundchannel.c \
|
2020-10-20 20:18:19 -05:00
|
|
|
plugins/spender/multiwithdraw.c \
|
|
|
|
plugins/spender/openchannel.c
|
2020-09-09 19:56:14 +09:30
|
|
|
PLUGIN_SPENDER_HEADER := \
|
2020-08-21 17:31:33 +08:00
|
|
|
plugins/spender/multifundchannel.h \
|
2020-08-21 17:58:20 +08:00
|
|
|
plugins/spender/multiwithdraw.h \
|
|
|
|
plugins/spender/fundchannel.h \
|
2020-10-20 20:18:19 -05:00
|
|
|
plugins/spender/multifundchannel.h \
|
|
|
|
plugins/spender/openchannel.h
|
2020-09-09 19:55:20 +09:30
|
|
|
PLUGIN_SPENDER_OBJS := $(PLUGIN_SPENDER_SRC:.c=.o)
|
|
|
|
|
2023-12-11 13:34:22 +05:30
|
|
|
PLUGIN_RECOVER_SRC := plugins/recover.c
|
|
|
|
PLUGIN_RECOVER_OBJS := $(PLUGIN_RECOVER_SRC:.c=.o)
|
|
|
|
|
2021-04-22 17:51:22 -05:00
|
|
|
PLUGIN_FUNDER_SRC := \
|
|
|
|
plugins/funder.c \
|
|
|
|
plugins/funder_policy.c
|
|
|
|
PLUGIN_FUNDER_HEADER := \
|
|
|
|
plugins/funder_policy.h
|
|
|
|
PLUGIN_FUNDER_OBJS := $(PLUGIN_FUNDER_SRC:.c=.o)
|
|
|
|
|
2020-06-19 14:22:25 +08:00
|
|
|
PLUGIN_ALL_SRC := \
|
|
|
|
$(PLUGIN_AUTOCLEAN_SRC) \
|
2022-06-24 06:59:36 +05:30
|
|
|
$(PLUGIN_chanbackup_SRC) \
|
2020-06-19 14:22:25 +08:00
|
|
|
$(PLUGIN_BCLI_SRC) \
|
2022-07-16 22:48:21 +09:30
|
|
|
$(PLUGIN_COMMANDO_SRC) \
|
2021-01-13 19:28:38 +10:30
|
|
|
$(PLUGIN_FETCHINVOICE_SRC) \
|
2021-04-22 17:51:22 -05:00
|
|
|
$(PLUGIN_FUNDER_SRC) \
|
2021-06-15 06:37:38 +09:30
|
|
|
$(PLUGIN_TOPOLOGY_SRC) \
|
2020-06-19 14:22:25 +08:00
|
|
|
$(PLUGIN_KEYSEND_SRC) \
|
2020-08-28 12:01:57 +09:30
|
|
|
$(PLUGIN_TXPREPARE_SRC) \
|
2020-06-19 14:22:25 +08:00
|
|
|
$(PLUGIN_LIB_SRC) \
|
2021-01-13 19:28:38 +10:30
|
|
|
$(PLUGIN_OFFERS_SRC) \
|
2020-08-05 22:01:20 +08:00
|
|
|
$(PLUGIN_PAY_LIB_SRC) \
|
2020-09-09 19:55:20 +09:30
|
|
|
$(PLUGIN_PAY_SRC) \
|
2023-12-11 13:34:22 +05:30
|
|
|
$(PLUGIN_SPENDER_SRC) \
|
|
|
|
$(PLUGIN_RECOVER_SRC)
|
2020-12-16 13:43:23 +10:30
|
|
|
|
2020-06-19 14:22:25 +08:00
|
|
|
PLUGIN_ALL_HEADER := \
|
2022-10-17 11:07:05 +10:30
|
|
|
$(PLUGIN_PAY_HEADER) \
|
2020-08-05 22:01:20 +08:00
|
|
|
$(PLUGIN_LIB_HEADER) \
|
2021-04-22 17:51:22 -05:00
|
|
|
$(PLUGIN_FUNDER_HEADER) \
|
2020-09-09 19:55:20 +09:30
|
|
|
$(PLUGIN_PAY_LIB_HEADER) \
|
2020-12-16 13:43:28 +10:30
|
|
|
$(PLUGIN_OFFERS_HEADER) \
|
2020-09-09 19:55:20 +09:30
|
|
|
$(PLUGIN_SPENDER_HEADER)
|
2020-06-19 14:22:25 +08:00
|
|
|
|
2022-04-10 20:08:15 +09:30
|
|
|
C_PLUGINS := \
|
2020-06-19 14:22:25 +08:00
|
|
|
plugins/autoclean \
|
2022-06-24 06:59:36 +05:30
|
|
|
plugins/chanbackup \
|
2020-06-19 14:22:25 +08:00
|
|
|
plugins/bcli \
|
2022-07-16 22:48:21 +09:30
|
|
|
plugins/commando \
|
2021-01-13 19:28:38 +10:30
|
|
|
plugins/fetchinvoice \
|
2021-04-22 17:51:22 -05:00
|
|
|
plugins/funder \
|
2021-06-15 06:37:38 +09:30
|
|
|
plugins/topology \
|
2020-06-19 14:22:25 +08:00
|
|
|
plugins/keysend \
|
2021-01-13 19:28:38 +10:30
|
|
|
plugins/offers \
|
2020-08-28 12:01:57 +09:30
|
|
|
plugins/pay \
|
2023-12-11 13:34:22 +05:30
|
|
|
plugins/recover \
|
2020-09-09 19:55:20 +09:30
|
|
|
plugins/txprepare \
|
2023-07-31 11:21:22 +09:30
|
|
|
plugins/cln-renepay \
|
2020-09-09 19:55:20 +09:30
|
|
|
plugins/spenderp
|
2020-06-19 14:22:25 +08:00
|
|
|
|
2023-07-15 14:12:59 +09:30
|
|
|
PY_PLUGINS := \
|
|
|
|
plugins/clnrest/clnrest.py
|
|
|
|
|
2023-02-06 12:21:30 +10:30
|
|
|
ifeq ($(HAVE_SQLITE3),1)
|
|
|
|
C_PLUGINS += plugins/sql
|
|
|
|
PLUGIN_ALL_SRC += $(PLUGIN_SQL_SRC)
|
|
|
|
PLUGIN_ALL_HEADER += $(PLUGIN_SQL_HEADER)
|
|
|
|
endif
|
|
|
|
|
2023-07-15 14:12:59 +09:30
|
|
|
# This is non-python plugins (PY_PLUGINS need their whole directory!)
|
2022-04-10 20:08:15 +09:30
|
|
|
PLUGINS := $(C_PLUGINS)
|
2023-02-06 12:21:30 +10:30
|
|
|
PLUGIN_ALL_OBJS := $(PLUGIN_ALL_SRC:.c=.o)
|
2022-04-10 20:08:15 +09:30
|
|
|
|
|
|
|
ifneq ($(RUST),0)
|
|
|
|
# Builtin plugins must be in this plugins dir to work when we're executed
|
|
|
|
# *without* make install.
|
|
|
|
plugins/cln-grpc: target/${RUST_PROFILE}/cln-grpc
|
|
|
|
@cp $< $@
|
|
|
|
|
|
|
|
PLUGINS += plugins/cln-grpc
|
|
|
|
endif
|
|
|
|
|
2019-01-15 14:43:27 +10:30
|
|
|
PLUGIN_COMMON_OBJS := \
|
2019-10-29 12:00:18 -05:00
|
|
|
bitcoin/base58.o \
|
2021-07-02 16:00:17 -05:00
|
|
|
bitcoin/block.o \
|
2022-07-19 17:04:41 +09:30
|
|
|
bitcoin/chainparams.o \
|
2020-07-08 06:20:21 +09:30
|
|
|
bitcoin/feerate.o \
|
2021-07-02 16:00:17 -05:00
|
|
|
bitcoin/preimage.o \
|
2020-05-16 10:59:05 +09:30
|
|
|
bitcoin/privkey.o \
|
2020-05-21 11:27:00 +09:30
|
|
|
bitcoin/psbt.o \
|
2019-01-15 14:43:27 +10:30
|
|
|
bitcoin/pubkey.o \
|
|
|
|
bitcoin/script.o \
|
|
|
|
bitcoin/shadouble.o \
|
|
|
|
bitcoin/short_channel_id.o \
|
|
|
|
bitcoin/signature.o \
|
|
|
|
bitcoin/tx.o \
|
|
|
|
bitcoin/varint.o \
|
2019-02-21 11:15:57 +10:30
|
|
|
common/amount.o \
|
2021-09-21 16:53:10 +09:30
|
|
|
common/autodata.o \
|
2022-02-16 15:36:47 -06:00
|
|
|
common/coin_mvt.o \
|
2020-01-26 13:07:50 +01:00
|
|
|
common/base32.o \
|
2019-01-15 14:43:27 +10:30
|
|
|
common/bech32.o \
|
|
|
|
common/bech32_util.o \
|
2019-07-30 14:55:12 +09:30
|
|
|
common/bigsize.o \
|
2019-01-15 14:43:27 +10:30
|
|
|
common/bolt11.o \
|
2021-03-16 15:33:07 -05:00
|
|
|
common/channel_id.o \
|
2019-01-15 14:43:27 +10:30
|
|
|
common/daemon.o \
|
2024-01-25 10:58:53 +10:30
|
|
|
common/deprecation.o \
|
2019-09-05 10:37:16 +09:30
|
|
|
common/features.o \
|
2019-01-15 14:43:27 +10:30
|
|
|
common/hash_u5.o \
|
2022-07-04 13:19:38 +09:30
|
|
|
common/json_param.o \
|
|
|
|
common/json_parse.o \
|
|
|
|
common/json_parse_simple.o \
|
2022-11-02 10:02:22 +10:30
|
|
|
common/json_filter.o \
|
2020-01-26 13:07:50 +01:00
|
|
|
common/json_stream.o \
|
2021-05-26 18:13:08 -05:00
|
|
|
common/lease_rates.o \
|
2019-01-15 14:43:27 +10:30
|
|
|
common/memleak.o \
|
common/node_id: new type.
Node ids are pubkeys, but we only use them as pubkeys for routing and checking
gossip messages. So we're packing and unpacking them constantly, and wasting
some space and time.
This introduces a new type, explicitly the SEC1 compressed encoding
(33 bytes). We ensure its validity when we load from the db, or get it
from JSON. We still use 'struct pubkey' for peer messages, which checks
validity.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39475-39572(39518+/-36),2880732,41.150000-41.390000(41.298+/-0.085),2.260000-2.550000(2.336+/-0.11),44.390000-65.150000(58.648+/-7.5),32.740000-33.020000(32.89+/-0.093),44.130000-45.090000(44.566+/-0.32)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 16:04:06 +09:30
|
|
|
common/node_id.o \
|
2021-04-22 17:51:22 -05:00
|
|
|
common/psbt_open.o \
|
2019-01-15 20:34:07 +10:30
|
|
|
common/pseudorand.o \
|
2020-08-11 14:35:56 +09:30
|
|
|
common/random_select.o \
|
2022-06-24 06:59:36 +05:30
|
|
|
common/scb_wiregen.o \
|
2020-05-15 17:13:22 -05:00
|
|
|
common/setup.o \
|
2020-10-12 16:03:50 +10:30
|
|
|
common/status_levels.o \
|
2019-01-15 14:43:27 +10:30
|
|
|
common/type_to_string.o \
|
|
|
|
common/utils.o \
|
|
|
|
common/version.o \
|
2020-01-26 13:07:50 +01:00
|
|
|
common/wireaddr.o \
|
2021-09-09 12:20:52 +09:30
|
|
|
wire/channel_type_wiregen.o \
|
2019-01-15 14:43:27 +10:30
|
|
|
wire/fromwire.o \
|
2023-05-22 10:21:44 +09:30
|
|
|
wire/onion_wiregen.o \
|
|
|
|
wire/peer_wiregen.o \
|
2020-05-20 13:58:39 +02:00
|
|
|
wire/tlvstream.o \
|
2019-01-15 14:43:27 +10:30
|
|
|
wire/towire.o
|
|
|
|
|
2022-07-19 14:37:26 +09:30
|
|
|
include plugins/bkpr/Makefile
|
2023-07-31 11:21:22 +09:30
|
|
|
include plugins/renepay/Makefile
|
2022-07-19 14:37:26 +09:30
|
|
|
|
2022-07-19 15:26:04 +09:30
|
|
|
# Make sure these depend on everything.
|
|
|
|
ALL_C_SOURCES += $(PLUGIN_ALL_SRC)
|
|
|
|
ALL_C_HEADERS += $(PLUGIN_ALL_HEADER)
|
|
|
|
ALL_PROGRAMS += $(C_PLUGINS)
|
|
|
|
|
2021-11-30 13:35:44 +10:30
|
|
|
# Make all plugins depend on all plugin headers, for simplicity.
|
|
|
|
$(PLUGIN_ALL_OBJS): $(PLUGIN_ALL_HEADER)
|
|
|
|
|
2023-12-13 16:05:42 +10:30
|
|
|
plugins/pay: $(PLUGIN_PAY_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_PAY_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) common/gossmap.o common/fp16.o common/route.o common/dijkstra.o common/bolt12.o common/bolt12_merkle.o wire/bolt12_wiregen.o bitcoin/block.o common/blindedpay.o common/blindedpath.o common/hmac.o common/blinding.o common/onion_encode.o common/gossmods_listpeerchannels.o
|
2019-01-15 14:44:27 +10:30
|
|
|
|
2022-07-19 17:04:41 +09:30
|
|
|
plugins/autoclean: $(PLUGIN_AUTOCLEAN_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2019-05-21 17:02:39 +09:30
|
|
|
|
2022-07-19 17:04:41 +09:30
|
|
|
plugins/chanbackup: $(PLUGIN_chanbackup_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2022-06-24 06:59:36 +05:30
|
|
|
|
2023-04-11 06:57:45 +09:30
|
|
|
plugins/commando: $(PLUGIN_COMMANDO_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2022-07-16 22:48:21 +09:30
|
|
|
|
2021-06-15 06:37:38 +09:30
|
|
|
# Topology wants to decode node_announcement, and peer_wiregen which
|
|
|
|
# pulls in some of bitcoin/.
|
2023-12-07 06:44:05 +10:30
|
|
|
plugins/topology: common/route.o common/dijkstra.o common/gossmap.o common/fp16.o wire/peer_wiregen.o wire/channel_type_wiregen.o bitcoin/block.o bitcoin/preimage.o common/gossmods_listpeerchannels.o $(PLUGIN_TOPOLOGY_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2021-06-15 06:37:38 +09:30
|
|
|
|
2022-07-19 17:04:41 +09:30
|
|
|
plugins/txprepare: $(PLUGIN_TXPREPARE_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2020-08-28 12:01:57 +09:30
|
|
|
|
2022-07-19 17:04:41 +09:30
|
|
|
plugins/bcli: $(PLUGIN_BCLI_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2020-01-02 21:04:03 +01:00
|
|
|
|
2023-12-13 16:05:42 +10:30
|
|
|
plugins/keysend: wire/tlvstream.o wire/onion_wiregen.o $(PLUGIN_KEYSEND_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_PAY_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) common/gossmap.o common/fp16.o common/route.o common/dijkstra.o common/blindedpay.o common/blindedpath.o common/hmac.o common/blinding.o common/onion_encode.o common/gossmods_listpeerchannels.o
|
2020-08-05 22:01:20 +08:00
|
|
|
$(PLUGIN_KEYSEND_OBJS): $(PLUGIN_PAY_LIB_HEADER)
|
2020-03-27 14:31:00 +01:00
|
|
|
|
2024-01-29 10:06:12 +10:30
|
|
|
plugins/spenderp: bitcoin/block.o bitcoin/preimage.o bitcoin/psbt.o common/psbt_open.o common/json_channel_type.o common/channel_type.o common/features.o wire/peer${EXP}_wiregen.o $(PLUGIN_SPENDER_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2020-09-09 19:55:20 +09:30
|
|
|
|
2023-10-26 14:02:08 +10:30
|
|
|
plugins/offers: $(PLUGIN_OFFERS_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) common/addr.o common/bolt12.o common/bolt12_merkle.o common/bolt11_json.o common/iso4217.o $(WIRE_OBJS) $(WIRE_BOLT12_OBJS) bitcoin/block.o common/channel_id.o bitcoin/preimage.o common/blindedpath.o common/invoice_path_id.o common/blinding.o common/hmac.o $(JSMN_OBJS)
|
2020-12-16 13:43:23 +10:30
|
|
|
|
2023-12-13 16:04:32 +10:30
|
|
|
plugins/fetchinvoice: $(PLUGIN_FETCHINVOICE_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) common/bolt12.o common/bolt12_merkle.o common/iso4217.o $(WIRE_OBJS) $(WIRE_BOLT12_OBJS) bitcoin/block.o common/channel_id.o bitcoin/preimage.o $(JSMN_OBJS) common/gossmap.o common/fp16.o common/dijkstra.o common/route.o common/blindedpath.o common/hmac.o common/blinding.o common/gossmods_listpeerchannels.o
|
2020-12-16 13:48:00 +10:30
|
|
|
|
2022-07-19 17:04:41 +09:30
|
|
|
plugins/funder: bitcoin/psbt.o common/psbt_open.o $(PLUGIN_FUNDER_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2021-04-22 17:51:22 -05:00
|
|
|
|
2023-12-11 13:34:22 +05:30
|
|
|
plugins/recover: common/gossmap.o common/fp16.o $(PLUGIN_RECOVER_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
|
|
|
|
2023-01-30 16:54:17 +10:30
|
|
|
# This covers all the low-level list RPCs which return simple arrays
|
2023-03-20 10:52:24 +10:30
|
|
|
SQL_LISTRPCS := listchannels listforwards listhtlcs listinvoices listnodes listoffers listpeers listpeerchannels listclosedchannels listtransactions listsendpays bkpr-listaccountevents bkpr-listincome
|
2024-03-03 18:29:52 -08:00
|
|
|
SQL_LISTRPCS_SCHEMAS := $(foreach l,$(SQL_LISTRPCS),doc/schemas/lightning-$l.json)
|
|
|
|
|
|
|
|
# RES_JSON is generated by:
|
|
|
|
# 1: deleting description array (used for field details) but keeping description keys
|
|
|
|
# 2: deleting additionalProperties, required, enum, maxLength, minLength, pre_return_value_notes, post_return_value_notes, anyOf, oneOf, hidden, untyped, default, comment, added, maximum, minimum, pattern, format
|
|
|
|
# (We only need [field].type, [field].name, [field].deprecated, [field].allOf, [field].items.allOf and allOf from response.properties)
|
|
|
|
# 3: deleting empty objects from .response.properties
|
|
|
|
# But these simple removals drop us from 100k to 18k.
|
2023-01-30 16:54:17 +10:30
|
|
|
plugins/sql-schema_gen.h: plugins/Makefile $(SQL_LISTRPCS_SCHEMAS)
|
2024-03-03 18:29:52 -08:00
|
|
|
@$(call VERBOSE,GEN $@, \
|
|
|
|
( \
|
|
|
|
SEP=""; \
|
|
|
|
echo '"{'; \
|
|
|
|
for f in $(SQL_LISTRPCS); do \
|
|
|
|
RES_JSON=$$(echo "$$(jq 'walk(if type == "object" then if has("description") and (.description | type) == "array" then del(.description) else . end else . end ) | walk(if type == "object" then del(.additionalProperties, .required, .enum, .maxLength, .minLength, .pre_return_value_notes, .post_return_value_notes, .anyOf, .oneOf, .hidden, .untyped, .default, .comment, .added, .maximum, .minimum, .pattern, .format) else . end) | walk(if type == "object" then with_entries(select(.value != {})) else . end) | .response.properties' < doc/schemas/lightning-$$f.json)" | sed 's/"/\\"/g'); \
|
|
|
|
echo "$$SEP\\\"$$f\\\":{\\\"properties\\\": $$RES_JSON}"; \
|
|
|
|
SEP=","; \
|
|
|
|
done; \
|
|
|
|
echo '}"' \
|
|
|
|
) | tr -d ' \n' > $@ \
|
|
|
|
)
|
2023-01-30 16:54:17 +10:30
|
|
|
|
|
|
|
plugins/sql.o: plugins/sql-schema_gen.h
|
2023-01-30 16:54:17 +10:30
|
|
|
plugins/sql: $(PLUGIN_SQL_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) common/gossip_store.o gossipd/gossip_store_wiregen.o
|
2023-01-30 16:54:17 +10:30
|
|
|
|
2020-09-24 11:02:54 +09:30
|
|
|
# Generated from PLUGINS definition in plugins/Makefile
|
2020-10-22 10:21:08 +10:30
|
|
|
ALL_C_HEADERS += plugins/list_of_builtin_plugins_gen.h
|
2023-07-15 14:12:59 +09:30
|
|
|
PLUGIN_BASES := $(PLUGINS:plugins/%=%) $(PY_PLUGINS:plugins/%=%)
|
|
|
|
|
2022-09-12 09:35:52 +09:30
|
|
|
plugins/list_of_builtin_plugins_gen.h: plugins/Makefile Makefile config.vars
|
2023-07-15 14:12:59 +09:30
|
|
|
@$(call VERBOSE,GEN $@,echo "static const char *list_of_builtin_plugins[] = { $(PLUGIN_BASES:%=\"%\",) NULL };" > $@)
|
2021-04-22 17:53:28 -05:00
|
|
|
|
2022-12-21 12:26:46 +01:00
|
|
|
CLN_PLUGIN_EXAMPLES := \
|
|
|
|
target/${RUST_PROFILE}/examples/cln-plugin-startup \
|
2023-04-11 06:57:45 +09:30
|
|
|
target/${RUST_PROFILE}/examples/cln-plugin-reentrant \
|
2022-12-21 12:26:46 +01:00
|
|
|
target/${RUST_PROFILE}/examples/cln-rpc-getinfo
|
2022-01-17 12:59:09 +01:00
|
|
|
|
2022-12-21 12:26:46 +01:00
|
|
|
CLN_PLUGIN_SRC = $(shell find plugins/src -name "*.rs")
|
2022-01-17 12:59:09 +01:00
|
|
|
|
2022-03-22 16:49:12 +01:00
|
|
|
target/${RUST_PROFILE}/cln-grpc: ${CLN_PLUGIN_SRC}
|
|
|
|
cargo build ${CARGO_OPTS} --bin cln-grpc
|
2022-01-17 16:53:52 +01:00
|
|
|
|
2022-04-12 15:55:55 +09:30
|
|
|
ifneq ($(RUST),0)
|
|
|
|
DEFAULT_TARGETS += $(CLN_PLUGIN_EXAMPLES) plugins/cln-grpc
|
|
|
|
endif
|
|
|
|
|
2023-04-12 11:34:57 +09:30
|
|
|
clean: plugins-clean
|
|
|
|
plugins-clean:
|
|
|
|
$(RM) $(PLUGINS) $(CLN_PLUGIN_EXAMPLES)
|
|
|
|
$(RM) plugins/sql-schema_gen.h
|
|
|
|
|
2021-04-22 17:53:28 -05:00
|
|
|
include plugins/test/Makefile
|