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

Consider OpenRPC integration #5

Closed
BelfordZ opened this issue Sep 11, 2019 · 11 comments
Closed

Consider OpenRPC integration #5

BelfordZ opened this issue Sep 11, 2019 · 11 comments

Comments

@BelfordZ
Copy link

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.

@cinemast
Copy link
Contributor

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

@BelfordZ
Copy link
Author

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

hmu!

@cinemast
Copy link
Contributor

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

@lauritsriple
Copy link

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

@BelfordZ
Copy link
Author

BelfordZ commented Oct 24, 2020

@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 ;)

@cinemast
Copy link
Contributor

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?

@BelfordZ
Copy link
Author

BelfordZ commented Nov 4, 2020

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

@cinemast
Copy link
Contributor

cinemast commented Nov 7, 2020

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

@cinemast
Copy link
Contributor

cinemast commented Nov 7, 2020

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?

@cinemast
Copy link
Contributor

cinemast commented Nov 7, 2020

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.

@BelfordZ
Copy link
Author

@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.

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

No branches or pull requests

3 participants