From 4f4dc8252004994c1d130cb2b33689c2273b2744 Mon Sep 17 00:00:00 2001 From: mycognosist Date: Mon, 5 Dec 2022 13:32:37 +0200 Subject: [PATCH] update publish curl example --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2175c9f..0e8741c 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ The server currently supports HTTP. | --- | --- | --- | --- | | `ping` | | `pong!` | Responds if the JSON-RPC server is running | | `whoami` | | `<@...=.ed25519>` | Returns the public key of the local node | -| `publish` | `` | `{ msg_key: <%...=.sha256>, next_seq: }` | Publishes a message and returns the key (message hash) and next sequence number | +| `publish` | `` | `{ msg_key: <%...=.sha256>, next_seq: }` | Publishes a message and returns the key (message hash) and sequence number | `curl` can be used to invoke the available methods from the commandline: @@ -95,7 +95,13 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method" ``` curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "publish", "params": {"type": "about", "about": "@o8lWpyLeSqV/BJV9pbxFhKpwm6Lw5k+sqexYK+zT9Tc=.ed25519", "name": "solar_glyph", "description": "glyph's experimental solar (rust) node"}, "id":1 }' 127.0.0.1:3030 -{"jsonrpc":"2.0","result":"pong!","id":1} +{"jsonrpc":"2.0","result":{"msg_key": "", "seq": "","id":1} +``` + +_Note: You might find it easier to save your JSON to file and pass that to `curl` instead._ + +``` +curl -X POST -H "Content-Type: application/json" --data @publish.json 127.0.0.1:3030 ``` ## License