Closed steepdawn974 closed 1 year ago
Hello, thank you for this report!
You have used the command cashu receive <token>
wrong, there should be a token not an amount there.
Instead, to mint yourself free ecash, you can use cashu invoice 1000
and you will get free money since you've set LIGHTNING=false
. This is just for testing and development!
To your questions:
There are only sporadic comments in the .env.example
. MINT_HOST
is the host the wallet will connect to. MINT_SERVER_HOST
is the host the mint will listen on. Very bad naming, I should add some comments :)
The mint URL for the lnbits mints is https://legend.lnbits.com/cashu/api/v1/GsAL2UKczDnkS5SWW65GZE
(replace ID with mint_id). This is not quite easy to figure out, it's on my todo list.
There are multiple options to use this mint in the CLI:
MINT_URL=https://legend.lnbits.com/cashu/api/v1/GsAL2UKczDnkS5SWW65GZE cashu invoice 100
MINT_URL
in the .env
fileThank you for your interest, let me know if anything is unclear and please join our Telegram group: https://t.me/CashuBTC
Hello,
wanted to play with cashu by setting up a local mint, and mint some tokens. Getting error
binascii.Error: Incorrect padding (local mint)
when runningcashu receive
Steps taken
.env
file withDEBUG=TRUE
,TOR=FALSE
,LIGHTNING=FALSE
, comment outSOCKS
CASHU_DIR=~/.cashu
WALLET
MINT_URL=https://localhost:3338
MINT_HOST=127.0.0.1 MINT_PORT=3338
use builtin tor, this overrides SOCKS_HOST and SOCKS_PORT
TOR=FALSE
use custom tor proxy, use with TOR=false
SOCKS_HOST=localhost
SOCKS_PORT=9050
MINT
MINT_PRIVATE_KEY=supersecretprivatekey
MINT_SERVER_HOST=127.0.0.1 MINT_SERVER_PORT=3338
LIGHTNING=FALSE
fee to reserve in percent of the amount
LIGHTNING_FEE_PERCENT=1.0
minimum fee to reserve
LIGHTNING_RESERVE_FEE_MIN=4000
LNBITS_ENDPOINT=https://legend.lnbits.com LNBITS_KEY=yourkeyasdasdasd
NOSTR
nostr private key to which to receive tokens to
NOSTR_PRIVATE_KEY=hex_nostrprivatekey_here
nostr relays (comma separated list)
NOSTR_RELAYS=\"wss://nostr-pub.wellorder.net\" " > .env
2023-01-25 11:18:05.24 | INFO | Started server process [282100] 2023-01-25 11:18:05.24 | INFO | Waiting for application startup. 2023-01-25 11:18:05.26 | INFO | Data dir: /home/ingo/.cashu 2023-01-25 11:18:05.26 | INFO | Mint started. 2023-01-25 11:18:05.26 | INFO | Application startup complete. 2023-01-25 11:18:05.26 | INFO | Uvicorn running on http://127.0.0.1:3338 (Press CTRL+C to quit)
23-01-25 11:36:36.044 | DEBUG | cashu.wallet.wallet:init:407 - Wallet initalized with mint URL http://127.0.0.1:3338 Balance: 0 sat 2023-01-25 11:36:36.061 | DEBUG | cashu.wallet.wallet:_load_mint:156 - Mint keysets: ['eNPchHkKANBq'] 2023-01-25 11:36:36.062 | DEBUG | cashu.wallet.wallet:_load_mint:157 - Current mint keyset: eNPchHkKANBq Traceback (most recent call last): File "/home//.pyenv/versions/3.9.13/envs/cashu/bin/cashu", line 6, in
sys.exit(cli())
File "/home//.pyenv/versions/3.9.13/envs/cashu/lib/python3.9/site-packages/click/core.py", line 1128, in call
return self.main(args, kwargs)
File "/home//.pyenv/versions/3.9.13/envs/cashu/lib/python3.9/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home//.pyenv/versions/3.9.13/envs/cashu/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home//.pyenv/versions/3.9.13/envs/cashu/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/home//.pyenv/versions/3.9.13/envs/cashu/lib/python3.9/site-packages/click/core.py", line 754, in invoke
return __callback( args, kwargs)
File "/home//.pyenv/versions/3.9.13/envs/cashu/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, *kwargs)
File "/home//code/cashu/cashu/wallet/cli.py", line 116, in wrapper
return asyncio.run(f( args, kwargs))
File "/home//.pyenv/versions/3.9.13/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/home//.pyenv/versions/3.9.13/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/home//code/cashu/cashu/wallet/cli.py", line 412, in receive_cli
await receive(ctx, token, lock)
File "/home//code/cashu/cashu/wallet/cli.py", line 357, in receive
dtoken = json.loads(base64.urlsafe_b64decode(token))
File "/home//.pyenv/versions/3.9.13/lib/python3.9/base64.py", line 133, in urlsafe_b64decode
return b64decode(s)
File "/home//.pyenv/versions/3.9.13/lib/python3.9/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding