Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package generated protobuf code #9

Open
dckc opened this issue Jun 16, 2020 · 4 comments
Open

package generated protobuf code #9

dckc opened this issue Jun 16, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@dckc
Copy link

dckc commented Jun 16, 2020

It would be really handy to be able to just npm install rchain-probuf and get the stuff generated files with the rnode-grpc-js tool.

Package versions could correspond to rnode versions.

@dckc
Copy link
Author

dckc commented Jun 17, 2020

progress: rchain-community/rvote@c86ae14

@tgrospic
Copy link
Owner

You can do the same with two commands.

# Install
npm i @tgrospic/rnode-grpc-js google-protobuf @grpc/grpc-js grpc-tools protobufjs

# Generate JS
node_modules/.bin/rnode-grpc --rnode-version v0.9.24

Why I'm not jumping on generating fixed versions is because I'm planing to build code generation directly from gRPC reflection which is now enabled in RNode. And also no additional tool will be necessary.

But having some clever GitHub action to generate fixed version would be nice to have.
In most version protobuf definitions are not changes so generating for each version is not necessary but I'm not sure what would be better approach.

@tgrospic tgrospic added the enhancement New feature or request label Jun 19, 2020
@dckc
Copy link
Author

dckc commented Jun 19, 2020

Those 2 commands are pretty much what I did. Publishing the result in npm would save a few hours here and there for folks like me.

Putting it in a CDN along with a few more bits so that rchain is available with one <script src='https://'> would be really nice. (with subresource integrity, of course)

I haven't gone as far as putting the generated code in npm... or even as far as figuring out how to treat different directories as different packages in my project.

I wonder what gRPC reflection is or what its impact would be. Here's hoping for time to study it...

@tgrospic
Copy link
Owner

More info about gRPC reflection and what this means for RNode is on PR where reflection is enabled.
rchain/rchain#2698

Basically, server can give the same information as in proto files so client code can be generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants