Merge fort-nix/nix-bitcoin#366: Update nixpkgs
ce10003747
lnd: allow curl to retry in the create-wallet script (Jonas Nick)a23b9d1c2d
lnd: check that state is RPC_ACTIVE after unlocking (Jonas Nick)c75347027b
lnd: don't wait until the RPC port is open after unlocking (Jonas Nick)bc9199a386
Update nixpkgs (Jonas Nick)8fbba87c0f
Update nixpkgs (Martin Milata) Pull request description: ACKs for top commit: nixbitcoin: ACKce10003747
Tree-SHA512: 658d74caec7849ff173ce58c7807d5342f39ff159bc40e617e9f28de7696b91e2801f920b183deefea141f9de2db9a9423ce13d31e6b96ff991ab07032522b55
This commit is contained in:
commit
842ed44292
@ -198,7 +198,10 @@ in {
|
|||||||
RestartSec = "10s";
|
RestartSec = "10s";
|
||||||
ReadWritePaths = cfg.dataDir;
|
ReadWritePaths = cfg.dataDir;
|
||||||
ExecStartPost = let
|
ExecStartPost = let
|
||||||
curl = "${pkgs.curl}/bin/curl -s --show-error";
|
# Retrying is necessary because it can happen that the lnd socket is
|
||||||
|
# existing, but the RPC service isn't yet, which results in error
|
||||||
|
# "waiting to start, RPC services not available".
|
||||||
|
curl = "${pkgs.curl}/bin/curl -s --show-error --retry 10";
|
||||||
restUrl = "https://${cfg.restAddress}:${toString cfg.restPort}/v1";
|
restUrl = "https://${cfg.restAddress}:${toString cfg.restPort}/v1";
|
||||||
in [
|
in [
|
||||||
(nbLib.script "lnd-create-wallet" ''
|
(nbLib.script "lnd-create-wallet" ''
|
||||||
@ -239,9 +242,14 @@ in {
|
|||||||
-d "{\"wallet_password\": \"$(cat ${secretsDir}/lnd-wallet-password | tr -d '\n' | base64 -w0)\"}" \
|
-d "{\"wallet_password\": \"$(cat ${secretsDir}/lnd-wallet-password | tr -d '\n' | base64 -w0)\"}" \
|
||||||
${restUrl}/unlockwallet
|
${restUrl}/unlockwallet
|
||||||
fi
|
fi
|
||||||
|
state=""
|
||||||
# Wait until the RPC port is open
|
while [ "$state" != "RPC_ACTIVE" ]; do
|
||||||
while ! { exec 3>/dev/tcp/${cfg.rpcAddress}/${toString cfg.rpcPort}; } &>/dev/null; do
|
state=$(${curl} \
|
||||||
|
--cacert ${secretsDir}/lnd-cert \
|
||||||
|
-d '{}' \
|
||||||
|
-X POST \
|
||||||
|
${restUrl}/state |\
|
||||||
|
${pkgs.jq}/bin/jq -r '.state')
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
done
|
||||||
'')
|
'')
|
||||||
|
@ -8,11 +8,11 @@ in
|
|||||||
{
|
{
|
||||||
# To update, run ../helper/fetch-channel REV
|
# To update, run ../helper/fetch-channel REV
|
||||||
nixpkgs = fetch {
|
nixpkgs = fetch {
|
||||||
rev = "dc326c78a93862efb30a76216f527a56496e6284";
|
rev = "359e6542e1d41eb18df55c82bdb08bf738fae2cf";
|
||||||
sha256 = "094zb1p5i5f2nlxny3dc814jvs90nimdj6wwd80495hgs9z76wgp";
|
sha256 = "05v28njaas9l26ibc6vy6imvy7grbkli32bmv0n32x6x9cf68gf9";
|
||||||
};
|
};
|
||||||
nixpkgs-unstable = fetch {
|
nixpkgs-unstable = fetch {
|
||||||
rev = "4518794ee53d109d551c210a6d195b79e9995a90";
|
rev = "036dc0c709650e0c833822307af801f576d67273";
|
||||||
sha256 = "1h86bqrkiydn5nwpndg8k5apdjxff5qigbrrwfam3893vgb7hws2";
|
sha256 = "0pnrygs6xf7id63zi17pq5379hfppwbb5cfazhypcqz6l3dfk00g";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user