mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-13 11:52:45 +02:00
refactor: make running without LN explicit in .env
This commit is contained in:
parent
de9a96e621
commit
762b79fde2
4 changed files with 10 additions and 9 deletions
|
|
@ -71,7 +71,7 @@ bitcoind_zmq_block_port_testnet=28332
|
|||
bitcoind_user=raspibolt
|
||||
bitcoind_pw=please_please_update_me_please
|
||||
|
||||
# lnd_grpc, cln_grpc
|
||||
# lnd_grpc, cln_grpc, none
|
||||
# Please refer to the documentation for the install procedure
|
||||
# for each implementation.
|
||||
ln_node=lnd_grpc
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from app.models.lightning import (
|
|||
from app.models.system import APIPlatform
|
||||
from app.utils import SSE, lightning_config, redis_get, send_sse_message
|
||||
|
||||
if lightning_config.ln_node == "lnd":
|
||||
if lightning_config.ln_node == "lnd_grpc":
|
||||
import app.repositories.ln_impl.lnd_grpc as ln
|
||||
elif lightning_config.ln_node == "cln_grpc":
|
||||
import app.repositories.ln_impl.cln_grpc as ln
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ from app.utils import send_sse_message
|
|||
|
||||
|
||||
def get_implementation_name() -> str:
|
||||
return "LND"
|
||||
return "LND_GRPC"
|
||||
|
||||
|
||||
async def get_wallet_balance_impl() -> WalletBalance:
|
||||
|
|
@ -94,9 +94,10 @@ async def list_all_tx_impl(
|
|||
if p.payment_request in memo_cache:
|
||||
comment = memo_cache[p.payment_request]
|
||||
else:
|
||||
pr = await decode_pay_request_impl(p.payment_request)
|
||||
comment = pr.description
|
||||
memo_cache[p.payment_request] = pr.description
|
||||
if p.payment_request is not None and p.payment_request != "":
|
||||
pr = await decode_pay_request_impl(p.payment_request)
|
||||
comment = pr.description
|
||||
memo_cache[p.payment_request] = pr.description
|
||||
tx.append(GenericTx.from_lnd_grpc_payment(p, comment))
|
||||
|
||||
def sortKey(e: GenericTx):
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ from fastapi_plugins import redis_plugin
|
|||
from starlette import status
|
||||
|
||||
node_type = config("ln_node")
|
||||
if node_type == "lnd":
|
||||
if node_type == "lnd_grpc":
|
||||
import app.repositories.ln_impl.protos.lnd.lightning_pb2_grpc as lnrpc
|
||||
import app.repositories.ln_impl.protos.lnd.router_pb2_grpc as routerrpc
|
||||
import app.repositories.ln_impl.protos.lnd.walletunlocker_pb2_grpc as unlockerrpc
|
||||
|
|
@ -104,12 +104,12 @@ 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 == "":
|
||||
elif self.ln_node == "none":
|
||||
# its ok to run raspiblitz also without lightning
|
||||
pass
|
||||
else:
|
||||
raise NameError(
|
||||
f'Node type "{self.ln_node}" is unknown. Use "lnd" or "clightning"'
|
||||
f'Node type "{self.ln_node}" is unknown. Use "lnd_grpc" or "cln_grpc" or "none"'
|
||||
)
|
||||
|
||||
def metadata_callback(self, context, callback):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue