mirror of
https://github.com/aljazceru/btcpayserver-docker.git
synced 2025-12-18 20:34:20 +01:00
Add LND support
This commit is contained in:
@@ -23,7 +23,7 @@ services:
|
|||||||
- bitcoind
|
- bitcoind
|
||||||
btcpayserver:
|
btcpayserver:
|
||||||
environment:
|
environment:
|
||||||
BTCPAY_BTCLIGHTNING: "/etc/clightning_bitcoin/lightning-rpc"
|
BTCPAY_BTCLIGHTNING: "type=clightning;server=unix://etc/clightning_bitcoin/lightning-rpc"
|
||||||
volumes:
|
volumes:
|
||||||
- "clightning_bitcoin_datadir:/etc/clightning_bitcoin"
|
- "clightning_bitcoin_datadir:/etc/clightning_bitcoin"
|
||||||
links:
|
links:
|
||||||
|
|||||||
49
docker-compose-generator/docker-fragments/bitcoin-lnd.yml
Normal file
49
docker-compose-generator/docker-fragments/bitcoin-lnd.yml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
lnd_bitcoin:
|
||||||
|
image: btcpayserver/lnd:0.4.2.0
|
||||||
|
container_name: btcpayserver_lnd_bitcoin
|
||||||
|
environment:
|
||||||
|
LND_CHAIN: "btc"
|
||||||
|
LND_ENVIRONMENT: "${NBITCOIN_NETWORK:-regtest}"
|
||||||
|
LND_EXTRA_ARGS: |
|
||||||
|
restlisten=0.0.0.0:8080
|
||||||
|
bitcoin.node=bitcoind
|
||||||
|
bitcoind.rpchost=bitcoind:43782
|
||||||
|
bitcoind.zmqpath=tcp://bitcoind:28332
|
||||||
|
externalip=${BTCPAY_HOST}:9735
|
||||||
|
alias=${LIGHTNING_ALIAS}
|
||||||
|
noencryptwallet=1
|
||||||
|
notls=1
|
||||||
|
ports:
|
||||||
|
- "9735:9735"
|
||||||
|
expose:
|
||||||
|
- "8080"
|
||||||
|
- "9735"
|
||||||
|
volumes:
|
||||||
|
- "lnd_bitcoin_datadir:/data"
|
||||||
|
- "bitcoin_datadir:/deps/.bitcoin"
|
||||||
|
links:
|
||||||
|
- bitcoind
|
||||||
|
|
||||||
|
btcpayserver:
|
||||||
|
environment:
|
||||||
|
BTCPAY_BTCLIGHTNING: "type=lnd-rest;server=http://lnd_bitcoin:8080/;macaroonfilepath=/etc/lnd_bitcoin/admin.macaroon;allowinsecure=true"
|
||||||
|
volumes:
|
||||||
|
- "lnd_bitcoin_datadir:/etc/lnd_bitcoin"
|
||||||
|
links:
|
||||||
|
- lnd_bitcoin
|
||||||
|
|
||||||
|
bitcoind:
|
||||||
|
environment:
|
||||||
|
BITCOIN_EXTRA_ARGS: |
|
||||||
|
zmqpubrawtx=tcp://0.0.0.0:28332
|
||||||
|
zmqpubrawblock=tcp://0.0.0.0:28332
|
||||||
|
zmqpubrawtxlock=tcp://0.0.0.0:28332
|
||||||
|
zmqpubhashblock=tcp://0.0.0.0:28332
|
||||||
|
expose:
|
||||||
|
- "28332"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
lnd_bitcoin_datadir:
|
||||||
@@ -4,7 +4,7 @@ services:
|
|||||||
|
|
||||||
btcpayserver:
|
btcpayserver:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: nicolasdorier/btcpayserver:1.0.2.39
|
image: nicolasdorier/btcpayserver:1.0.2.40
|
||||||
expose:
|
expose:
|
||||||
- "49392"
|
- "49392"
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ services:
|
|||||||
- litecoind
|
- litecoind
|
||||||
btcpayserver:
|
btcpayserver:
|
||||||
environment:
|
environment:
|
||||||
BTCPAY_LTCLIGHTNING: "/etc/clightning_litecoin/lightning-rpc"
|
BTCPAY_LTCLIGHTNING: "type=clightning;server=unix://etc/clightning_litecoin/lightning-rpc"
|
||||||
volumes:
|
volumes:
|
||||||
- "clightning_litecoin_datadir:/etc/clightning_litecoin"
|
- "clightning_litecoin_datadir:/etc/clightning_litecoin"
|
||||||
links:
|
links:
|
||||||
|
|||||||
49
docker-compose-generator/docker-fragments/litecoin-lnd.yml
Normal file
49
docker-compose-generator/docker-fragments/litecoin-lnd.yml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
lnd_litecoin:
|
||||||
|
image: btcpayserver/lnd:0.4.2.0
|
||||||
|
container_name: btcpayserver_lnd_litecoin
|
||||||
|
environment:
|
||||||
|
LND_CHAIN: "ltc"
|
||||||
|
LND_ENVIRONMENT: "${NBITCOIN_NETWORK:-regtest}"
|
||||||
|
LND_EXTRA_ARGS: |
|
||||||
|
restlisten=0.0.0.0:8080
|
||||||
|
litecoin.node=litecoind
|
||||||
|
litecoind.rpchost=litecoind:43782
|
||||||
|
litecoind.zmqpath=tcp://litecoind:28332
|
||||||
|
externalip=${BTCPAY_HOST}:9736
|
||||||
|
alias=${LIGHTNING_ALIAS}
|
||||||
|
noencryptwallet=1
|
||||||
|
notls=1
|
||||||
|
ports:
|
||||||
|
- "9736:9735"
|
||||||
|
expose:
|
||||||
|
- "8080"
|
||||||
|
- "9736"
|
||||||
|
volumes:
|
||||||
|
- "lnd_litecoin_datadir:/data"
|
||||||
|
- "litecoin_datadir:/deps/.litecoin"
|
||||||
|
links:
|
||||||
|
- litecoind
|
||||||
|
|
||||||
|
btcpayserver:
|
||||||
|
environment:
|
||||||
|
BTCPAY_LTCLIGHTNING: "type=lnd-rest;server=http://lnd_litecoin:8080/;macaroonfilepath=/etc/lnd_litecoin/admin.macaroon;allowinsecure=true"
|
||||||
|
volumes:
|
||||||
|
- "lnd_litecoin_datadir:/etc/lnd_litecoin"
|
||||||
|
links:
|
||||||
|
- lnd_litecoin
|
||||||
|
|
||||||
|
litecoind:
|
||||||
|
environment:
|
||||||
|
BITCOIN_EXTRA_ARGS: |
|
||||||
|
zmqpubrawtx=tcp://0.0.0.0:28332
|
||||||
|
zmqpubrawblock=tcp://0.0.0.0:28332
|
||||||
|
zmqpubrawtxlock=tcp://0.0.0.0:28332
|
||||||
|
zmqpubhashblock=tcp://0.0.0.0:28332
|
||||||
|
expose:
|
||||||
|
- "28332"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
lnd_litecoin_datadir:
|
||||||
@@ -21,6 +21,11 @@ namespace DockerGenerator
|
|||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
public string LNDFragment
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
public static CryptoDefinition[] GetDefinitions()
|
public static CryptoDefinition[] GetDefinitions()
|
||||||
{
|
{
|
||||||
@@ -31,30 +36,29 @@ namespace DockerGenerator
|
|||||||
Crypto = "ltc",
|
Crypto = "ltc",
|
||||||
CryptoFragment = "litecoin",
|
CryptoFragment = "litecoin",
|
||||||
CLightningFragment = "litecoin-clightning",
|
CLightningFragment = "litecoin-clightning",
|
||||||
|
LNDFragment = "litecoin-lnd"
|
||||||
},
|
},
|
||||||
new CryptoDefinition()
|
new CryptoDefinition()
|
||||||
{
|
{
|
||||||
Crypto = "btc",
|
Crypto = "btc",
|
||||||
CryptoFragment = "bitcoin",
|
CryptoFragment = "bitcoin",
|
||||||
CLightningFragment = "bitcoin-clightning",
|
CLightningFragment = "bitcoin-clightning",
|
||||||
|
LNDFragment = "bitcoin-lnd"
|
||||||
},
|
},
|
||||||
new CryptoDefinition()
|
new CryptoDefinition()
|
||||||
{
|
{
|
||||||
Crypto = "btg",
|
Crypto = "btg",
|
||||||
CryptoFragment = "bgold",
|
CryptoFragment = "bgold"
|
||||||
CLightningFragment = null,
|
|
||||||
},
|
},
|
||||||
new CryptoDefinition()
|
new CryptoDefinition()
|
||||||
{
|
{
|
||||||
Crypto = "ftc",
|
Crypto = "ftc",
|
||||||
CryptoFragment = "feathercoin",
|
CryptoFragment = "feathercoin"
|
||||||
CLightningFragment = null,
|
|
||||||
},
|
},
|
||||||
new CryptoDefinition()
|
new CryptoDefinition()
|
||||||
{
|
{
|
||||||
Crypto = "grs",
|
Crypto = "grs",
|
||||||
CryptoFragment = "groestlcoin",
|
CryptoFragment = "groestlcoin"
|
||||||
CLightningFragment = null,
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,10 +101,18 @@ namespace DockerGenerator
|
|||||||
if(mainChildMapping.Children.TryGetValue(leaf.Key, out var mainLeaf))
|
if(mainChildMapping.Children.TryGetValue(leaf.Key, out var mainLeaf))
|
||||||
{
|
{
|
||||||
if(leaf.Value is YamlScalarNode leafScalar && mainLeaf is YamlScalarNode leafMainScalar)
|
if(leaf.Value is YamlScalarNode leafScalar && mainLeaf is YamlScalarNode leafMainScalar)
|
||||||
|
{
|
||||||
|
var eof = EOF(leafMainScalar.Value) ?? EOF(leaf.Value.ToString());
|
||||||
|
if(eof != null)
|
||||||
|
{
|
||||||
|
leafMainScalar.Value = leafMainScalar.Value + eof + leaf.Value;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
leafMainScalar.Value = leafMainScalar.Value + "," + leaf.Value;
|
leafMainScalar.Value = leafMainScalar.Value + "," + leaf.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mainChildMapping.Add(leaf.Key, leaf.Value);
|
mainChildMapping.Add(leaf.Key, leaf.Value);
|
||||||
@@ -124,6 +132,15 @@ namespace DockerGenerator
|
|||||||
}).ToArray();
|
}).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string EOF(string value)
|
||||||
|
{
|
||||||
|
if(value.Contains("\r\n", StringComparison.OrdinalIgnoreCase))
|
||||||
|
return "\r\n";
|
||||||
|
if(value.Contains("\n", StringComparison.OrdinalIgnoreCase))
|
||||||
|
return "\n";
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private YamlMappingNode ParseDocument(string fragment)
|
private YamlMappingNode ParseDocument(string fragment)
|
||||||
{
|
{
|
||||||
var input = new StringReader(File.ReadAllText(Path.Combine(FragmentLocation, $"{fragment}.yml")));
|
var input = new StringReader(File.ReadAllText(Path.Combine(FragmentLocation, $"{fragment}.yml")));
|
||||||
|
|||||||
@@ -86,6 +86,10 @@ namespace DockerGenerator
|
|||||||
{
|
{
|
||||||
fragments.Add(crypto.CLightningFragment);
|
fragments.Add(crypto.CLightningFragment);
|
||||||
}
|
}
|
||||||
|
if(composition.SelectedLN == "lnd" && crypto.LNDFragment != null)
|
||||||
|
{
|
||||||
|
fragments.Add(crypto.LNDFragment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var def = new DockerComposeDefinition(name, fragments);
|
var def = new DockerComposeDefinition(name, fragments);
|
||||||
|
|||||||
Reference in New Issue
Block a user