CloakedServices / CloakedNetworkPoC

Whitepaper @ https://github.com/CloakedServices/CloakedNetwork
GNU Affero General Public License v3.0
1 stars 0 forks source link

cashu wallet 400 error #39

Closed mixmasala closed 7 months ago

mixmasala commented 8 months ago
23a7ba24fdbe:/build/katzenpost/katzensocks# podman logs voting_mixnet-client_cashu_wallet-1 
Skipping virtualenv creation, as specified in config file.
Warning: 'cashu' is an entry point defined in pyproject.toml, but it's not installed as a script. You may get improper `sys.argv[0]`.

The support to run uninstalled scripts will be removed in a future release.

Run `poetry install` to resolve and get rid of this message.

INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:4448 (Press CTRL+C to quit)
2023-11-06 10:45:05.526 | ERROR    | cashu.wallet.api.app:catch_exceptions:34 - Exception: Proxy keys should use proper URL forms rather than plain scheme strings. Instead of "http", use "http://"
Creating database directory: /root/.cashu/wallet
Generated a new mnemonic. To view it, run "cashu info --mnemonic".
INFO:     127.0.0.1:38218 - "POST /lightning/create_invoice?amount=42 HTTP/1.1" 400 Bad Request
2023-11-06 10:45:08.517 | ERROR    | cashu.wallet.api.app:catch_exceptions:34 - Exception: Proxy keys should use proper URL forms rather than plain scheme strings. Instead of "http", use "http://"
INFO:     127.0.0.1:56558 - "POST /lightning/create_invoice?amount=42 HTTP/1.1" 400 Bad Request
INFO:     127.0.0.1:35868 - "GET /balance HTTP/1.1" 200 OK
INFO:     127.0.0.1:35868 - "POST /lightning/create_invoice?amount=42 HTTP/1.1" 400 Bad Request
2023-11-06 12:26:56.076 | ERROR    | cashu.wallet.api.app:catch_exceptions:34 - Exception: Proxy keys should use proper URL forms rather than plain scheme strings. Instead of "http", use "http://"
INFO:     127.0.0.1:35872 - "POST /send?amount=1 HTTP/1.1" 400 Bad Request
2023-11-06 12:26:56.815 | ERROR    | cashu.wallet.api.app:catch_exceptions:34 - Exception: Proxy keys should use proper URL forms rather than plain scheme strings. Instead of "http", use "http://"
mixmasala commented 8 months ago

See: https://github.com/CloakedServices/CloakedNetworkPoC/blob/b9bc4a1348321a9f5e87d2b8096b58e6258bd058/katzensocks/client/client_test.go#L70

and

https://github.com/CloakedServices/CloakedNetworkPoC/blob/b9bc4a1348321a9f5e87d2b8096b58e6258bd058/katzensocks/client/client_test.go#L100

which correspond to api endpoints lightning/create_invoice and send

mixmasala commented 8 months ago

https://github.com/CloakedServices/CloakedNetworkPoC/actions/runs/6774684894/job/18412316096?pr=40 see run here

mixmasala commented 7 months ago

From branch: commit 799e4657bf56fc9a59b46541cac87af931ee00fb (HEAD -> fix/cashu_invoice_creation, cloaked/fix/cashu_invoice_creation) i rebuilt from cashu git tip: commit 0c3777dd1799337f2cb6ee1a5545120958834eb4 (grafted, HEAD -> main, origin/main, origin/HEAD) this PR adds the logline

10:56:02.351 INFO katzensocks_client: Balance too low: 0 sats, creating Lightning invoice
10:56:02.359 DEBU minclient/conn:cb2eae763b1f42292c3eff1842a8059f4a267c4f32dbb37ac189403ebec5dcac@provider2: Handshake completed.
10:56:02.359 DEBU minclient/pki:cb2eae763b1f42292c3eff1842a8059f4a267c4f32dbb37ac189403ebec5dcac@provider2: New clock skew: 0 sec
10:56:02.359 DEBU provider2_client: onConnection <nil>
10:56:02.360 DEBU provider2_client: Clock skew vs provider: 0s
10:56:03.516 ERRO katzensocks_client: topup cashu, CreateInvoice: 400 Bad Request
10:56:03.858 DEBU provider2_client: SendMessage
10:56:03.859 DEBU provider2_client: doSend [a8815e7839b0867d03118634c7d64d7a] with SURB ID [4a5196e2dec2ce790b6fa68cbbd9adb5]

wallet logs:

5a1676a17c94:/build/katzenpost/katzensocks# podman logs voting_mixnet-client_cashu_wallet-1
Skipping virtualenv creation, as specified in config file.
Warning: 'cashu' is an entry point defined in pyproject.toml, but it's not installed as a script. You may get improper `sys.argv[0]`.

The support to run uninstalled scripts will be removed in a future release.

Run `poetry install` to resolve and get rid of this message.

INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:4448 (Press CTRL+C to quit)
Creating database directory: /root/.cashu/wallet
Generated a new mnemonic. To view it, run "cashu info --mnemonic".
INFO:     127.0.0.1:49474 - "GET /balance HTTP/1.1" 200 OK
2023-11-10 10:56:03.515 | ERROR    | cashu.wallet.api.app:catch_exceptions:34 - Exception: Expecting value: line 1 column 1 (char 0)
INFO:     127.0.0.1:49474 - "POST /lightning/create_invoice?amount=100 HTTP/1.1" 400 Bad Request
mixmasala commented 7 months ago

I restarted and tried again, and now I see that requests are successful:

5a1676a17c94:/build/katzenpost/katzensocks# podman logs voting_mixnet-client_cashu_wallet-1
Skipping virtualenv creation, as specified in config file.
Warning: 'cashu' is an entry point defined in pyproject.toml, but it's not installed as a script. You may get improper `sys.argv[0]`.

The support to run uninstalled scripts will be removed in a future release.

Run `poetry install` to resolve and get rid of this message.

INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:4448 (Press CTRL+C to quit)
Creating database directory: /root/.cashu/wallet
Generated a new mnemonic. To view it, run "cashu info --mnemonic".
INFO:     127.0.0.1:49474 - "GET /balance HTTP/1.1" 200 OK
2023-11-10 10:56:03.515 | ERROR    | cashu.wallet.api.app:catch_exceptions:34 - Exception: Expecting value: line 1 column 1 (char 0)
INFO:     127.0.0.1:49474 - "POST /lightning/create_invoice?amount=100 HTTP/1.1" 400 Bad Request
INFO:     127.0.0.1:36876 - "GET /balance HTTP/1.1" 200 OK
INFO:     127.0.0.1:36876 - "POST /lightning/create_invoice?amount=100 HTTP/1.1" 200 OK
INFO:     127.0.0.1:36876 - "GET /lightning/invoice_state?payment_hash=3999234af251d399f42f3bfbd93611f042bbc3bef6ad42b3de033647bb97ca30 HTTP/1.1" 200 OK
cashuAeyJ0b2tlbiI6IFt7InByb29mcyI6IFt7ImlkIjogIjFjQ05JQVoyWC93MSIsICJhbW91bnQiOiAxLCAic2VjcmV0IjogIjllYTBmYmFjMDlkYTYyMGU3OTMyMzRkODI0ZWFmNWQ2MTY4ODJjNGJlMTQ2MjVjODZiY2RmMmEzNmIwNTgyYjMiLCAiQyI6ICIwMzI0ZDBkMzNiMmFkMDY3ZGRjNWZiMmZhZGRjNzIxMzlkNTA3MDMyOWI2YWYzNTc3NmUyZjAxOThlZDcxZDBjOWUifV0sICJtaW50IjogImh0dHA6Ly8xMjcuMC4wLjE6MzMzOCJ9XX0=
Balance: 99 sat
INFO:     127.0.0.1:36876 - "POST /send?amount=1 HTTP/1.1" 200 OK
INFO:     127.0.0.1:48278 - "GET /balance HTTP/1.1" 200 OK
cashuAeyJ0b2tlbiI6IFt7InByb29mcyI6IFt7ImlkIjogIjFjQ05JQVoyWC93MSIsICJhbW91bnQiOiAxLCAic2VjcmV0IjogIjkxMGMzNjU5NmYzN2VmY2I2YWUyYmI1MjlmYjI1MGI3ZTdjNzM4ODk2OTI3Zjg4OTczYjFhZTVkNzRlYWY5YzgiLCAiQyI6ICIwMmY1MWIyMmUxMTE2MjJmZWMyNjNmZmYwNWRmNWQxYzMwMDUwNTI3Y2JhNjAxMjY1MGE3YzJjN2Q3MTBlOGZkYmEifV0sICJtaW50IjogImh0dHA6Ly8xMjcuMC4wLjE6MzMzOCJ9XX0=
Balance: 98 sat
INFO:     127.0.0.1:48278 - "POST /send?amount=1 HTTP/1.1" 200 OK
INFO:     127.0.0.1:40294 - "GET /balance HTTP/1.1" 200 OK
cashuAeyJ0b2tlbiI6IFt7InByb29mcyI6IFt7ImlkIjogIjFjQ05JQVoyWC93MSIsICJhbW91bnQiOiAxLCAic2VjcmV0IjogIjVhYjAwMThiYzllNmM5NDEyYmUyZjRmYTIxM2U2OTUwZTg2NjA1YjQxZDg0OGE0N2U4NGFhY2Y4ZDQ4YzBlZjAiLCAiQyI6ICIwMmE0NzNjYTVjYWIzNmQ1OWViOTkwNmVjMTFmNjNhN2U2Nzg1NGFhMjU5YmZmMjMwMTBiNjE0YTBkMGFmOGU2MGUifV0sICJtaW50IjogImh0dHA6Ly8xMjcuMC4wLjE6MzMzOCJ9XX0=
Balance: 97 sat
INFO:     127.0.0.1:40294 - "POST /send?amount=1 HTTP/1.1" 200 OK