-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
expose a simple friendlier GET API for retrieving contract state, eg. for use with curl. #904
Comments
We could also support puts using HTTP PUT, although the user would need to provide the contract WASM in addition to the updated state or delta. |
A couple comments/caveats first. There are some things are not keen to using regular HTTP requests like the subscribe and updates since the way it works it would require polling from the client side so that's gonna feel a bit awkward compared to the more natural websocket approach where we are essentially implementing a pub/sub model though it. That said, I can see the value of this and ease of use if you want to do approach managing contracts in a more traditional style, like through a REST API. The implementation should be done via adding new path handlers to the existing http gateway server handling the websocket connections. See We would add new route handlers under the But we can break the task in 2 separate PR's so is easier to implement and review. So first do the necessary changes to the server. The server needs to handle the requests to the contract executor and then wait for an answer, since all that is running on it's own task/thread, you can check how this is done in the websocket implementation at The regular HTTP request one should be a simplier version of this, and we would need a separate handler for each operation (let's just start with get since that's relatively simple). I could get this done quickly but I will leave it open to implement to anybody who wants to help contributing so they get more familiar with how the whole application is setup. P.S. Also must comment that curl can upgrade connections to use websockets, although it ain't the more natural/easiest to use thing, since this is what this initially spawned the request. |
If you need any help while implementing feel free to just post them here and I'll help you moving as fast as possible. |
I have some ideas about how to expose contract state. I am also working on how to expose an API filtered by user inetrface. |
Would you enjoy a public talk or a private talk about this? Either way, we can schedule a talk soon. |
Yes I would love to enjoy a private talk. I also think a public dev documentation could benefit to the dev community. I just would not like to be recorded. |
I've started this conversation to help anyone make such requirements. |
I would like to connect mobile and web apps to freenet. Could we create a way to interact directly to contracts, delegate and user interface directly from web or apps please?
The text was updated successfully, but these errors were encountered: