jsonrpcx/json-rpc-cxx

Consider OpenRPC integration

BelfordZ opened this issue ยท 11 comments

Hey there,

I work on a project called OpenRPC. Its a fork of OpenAPI, modified to suit JSON-RPC 2.0.

There are a lot of things you can use an OpenRPC document for in your projects. Let me know if you have any questions or need any help.

Cheers.

This looks very interesting, I'll have a look.

Happy to jump in a call with you and talk about your project and open rpc.

hmu!

Looks quite similar to what I had in mind anyway: https://github.com/cinemast/json-rpc-stub/blob/master/examples/warehouse.json

It is again similar to Kodi's JSON-RPC API description: https://kodi.wiki/view/JSON-RPC_API/v8

Hi! Is there any plans for integrating this to the library? Support for openrpc to generate stubs would be really neat.

@lauritsriple we have a hosted version of mock-server that is a json rpc for getting a 15-minute mock server. You can give it a try by passing in your open-rpc document to the mock method:

https://playground.open-rpc.org/?url=https://mock.open-rpc.org

it will return you a url to use as mock server. It will respond to all your methods, validate params, respond to rpc.discover.

It you want to run your own, or run it against a single document instead of in this 'service mode', you can check out https://github.com/open-rpc/mock-server

While that might not be the best path for this specific project, it certainly is a cool one ;)

I like the idea, just did not have time yet to implement it. @BelfordZ do you already have existing code generators for other languages/libraries?

yep. We have https://github.com/open-rpc/generator

which can generated a fully typed api client for you. Along side this, you can generate a documentation site similar to what we have here: https://core-geth.org

Would you prefer to integrate json-rpc-cxx support in the existing open-rpc/generator or have it as a separate project?

Ok, I just took a look at the existing rust integration. Apparently there is nothing there? I would have thought that the generator is somehow template based?

I just checked out the source and tried to build it:

npm install
npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\cinemast\AppData\Roaming\npm-cache\_logs\2020-11-07T20_01_35_257Z-debug.log
PS C:\Users\cinemast\git\generator> npm install
npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\cinemast\AppData\Roaming\npm-cache\_logs\2020-11-07T20_06_50_534Z-debug.log

Looking at the pulled in dependencies, I think adding to the existing repo is not an option for me. I prefer downloading a simple binary that I can use within my build process and not having to pull in the node ecosystem.

@cinemast That makes sense. Sorry about the issue with current generator that you are running into.

That said, the open-rpc/generator is meant to serve as a generic / try to suit all generator. I'd love to see a generator written in different languages, ones that can produce a light binary. Happy to help any way I can.