You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, due to its fork of Cairo Hints, Scarb Agent uses protocol buffers to define messages shared between Cairo and an external server.
Now that we're using the YAML schema for the input and output of the Cairo program, I'm thinking of using YAML as well to define oracle requests, responses and services. This way, we have consistency with I/O, it's easier to support more complex data types, better DX, and we keep all cairo serde-related code in cairo-io-serde crate.
Here is an example of the yaml file for an oracle definitions:
I think that this is incredible and that we could also leverage the power of YAML into this to merge the configurations, like servers.json and cairo_input.yaml into a agent_config.yaml.
Also, YAML usually supports anchors (example), which let us easily duplicate data if we need to, like the current url of the Python server.
Another thing is that adding Primitive, Array or Struct its duplicating information, as this can be obtain through the definition of the YAML for example:
Array
Request:
fields:
y:
- i32
Struct
Inner:
fields:
inner_field: u32# This is also how we can define a primitiveRequest:
fields:
x:
inner: Inner
Options
Inner:
fields:
inner_field: Option<u32>
Servers.json
schemas:
Inner:
fields:
inner_field: u32servers:
- name: apyserver_url: localhost:3000/apy # Also the name should be a reference, but we should not concatenate `server_url + / + name`
- name: balance_dataserver_url: localhost:3000/my_balance# Also we could make that if url is missing we take the default url plus the name in this case
- name: ironclad_data # here it whould be `default_url + / + ironclad_data`options:
default_url: localhost:3000
Also, is there a possibility to do something with Oracle.lock?
Currently, due to its fork of Cairo Hints, Scarb Agent uses protocol buffers to define messages shared between Cairo and an external server.
Now that we're using the YAML schema for the input and output of the Cairo program, I'm thinking of using YAML as well to define oracle requests, responses and services. This way, we have consistency with I/O, it's easier to support more complex data types, better DX, and we keep all cairo serde-related code in
cairo-io-serde
crate.Here is an example of the yaml file for an oracle definitions:
Wdyt @Gonmeso @EduPonz
The text was updated successfully, but these errors were encountered: