ParadigmFoundation / kosu-monorepo

Monorepo for Kosu (濾す). Includes network client, solidity contracts, and supporting libraries/tooling.
https://docs.kosu.io
MIT License
16 stars 4 forks source link

Generate JSON-RPC library clients using OpenRPC #370

Open BelfordZ opened 5 years ago

BelfordZ commented 5 years ago

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 commented 5 years ago

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

hrharder commented 5 years ago

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

BelfordZ commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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