rpc_over_socket #16

Merged
maximevanhees merged 2 commits from rpc_over_socket into main 2025-10-23 13:48:58 +00:00
Member

Implements JSON-RPC calls over Unix sockets. Can be enabled using the --enable-rpc-ipc flag and a custom socket path can be supplied with --rpc-ipc-path.

Example starting the herodb with data directory in /tmp/data_test and the socket path /tmp/herodb.sock:

OPENAI_API_KEY=<api_key> ./target/release/herodb --dir /tmp/data_test --enable-rpc --rpc-port 8080 --enable-rpc-ipc --rpc-ipc-path /tmp/herodb.sock --admin-secret "<admin_password>"

It can be testing using tools like socat. For example:
socat -d -d -t 5 - UNIX-CONNECT:/tmp/herodb.sock

  • request:
{
  "jsonrpc": "2.0",
  "method": "herodb_getDatabaseInfo", 
  "params": [1],
  "id": 3
}
  • response:
{"jsonrpc":"2.0","id":3,"result":{"id":1,"name":"local-vectors","backend":"Lance","encrypted":false,"redis_version":"7.0","storage_path":"/tmp/data_test","size_on_disk":0,"key_count":null,"created_at":1761210093,"last_access":null}}
Implements JSON-RPC calls over Unix sockets. Can be enabled using the `--enable-rpc-ipc` flag and a custom socket path can be supplied with `--rpc-ipc-path`. Example starting the `herodb` with data directory in `/tmp/data_test` and the socket path `/tmp/herodb.sock`: ``` OPENAI_API_KEY=<api_key> ./target/release/herodb --dir /tmp/data_test --enable-rpc --rpc-port 8080 --enable-rpc-ipc --rpc-ipc-path /tmp/herodb.sock --admin-secret "<admin_password>" ``` It can be testing using tools like `socat`. For example: `socat -d -d -t 5 - UNIX-CONNECT:/tmp/herodb.sock` - request: ``` { "jsonrpc": "2.0", "method": "herodb_getDatabaseInfo", "params": [1], "id": 3 } ``` - response: ``` {"jsonrpc":"2.0","id":3,"result":{"id":1,"name":"local-vectors","backend":"Lance","encrypted":false,"redis_version":"7.0","storage_path":"/tmp/data_test","size_on_disk":0,"key_count":null,"created_at":1761210093,"last_access":null}} ```
maximevanhees added 2 commits 2025-10-23 13:48:44 +00:00
maximevanhees merged commit 592b6c1ea9 into main 2025-10-23 13:48:58 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: herocode/herodb#16
No description provided.