mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-22 22:33:46 +03:00
bitcoind: support onion address announcing
This commit is contained in:
parent
9662c19ab1
commit
332d0e70c8
@ -28,6 +28,10 @@
|
||||
# LND and electrs are not compatible with pruning.
|
||||
# services.bitcoind.prune = 100000;
|
||||
#
|
||||
# Set this to accounce the onion service address to peers.
|
||||
# The onion service allows accepting incoming connections via Tor.
|
||||
# nix-bitcoin.onionServices.bitcoind.public = true;
|
||||
#
|
||||
# You can add options that are not defined in modules/bitcoind.nix as follows
|
||||
# services.bitcoind.extraConfig = ''
|
||||
# maxorphantx=110
|
||||
|
@ -67,6 +67,14 @@ in {
|
||||
default = 8333;
|
||||
description = "Port to listen for peer connections.";
|
||||
};
|
||||
getPublicAddressCmd = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
Bash expression which outputs the public service address to announce to peers.
|
||||
If left empty, no address is announced.
|
||||
'';
|
||||
};
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = config.nix-bitcoin.pkgs.bitcoind;
|
||||
@ -328,6 +336,10 @@ in {
|
||||
${extraRpcauth}
|
||||
${/* Enable bitcoin-cli for group 'bitcoin' */ ""}
|
||||
printf "rpcuser=${cfg.rpc.users.privileged.name}\nrpcpassword="; cat "${secretsDir}/bitcoin-rpcpassword-privileged";
|
||||
echo
|
||||
${optionalString (cfg.getPublicAddressCmd != "") ''
|
||||
echo "externalip=$(${cfg.getPublicAddressCmd})"
|
||||
''}
|
||||
)
|
||||
confFile='${cfg.dataDir}/bitcoin.conf'
|
||||
if [[ ! -e $confFile || $cfg != $(cat $confFile) ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user