SiaFoundation / walletd

A new Sia wallet
https://sia.tech/software/walletd
MIT License
14 stars 8 forks source link

Add consensus update endpoints #158

Closed n8maninger closed 1 month ago

n8maninger commented 1 month ago

Adds consensus update endpoints for retrieving block deltas and adds experimental support for using a remote consensus database for wallet state.

n8maninger commented 1 month ago

This makes me wonder if, instead of doing chain.Manager-over-HTTP, we could do chain.Store-over-HTTP. Then we wouldn't need to fake or half-implement so many of these methods.

The downside is that, if you want to write a client in a different language, you have to reimplement chain.Manager, which is a lot of code. Hmm.

If you wanted to do chain.Store over HTTP, you would almost certainly need to add context.Context support and explicit errors to the interface 😛. The primary goal is to expose chain.ApplyUpdate and chain.RevertUpdate for exchanges to watch for utxo deposits. chain.Store over HTTP isn't enough without reimplementing all of the logic.