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

Implement /pallets endpoints #293

Closed
9 of 10 tasks
emostov opened this issue Sep 18, 2020 · 8 comments
Closed
9 of 10 tasks

Implement /pallets endpoints #293

emostov opened this issue Sep 18, 2020 · 8 comments
Labels
I8 - Enhancement Additional feature request P7 - Nice to Have Nice, but not urgent Q1 - Easy Issue is easy, good newcomer issue

Comments

@emostov
Copy link
Contributor

emostov commented Sep 18, 2020

Implementing one of these would be good exprience for someone looking to learn more about polkadot-js and this service.

  • /pallets
  • /pallets/{palletId}/constants
  • /pallets/{palletId}/constants/{constantId}
  • /pallets/{palletId}/dispatchables
  • /pallets/{palletId}/dispatchables/{dispatchableId}
  • /pallets/{palletId}/errors
  • /pallets/{palletId}/errors/{errorId}
  • /pallets/{palletId}/events
  • /pallets/{palletId}/events/{eventId}
  • /pallets/{palletId}/storage
@danforbes
Copy link
Contributor

Zeke, would the solution to this Issue amount to reading the metadata based on the user-provided palletId, etc and simply returning the correct value?

@emostov
Copy link
Contributor Author

emostov commented Nov 12, 2020

@danforbes, essentially but filtering out modules from the metadata that do no include the item type (i.e. filtering out modules that do no include storage items if the user requests /pallets/{palletId}/storage)

There will likely also be some slight reorganization and or derived information added to the metadata or the exact item retrieved.

@ltfschoen
Copy link

are you able to forecast when would /pallets/democracy/storage/ReferendumInfoOf may be implemented by? is anyone working on it already?

@emostov
Copy link
Contributor Author

emostov commented Feb 10, 2021

@ltfschoen This is already implemented

@ltfschoen
Copy link

ltfschoen commented Feb 10, 2021

@ltfschoen This is already implemented

yes i understand that the democracy pallet is implemented into Substrate itself,

but where is it implemented in this sidecare repository? when would it be specifically implemented into this sidecar repository. the democracy pallet isn't included in either the /controllers or /services folders of this repository. isn't this where it would be implemented?

currently if i run curl -s http://0.0.0.0:8080 | jq the response does not include any democracy pallet paths

@emostov
Copy link
Contributor Author

emostov commented Feb 11, 2021

The path for what you are asking for is already implemented as pallets/{palletId}/storage/{storageItemId}. Please consult the swagger docs for more info on the endpoint: https://paritytech.github.io/substrate-api-sidecar/dist/

@ltfschoen
Copy link

thanks, i see. i guess it would have helped if i actually tried it properly. when i run curl -s http://0.0.0.0:8080 | jq it does show the endpoints:

    {
      "path": "/pallets/:palletId/storage/:storageItemId",
      "method": "get"
    },
    {
      "path": "/pallets/:palletId/storage/",
      "method": "get"
    },

and it get this response:

➜  ~ curl -s http://0.0.0.0:8080/pallets/democracy/storage/ | jq
{
  "code": 400,
  "message": "\"democracy\" was not recognized as a queryable pallet.",
..
}

so the problem i have is that my runtime doesn't implement the democracy module yet

@emostov emostov added I8 - Enhancement Additional feature request Q1 - Easy Issue is easy, good newcomer issue P7 - Nice to Have Nice, but not urgent labels Mar 16, 2021
@IkerAlus
Copy link
Contributor

My understanding is that this issue is already close with #1209 , #1210 , #1204 and #1176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I8 - Enhancement Additional feature request P7 - Nice to Have Nice, but not urgent Q1 - Easy Issue is easy, good newcomer issue
Projects
None yet
Development

No branches or pull requests

4 participants