From 4c38bcbcf31c857b5655766138c33dc6ead9325d Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Mon, 7 Nov 2022 14:00:05 +0100 Subject: [PATCH] set private key --- .env.example | 4 ++++ lnbits/extensions/cashu/__init__.py | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 32a67f75..b6a53205 100644 --- a/.env.example +++ b/.env.example @@ -108,3 +108,7 @@ ECLAIR_PASS=eclairpw # Enter /api in LightningTipBot to get your key LNTIPS_API_KEY=LNTIPS_ADMIN_KEY LNTIPS_API_ENDPOINT=https://ln.tips + +# Cashu Mint +# Use a long-enough random (!) private key +CASHU_PRIVATE_KEY="SuperSecretPrivateKey" diff --git a/lnbits/extensions/cashu/__init__.py b/lnbits/extensions/cashu/__init__.py index 7944e658..5d5fe131 100644 --- a/lnbits/extensions/cashu/__init__.py +++ b/lnbits/extensions/cashu/__init__.py @@ -1,5 +1,6 @@ import asyncio +from environs import Env # type: ignore from fastapi import APIRouter from fastapi.staticfiles import StaticFiles @@ -20,11 +21,13 @@ cashu_static_files = [ ] from cashu.mint.ledger import Ledger +env = Env() +env.read_env() + ledger = Ledger( db=db, - # seed=MINT_PRIVATE_KEY, - seed="asd", - derivation_path="0/0/0/1", + seed=env.str("CASHU_PRIVATE_KEY", default="SuperSecretPrivateKey"), + derivation_path="0/0/0/0", ) cashu_ext: APIRouter = APIRouter(prefix="/cashu", tags=["cashu"])