Compare commits
2 Commits
37cc8b9cf9
...
11974a1169
| Author | SHA1 | Date | |
|---|---|---|---|
| 11974a1169 | |||
| 26f9698bad |
4
.env.example
Normal file
4
.env.example
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Copy this file to .env and fill in your palladiumd RPC credentials.
|
||||||
|
# The .env file is gitignored — never commit it.
|
||||||
|
PALLADIUM_RPCUSER=your_rpc_user
|
||||||
|
PALLADIUM_RPCPASSWORD=your_rpc_password
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -27,6 +27,9 @@ cli/lightning-cli
|
|||||||
# Custom local binaries for testing
|
# Custom local binaries for testing
|
||||||
/palladium-bin/
|
/palladium-bin/
|
||||||
|
|
||||||
|
# Local secrets — never commit
|
||||||
|
.env
|
||||||
|
|
||||||
coverage
|
coverage
|
||||||
# Coverage profiling data files
|
# Coverage profiling data files
|
||||||
*.profraw
|
*.profraw
|
||||||
@@ -34,6 +37,7 @@ coverage
|
|||||||
# Generated Python API documentation
|
# Generated Python API documentation
|
||||||
docs/python
|
docs/python
|
||||||
ccan/config.h
|
ccan/config.h
|
||||||
|
ccan/config.h.*
|
||||||
__pycache__
|
__pycache__
|
||||||
config.vars
|
config.vars
|
||||||
monkeytype.sqlite3
|
monkeytype.sqlite3
|
||||||
|
|||||||
98
Dockerfile.palladium-lightning
Normal file
98
Dockerfile.palladium-lightning
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
# syntax=docker/dockerfile:1.7-labs
|
||||||
|
# Palladium Lightning — production image (amd64, no cross-compilation, no Rust plugins)
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
|
# Stage 1: builder
|
||||||
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
|
FROM ubuntu:22.04 AS builder
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
build-essential \
|
||||||
|
ca-certificates \
|
||||||
|
gcc \
|
||||||
|
git \
|
||||||
|
gettext \
|
||||||
|
jq \
|
||||||
|
libffi-dev \
|
||||||
|
libicu-dev \
|
||||||
|
libprotobuf-c-dev \
|
||||||
|
libsodium-dev \
|
||||||
|
libsqlite3-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libtool \
|
||||||
|
pkg-config \
|
||||||
|
protobuf-compiler \
|
||||||
|
python3-dev \
|
||||||
|
zlib1g-dev && \
|
||||||
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /opt/lightningd
|
||||||
|
|
||||||
|
# Copy source (excluding .git, added back below for submodule init)
|
||||||
|
COPY --exclude=.git/ . .
|
||||||
|
COPY .git/ .git/
|
||||||
|
|
||||||
|
RUN git submodule update --init --recursive --depth 1 --jobs "$(nproc)"
|
||||||
|
|
||||||
|
RUN ./configure \
|
||||||
|
--prefix=/tmp/lightning_install \
|
||||||
|
--disable-valgrind \
|
||||||
|
--disable-compat
|
||||||
|
|
||||||
|
RUN make install-program -j"$(nproc)"
|
||||||
|
|
||||||
|
# Strip debug symbols to reduce image size
|
||||||
|
RUN find /tmp/lightning_install -type f -executable \
|
||||||
|
-exec sh -c 'file "$1" | grep -q ELF && strip --strip-unneeded "$1"' _ {} \;
|
||||||
|
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
|
# Stage 2: runtime
|
||||||
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
|
FROM ubuntu:22.04 AS lightningd
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
ca-certificates \
|
||||||
|
inotify-tools \
|
||||||
|
jq \
|
||||||
|
libffi8 \
|
||||||
|
libicu70 \
|
||||||
|
libsodium23 \
|
||||||
|
libsqlite3-0 \
|
||||||
|
socat && \
|
||||||
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# palladium-cli is needed by the bcli plugin to talk to palladiumd.
|
||||||
|
# Copy it from the already-built palladium-node image so we don't duplicate binaries.
|
||||||
|
# Build palladium-node:local first: docker compose -f docker-compose.yml build
|
||||||
|
COPY --from=palladium-node:local /usr/local/bin/palladium-cli /usr/local/bin/palladium-cli
|
||||||
|
|
||||||
|
# Lightning binaries and plugins
|
||||||
|
COPY --from=builder /tmp/lightning_install/ /usr/local/
|
||||||
|
|
||||||
|
COPY tools/docker-entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
ENV LIGHTNINGD_DATA=/root/.lightning
|
||||||
|
ENV LIGHTNINGD_NETWORK=palladium
|
||||||
|
ENV LIGHTNINGD_PORT=9735
|
||||||
|
ENV LIGHTNINGD_RPC_PORT=9835
|
||||||
|
ENV EXPOSE_TCP=false
|
||||||
|
|
||||||
|
EXPOSE 9735
|
||||||
|
|
||||||
|
VOLUME ["/root/.lightning"]
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
@@ -30,12 +30,22 @@ const struct chainparams networks[] = {
|
|||||||
.onchain_hrp = "plm",
|
.onchain_hrp = "plm",
|
||||||
.lightning_hrp = "plm",
|
.lightning_hrp = "plm",
|
||||||
.bip70_name = "main",
|
.bip70_name = "main",
|
||||||
|
/* genesis = 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
|
||||||
|
* (same as Bitcoin mainnet - Palladium kept the original genesis block)
|
||||||
|
*
|
||||||
|
* OPERATIONAL NOTES FOR PALLADIUM MAINNET:
|
||||||
|
* - Resilience Fork at block 340,000: block target changes from 10 min to 2 min.
|
||||||
|
* Operators should tune --cltv-expiry-delta and --cltv-final accordingly.
|
||||||
|
* Default cltv_expiry_delta=14 blocks ≈ 28 min (was 140 min on Bitcoin).
|
||||||
|
* - Taproot (BIP341) activates via BIP9 (bit 2), window opens Feb 14 2026.
|
||||||
|
* On regtest Taproot is ALWAYS_ACTIVE. Anchor/Taproot channels work
|
||||||
|
* on regtest immediately; on mainnet only after BIP9 lock-in. */
|
||||||
.genesis_blockhash = {{{.u.u8 = {0x6f, 0xe2, 0x8c, 0x0a, 0xb6, 0xf1, 0xb3,
|
.genesis_blockhash = {{{.u.u8 = {0x6f, 0xe2, 0x8c, 0x0a, 0xb6, 0xf1, 0xb3,
|
||||||
0x72, 0xc1, 0xa6, 0xa2, 0x46, 0xae, 0x63,
|
0x72, 0xc1, 0xa6, 0xa2, 0x46, 0xae, 0x63,
|
||||||
0xf7, 0x4f, 0x93, 0x1e, 0x83, 0x65, 0xe1,
|
0xf7, 0x4f, 0x93, 0x1e, 0x83, 0x65, 0xe1,
|
||||||
0x5a, 0x08, 0x9c, 0x68, 0xd6, 0x19, 0x00,
|
0x5a, 0x08, 0x9c, 0x68, 0xd6, 0x19, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00}}}},
|
0x00, 0x00, 0x00, 0x00}}}},
|
||||||
.rpc_port = 2333,
|
.rpc_port = 2332,
|
||||||
.ln_port = 9735,
|
.ln_port = 9735,
|
||||||
.cli = "palladium-cli",
|
.cli = "palladium-cli",
|
||||||
.cli_args = NULL,
|
.cli_args = NULL,
|
||||||
@@ -50,8 +60,7 @@ const struct chainparams networks[] = {
|
|||||||
.max_funding = AMOUNT_SAT_INIT((1 << 24) - 1),
|
.max_funding = AMOUNT_SAT_INIT((1 << 24) - 1),
|
||||||
.max_payment = AMOUNT_MSAT_INIT(0xFFFFFFFFULL),
|
.max_payment = AMOUNT_MSAT_INIT(0xFFFFFFFFULL),
|
||||||
.max_supply = AMOUNT_SAT_INIT(2100000000000000),
|
.max_supply = AMOUNT_SAT_INIT(2100000000000000),
|
||||||
/* "Lightning Charge Powers Developers & Blockstream Store" */
|
.when_lightning_became_cool = 1,
|
||||||
.when_lightning_became_cool = 504500,
|
|
||||||
.p2pkh_version = 55,
|
.p2pkh_version = 55,
|
||||||
.p2sh_version = 5,
|
.p2sh_version = 5,
|
||||||
.testnet = false,
|
.testnet = false,
|
||||||
@@ -59,6 +68,34 @@ const struct chainparams networks[] = {
|
|||||||
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_MAIN_PUBLIC,
|
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_MAIN_PUBLIC,
|
||||||
.bip32_privkey_version = BIP32_VER_MAIN_PRIVATE},
|
.bip32_privkey_version = BIP32_VER_MAIN_PRIVATE},
|
||||||
.is_elements = false},
|
.is_elements = false},
|
||||||
|
{.network_name = "testnet",
|
||||||
|
.onchain_hrp = "tplm",
|
||||||
|
.lightning_hrp = "tplm",
|
||||||
|
.bip70_name = "test",
|
||||||
|
/* genesis = 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
|
||||||
|
* (same as Bitcoin testnet - Palladium kept the original testnet genesis block) */
|
||||||
|
.genesis_blockhash = {{{.u.u8 = {0x43, 0x49, 0x7f, 0xd7, 0xf8, 0x26, 0x95,
|
||||||
|
0x71, 0x08, 0xf4, 0xa3, 0x0f, 0xd9, 0xce,
|
||||||
|
0xc3, 0xae, 0xba, 0x79, 0x97, 0x20, 0x84,
|
||||||
|
0xe9, 0x0e, 0xad, 0x01, 0xea, 0x33, 0x09,
|
||||||
|
0x00, 0x00, 0x00, 0x00}}}},
|
||||||
|
.rpc_port = 12332,
|
||||||
|
.ln_port = 19735,
|
||||||
|
.cli = "palladium-cli",
|
||||||
|
.cli_args = "-testnet",
|
||||||
|
.cli_min_supported_version = 150000,
|
||||||
|
.dust_limit = { 546 },
|
||||||
|
.max_funding = AMOUNT_SAT_INIT((1 << 24) - 1),
|
||||||
|
.max_payment = AMOUNT_MSAT_INIT(0xFFFFFFFFULL),
|
||||||
|
.max_supply = AMOUNT_SAT_INIT(2100000000000000),
|
||||||
|
.when_lightning_became_cool = 1,
|
||||||
|
.p2pkh_version = 127,
|
||||||
|
.p2sh_version = 115,
|
||||||
|
.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 = "regtest",
|
{.network_name = "regtest",
|
||||||
.onchain_hrp = "rplm",
|
.onchain_hrp = "rplm",
|
||||||
.lightning_hrp = "rplm",
|
.lightning_hrp = "rplm",
|
||||||
@@ -68,7 +105,7 @@ const struct chainparams networks[] = {
|
|||||||
0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e,
|
0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e,
|
||||||
0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c,
|
0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c,
|
||||||
0xf1, 0x88, 0x91, 0x0f}}}},
|
0xf1, 0x88, 0x91, 0x0f}}}},
|
||||||
.rpc_port = 28444,
|
.rpc_port = 12443,
|
||||||
.ln_port = 19846,
|
.ln_port = 19846,
|
||||||
.cli = "palladium-cli",
|
.cli = "palladium-cli",
|
||||||
.cli_args = "-regtest",
|
.cli_args = "-regtest",
|
||||||
|
|||||||
@@ -340,8 +340,8 @@ struct configvar **initial_config_opts(const tal_t *ctx,
|
|||||||
"Set base directory: network-specific subdirectory is under here");
|
"Set base directory: network-specific subdirectory is under here");
|
||||||
opt_register_early_arg("--network", opt_set_network, opt_show_network,
|
opt_register_early_arg("--network", opt_set_network, opt_show_network,
|
||||||
NULL,
|
NULL,
|
||||||
"Select the network parameters (bitcoin, testnet,"
|
"Select the network parameters (palladium, testnet,"
|
||||||
" signet, or regtest)");
|
" or regtest)");
|
||||||
opt_register_early_noarg("--testnet",
|
opt_register_early_noarg("--testnet",
|
||||||
opt_set_specific_network, "testnet",
|
opt_set_specific_network, "testnet",
|
||||||
"Alias for --network=testnet");
|
"Alias for --network=testnet");
|
||||||
@@ -353,7 +353,7 @@ struct configvar **initial_config_opts(const tal_t *ctx,
|
|||||||
"Alias for --network=signet");
|
"Alias for --network=signet");
|
||||||
opt_register_early_noarg("--mainnet",
|
opt_register_early_noarg("--mainnet",
|
||||||
opt_set_specific_network, "palladium",
|
opt_set_specific_network, "palladium",
|
||||||
"Alias for --network=bitcoin");
|
"Alias for --network=palladium");
|
||||||
opt_register_early_noarg("--regtest",
|
opt_register_early_noarg("--regtest",
|
||||||
opt_set_specific_network, "regtest",
|
opt_set_specific_network, "regtest",
|
||||||
"Alias for --network=regtest");
|
"Alias for --network=regtest");
|
||||||
|
|||||||
3
configure
vendored
3
configure
vendored
@@ -538,8 +538,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! check_command 'lowdown' lowdown; then
|
if ! check_command 'lowdown' lowdown; then
|
||||||
echo "*** We need lowdown!" >&2
|
echo "WARNING: lowdown not found, man page generation will be skipped." >&2
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if echo | check_command sha256sum sha256sum; then
|
if echo | check_command sha256sum sha256sum; then
|
||||||
|
|||||||
46
docker-compose.lightning.yml
Normal file
46
docker-compose.lightning.yml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# Palladium Lightning — docker-compose
|
||||||
|
#
|
||||||
|
# Joins the existing `palladium-net` network created by the palladiumd compose stack.
|
||||||
|
# The palladium-node:local image must be built before this one (palladium-cli is copied from it).
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# # 1. Create .env with RPC credentials (see .env.example)
|
||||||
|
# # 2. Ensure palladiumd is running on palladium-net
|
||||||
|
# docker compose -f docker-compose.lightning.yml build
|
||||||
|
# docker compose -f docker-compose.lightning.yml up -d
|
||||||
|
#
|
||||||
|
# # Check status
|
||||||
|
# docker logs palladium-lightning
|
||||||
|
# docker exec palladium-lightning lightning-cli --network=palladium getinfo
|
||||||
|
|
||||||
|
networks:
|
||||||
|
palladium-net:
|
||||||
|
external: true # created by the palladiumd compose stack
|
||||||
|
|
||||||
|
services:
|
||||||
|
palladium-lightning:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.palladium-lightning
|
||||||
|
image: palladium-lightning:local
|
||||||
|
container_name: palladium-lightning
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- palladium-net
|
||||||
|
ports:
|
||||||
|
- "0.0.0.0:9735:9735" # Lightning P2P — must be reachable from the internet
|
||||||
|
# RPC (9835) is NOT exposed on the host.
|
||||||
|
# Use: docker exec palladium-lightning lightning-cli --network=palladium <command>
|
||||||
|
volumes:
|
||||||
|
- ./.lightning:/root/.lightning
|
||||||
|
environment:
|
||||||
|
LIGHTNINGD_NETWORK: palladium
|
||||||
|
EXPOSE_TCP: "false"
|
||||||
|
command: >
|
||||||
|
--network=palladium
|
||||||
|
--palladium-rpcconnect=palladiumd
|
||||||
|
--palladium-rpcport=2332
|
||||||
|
--palladium-rpcuser=${PALLADIUM_RPCUSER}
|
||||||
|
--palladium-rpcpassword=${PALLADIUM_RPCPASSWORD}
|
||||||
|
--palladium-cli=/usr/local/bin/palladium-cli
|
||||||
|
--log-level=info
|
||||||
@@ -2654,7 +2654,7 @@ json_openchannel_bump(struct command *cmd,
|
|||||||
/* Ok, we're kosher to start. Delay if not synced yet. */
|
/* Ok, we're kosher to start. Delay if not synced yet. */
|
||||||
if (!topology_synced(cmd->ld->topology)) {
|
if (!topology_synced(cmd->ld->topology)) {
|
||||||
json_notify_fmt(cmd, LOG_UNUSUAL,
|
json_notify_fmt(cmd, LOG_UNUSUAL,
|
||||||
"Waiting to sync with bitcoind network (block %u of %u)",
|
"Waiting to sync with palladiumd network (block %u of %u)",
|
||||||
get_block_height(cmd->ld->topology),
|
get_block_height(cmd->ld->topology),
|
||||||
get_network_blockheight(cmd->ld->topology));
|
get_network_blockheight(cmd->ld->topology));
|
||||||
|
|
||||||
@@ -3287,7 +3287,7 @@ static struct command_result *json_openchannel_init(struct command *cmd,
|
|||||||
|
|
||||||
if (!topology_synced(cmd->ld->topology)) {
|
if (!topology_synced(cmd->ld->topology)) {
|
||||||
json_notify_fmt(cmd, LOG_UNUSUAL,
|
json_notify_fmt(cmd, LOG_UNUSUAL,
|
||||||
"Waiting to sync with bitcoind network (block %u of %u)",
|
"Waiting to sync with palladiumd network (block %u of %u)",
|
||||||
get_block_height(cmd->ld->topology),
|
get_block_height(cmd->ld->topology),
|
||||||
get_network_blockheight(cmd->ld->topology));
|
get_network_blockheight(cmd->ld->topology));
|
||||||
|
|
||||||
|
|||||||
@@ -1456,7 +1456,7 @@ static struct command_result *json_fundchannel_start(struct command *cmd,
|
|||||||
= tal(cmd, struct fundchannel_start_info);
|
= tal(cmd, struct fundchannel_start_info);
|
||||||
|
|
||||||
json_notify_fmt(cmd, LOG_UNUSUAL,
|
json_notify_fmt(cmd, LOG_UNUSUAL,
|
||||||
"Waiting to sync with bitcoind network (block %u of %u)",
|
"Waiting to sync with palladiumd network (block %u of %u)",
|
||||||
get_block_height(cmd->ld->topology),
|
get_block_height(cmd->ld->topology),
|
||||||
get_network_blockheight(cmd->ld->topology));
|
get_network_blockheight(cmd->ld->topology));
|
||||||
|
|
||||||
|
|||||||
@@ -720,7 +720,7 @@ const u8 *send_htlc_out(const tal_t *ctx,
|
|||||||
/* Note: we allow outgoing HTLCs before sync, for fast startup. */
|
/* Note: we allow outgoing HTLCs before sync, for fast startup. */
|
||||||
if (!topology_synced(out->peer->ld->topology)) {
|
if (!topology_synced(out->peer->ld->topology)) {
|
||||||
log_debug(out->log, "Sending HTLC while still syncing"
|
log_debug(out->log, "Sending HTLC while still syncing"
|
||||||
" with bitcoin network (%u vs %u)",
|
" with palladium network (%u vs %u)",
|
||||||
get_block_height(out->peer->ld->topology),
|
get_block_height(out->peer->ld->topology),
|
||||||
get_network_blockheight(out->peer->ld->topology));
|
get_network_blockheight(out->peer->ld->topology));
|
||||||
}
|
}
|
||||||
@@ -2409,7 +2409,7 @@ void peer_got_commitsig(struct channel *channel, const u8 *msg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we're not synced with bitcoin network, we can't accept
|
/* If we're not synced with palladium network, we can't accept
|
||||||
* any new HTLCs. We stall at this point, in the hope that it
|
* any new HTLCs. We stall at this point, in the hope that it
|
||||||
* won't take long! */
|
* won't take long! */
|
||||||
if (added && !topology_synced(ld->topology)) {
|
if (added && !topology_synced(ld->topology)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user