Open idky137 opened 1 week ago
A possible gRPC implementation:
This would allow any wallets or block explorers to have a simple interface to fetch data both locally and remotely and allow for more complex indices to be built when running code privately. But would also stop public Zaino servers that will replace lightwalletd from exposing potentially dangerous functionality.
A simple wrapper for the ReadStateService seems best. Multiple encodings could be supported by tonic as long as there are From
and Codec
impls for them (though tonic doesn't yet support selecting a codec with the content-type header so it would need to use different endpoints or rust cfg flags).
Several options have been discussed:
A wrapper around the ReadStateService from Zebra, either hyper or a gRPC implementation. Offering a 1-2-1 correlation of functionality provided by the ReadStateService would provide a tidy way for "cli-wallets" to access chain data either locally or remotely but adds dev time duplicating functionality already offered by the lightwallet gRPC service.
Extending The lightwallet gRPC service with functionality required by "cli-wallets" and block explorers to provide a single unified API would lead to a more concise and easier to maintain service but would require extra dev by consumers to implement both local and remote functionality. (This could be nullified by adding a set of public methods in Zaino-State with a 1-2-1 correlation with the extended wallet gRPC service.)