Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/bsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
git clone https://github.com/lightning/bolts.git ../bolts
# fatal: unsafe repository ('/Users/runner/work/lightning/lightning' is owned by someone else)
git config --global --add safe.directory `pwd`
for d in libsodium libwally-core gheap jsmn libbacktrace lowdown; do git config --global --add safe.directory `pwd`/external/$d; done
for d in libwally-core gheap jsmn libbacktrace; do git config --global --add safe.directory `pwd`/external/$d; done
git submodule update --init --recursive

./configure CC="$CC" --disable-valgrind
Expand Down
7 changes: 0 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "daemon/jsmn"]
path = external/jsmn
url = https://github.com/zserge/jsmn
[submodule "libsodium"]
path = external/libsodium
url = https://github.com/jedisct1/libsodium.git
[submodule "external/libbacktrace"]
path = external/libbacktrace
url = https://github.com/ianlancetaylor/libbacktrace.git
Expand All @@ -14,7 +11,3 @@
[submodule "external/gheap"]
path = external/gheap
url = https://github.com/valyala/gheap
[submodule "external/lowdown"]
path = external/lowdown
url = https://github.com/kristapsdz/lowdown.git
ignore = dirty
12 changes: 4 additions & 8 deletions Cargo.lock

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

10 changes: 0 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ RUN mkdir /opt/bitcoin && cd /opt/bitcoin \
&& tar -xzvf $BITCOIN_TARBALL $BD/ --strip-components=1 \
&& rm $BITCOIN_TARBALL

ENV LITECOIN_VERSION 0.16.3
ENV LITECOIN_URL https://download.litecoin.org/litecoin-${LITECOIN_VERSION}/linux/litecoin-${LITECOIN_VERSION}-${TARBALL_ARCH_FINAL}.tar.gz

# install litecoin binaries
RUN mkdir /opt/litecoin && cd /opt/litecoin \
&& wget -qO litecoin.tar.gz "$LITECOIN_URL" \
&& tar -xzvf litecoin.tar.gz litecoin-$LITECOIN_VERSION/bin/litecoin-cli --strip-components=1 --exclude=*-qt \
&& rm litecoin.tar.gz

FROM --platform=${DEFAULT_TARGETPLATFORM} ${BASE_DISTRO} AS base-builder
RUN apt-get update -qq && \
apt-get install -qq -y --no-install-recommends \
Expand Down Expand Up @@ -264,7 +255,6 @@ RUN --mount=type=bind,from=builder,source=/var/libpq,target=/var/libpq,rw \
COPY --from=builder /tmp/lightning_install/ /usr/local/
COPY --from=builder-python /root/.venvs/cln/lib/python3.11/site-packages /usr/local/lib/python3.11/dist-packages/
COPY --from=downloader /opt/bitcoin/bin /usr/bin
COPY --from=downloader /opt/litecoin/bin /usr/bin
COPY tools/docker-entrypoint.sh entrypoint.sh

EXPOSE 9735 9835
Expand Down
52 changes: 0 additions & 52 deletions bitcoin/chainparams.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,58 +163,6 @@ const struct chainparams networks[] = {
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC,
.bip32_privkey_version = BIP32_VER_TEST_PRIVATE},
.is_elements = false},
{.network_name = "litecoin",
.onchain_hrp = "ltc",
.lightning_hrp = "ltc",
.bip70_name = "main",
.genesis_blockhash = {{{.u.u8 = {0xe2, 0xbf, 0x04, 0x7e, 0x7e, 0x5a, 0x19,
0x1a, 0xa4, 0xef, 0x34, 0xd3, 0x14, 0x97,
0x9d, 0xc9, 0x98, 0x6e, 0x0f, 0x19, 0x25,
0x1e, 0xda, 0xba, 0x59, 0x40, 0xfd, 0x1f,
0xe3, 0x65, 0xa7, 0x12}}}},
.rpc_port = 9332,
.ln_port = 9735,
.cli = "litecoin-cli",
.cli_args = NULL,
.cli_min_supported_version = 150000,
.dust_limit = { 100000 },
.max_funding = AMOUNT_SAT_INIT(60 * ((1 << 24) - 1)),
.max_payment = AMOUNT_MSAT_INIT(60 * 0xFFFFFFFFULL),
.max_supply = AMOUNT_SAT_INIT(2100000000000000),
.when_lightning_became_cool = 1320000,
.p2pkh_version = 48,
.p2sh_version = 50,
.testnet = false,
.fee_asset_tag = NULL,
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_MAIN_PUBLIC,
.bip32_privkey_version = BIP32_VER_MAIN_PRIVATE},
.is_elements = false},
{.network_name = "litecoin-testnet",
.onchain_hrp = "tltc",
.lightning_hrp = "tltc",
.bip70_name = "test",
.genesis_blockhash = {{{.u.u8 = {0xa0, 0x29, 0x3e, 0x4e, 0xeb, 0x3d, 0xa6,
0xe6, 0xf5, 0x6f, 0x81, 0xed, 0x59, 0x5f,
0x57, 0x88, 0x0d, 0x1a, 0x21, 0x56, 0x9e,
0x13, 0xee, 0xfd, 0xd9, 0x51, 0x28, 0x4b,
0x5a, 0x62, 0x66, 0x49}}}},
.rpc_port = 19332,
.ln_port = 9735,
.cli = "litecoin-cli",
.cli_args = "-testnet",
.cli_min_supported_version = 150000,
.dust_limit = { 100000 },
.max_funding = AMOUNT_SAT_INIT(60 * ((1 << 24) - 1)),
.max_payment = AMOUNT_MSAT_INIT(60 * 0xFFFFFFFFULL),
.max_supply = AMOUNT_SAT_INIT(2100000000000000),
.when_lightning_became_cool = 1,
.p2pkh_version = 111,
.p2sh_version = 58,
.testnet = true,
.fee_asset_tag = NULL,
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC,
.bip32_privkey_version = BIP32_VER_TEST_PRIVATE},
.is_elements = false},
{.network_name = "liquid-regtest",
.onchain_hrp = "ert",
.lightning_hrp = "ert",
Expand Down
2 changes: 1 addition & 1 deletion common/configdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ struct configvar **initial_config_opts(const tal_t *ctx,
opt_register_early_arg("--network", opt_set_network, opt_show_network,
NULL,
"Select the network parameters (bitcoin, testnet,"
" signet, regtest, litecoin or litecoin-testnet)");
" signet, or regtest)");
opt_register_early_noarg("--testnet",
opt_set_specific_network, "testnet",
"Alias for --network=testnet");
Expand Down
13 changes: 8 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,9 @@ else
HAVE_PYTHON3_MAKO=0
fi

if check_command 'lowdown' lowdown; then
HAVE_LOWDOWN=1
else
HAVE_LOWDOWN=0
if ! check_command 'lowdown' lowdown; then
echo "*** We need lowdown!" >&2
exit 1
fi

if echo | check_command sha256sum sha256sum; then
Expand Down Expand Up @@ -572,7 +571,6 @@ add_var ASAN "$ASAN"
add_var UBSAN "$UBSAN"
add_var TEST_NETWORK "$TEST_NETWORK"
add_var HAVE_PYTHON3_MAKO "$HAVE_PYTHON3_MAKO"
add_var HAVE_LOWDOWN "$HAVE_LOWDOWN"
add_var SHA256SUM "$SHA256SUM"
add_var FUZZING "$FUZZING"
add_var RUST "$RUST"
Expand All @@ -587,6 +585,11 @@ while IFS='=' read VAR VAL; do
eval $VAR=\"$VAL\"
done < $CONFIG_VAR_FILE.$$

if [ "$HAVE_GOOD_LIBSODIUM" != 1 ]; then
echo "*** We need a libsodium >= 1.0.4 (released 2015-06-11)." >&2
exit 1
fi

if [ "$HAVE_SQLITE3" = 0 -a "$HAVE_POSTGRES" = 0 ]; then
# I have no database yet I must schema!)
echo "*** We need a database, but neither sqlite3 nor postgres found" >&2
Expand Down
3 changes: 1 addition & 2 deletions devtools/gossipwith.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,7 @@ int main(int argc, char *argv[])
opt_register_arg("--network", opt_set_network, opt_show_network,
NULL,
"Select the network parameters (bitcoin, testnet, signet,"
" regtest, liquid, liquid-regtest, litecoin or"
" litecoin-testnet)");
" regtest, liquid, or liquid-regtest)");
opt_register_noarg("--must-get-max-messages", opt_set_bool, &no_early_close,
"Fail with exit code 1 unless we reach maximum messages");
opt_register_noarg("--help|-h", opt_usage_and_exit,
Expand Down
9 changes: 0 additions & 9 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,7 @@ RBRACKET=)
$(MARKDOWNPAGES_WITH_EXT): doc/%.7.md: doc/schemas/%.json tools/fromschema.py
@tools/fromschema.py --markdownfile=$@ $< > [email protected] && mv [email protected] $@

# If we need to build lowdown, make tools/md2man.sh depend on it.
# That way it's not used in SHA256STAMP (which only uses direct
# dependencies), but make will be forced to build it.
ifeq ($(HAVE_LOWDOWN),0)
LOWDOWN := $(TARGET_DIR)/lowdown-build/bin/lowdown
tools/md2man.sh: $(LOWDOWN)
touch $@
else
LOWDOWN := lowdown
endif

# For versions in documentation, we don't change with every git version, to
# save build time. We build them on new tags or keep them on pre-next-release version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Here's a list of parts, with notes:

- external/ - external libraries from other sources
- libbacktrace - library to provide backtraces when things go wrong.
- libsodium - encryption library (should be replaced soon with built-in)
- libwally-core - bitcoin helper library
- secp256k1 - bitcoin curve encryption library within libwally-core
- jsmn - tiny JSON parsing helper
Expand Down
2 changes: 0 additions & 2 deletions doc/getting-started/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ sudo apt-get install -y valgrind libpq-dev shellcheck cppcheck \
libsecp256k1-dev lowdown
```

If you can't install `lowdown`, a version will be built in-tree.

If you want to build the Rust plugins (cln-grpc, clnrest, cln-bip353 and wss-proxy):

```shell
Expand Down
2 changes: 1 addition & 1 deletion doc/lightning-reckless.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Available option flags:
request additional debug output

**--network**=*network*
specify bitcoin, regtest, liquid, liquid-regtest, litecoin, signet,
specify bitcoin, regtest, liquid, liquid-regtest, signet,
or testnet networks. (default: bitcoin)

NOTES
Expand Down
34 changes: 1 addition & 33 deletions external/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
SUBMODULES = \
external/libsodium \
external/libwally-core \
external/gheap \
external/jsmn \
external/libbacktrace

ifeq ($(HAVE_LOWDOWN),0)
SUBMODULES += external/lowdown
endif

TOP := ../..
ifdef BUILD
CROSSCOMPILE_OPTS := --host="$(MAKE_HOST)" --build="$(BUILD)"
Expand All @@ -17,7 +12,6 @@ else
TARGET_DIR := external/build-$(shell ${CC} -dumpmachine)
endif

LIBSODIUM_HEADERS := external/libsodium/src/libsodium/include/sodium.h
LIBWALLY_HEADERS := external/libwally-core/include/wally_bip32.h \
external/libwally-core/include/wally_core.h \
external/libwally-core/include/wally_psbt.h \
Expand All @@ -29,13 +23,9 @@ JSMN_HEADERS := external/jsmn/jsmn.h
GHEAP_HEADERS := external/gheap/gheap.h
LIBBACKTRACE_HEADERS := external/libbacktrace/backtrace.h

EXTERNAL_HEADERS := $(LIBSODIUM_HEADERS) $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS) $(JSMN_HEADERS) $(GHEAP_HEADERS) $(LIBBACKTRACE_HEADERS)
EXTERNAL_HEADERS := $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS) $(JSMN_HEADERS) $(GHEAP_HEADERS) $(LIBBACKTRACE_HEADERS)
EXTERNAL_LIBS := ${TARGET_DIR}/libwallycore.a ${TARGET_DIR}/libsecp256k1.a ${TARGET_DIR}/libjsmn.a ${TARGET_DIR}/libbacktrace.a

ifeq ($(HAVE_LOWDOWN),0)
EXTERNAL_HEADERS += external/lowdown/lowdown.h
endif

EXTERNAL_INCLUDE_FLAGS := \
-I external/libwally-core/include/ \
-I external/libwally-core/src/secp256k1/include/ \
Expand All @@ -44,14 +34,7 @@ EXTERNAL_INCLUDE_FLAGS := \
-I external/gheap/ \
-I ${TARGET_DIR}/libbacktrace-build

ifneq ($(HAVE_GOOD_LIBSODIUM),1)
EXTERNAL_INCLUDE_FLAGS += -I external/libsodium/src/libsodium/include \
-I external/libsodium/src/libsodium/include/sodium \
-I $(TARGET_DIR)/libsodium-build/src/libsodium/include
EXTERNAL_LIBS += ${TARGET_DIR}/libsodium.a
else
LDLIBS += $(SODIUM_LDLIBS)
endif

ifeq ($(HAVE_ZLIB),1)
LDLIBS += -lz
Expand All @@ -67,15 +50,6 @@ endif

$(EXTERNAL_HEADERS): submodcheck

# We build libsodium, since Ubuntu xenial has one too old.
$(TARGET_DIR)/libsodium.a: $(TARGET_DIR)/libsodium-build/src/libsodium/libsodium.la
$(MAKE) -C $(TARGET_DIR)/libsodium-build DESTDIR=$$(pwd)/$(TARGET_DIR) install-exec

$(TARGET_DIR)/libsodium-build/src/libsodium/libsodium.la: external/libsodium/src/libsodium/include/sodium.h
cd external/libsodium && ./autogen.sh
mkdir -p ${TARGET_DIR}/libsodium-build
cd $(TARGET_DIR)/libsodium-build && $(TOP)/libsodium/configure CC="$(CC)" CFLAGS="$(FUZZFLAGS)" LDFLAGS="$(FUZZFLAGS)" --enable-static=yes $(CROSSCOMPILE_OPTS) --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)

# libsecp included in libwally.
# Wildcards here are magic. See http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file
$(TARGET_DIR)/libsecp256k1.% $(TARGET_DIR)/libwallycore.%: $(TARGET_DIR)/libwally-core-build/src/secp256k1/libsecp256k1.la $(TARGET_DIR)/libwally-core-build/src/libwallycore.la
Expand Down Expand Up @@ -117,10 +91,6 @@ $(TARGET_DIR)/libbacktrace.a: external/libbacktrace/backtrace.h
cd $(TARGET_DIR)/libbacktrace-build && $(TOP)/libbacktrace/configure CC="$(CC)" --enable-static=yes $(CROSSCOMPILE_OPTS) --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)
$(MAKE) -C $(TARGET_DIR)/libbacktrace-build DESTDIR=$$(pwd)/$(TARGET_DIR) install-exec

$(TARGET_DIR)/lowdown-build/bin/lowdown: external/lowdown/lowdown.h
cd external/lowdown && CC="$(CC)" CFLAGS="$(FUZZFLAGS)" ./configure LDFLAGS="$(FUZZFLAGS)" PREFIX=`pwd`/$(TOP)/$(TARGET_DIR)/lowdown-build/
$(MAKE) -C external/lowdown install

distclean: external-distclean
clean: external-clean

Expand All @@ -129,7 +99,5 @@ external-clean:
$(RM) -rf $(TARGET_DIR)

external-distclean:
make -C external/libsodium distclean || true
if [ -f external/lowdown/Makefile.configure ]; then $(MAKE) -C external/lowdown distclean; fi
$(RM) -rf ${TARGET_DIR}/libbacktrace-build ${TARGET_DIR}/libsodium-build ${TARGET_DIR}/libwally-core-build ${TARGET_DIR}/jsmn-build
$(RM) -r `git status --ignored --porcelain external/libwally-core | grep '^!! ' | cut -c3-`
3 changes: 1 addition & 2 deletions hsmd/libhsmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2347,8 +2347,7 @@ u8 *hsmd_init(struct secret hsm_secret, const u64 hsmd_version,

/* Fill in the BIP32 tree for bitcoin addresses. */
/* In libwally-core, the version BIP32_VER_TEST_PRIVATE is for testnet/regtest,
* and BIP32_VER_MAIN_PRIVATE is for mainnet. For litecoin, we also set it like
* bitcoin else.*/
* and BIP32_VER_MAIN_PRIVATE is for mainnet. */
do {
hkdf_sha256(bip32_seed, sizeof(bip32_seed),
&salt, sizeof(salt),
Expand Down
4 changes: 2 additions & 2 deletions plugins/rest-plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ rcgen = "0.13"
hyper = "1"
tower= "0.5"
tower-http = { version = "0.6", features = ["cors", "set-header"] }
utoipa = { version = "5", features = ['axum_extras'] }
utoipa = { git = "https://github.com/rustyrussell/utoipa.git", features = ['axum_extras'] }

log-panics = "2"
socketioxide = "0.15"

cln-plugin = { version = "0.5", path = "../../plugins" }
cln-rpc = { version = "0.5", path = "../../cln-rpc" }
utoipa-swagger-ui = { version = "9.0.0", features = ["vendored", "axum"] }
utoipa-swagger-ui = { git = "https://github.com/rustyrussell/utoipa.git", features = ["vendored", "axum"] }

3 changes: 0 additions & 3 deletions tools/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@ echo "Current Timestamp: $DATE"
mkdir -p "$RELEASEDIR"

if [ "$WITHOUT_ZIP" = "false" ]; then
# submodcheck needs to know if we have lowdown
touch config.vars
./configure --reconfigure
# If it's a completely clean directory, we need submodules!
make submodcheck

Expand Down
2 changes: 1 addition & 1 deletion tools/reckless
Original file line number Diff line number Diff line change
Expand Up @@ -2033,7 +2033,7 @@ if __name__ == '__main__':

NETWORK = 'regtest' if args.regtest else 'bitcoin'
SUPPORTED_NETWORKS = ['bitcoin', 'regtest', 'liquid', 'liquid-regtest',
'litecoin', 'signet', 'testnet', 'testnet4']
'signet', 'testnet', 'testnet4']
if args.version:
report_version()
elif args.cmd1 is None:
Expand Down
Loading