https://devenv.sh allows defining tasks in your favorite language using JSON-RPC protocol and exposing them as an executable :
{
task.serverProtocol = [ "myexecutable" ];
}
Which would launch myexecutable /tmp/rando.sock
and devenv
would on startup immediately ask for a list of tasks:
{
"jsonrpc": "2.0",
"method": "initialize",
"params": {},
"id": 1
}
And the server responds:
{
"jsonrpc": "2.0",
"result": {
"tasks": [{
"name": "prefix:custom",
"depends": []
}]
},
"id": 1
}
Then the client can ask the server to run a task:
{
"jsonrpc": "2.0",
"method": "run",
"params": {
"task": "prefix:name",
"inputs": {},
"outputs": {}
},
"id": 2
}
And server streams updates about stdout/stderr:
{
"jsonrpc": "2.0",
"method": "log",
"params": {
"task": "prefix:name",
"line": "some text",
"stderr": false,
"time": "20240828T212611.11Z",
}
}
Until the final response from the server with outputs and the final status of the task.
{
"jsonrpc": "2.0",
"result": {
"task": "prefix:name",
"outputs": {},
"status": "succeeded"
},
"id": 2
}
- Use reth-ipc for the Client using (jsonrspee)[https://github.com/paritytech/jsonrpsee/)
- A test suite with a defined set of tasks that Server SDK should implement for the test suite to run against
- Rust SDK for the Server