mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 10:34:20 +01:00
refactor
This commit is contained in:
25
cashu/mint/startup.py
Normal file
25
cashu/mint/startup.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import asyncio
|
||||
from loguru import logger
|
||||
|
||||
from cashu.core.settings import CASHU_DIR
|
||||
|
||||
from cashu.lightning import WALLET
|
||||
from cashu.mint.migrations import m001_initial
|
||||
|
||||
from . import ledger
|
||||
|
||||
|
||||
async def load_ledger():
|
||||
await asyncio.wait([m001_initial(ledger.db)])
|
||||
await ledger.load_used_proofs()
|
||||
|
||||
error_message, balance = await WALLET.status()
|
||||
if error_message:
|
||||
logger.warning(
|
||||
f"The backend for {WALLET.__class__.__name__} isn't working properly: '{error_message}'",
|
||||
RuntimeWarning,
|
||||
)
|
||||
|
||||
logger.info(f"Lightning balance: {balance} sat")
|
||||
logger.info(f"Data dir: {CASHU_DIR}")
|
||||
logger.info("Mint started.")
|
||||
Reference in New Issue
Block a user