mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-16 12:20:14 +02:00
parent
887d44be44
commit
d890907028
3 changed files with 22 additions and 5 deletions
|
|
@ -177,6 +177,11 @@ async def register_lightning_listener():
|
|||
"""
|
||||
|
||||
try:
|
||||
|
||||
if lightning_config.ln_node == "" or lightning_config.ln_node == "none":
|
||||
logging.info("SKIPPING register_lightning_listener -> no lightning configured")
|
||||
return
|
||||
|
||||
await ln.get_ln_info_impl()
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
|
|
|||
|
|
@ -26,10 +26,11 @@ elif node_type == "cln_grpc":
|
|||
import app.repositories.ln_impl.protos.cln.node_pb2_grpc as clnrpc
|
||||
elif node_type == "cln_unix_socket":
|
||||
from pyln.client import LightningRpc
|
||||
elif node_type == "" or node_type == "none":
|
||||
logging.info("Running in bitcoin-only mode")
|
||||
else:
|
||||
raise ValueError(f"Unknown node type: {node_type}")
|
||||
|
||||
|
||||
from app.models.bitcoind import BlockRpcFunc
|
||||
|
||||
|
||||
|
|
@ -104,7 +105,7 @@ class LightningConfig:
|
|||
opts = (("grpc.ssl_target_name_override", "cln"),)
|
||||
self._channel = grpc.aio.secure_channel(cln_grpc_url, creds, options=opts)
|
||||
self.cln_stub = clnrpc.NodeStub(self._channel)
|
||||
elif self.ln_node == "none":
|
||||
elif self.ln_node == "none" or self.ln_node == "":
|
||||
# its ok to run raspiblitz also without lightning
|
||||
pass
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@ if [ "$?" != "0" ]; then
|
|||
fi
|
||||
|
||||
local=.
|
||||
remote=admin@$localIP:/root/blitz_api
|
||||
remoteRepoPath="/root/blitz_api"
|
||||
remote="admin@$localIP:${remoteRepoPath}"
|
||||
|
||||
# clean pycache just in case the code was compiled locally before
|
||||
echo "# local cache delete .."
|
||||
|
|
@ -55,6 +56,17 @@ rm -r ./app/repositories/__pycache__ 2>/dev/null
|
|||
rm -r ./app/routers/__pycache__ 2>/dev/null
|
||||
rm -r ./app/auth/__pycache__ 2>/dev/null
|
||||
|
||||
# make sure remote repo files can be overwritten bei user admin
|
||||
sshpass -p "$passwordA" ssh -p $sshPort admin@$localIP "sudo chown -R admin:admin ${remoteRepoPath}"
|
||||
result=$?
|
||||
echo "result(${result})"
|
||||
if [ "$result" != "0" ]; then
|
||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
echo "FAIL: was not able to ssh in: ssh -p ${sshPort} admin@$localIP"
|
||||
echo "SSH in once manually. Then try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Needs sshpass installed
|
||||
echo "# syncing local code to: ${remote}"
|
||||
sshpass -p "$passwordA" rsync -rvz --exclude .git/ -e "ssh -p ${sshPort}" $local $remote
|
||||
|
|
@ -62,8 +74,7 @@ result=$?
|
|||
echo "result(${result})"
|
||||
if [ "$result" != "0" ]; then
|
||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
echo "FAIL: was not able to ssh in: ssh -p ${sshPort} admin@$localIP"
|
||||
echo "SSH in once manually. Then try again."
|
||||
echo "FAIL: was not able to rsync"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue