-
Notifications
You must be signed in to change notification settings - Fork 90
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
Chopsticks client is not compatible with Papi #801
Comments
Chopsticks is a client itself and it and has its own methods, this one is not implemented |
yeah we need to implement those new methods |
@xlc, thanks for the response. Could you estimate which version will include the fix? |
Unfortunately, I can't provide an estimate as we don't have extra resources atm |
There are ways for papi to work with clients that do not yet implement these rpc methods (https://papi.how/requirements#polkadot-sdk-110--x--1110) - as long as the client at least acts as a client on polkadot api > v1.1.0 would. We're still running into issues with this method though, which strangely results in the following error message from the chopsticks client:
Any idea what the issue may be here? May it be that the id coming from papi is throwing it off? |
id needs to be number |
Mhh I see we have to document this better, but Polkadot-API is built on top of the new Polkadot JSON-RPC spec, and requires The compatibility layer from Another issue might be this:
However, the JSON-RPC spec (the global one) specifies that the All of the requests coming from PAPI use string |
We would be super happy to collaborate on this. We can assign some resources for the upcoming OpenGov proposal to tackle this. Meaning that I would be super happy to be mentored and contribute 🙂
As @voliva pointed out this is bad, as it makes the API not JSON-RPC compliant. In other words: this API seems to be tightly coupled to an implementation detail of PJS... which kinda defeats the point of having a JSON-RPC interface. |
Here are some pointers for people wanting to contribute: To update JSON RPC id type schema:
To implement new RPC methods: Add a new file if needed (e.g. chainHead.ts): https://github.com/AcalaNetwork/chopsticks/tree/master/packages/core/src/rpc/substrate and have it added to the handlers: https://github.com/AcalaNetwork/chopsticks/blob/7c4a7a92a4ea774ae10f1a2b1349063f760990e0/packages/core/src/rpc/substrate/index.ts Implement the handler methods. Use existing methods as an example. e.g.
and that's pretty much it. The JSON RPC spec should contain all the info about what's needed: https://paritytech.github.io/json-rpc-interface-spec/ However, I will suggest just use papi to connect to Chopsticks, and implement whatever missing RPC methods it complaints until it runs to get an MVP version out. The API docs for Chopsticks core types could be helpful: https://acalanetwork.github.io/chopsticks/docs/core/README.html In theory, the existing core types should be enough to implement all the RPC handlers but let me know if that's not the case. |
Making a new release with papi support https://github.com/AcalaNetwork/chopsticks/releases/tag/0.15.0 |
Description
When attempting to create a client instance in PAPI, Chopsticks throws the following error:
After some investigation, it appears that the desired RPC call is not available after forking.
Steps to Reproduce
chainHead_v1_follow
method is available under Developer > RPC calls > rpc > methods.The text was updated successfully, but these errors were encountered: