mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-02-03 15:54:20 +01:00
Mint database setting (#126)
* mint: new .env variable MINT_DATABASE * make format
This commit is contained in:
@@ -8,6 +8,8 @@ CASHU_DIR=~/.cashu
|
||||
MINT_HOST=127.0.0.1
|
||||
MINT_PORT=3338
|
||||
|
||||
MINT_DATABASE=data/mint
|
||||
|
||||
# use builtin tor, this overrides SOCKS_HOST and SOCKS_PORT
|
||||
TOR=TRUE
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ MINT_URL = env.str("MINT_URL", default=None)
|
||||
MINT_HOST = env.str("MINT_HOST", default="8333.space")
|
||||
MINT_PORT = env.int("MINT_PORT", default=3338)
|
||||
|
||||
MINT_DATABASE = env.str("MINT_DATABASE", default="data/mint")
|
||||
|
||||
if not MINT_URL:
|
||||
if MINT_HOST in ["localhost", "127.0.0.1"]:
|
||||
MINT_URL = f"http://{MINT_HOST}:{MINT_PORT}"
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Dict, Optional
|
||||
|
||||
import requests
|
||||
|
||||
from cashu.core.settings import LNBITS_ENDPOINT, LNBITS_KEY
|
||||
from cashu.core.settings import DEBUG, LNBITS_ENDPOINT, LNBITS_KEY
|
||||
|
||||
from .base import (
|
||||
InvoiceResponse,
|
||||
@@ -26,6 +26,7 @@ class LNbitsWallet(Wallet):
|
||||
self.s = requests.Session()
|
||||
self.s.auth = ("user", "pass")
|
||||
self.s.headers.update({"X-Api-Key": key})
|
||||
self.s.verify = not DEBUG
|
||||
|
||||
async def status(self) -> StatusResponse:
|
||||
try:
|
||||
|
||||
@@ -7,13 +7,13 @@ from loguru import logger
|
||||
|
||||
from cashu.core.db import Database
|
||||
from cashu.core.migrations import migrate_databases
|
||||
from cashu.core.settings import CASHU_DIR, LIGHTNING, MINT_PRIVATE_KEY
|
||||
from cashu.core.settings import CASHU_DIR, LIGHTNING, MINT_DATABASE, MINT_PRIVATE_KEY
|
||||
from cashu.lightning.lnbits import LNbitsWallet # type: ignore
|
||||
from cashu.mint import migrations
|
||||
from cashu.mint.ledger import Ledger
|
||||
|
||||
ledger = Ledger(
|
||||
db=Database("mint", "data/mint"),
|
||||
db=Database("mint", MINT_DATABASE),
|
||||
seed=MINT_PRIVATE_KEY,
|
||||
derivation_path="0/0/0/0",
|
||||
lightning=LNbitsWallet(),
|
||||
|
||||
Reference in New Issue
Block a user