Files
herolib/lib/hero/heromodels
2025-12-02 03:27:17 +01:00
..
...
2025-09-14 07:19:52 +02:00
...
2025-12-02 03:27:17 +01:00
...
2025-11-15 07:09:56 +02:00
...
2025-11-15 06:15:02 +02:00
...
2025-11-15 06:15:02 +02:00
...
2025-11-15 07:09:56 +02:00
...
2025-09-18 08:36:50 +02:00

http based RPC server


curl -s http://localhost:9933/ \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "message_set",
    "params": {
      "message": "Hello world!",
      "parent": 0,
      "author": 42
    },
    "id": 1
  }' | jq .

{
  "jsonrpc": "2.0",
  "result": "46",
  "id": 1
}

rpc discovery:

curl -s http://localhost:9933/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"rpc.discover","params":[],"id":99}' | jq .

unix socket based RPC server

# to test the discover function, this returns the openrpc specification:
echo '{"jsonrpc":"2.0","method":"rpc.discover","params":[],"id":1}' | nc -U /tmp/heromodels

# to test interactively:

nc -U /tmp/heromodels

# then e.g. paste following in

{"jsonrpc":"2.0","method":"message_set","params":{"message":"Hello world!","parent":0,"author":42},"id":1}

needs to be on one line for openrpc to work

see lib/hero/heromodels/rpc/openrpc.json for the full openrpc specification