Closed jonasnick closed 5 years ago
How about I add support for a configurable proxy (via superagent-proxy
) instead of using a transparent proxy?
So... I added support for setting explicit proxy configuration (https://github.com/shesek/spark-wallet/commit/e5cd4e5a23a70e2f0fd3ce2b825e496a41c413a8, using the HTTPS_PROXY
/ALL_PROXY
environment variables), but the cause of this issue is that Bitstamp are apparently blocking requests from Tor.
This is what I get when trying to access https://www.bitstamp.net/api/v2/ticker/btcusd using the Tor browser:
It looks like the only solution is to fetch rates from someplace else, that doesn't block tor. Any suggestions?
Thanks! And wow, how annoying... kraken requires cloudflare authentication too.
curl -X POST -d "pair=XBTUSD" https://api.kraken.com/0/public/Ticker | jq -r ".result .XXBTZUSD .c [0]"
doesn't work if you prepend torsocks. Perhaps another service to add to blockstream.info? :)
Wasabi Wallet provides an API for the USD rate :grimacing:
torsocks curl -X GET "http://wasabiukrxmkdgve5kynjztuovbg43uxcbcxn6y2okcrsg7gb6jdmbad.onion/api/v3/btc/Offchain/exchange-rates" -H "accept: application/json"
[{"ticker":"USD","rate":7272.75}]
Great find! Implemented in 485b0c13792c8f812e6c12110e0518992a1b9953, should work if you start spark with spark-wallet --rate-provider wasabi --all-proxy socks5h://127.0.0.1:9150
(or use a transparent proxy with torsocks instead of all-proxy
).
Still not released, though. I hope to release a new version sometime in the next few days (requires fixing #79 first).
Thanks! will try this out once released.
v0.2.6 was released with support for wasabi as the exchange rate provider and for setting a proxy. I also aliased --all-proxy
as simply --proxy
.
Thank you
Hey, I've been trying to wrap spark-wallet in torsocks to only allow outbound connections through tor, in particular getting the price from bitstamp. However, I'm getting the following error:
Spark wallet works as usual, but my wallet balance (in usd) remains
n/a
. I've been trying to debug this, but I have no idea why it shouldn't just work. So I'm wondering if superagent does something fancy in the background.