pull down to refresh

Just sharing what I've been working on.
#!/bin/bash

set -e

A1="28.1"
B1="bitcoin-${A1}-x86_64-linux-gnu.tar.gz"
C1="https://bitcoincore.org/bin/bitcoin-core-${A1}/${B1}"
D1="/usr/local/bin"
E1="u53R_$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c12)"
F1="p@5s_$(head /dev/urandom | tr -dc A-Za-z0-9!@#\$%^&*()_+ | head -c16)"
G1="tcp://127.0.0.1:28332"
H1="tcp://127.0.0.1:28333"
I1="v0.18.5-beta"
J1="lnd-linux-amd64-${I1}.tar.gz"
K1="https://github.com/lightningnetwork/lnd/releases/download/${I1}/${J1}"
L1="https://github.com/lightningnetwork/lnd/releases/download/${I1}/manifest-${I1}.txt"
M1="https://github.com/lightningnetwork/lnd/releases/download/${I1}/manifest-${I1}.txt.sig"
N1="8B3F86ED7057F08D"

X1() { printf "\x1b[0;32m%s\x1b[0m\n" "$1"; }
Y1() { { [ -d "$(dirname "$1")" ] || mkdir -p "$(dirname "$1")"; }; echo "$2" > "$1"; }

X1 "."
sudo apt update
sudo apt install -y git curl tar wget build-essential gpg

X1 "."
curl -fsSL "$C1" -o "$B1"

X1 "."
tar -xf "$B1"
sudo install $(find bitcoin-${A1}/bin/ -type f) "$D1"

X1 "."
Y1 "$HOME/.bitcoin/bitcoin.conf" "server=1
txindex=1
rpcuser=${E1}
rpcpassword=${F1}
zmqpubrawblock=${G1}
zmqpubrawtx=${H1}"

X1 "."
bitcoind -daemon

X1 "."
curl -fsSL "$K1" -o "$J1"

X1 "."
curl -fsSL "$L1" -o "manifest-${I1}.txt"
curl -fsSL "$M1" -o "manifest-${I1}.txt.sig"
gpg --keyserver keyserver.ubuntu.com --recv-keys "$N1"
gpg --verify "manifest-${I1}.txt.sig" "manifest-${I1}.txt"

X1 "."
tar -xf "$J1"
sudo mv $(find lnd-linux-amd64-${I1}/ -type f) "$D1"

X1 "."
Y1 "$HOME/.lnd/lnd.conf" "$(echo -e "[Application Options]
alias=node_$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c8)
color=#$(head /dev/urandom | tr -dc A-F0-9 | head -c6)

[Bitcoin]
bitcoin.active=1
bitcoin.node=bitcoind
bitcoin.mainnet=1

[Bitcoind]
bitcoind.rpchost=127.0.0.1
bitcoind.rpcuser=${E1}
bitcoind.rpcpass=${F1}
bitcoind.zmqpubrawblock=${G1}
bitcoind.zmqpubrawtx=${H1}")"

X1 "."
lnd &
Make one without bitcoin core but using neutrino. That way you will have a LND ready in just few moments.
reply
100 sats \ 1 reply \ @Mumbo OP 19 Feb
#!/bin/bash

set -e

A=$(echo "djAuMTguNS1iZXRh" | base64 -d)
B="lnd-linux-amd64-${A}.tar.gz"
C="https://github.com/lightningnetwork/lnd/releases/download/${A}/${B}"
D="https://github.com/lightningnetwork/lnd/releases/download/${A}/manifest-${A}.txt"
E="${D}.sig"
F=$(echo "OEIzRjg2RUQ3MDU3RjA4RA==" | base64 -d)

fn() { [ ! -d "$(dirname "$1")" ] && mkdir -p "$(dirname "$1")"; echo "$2" > "$1"; }

apt update >/dev/null && apt install -y git curl tar wget gpg >/dev/null
curl -sSL "$C" -o "$B" && curl -sSL "$D" -o "manifest-${A}.txt" && curl -sSL "$E" -o "manifest-${A}.txt.sig"
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys "$F" >/dev/null && gpg --verify "manifest-${A}.txt.sig" "manifest-${A}.txt" >/dev/null
tar -xf "$B" && find lnd-linux-amd64-${A}/ -type f | xargs -I{} mv {} /usr/local/bin
fn "$HOME/.lnd/lnd.conf" "$(awk "BEGIN {printf \"[Application Options]\\nalias=node_%s\\ncolor=#%s\\n\\n[Bitcoin]\\nbitcoin.active=1\\nbitcoin.node=neutrino\\nbitcoin.mainnet=1\\n\\n[Neutrino]\\nneutrino.connect=btcd-mainnet.lightning.computer\\n\", \"$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c8)\", \"$(head /dev/urandom | tr -dc A-F0-9 | head -c6)\"}")"
(lnd &) >/dev/null
reply
deleted by author