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
Add rest server support for wasm module, to query and create tx #7
Comments
I feel endpoints should be grouped separately for code and contract. Here is the list of endpoints I think should be good. I wanted to make sure they don't deviate much from client. Transactions:POST /code/store Query:GET /code/list |
@sahith-narahari can you elaborate on the reason for the I would propose the following endpoints with Create ContractPOST
|
Thank you both for your comments. In general, the list looks correct for scope @sahith-narahari And I do agree (to 95%) with the detailed version from @alpe , thanks for spec'ing this more. It does look more RESTful, The one issue with the second part is the confusion between
The |
Sticking with that pattern, I would make the queries more "RESTFUL":
I am unsure about And all cli flags we want to support should be turned into query args What do you think here? |
Thanks for the detailed explanation @alpe @ethanfrey. My main motto behind the separation was ListCode and ListContract will create an ambiguity with same endpoints. |
Regarding |
This issue is now published on WorksHub. If you would like to work on this issue you can |
Sorry about the ambiguity in the path of my proposal. I was doing some edits before submitting. It was like this before:
This reflects the dependency between code and contract in a REST-ish style but for execution the caller would need to know or resolve |
@sahith-narahari started working on this issue via WorksHub. |
Thanks @ethanfrey for the heads up, will ensure that. |
@ethanfrey I'm done with all functions except for contract state. I see in cli it was separated using sub-commands, how would you like me to go ahead with this in rest. |
Hi @sahith-narahari can you make a pr with the current state. I would be happy to merge this while work continues, so I can start to test out on a live node. As to the state query functions, I would us a separate path for each.
If you have better names, you can use those instead |
Thanks, will raise a PR with current state |
I merged this PR. |
Yes, I will the add remaining two query functions. Even I wanted to test these, will try to find a way. Else I'll test them manually by deploying a contract using rest and query it |
A manual test is better than no test at all. And good enough for now. If it works, the tests are there to keep us from breaking stuff in the future. Which we can do once we figure out a good approach (consulting cosmos-sdk core team on best practices) |
* Update to ibc version of wasmvm * Update test contracts * Adjust code to updated wasmvm * Update to tip of wasmvm PR 172 * Update test contracts and add stargate support to tests * Upgrade to wasmvm 94043576bb71 Co-authored-by: Alex Peters <alpe@users.noreply.github.com>
…s/github.com/cosmos/ibc-go/v2-2.0.2
Is there an official doc for the rest paths? It's not clear which style got accepted |
The REST integration was deprecated and is removed now. Instead there is a grpc-rest gateway endpoint. You can see the path defined in in the query proto file |
…osmWasm#7) * featremove custom proto changes of genesis and types * feat!: extract custom wasm logic for lbm-sdk * feat: move custom cli of lbm-sdk to `wasmplus` client package * feat: remove params for wasmplus. just use original params of x/wasm * chore: remove unused customEncoding and customQuerier * chore: apply a changes about separated ibc-go import path * doc: add readme of `x/wasmplus` * fix: lint error * chore: add more unittest * chore: add more unittest * chore: add more unittest * chore: add more unittest * chore: update changelog * chore: remove interchain-accounts * chore: feedback reviews * doc: update proto changes * chore: apply review feedback - move all function of `wasmplus/keeper/keeper_extension.go` to `wasmplus/keeper/keeper.go` - remove no need files (keeper_extension.go, metrics.go)
Summary
We only have CLI, and we will want to add support for a rest server. This would go into
x/wasmd/client/rest
and be exposed with the standard wasmcli rest server.Problem Definition
We want to allow webapps to do everything we can do in the CLI. I have no clear design for the urls, so the first part is maybe to propose a set of endpoints. I want queries and ability to submit the 3 tx defined in this module. This will be the basis for a js api.
This will also probably involve refactoring the Querier a bit to allow better reuse between cli and rest.
Proposal
To be filled in (add your proposal of endpoints in the comments, please)
For Admin Use
The text was updated successfully, but these errors were encountered: