lightninglabs / faraday

Lightning Channel Management & Optimization Tool
MIT License
129 stars 30 forks source link

fiat: Expand fiat backends #37

Open carlaKC opened 4 years ago

carlaKC commented 4 years ago

As is, the fiat package only uses CoinCap's API for price information. The package is designed to allow different price sources without affecting our price calculation logic.

Steps to completion

  1. Identify different sources of price data and propose in this issue (perhaps coindesk)
  2. Add code to obtain price data over a range and update fiat/GetPrices to allow users to choose a backend
  3. Update rpc to allow choice of backends
nixbitcoin commented 4 years ago

It would also be great to create a Proxy option, like --server.proxy in loopd, to tunnel all price requests over Tor. This has obvious privacy benefits.

@zkSNACKs offer a Tor v3 HS under which you can request prices at http://wasabiukrxmkdgve5kynjztuovbg43uxcbcxn6y2okcrsg7gb6jdmbad.onion/api/v3/btc/Offchain/exchange-rates.

ellemouton commented 3 years ago

I was having a go at adding the --server.proxy option that @nixbitcoin suggested. However, it seems to me that CoinCap does not allow requests over Tor. When I curl the API directly I get json back but when I curl the API through the Tor proxy then I get a webpage back that requires a captcha to be completed. The same does not go for other APIs such as coindesk which makes me think that CoinCap is not allowing Tor requests (i am a Tor noob though so there may be a way to get around this that I am unaware of).