Skip to content

Commit

Permalink
Hotfix/peers (#82)
Browse files Browse the repository at this point in the history
* hotfix for peers on first run

* wip

* hotfix for peers on first run

* more resilient peer add

* change sh to bash

* remove extraneous var

Co-authored-by: Dread <[email protected]>
Co-authored-by: Aiden McClelland <[email protected]>
Co-authored-by: Aiden McClelland <[email protected]>
  • Loading branch information
4 people authored Oct 31, 2022
1 parent 61cc951 commit 45cb1d1
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
lnd/.git
configurator
!configurator/target/aarch64-unknown-linux-musl/release/configurator
health-check
!health-check/target/aarch64-unknown-linux-musl/release/health-check
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
image.tar
lnd.s9pk
scripts/embassy.js
.vscode/
.vscode/
docker-images/
24 changes: 23 additions & 1 deletion docker_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -e

Expand All @@ -12,11 +12,33 @@ _term() {
export HOST_IP=$(ip -4 route list match 0/0 | awk '{print $3}')
export CONTAINER_IP=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')

# ----------Hotfix for bootstrapping peers----------
addpeers() {
lncli connect 03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f@3.33.236.230:9735 || >&2 echo 'Failed to add fallback peer #1'
lncli connect 02bba49d7f9c57b9c05f7eb33bf4dc69b2aa37cb63caff93f13bfa88135e7f7a46@212.129.58.219:9739 || >&2 echo 'Failed to add fallback peer #2'
lncli connect 033dee9c6a0afc40ffd8f27d68ef260f3e5e1c19e59c6f9bb607fb04c1d497a809@98.165.150.209:9735 || >&2 echo 'Failed to add fallback peer #3'
}
# ----------End of Hotfix---------------------------

configurator
configurator_child=$!
lnd &
lnd_child=$!

# ----------Hotfix for bootstrapping peers----------
sleep 60
regex='"synced_to_chain"\s*:\s*true'
while true; do
echo 'checking for sync to chain...'
if [[ "$(lncli getinfo)" =~ $regex ]]; then
addpeers
break
fi
echo 'waiting to add peers...'
sleep 5
done
# ----------End of Hotfix---------------------------

trap _term SIGTERM

wait $lnd_child $configurator_child
4 changes: 2 additions & 2 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
id: lnd
title: Lightning Network Daemon
version: 0.15.2
version: 0.15.2.1
release-notes: |-
* New LND v0.15.2-beta: [Upstream Release Notes](https://github.com/lightningnetwork/lnd/blob/master/docs/release-notes/release-notes-0.15.2.md)
* Minor hotfix for bootstrapping peers on first run
license: mit
wrapper-repo: "https://github.com/Start9Labs/lnd-wrapper"
upstream-repo: "https://github.com/lightningnetwork/lnd"
Expand Down
2 changes: 1 addition & 1 deletion scripts/services/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,5 @@ export const migration: T.ExpectedExports.migration = compat.migrations
down: () => { throw new Error('Cannot downgrade') },
},
},
"0.15.0",
"0.15.2.1",
);

0 comments on commit 45cb1d1

Please sign in to comment.