2

We have a pallet (called pallet_supersig), and have an RPC module that we have implemented into a substrate node template with supersig, when running the dev node we can find the rpc methods() that the supersig methods are there:

    superSig_getProposalState
    superSig_getSupersigId
    superSig_getUserSupersigs
    superSig_listMembers
    superSig_listProposals

rpc > methods()

But not in the dropdown,

enter image description here

We also try to curl it, but aren't able to find the exact request to access it. Or perhaps it is not accessible?

We are either calling it incorrectly or we are missing something when desinging the RPC. Could someone check over this issue RPC to see what we're missing?

1
  • 1
    it would be useful if you add in the post the curl command you are using Commented Aug 24, 2022 at 10:34

1 Answer 1

8

You can list all RPC methods like this with cURL and jq:

curl -sS -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "rpc_methods"}' http://localhost:9933/ | jq '.result.methods'

Or call one of your supersig methods like this:

curl -sS -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "superSig_listMembers", "params": [123]}' http://localhost:9933/

# Which errors with a weird message...
{"jsonrpc":"2.0","error":{"code":1,"message":"Runtime error","data":"Application(Execution(Other(\"Exported method SuperSigApi_list_members is not found\")))"},"id":1}%                      

Anyway, the browser error message gives it away.

API/INIT: RPC methods not decorated: superSig_getProposalState, superSig_getSupersigId, superSig_getUserSupersigs, superSig_listMembers, superSig_listProposals

So it should be fixed by this.
Normally the node should also print that error, but your node isn't printing anything.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.