Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

gRPC service definitions #272

Open
nfultz opened this issue Jul 6, 2020 · 2 comments
Open

gRPC service definitions #272

nfultz opened this issue Jul 6, 2020 · 2 comments

Comments

@nfultz
Copy link

nfultz commented Jul 6, 2020

Are there plans to include gRPC service definitions for this package? I only see messages declared in api.proto.

@Shoeboxam
Copy link
Member

Shoeboxam commented Jul 10, 2020

I don't currently have plans to add gRPC service definitions, but I'm not opposed to adding them. We don't currently use gRPC because, for my use case, gRPC hasn't been necessary- I'm just working with ffi. I see how these can be useful though.

I did a little research into this--
Looking at grpc-rs, we could switch the codec to prost:
https://github.com/tikv/grpc-rs#feature-prost-codec-and-protobuf-codec

I see some additional necessary dependencies like Cmake, binutils, yasm, perl. On the face of it, this makes me prefer gating gRPC behind a feature flag to keep the dependencies down. The feature flag would need to be present in the validator crate's build process, so we can swap the prost build out with the grpc-rs build. What other details do you foresee in how you see this feature being integrated? Do you have opinions on exposing it as a separate crate, or via conditional compilation on an existing crate?

@nfultz
Copy link
Author

nfultz commented Jul 10, 2020

I agree, I don't think you need to pull in the grpc client / server library; but rather, since this repository is the source of truth for the api, it would be nice to have that api described in the proto definition, as a service with methods.

This would help leverage some other libraries eg to handle oauth tokens, generate REST wrappers, etc, when building a system.

In a non-network context, it might also make it easier to quickly create other language bindings as well. I could definitely imagine generating api.R + wrapper.c directly from a service definition, for example. I think prost already provides callback hooks for that type of thing.

@raprasad raprasad moved this from Ready to To Discuss/Estimate in DEPRECATED - WhiteNoise Combined Release Aug 31, 2020
@raprasad raprasad removed this from To Discuss/Estimate in DEPRECATED - WhiteNoise Combined Release Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants