essential-contributions / essential-server

Centralized implementation of the Essential declarative protocol
Apache License 2.0
0 stars 0 forks source link

feat: add query state reads #166

Closed freesig closed 2 months ago

freesig commented 2 months ago

Adds an api that allows the user to submit a query that contains the solution data and state reads. The api then returns a list of key and values read on the pre state reads (this is basically a list of exactly what pre state is required for an intent, super useful for debugging).

Note there is no need to return the post state reads as this can be computed offline by just applying the state mutations to this pre state.

It can also return the pre and post state slots.

The other usecase for this api is writing pint programs that are only state reads. This will allow running state read queries using pint and the front end apps can interpret the slots to get the results.

Additionally this adds a test that runs all the curl commands in the rest server README.

TODO:

freesig commented 2 months ago

closes #165

freesig commented 2 months ago

@mitchmindtree I had to implement some serialization to get past the failing tests, maybe have a quick look at the last commit?