cartesi / machine-emulator-tools

Set of tools to help the development
Apache License 2.0
13 stars 20 forks source link

Simpler tool for raw GIO requests #84

Open edubart opened 1 month ago

edubart commented 1 month ago

Context

I was trying to create a naive example on how to exchange data with the outside, I ended up with the following example:

echo '{"domain":16,"id":"'$(echo -n Hello from inside! | hex --encode)'"}' |
  rollup gio |
  jq -r .data |
  tr -d '\n' |
  hex --decode > output

This is boilerplate and heavy on machine cycles due to all encoding going on, I wish we had a new simpler tool more low level and naive to simplify the example, something like:

echo -n Hello from inside! | gio --domain 16 > output

So no JSON and hex encoding in the middle, just raw binary data for IO with pipes. The tool would be way simpler than rollup tool. The motivation is to simplify examples in things I am trying to document.

Maybe this could be done inside yield tool, since it is more low level.