2019-01-15 05:14:27 +01:00
|
|
|
PLUGIN_PAY_SRC := plugins/pay.c
|
|
|
|
PLUGIN_PAY_OBJS := $(PLUGIN_PAY_SRC:.c=.o)
|
|
|
|
|
2019-05-21 09:32:39 +02:00
|
|
|
PLUGIN_AUTOCLEAN_SRC := plugins/autoclean.c
|
|
|
|
PLUGIN_AUTOCLEAN_OBJS := $(PLUGIN_AUTOCLEAN_SRC:.c=.o)
|
|
|
|
|
2022-06-24 03:29:36 +02:00
|
|
|
PLUGIN_chanbackup_SRC := plugins/chanbackup.c
|
|
|
|
PLUGIN_chanbackup_OBJS := $(PLUGIN_chanbackup_SRC:.c=.o)
|
|
|
|
|
2021-06-14 23:07:38 +02:00
|
|
|
PLUGIN_TOPOLOGY_SRC := plugins/topology.c
|
|
|
|
PLUGIN_TOPOLOGY_OBJS := $(PLUGIN_TOPOLOGY_SRC:.c=.o)
|
|
|
|
|
2020-08-28 04:31:57 +02:00
|
|
|
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 15:18:21 +02:00
|
|
|
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 16:01:20 +02:00
|
|
|
PLUGIN_LIB_SRC := plugins/libplugin.c
|
|
|
|
PLUGIN_LIB_HEADER := plugins/libplugin.h
|
2019-01-15 05:13:27 +01:00
|
|
|
PLUGIN_LIB_OBJS := $(PLUGIN_LIB_SRC:.c=.o)
|
|
|
|
|
2020-08-05 16:01:20 +02: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)
|
|
|
|
|
2021-01-07 19:36:47 +01:00
|
|
|
PLUGIN_OFFERS_SRC := plugins/offers.c plugins/offers_offer.c plugins/offers_invreq_hook.c plugins/offers_inv_hook.c
|
2020-12-16 04:13:23 +01:00
|
|
|
PLUGIN_OFFERS_OBJS := $(PLUGIN_OFFERS_SRC:.c=.o)
|
2021-01-07 19:35:47 +01:00
|
|
|
PLUGIN_OFFERS_HEADER := $(PLUGIN_OFFERS_SRC:.c=.h)
|
2020-12-16 04:13:23 +01:00
|
|
|
|
2020-12-16 04:18:00 +01:00
|
|
|
PLUGIN_FETCHINVOICE_SRC := plugins/fetchinvoice.c
|
|
|
|
PLUGIN_FETCHINVOICE_OBJS := $(PLUGIN_FETCHINVOICE_SRC:.c=.o)
|
|
|
|
PLUGIN_FETCHINVOICE_HEADER :=
|
|
|
|
|
2020-09-09 12:25:20 +02:00
|
|
|
PLUGIN_SPENDER_SRC := \
|
2020-08-21 11:58:20 +02:00
|
|
|
plugins/spender/fundchannel.c \
|
2020-09-09 12:26:14 +02:00
|
|
|
plugins/spender/main.c \
|
2020-08-21 11:31:33 +02:00
|
|
|
plugins/spender/multifundchannel.c \
|
2020-10-21 03:18:19 +02:00
|
|
|
plugins/spender/multiwithdraw.c \
|
|
|
|
plugins/spender/openchannel.c
|
2020-09-09 12:26:14 +02:00
|
|
|
PLUGIN_SPENDER_HEADER := \
|
2020-08-21 11:31:33 +02:00
|
|
|
plugins/spender/multifundchannel.h \
|
2020-08-21 11:58:20 +02:00
|
|
|
plugins/spender/multiwithdraw.h \
|
|
|
|
plugins/spender/fundchannel.h \
|
2020-10-21 03:18:19 +02:00
|
|
|
plugins/spender/multifundchannel.h \
|
|
|
|
plugins/spender/openchannel.h
|
2020-09-09 12:25:20 +02:00
|
|
|
PLUGIN_SPENDER_OBJS := $(PLUGIN_SPENDER_SRC:.c=.o)
|
|
|
|
|
2021-04-23 00:51:22 +02: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 08:22:25 +02:00
|
|
|
PLUGIN_ALL_SRC := \
|
|
|
|
$(PLUGIN_AUTOCLEAN_SRC) \
|
2022-06-24 03:29:36 +02:00
|
|
|
$(PLUGIN_chanbackup_SRC) \
|
2020-06-19 08:22:25 +02:00
|
|
|
$(PLUGIN_BCLI_SRC) \
|
2022-07-16 15:18:21 +02:00
|
|
|
$(PLUGIN_COMMANDO_SRC) \
|
2021-01-13 09:58:38 +01:00
|
|
|
$(PLUGIN_FETCHINVOICE_SRC) \
|
2021-04-23 00:51:22 +02:00
|
|
|
$(PLUGIN_FUNDER_SRC) \
|
2021-06-14 23:07:38 +02:00
|
|
|
$(PLUGIN_TOPOLOGY_SRC) \
|
2020-06-19 08:22:25 +02:00
|
|
|
$(PLUGIN_KEYSEND_SRC) \
|
2020-08-28 04:31:57 +02:00
|
|
|
$(PLUGIN_TXPREPARE_SRC) \
|
2020-06-19 08:22:25 +02:00
|
|
|
$(PLUGIN_LIB_SRC) \
|
2021-01-13 09:58:38 +01:00
|
|
|
$(PLUGIN_OFFERS_SRC) \
|
2020-08-05 16:01:20 +02:00
|
|
|
$(PLUGIN_PAY_LIB_SRC) \
|
2020-09-09 12:25:20 +02:00
|
|
|
$(PLUGIN_PAY_SRC) \
|
|
|
|
$(PLUGIN_SPENDER_SRC)
|
2020-12-16 04:13:23 +01:00
|
|
|
|
2020-06-19 08:22:25 +02:00
|
|
|
PLUGIN_ALL_HEADER := \
|
2020-08-05 16:01:20 +02:00
|
|
|
$(PLUGIN_LIB_HEADER) \
|
2021-04-23 00:51:22 +02:00
|
|
|
$(PLUGIN_FUNDER_HEADER) \
|
2020-09-09 12:25:20 +02:00
|
|
|
$(PLUGIN_PAY_LIB_HEADER) \
|
2020-12-16 04:13:28 +01:00
|
|
|
$(PLUGIN_OFFERS_HEADER) \
|
2020-09-09 12:25:20 +02:00
|
|
|
$(PLUGIN_SPENDER_HEADER)
|
2020-06-19 08:22:25 +02:00
|
|
|
PLUGIN_ALL_OBJS := $(PLUGIN_ALL_SRC:.c=.o)
|
|
|
|
|
2022-04-10 12:38:15 +02:00
|
|
|
C_PLUGINS := \
|
2020-06-19 08:22:25 +02:00
|
|
|
plugins/autoclean \
|
2022-06-24 03:29:36 +02:00
|
|
|
plugins/chanbackup \
|
2020-06-19 08:22:25 +02:00
|
|
|
plugins/bcli \
|
2022-07-16 15:18:21 +02:00
|
|
|
plugins/commando \
|
2021-01-13 09:58:38 +01:00
|
|
|
plugins/fetchinvoice \
|
2021-04-23 00:51:22 +02:00
|
|
|
plugins/funder \
|
2021-06-14 23:07:38 +02:00
|
|
|
plugins/topology \
|
2020-06-19 08:22:25 +02:00
|
|
|
plugins/keysend \
|
2021-01-13 09:58:38 +01:00
|
|
|
plugins/offers \
|
2020-08-28 04:31:57 +02:00
|
|
|
plugins/pay \
|
2020-09-09 12:25:20 +02:00
|
|
|
plugins/txprepare \
|
|
|
|
plugins/spenderp
|
2020-06-19 08:22:25 +02:00
|
|
|
|
2022-04-10 12:38:15 +02:00
|
|
|
PLUGINS := $(C_PLUGINS)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
# Make sure these depend on everything.
|
|
|
|
ALL_C_SOURCES += $(PLUGIN_ALL_SRC)
|
2020-10-22 02:57:07 +02:00
|
|
|
ALL_C_HEADERS += $(PLUGIN_ALL_HEADER)
|
2022-04-10 12:38:15 +02:00
|
|
|
ALL_PROGRAMS += $(C_PLUGINS)
|
2020-08-31 03:13:25 +02:00
|
|
|
|
2019-01-15 05:13:27 +01:00
|
|
|
PLUGIN_COMMON_OBJS := \
|
2019-10-29 18:00:18 +01:00
|
|
|
bitcoin/base58.o \
|
2021-07-02 23:00:17 +02:00
|
|
|
bitcoin/block.o \
|
2020-07-07 22:50:21 +02:00
|
|
|
bitcoin/feerate.o \
|
2021-07-02 23:00:17 +02:00
|
|
|
bitcoin/preimage.o \
|
2020-05-16 03:29:05 +02:00
|
|
|
bitcoin/privkey.o \
|
2020-05-21 03:57:00 +02:00
|
|
|
bitcoin/psbt.o \
|
2019-01-15 05:13:27 +01:00
|
|
|
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 01:45:57 +01:00
|
|
|
common/amount.o \
|
2021-09-21 09:23:10 +02:00
|
|
|
common/autodata.o \
|
2022-02-16 22:36:47 +01:00
|
|
|
common/coin_mvt.o \
|
2020-01-26 13:07:50 +01:00
|
|
|
common/base32.o \
|
2019-01-15 05:13:27 +01:00
|
|
|
common/bech32.o \
|
|
|
|
common/bech32_util.o \
|
2019-07-30 07:25:12 +02:00
|
|
|
common/bigsize.o \
|
2019-01-15 05:13:27 +01:00
|
|
|
common/bolt11.o \
|
2021-03-16 21:33:07 +01:00
|
|
|
common/channel_id.o \
|
2019-01-15 05:13:27 +01:00
|
|
|
common/daemon.o \
|
2019-09-05 03:07:16 +02:00
|
|
|
common/features.o \
|
2019-01-15 05:13:27 +01:00
|
|
|
common/hash_u5.o \
|
2022-07-04 05:49:38 +02:00
|
|
|
common/json_param.o \
|
|
|
|
common/json_parse.o \
|
|
|
|
common/json_parse_simple.o \
|
2020-01-26 13:07:50 +01:00
|
|
|
common/json_stream.o \
|
2021-05-27 01:13:08 +02:00
|
|
|
common/lease_rates.o \
|
2019-01-15 05:13:27 +01:00
|
|
|
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 08:34:06 +02:00
|
|
|
common/node_id.o \
|
2021-04-23 00:51:22 +02:00
|
|
|
common/psbt_open.o \
|
2019-01-15 11:04:07 +01:00
|
|
|
common/pseudorand.o \
|
2020-08-11 07:05:56 +02:00
|
|
|
common/random_select.o \
|
2022-06-24 03:29:36 +02:00
|
|
|
common/scb_wiregen.o \
|
2020-05-16 00:13:22 +02:00
|
|
|
common/setup.o \
|
2020-10-12 07:33:50 +02:00
|
|
|
common/status_levels.o \
|
2019-01-15 05:13:27 +01:00
|
|
|
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 04:50:52 +02:00
|
|
|
wire/channel_type_wiregen.o \
|
2019-01-15 05:13:27 +01:00
|
|
|
wire/fromwire.o \
|
2020-09-07 23:06:50 +02:00
|
|
|
wire/onion$(EXP)_wiregen.o \
|
2021-07-02 23:00:17 +02:00
|
|
|
wire/peer$(EXP)_wiregen.o \
|
2020-05-20 13:58:39 +02:00
|
|
|
wire/tlvstream.o \
|
2019-01-15 05:13:27 +01:00
|
|
|
wire/towire.o
|
|
|
|
|
2021-11-30 04:05:44 +01:00
|
|
|
# Make all plugins depend on all plugin headers, for simplicity.
|
|
|
|
$(PLUGIN_ALL_OBJS): $(PLUGIN_ALL_HEADER)
|
|
|
|
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/pay: bitcoin/chainparams.o $(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$(EXP)_wiregen.o bitcoin/block.o
|
2019-01-15 05:14:27 +01:00
|
|
|
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/autoclean: bitcoin/chainparams.o $(PLUGIN_AUTOCLEAN_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2019-05-21 09:32:39 +02:00
|
|
|
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/chanbackup: bitcoin/chainparams.o $(PLUGIN_chanbackup_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2022-06-24 03:29:36 +02:00
|
|
|
|
2022-07-16 15:18:21 +02:00
|
|
|
plugins/commando: $(PLUGIN_COMMANDO_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) bitcoin/chainparams.o
|
|
|
|
|
2021-06-14 23:07:38 +02:00
|
|
|
# Topology wants to decode node_announcement, and peer_wiregen which
|
|
|
|
# pulls in some of bitcoin/.
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/topology: common/route.o common/dijkstra.o common/gossmap.o common/fp16.o bitcoin/chainparams.o wire/peer$(EXP)_wiregen.o wire/channel_type_wiregen.o bitcoin/block.o bitcoin/preimage.o $(PLUGIN_TOPOLOGY_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2021-06-14 23:07:38 +02:00
|
|
|
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/txprepare: bitcoin/chainparams.o $(PLUGIN_TXPREPARE_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2020-08-28 04:31:57 +02:00
|
|
|
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/bcli: bitcoin/chainparams.o $(PLUGIN_BCLI_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2020-01-02 21:04:03 +01:00
|
|
|
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/keysend: bitcoin/chainparams.o wire/tlvstream.o wire/onion$(EXP)_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
|
2020-08-05 16:01:20 +02:00
|
|
|
$(PLUGIN_KEYSEND_OBJS): $(PLUGIN_PAY_LIB_HEADER)
|
2020-03-27 14:31:00 +01:00
|
|
|
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/spenderp: bitcoin/block.o bitcoin/chainparams.o bitcoin/preimage.o bitcoin/psbt.o common/psbt_open.o wire/peer${EXP}_wiregen.o $(PLUGIN_SPENDER_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2020-09-09 12:25:20 +02:00
|
|
|
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/offers: bitcoin/chainparams.o $(PLUGIN_OFFERS_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) common/bolt12.o common/bolt12_merkle.o common/bolt11_json.o common/iso4217.o $(WIRE_OBJS) bitcoin/block.o common/channel_id.o bitcoin/preimage.o $(JSMN_OBJS)
|
2020-12-16 04:13:23 +01:00
|
|
|
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/fetchinvoice: bitcoin/chainparams.o $(PLUGIN_FETCHINVOICE_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) common/bolt12.o common/bolt12_merkle.o common/iso4217.o $(WIRE_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
|
2020-12-16 04:18:00 +01:00
|
|
|
|
2022-07-16 06:55:09 +02:00
|
|
|
plugins/funder: bitcoin/chainparams.o bitcoin/psbt.o common/psbt_open.o $(PLUGIN_FUNDER_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
|
2021-04-23 00:51:22 +02:00
|
|
|
|
2020-09-24 03:32:54 +02:00
|
|
|
# Generated from PLUGINS definition in plugins/Makefile
|
2020-10-22 01:51:08 +02:00
|
|
|
ALL_C_HEADERS += plugins/list_of_builtin_plugins_gen.h
|
|
|
|
plugins/list_of_builtin_plugins_gen.h: plugins/Makefile Makefile
|
2020-09-24 03:32:54 +02:00
|
|
|
@$(call VERBOSE,GEN $@,echo "static const char *list_of_builtin_plugins[] = { $(foreach d,$(notdir $(PLUGINS)),\"$d\",) NULL };" > $@)
|
2021-04-23 00:53:28 +02:00
|
|
|
|
2022-01-17 12:59:09 +01:00
|
|
|
CLN_PLUGIN_EXAMPLES := target/${RUST_PROFILE}/examples/cln-plugin-startup
|
|
|
|
CLN_PLUGIN_SRC = $(shell find plugins/src -name "*.rs")
|
|
|
|
|
|
|
|
${CLN_PLUGIN_EXAMPLES}: ${CLN_PLUGIN_SRC}
|
|
|
|
(cd plugins; cargo build ${CARGO_OPTS} --examples)
|
|
|
|
|
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 08:25:55 +02:00
|
|
|
ifneq ($(RUST),0)
|
|
|
|
DEFAULT_TARGETS += $(CLN_PLUGIN_EXAMPLES) plugins/cln-grpc
|
|
|
|
endif
|
|
|
|
|
2021-04-23 00:53:28 +02:00
|
|
|
include plugins/test/Makefile
|