This commit is contained in:
Justin (shocknet) 2024-06-30 17:15:21 -04:00
parent 9c75df2ae0
commit 55c39a5975

View file

@ -99,14 +99,17 @@ bitcoin.mainnet=true
bitcoin.node=neutrino bitcoin.node=neutrino
neutrino.addpeer=neutrino.shock.network neutrino.addpeer=neutrino.shock.network
feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json
noseedbackup=true
wallet-unlock-password-file=~/lnpass
wallet-unlock-allow-create=true
EOF EOF
echo "Created basic lnd.conf file." echo "Created new lnd.conf file."
fi fi
echo "LND installation and configuration completed." echo "LND installation and configuration completed."
} }
# Install Node.js using nvm # Function to install Node.js using nvm
install_nodejs() { install_nodejs() {
echo -n "Installing Node.js... " echo -n "Installing Node.js... "
REQUIRED_VERSION="18.0.0" REQUIRED_VERSION="18.0.0"
@ -173,6 +176,7 @@ install_lightning_pub() {
# Merge if upgrade # Merge if upgrade
rsync -av --exclude='*.sqlite' --exclude='.env' --exclude='logs' --exclude='node_modules' lightning_pub_temp/ lightning_pub/ > /dev/null rsync -av --exclude='*.sqlite' --exclude='.env' --exclude='logs' --exclude='node_modules' lightning_pub_temp/ lightning_pub/ > /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed to merge Lightning.Pub files." echo "Failed to merge Lightning.Pub files."
exit 1 exit 1
@ -184,11 +188,23 @@ install_lightning_pub() {
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
cd lightning_pub cd lightning_pub
npm install > /dev/null
if [ $? -ne 0 ]; then # Show a progress indicator while npm install is running
echo "Failed to install npm dependencies." echo -n "Installing npm dependencies... "
npm install > npm_install.log 2>&1 &
PID=$!
while kill -0 $PID 2> /dev/null; do
echo -n "."
sleep 1
done
if wait $PID; then
echo " done."
else
echo " failed. Check npm_install.log for details."
exit 1 exit 1
fi fi
echo "Lightning.Pub installation completed." echo "Lightning.Pub installation completed."
} }
@ -219,6 +235,7 @@ display_starting_animation() {
# Start services # Start services
start_services() { start_services() {
USER_HOME=$(eval echo ~$(whoami))
if [[ "$OS" == "Linux" ]]; then if [[ "$OS" == "Linux" ]]; then
if [ "$SYSTEMCTL_AVAILABLE" = true ]; then if [ "$SYSTEMCTL_AVAILABLE" = true ]; then
sudo bash -c "cat > /etc/systemd/system/lnd.service <<EOF sudo bash -c "cat > /etc/systemd/system/lnd.service <<EOF
@ -227,7 +244,7 @@ Description=LND Service
After=network.target After=network.target
[Service] [Service]
ExecStart=/home/$(whoami)/lnd/lnd ExecStart=${USER_HOME}/lnd/lnd
User=$(whoami) User=$(whoami)
Restart=always Restart=always
@ -242,7 +259,7 @@ After=network.target
[Service] [Service]
ExecStart=$(which npm) start ExecStart=$(which npm) start
WorkingDirectory=/home/$(whoami)/lightning_pub WorkingDirectory=${USER_HOME}/lightning_pub
User=$(whoami) User=$(whoami)
Restart=always Restart=always