diff --git a/cashu/core/settings.py b/cashu/core/settings.py index 5865f51..e22b118 100644 --- a/cashu/core/settings.py +++ b/cashu/core/settings.py @@ -7,9 +7,10 @@ from environs import Env # type: ignore env = Env() -ENV_FILE = os.path.join(str(Path.home()), ".cashu", ".env") +# env file: default to current dir, else home dir +ENV_FILE = os.path.join(os.getcwd(), ".env") if not os.path.isfile(ENV_FILE): - ENV_FILE = os.path.join(os.getcwd(), ".env") + ENV_FILE = os.path.join(str(Path.home()), ".cashu", ".env") if os.path.isfile(ENV_FILE): env.read_env(ENV_FILE) else: @@ -53,6 +54,7 @@ LNBITS_ENDPOINT = env.str("LNBITS_ENDPOINT", default=None) LNBITS_KEY = env.str("LNBITS_KEY", default=None) NOSTR_PRIVATE_KEY = env.str("NOSTR_PRIVATE_KEY", default=None) +NOSTR_RELAYS = env.list("NOSTR_RELAYS", default=["wss://nostr-pub.wellorder.net"]) MAX_ORDER = 64 VERSION = "0.7.0" diff --git a/cashu/wallet/cli.py b/cashu/wallet/cli.py index 93f6b6d..2330200 100644 --- a/cashu/wallet/cli.py +++ b/cashu/wallet/cli.py @@ -29,6 +29,7 @@ from cashu.core.settings import ( LIGHTNING, MINT_URL, NOSTR_PRIVATE_KEY, + NOSTR_RELAYS, SOCKS_HOST, SOCKS_PORT, TOR, @@ -551,7 +552,7 @@ async def nsend(ctx, amount: int, pubkey: str, verbose: bool, yes: bool): ) # we only use ephemeral private keys for sending - client = NostrClient() + client = NostrClient(relays=NOSTR_RELAYS) if verbose: print(f"Your ephemeral nostr private key: {client.private_key.hex()}") await asyncio.sleep(1) @@ -577,7 +578,7 @@ async def nreceive(ctx, verbose: bool): "Warning: No nostr private key set! You don't have NOSTR_PRIVATE_KEY set in your .env file. I will create a random private key for this session but I will not remember it." ) print("") - client = NostrClient(privatekey_hex=NOSTR_PRIVATE_KEY) + client = NostrClient(privatekey_hex=NOSTR_PRIVATE_KEY, relays=NOSTR_RELAYS) print(f"Your nostr public key: {client.public_key.hex()}") if verbose: print(f"Your nostr private key (do not share!): {client.private_key.hex()}") @@ -646,6 +647,7 @@ async def info(ctx): if NOSTR_PRIVATE_KEY: client = NostrClient(privatekey_hex=NOSTR_PRIVATE_KEY, connect=False) print(f"Nostr public key: {client.public_key.hex()}") + print(f"Nostr relays: {NOSTR_RELAYS}") if SOCKS_HOST: print(f"Socks proxy: {SOCKS_HOST}:{SOCKS_PORT}") print(f"Mint URL: {ctx.obj['HOST']}") diff --git a/cashu/wallet/wallet_live/.DS_Store b/cashu/wallet/wallet_live/.DS_Store deleted file mode 100644 index 5008ddf..0000000 Binary files a/cashu/wallet/wallet_live/.DS_Store and /dev/null differ diff --git a/cashu/wallet/wallet_live/.placeholder b/cashu/wallet/wallet_live/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/cashu/wallet/wallet_live/wallet.sqlite3 b/cashu/wallet/wallet_live/wallet.sqlite3 deleted file mode 100644 index d3e29bb..0000000 Binary files a/cashu/wallet/wallet_live/wallet.sqlite3 and /dev/null differ