kyokan / bob-wallet

Bob Wallet is a GUI for DNS Record Management and Name Auctions on Handshake. It includes an integrated full node: hsd
https://www.bobwallet.io/
GNU General Public License v3.0
381 stars 91 forks source link

Shakedex will not work in SPV mode #480

Open pinheadmz opened 2 years ago

pinheadmz commented 2 years ago

The Shakedex swapProof module expects the nodeClient to be able to getCoin(): https://github.com/kurumiimari/shakedex/blob/744387a5e6cf2499e4becc78618babc5bf173e5e/src/swapProof.js#L99-L102

The nodeClient is part of the shakedex Context object which only expects the IP address and API key for the full node's HTTP API: https://github.com/kurumiimari/shakedex/blob/744387a5e6cf2499e4becc78618babc5bf173e5e/src/context.js#L11-L12

Even though in SPV mode, Bob is already configured to make getCoin() requests from the hosted server...

https://github.com/kyokan/bob-wallet/blob/6f3f93bf202740f27cda1b46684d78e94ae68a96/app/background/node/service.js#L491-L496

... There is kinda currently no way to pass this data back to Shakedex easily.

The best fix may be actually a change in Shakedex, either adding a custom Context argument for getCoin() or maybe being able to pass a nodeClient object (which could include our API call for getCoin()) as opposed to just passing an IP address + api key.

For now, all attempts to fill an auction with SPV will simply fail. We might want to make it clear in the UI that shakedex + SPV is a bad combo, for now...