mirror of
https://github.com/Retropex/raspiblitz.git
synced 2025-05-13 03:30:49 +02:00
Merge branch 'dev' of https://github.com/rootzoll/raspiblitz into dev
This commit is contained in:
commit
ee26fb48cb
@ -46,21 +46,18 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
|
||||
echo "# INSTALL Web API ..."
|
||||
rm -r /root/blitz_api 2>/dev/null
|
||||
cd /root
|
||||
cd /root || exit 1
|
||||
# git clone https://github.com/fusion44/blitz_api.git /root/blitz_api
|
||||
git clone https://github.com/${DEFAULT_GITHUB_USER}/${DEFAULT_GITHUB_REPO}.git /root/blitz_api
|
||||
if [ "$?" != "0"]; then
|
||||
if ! git clone https://github.com/${DEFAULT_GITHUB_USER}/${DEFAULT_GITHUB_REPO}.git /root/blitz_api; then
|
||||
echo "error='git clone failed'"
|
||||
exit 1
|
||||
fi
|
||||
cd blitz_api
|
||||
git checkout ${DEFAULT_GITHUB_BRANCH}
|
||||
if [ "$?" != "0"]; then
|
||||
cd blitz_api || exit 1
|
||||
if ! git checkout ${DEFAULT_GITHUB_BRANCH}; then
|
||||
echo "error='git checkout failed'"
|
||||
exit 1
|
||||
fi
|
||||
pip install -r requirements.txt
|
||||
if [ "$?" != "0"]; then
|
||||
if ! pip install -r requirements.txt --no-deps; then
|
||||
echo "error='pip install failed'"
|
||||
exit 1
|
||||
fi
|
||||
@ -187,6 +184,9 @@ if [ "$1" = "update-config" ]; then
|
||||
echo "# CONFIG Web API Lightning --> CL"
|
||||
sed -i "s/^ln_node=.*/ln_node=cln_grpc/g" ./.env
|
||||
|
||||
# make sure cln-grpc is on
|
||||
/home/admin/config.scripts/cl-plugin.cln-grpc.sh on mainnet
|
||||
|
||||
# get hex values of pem files
|
||||
hexClient=$(xxd -p -c2000 /home/bitcoin/.lightning/bitcoin/client.pem)
|
||||
hexClientKey=$(xxd -p -c2000 /home/bitcoin/.lightning/bitcoin/client-key.pem)
|
||||
|
@ -41,17 +41,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
echo "# INSTALL WebUI"
|
||||
rm -r /root/blitz_web 2>/dev/null
|
||||
rm -r /root/${DEFAULT_GITHUB_REPO} 2>/dev/null
|
||||
cd /root
|
||||
# git clone https://github.com/cstenglein/raspiblitz-web.git /home/admin/blitz_web
|
||||
git clone https://github.com/${DEFAULT_GITHUB_USER}/${DEFAULT_GITHUB_REPO}.git /root/blitz_web
|
||||
if [ "$?" != "0"]; then
|
||||
cd /root || exit 1
|
||||
if ! git clone https://github.com/${DEFAULT_GITHUB_USER}/${DEFAULT_GITHUB_REPO}.git; then
|
||||
echo "error='git clone failed'"
|
||||
exit 1
|
||||
fi
|
||||
mv /root/${DEFAULT_GITHUB_REPO} /root/blitz_web
|
||||
cd blitz_web
|
||||
git checkout ${DEFAULT_GITHUB_BRANCH}
|
||||
if [ "$?" != "0"]; then
|
||||
cd blitz_web || exit 1
|
||||
if ! git checkout ${DEFAULT_GITHUB_BRANCH}; then
|
||||
echo "error='git checkout failed'"
|
||||
exit 1
|
||||
fi
|
||||
@ -59,19 +56,16 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
echo "# Compile WebUI"
|
||||
/home/admin/config.scripts/bonus.nodejs.sh on
|
||||
source <(/home/admin/config.scripts/bonus.nodejs.sh info)
|
||||
npm install --global yarn
|
||||
if [ "$?" != "0"]; then
|
||||
if ! npm install --global yarn; then
|
||||
echo "error='install yarn failed'"
|
||||
exit 1
|
||||
fi
|
||||
${NODEPATH}/yarn config set --home enableTelemetry 0
|
||||
${NODEPATH}/yarn install
|
||||
if [ "$?" != "0"]; then
|
||||
if ! ${NODEPATH}/yarn install; then
|
||||
echo "error='yarn install failed'"
|
||||
exit 1
|
||||
fi
|
||||
${NODEPATH}/yarn build
|
||||
if [ "$?" != "0"]; then
|
||||
if ! ${NODEPATH}/yarn build; then
|
||||
echo "error='yarn build failed'"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -36,7 +36,7 @@ function buildGRPCplugin() {
|
||||
sudo -u bitcoin /home/bitcoin/.cargo/bin/cargo build \
|
||||
--target-dir /home/bitcoin/cl-plugins-available/cln-grpc
|
||||
else
|
||||
echo "# - cln-grpc plugin already build/installed"
|
||||
echo "# - cln-grpc plugin was already built/installed"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -53,6 +53,7 @@ elif [ "$1" = status ]; then
|
||||
exit 0
|
||||
|
||||
elif [ "$1" = on ]; then
|
||||
if ! "$lightningcli_alias" plugin list | grep "/home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc"; then
|
||||
buildGRPCplugin
|
||||
|
||||
# symlink to plugin directory
|
||||
@ -67,7 +68,15 @@ elif [ "$1" = on ]; then
|
||||
sudo ufw allow "${PORT}" comment "${netprefix}clnGRPCport"
|
||||
# Tor
|
||||
/home/admin/config.scripts/tor.onion-service.sh "${netprefix}clnGRPCport" "${PORT}" "${PORT}"
|
||||
source <(/home/admin/_cache.sh get state)
|
||||
if [ "${state}" == "ready" ]; then
|
||||
sudo systemctl restart ${netprefix}lightningd
|
||||
fi
|
||||
echo "# cl-plugin.cln-grpc.sh on --> done"
|
||||
|
||||
else
|
||||
echo "# cl-plugin.cln-grpc.sh on --> already installed and running"
|
||||
fi
|
||||
exit 0
|
||||
|
||||
elif [ "$1" = off ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user