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

Generate JSON-RPC library clients using OpenRPC #370

Open
BelfordZ opened this issue Nov 6, 2019 · 7 comments
Open

Generate JSON-RPC library clients using OpenRPC #370

BelfordZ opened this issue Nov 6, 2019 · 7 comments
Labels
enhancement New feature or request go-kosu Project: go-kosu good first issue Good for newcomers

Comments

@BelfordZ
Copy link

BelfordZ commented Nov 6, 2019

Using OpenRPC you can describe your JSON-RPC interface, and generate clients accordingly. You can see how we did it for ethereum here: https://github.com/etclabscore/ethereum-json-rpc-specification

Specifically you may want to look at the openrpc.json file in the root.

@qustavo
Copy link
Contributor

qustavo commented Nov 6, 2019

This is great, do you know if there are plans to generate Go servers out of a OpenRPC spec?

@hrharder
Copy link
Member

hrharder commented Nov 6, 2019

Thanks for the suggestion @BelfordZ. This is certainly something we'd be interested in looking into.

@hrharder hrharder added enhancement New feature or request go-kosu Project: go-kosu good first issue Good for newcomers labels Nov 6, 2019
@BelfordZ
Copy link
Author

BelfordZ commented Nov 7, 2019

@gchaincl Thank you for taking a look, and asking.

Yes. We are working on generated go clients at the moment. I'd expect it to be ready before the new year.

If you are interested in helping in the efforts to getting a great go client together, feel free to pop by the open-rpc github, specifically https://github.com/open-rpc/generator-client

ATM we dont have an issue filed for the go client, would greatly appreciate this as a contribution.

@hrharder No problem. If you need any help or have any questions, I'm at your disposal.

Great work on this project BTW. It's always refreshing to see good software development practices in crypto.

@BelfordZ
Copy link
Author

BelfordZ commented Nov 7, 2019

@gchaincl My appologies, I read clients! haha.

Server generating is on the cards for sure, but its a little bit more nuanced than client generation, since the implementation of the server would be left open - it presents a very different developer workflow. We are working on patterns for making this nice to use, but haven't quite landed on anything yet.

@shanejonas
Copy link

There are existing libraries that can do client/server generation natively in golang, its currently used for hyperledger burrow, take a look, might fit your needs:

https://github.com/gregdhill/go-openrpc

@hrharder
Copy link
Member

hrharder commented Nov 7, 2019

@BelfordZ appreciate it! Glad you're seeing some good practices -- we certainly try.

Appreciate the issue. Once we clear up some higher-priority tasks we have in the pipeline we'll circle back to this. I've wanted to try out OpenRPC for some time. :)

@qustavo
Copy link
Contributor

qustavo commented Nov 11, 2019

There are existing libraries that can do client/server generation natively in golang, its currently used for hyperledger burrow, take a look, might fit your needs:

gregdhill/go-openrpc

Thanks for sharing, I'll have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go-kosu Project: go-kosu good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants