Add Palladium testing infrastructure and local regtest setup

This commit finalizes the integration of Palladium Lightning with
the Palladium Core backend, making it trivial for developers to
spin up and test a local regtest network.

Key changes:
- Created [TESTING_PALLADIUM.md](cci:7://file:///home/davide/lightning-plm/TESTING_PALLADIUM.md:0:0-0:0) with comprehensive regtest instructions.
- Linked the new testing guide in the main [README.md](cci:7://file:///home/davide/lightning-plm/README.md:0:0-0:0).
- Ignored `/palladium-bin/` in `.gitignore` to allow developers to drop
  backend binaries locally without accidentally committing them.
- Patched `contrib/startup_regtest.sh` to automatically detect and use
  these local `palladiumd`/`palladium-cli` binaries if present, removing
  the strict need to manually export environment variables.
- Fixed a false-positive timeout error in `startup_regtest.sh` when
  parsing the absent `clnrest` plugin logs
This commit is contained in:
2026-02-20 14:10:53 +01:00
parent 8193fbce55
commit ee8dccdd4d
11 changed files with 435 additions and 127 deletions

View File

@@ -27,17 +27,17 @@ static u8 liquid_regtest_fee_asset[] = {
const struct chainparams networks[] = {
{.network_name = "bitcoin",
.onchain_hrp = "bc",
.lightning_hrp = "bc",
.onchain_hrp = "plm",
.lightning_hrp = "plm",
.bip70_name = "main",
.genesis_blockhash = {{{.u.u8 = {0x6f, 0xe2, 0x8c, 0x0a, 0xb6, 0xf1, 0xb3,
0x72, 0xc1, 0xa6, 0xa2, 0x46, 0xae, 0x63,
0xf7, 0x4f, 0x93, 0x1e, 0x83, 0x65, 0xe1,
0x5a, 0x08, 0x9c, 0x68, 0xd6, 0x19, 0x00,
0x00, 0x00, 0x00, 0x00}}}},
.rpc_port = 8332,
.rpc_port = 2332,
.ln_port = 9735,
.cli = "bitcoin-cli",
.cli = "palladium-cli",
.cli_args = NULL,
.cli_min_supported_version = 150000,
.dust_limit = { 546 },
@@ -52,7 +52,7 @@ const struct chainparams networks[] = {
.max_supply = AMOUNT_SAT_INIT(2100000000000000),
/* "Lightning Charge Powers Developers & Blockstream Store" */
.when_lightning_became_cool = 504500,
.p2pkh_version = 0,
.p2pkh_version = 55,
.p2sh_version = 5,
.testnet = false,
.fee_asset_tag = NULL,
@@ -60,17 +60,17 @@ const struct chainparams networks[] = {
.bip32_privkey_version = BIP32_VER_MAIN_PRIVATE},
.is_elements = false},
{.network_name = "regtest",
.onchain_hrp = "bcrt",
.lightning_hrp = "bcrt",
.onchain_hrp = "rplm",
.lightning_hrp = "rplm",
.bip70_name = "regtest",
.genesis_blockhash = {{{.u.u8 = {0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b,
0x59, 0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb,
0x5b, 0xbf, 0x28, 0xc3, 0x4f, 0x3a, 0x5e,
0x33, 0x2a, 0x1f, 0xc7, 0xb2, 0xb7, 0x3c,
0xf1, 0x88, 0x91, 0x0f}}}},
.rpc_port = 18443,
.rpc_port = 12443,
.ln_port = 19846,
.cli = "bitcoin-cli",
.cli = "palladium-cli",
.cli_args = "-regtest",
.cli_min_supported_version = 150000,
.dust_limit = { 546 },
@@ -78,16 +78,16 @@ const struct chainparams networks[] = {
.max_payment = AMOUNT_MSAT_INIT(0xFFFFFFFFULL),
.max_supply = AMOUNT_SAT_INIT(2100000000000000),
.when_lightning_became_cool = 1,
.p2pkh_version = 111,
.p2sh_version = 196,
.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 = "signet",
.onchain_hrp = "tb",
.lightning_hrp = "tbs",
.onchain_hrp = "tplm",
.lightning_hrp = "tsplm",
.bip70_name = "signet",
// 00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6
.genesis_blockhash = {{{.u.u8 = {0xf6, 0x1e, 0xee, 0x3b, 0x63, 0xa3, 0x80,
@@ -97,7 +97,7 @@ const struct chainparams networks[] = {
0x08, 0x00, 0x00, 0x00}}}},
.rpc_port = 38332,
.ln_port = 39735,
.cli = "bitcoin-cli",
.cli = "palladium-cli",
.cli_args = "-signet",
.cli_min_supported_version = 150000,
.dust_limit = { 546 },
@@ -105,40 +105,40 @@ const struct chainparams networks[] = {
.max_payment = AMOUNT_MSAT_INIT(0xFFFFFFFFULL),
.max_supply = AMOUNT_SAT_INIT(2100000000000000),
.when_lightning_became_cool = 1,
.p2pkh_version = 111,
.p2sh_version = 196,
.p2pkh_version = 127,
.p2sh_version = 115,
.testnet = true,
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_SIGT_PUBLIC, .bip32_privkey_version = BIP32_VER_SIGT_PRIVATE},
.is_elements = false,
},
{.network_name = "testnet",
.onchain_hrp = "tb",
.lightning_hrp = "tb",
.onchain_hrp = "tplm",
.lightning_hrp = "tplm",
.bip70_name = "test",
.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 = 18332,
.rpc_port = 12332,
.ln_port = 19735,
.cli = "bitcoin-cli",
.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),
.p2pkh_version = 111,
.p2sh_version = 196,
.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 = "testnet4",
.onchain_hrp = "tb",
.lightning_hrp = "tb",
.onchain_hrp = "tplm",
.lightning_hrp = "tplm",
.bip70_name = "testnet4",
// 00000000da84f2bafbbc53dee25a72ae507ff4914b867c565be350b0da8bf043
.genesis_blockhash = {{{.u.u8 = {0x43, 0xf0, 0x8b, 0xda, 0xb0, 0x50, 0xe3,
@@ -148,15 +148,15 @@ const struct chainparams networks[] = {
0x00, 0x00, 0x00, 0x00}}}},
.rpc_port = 48332,
.ln_port = 49735,
.cli = "bitcoin-cli",
.cli = "palladium-cli",
.cli_args = "-testnet4",
.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),
.p2pkh_version = 111,
.p2sh_version = 196,
.p2pkh_version = 127,
.p2sh_version = 115,
.testnet = true,
.fee_asset_tag = NULL,
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC,