From 10a14ecc6161ba92d8478ed281a9a2ceffcecbc6 Mon Sep 17 00:00:00 2001 From: Adam Babik Date: Fri, 22 Dec 2017 11:57:27 +0100 Subject: [PATCH] Add Additional JSON-RPC API document --- Additional-JSON-RPC-API.md | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Additional-JSON-RPC-API.md diff --git a/Additional-JSON-RPC-API.md b/Additional-JSON-RPC-API.md new file mode 100644 index 0000000..cf8a48f --- /dev/null +++ b/Additional-JSON-RPC-API.md @@ -0,0 +1,45 @@ +# Whisper + +## MailServer + +MailServer is a Whisper node that has a capability to store messages and send them back after receiving a request. The messages are sent using p2p connection. + +### `shh_requestMessages` + +Returns cached, possibly expired, messages from a MailServer node. + +**Parameters** +1. `Object`: Options describing the request details: +* `mailServerPeer` - `String`: enode of a MailServer node (must be first added as a peer and allowed to send p2p messages using [`shh_markTrustedPeer`](https://github.com/ethereum/go-ethereum/wiki/Whisper-v5-RPC-API#shh_marktrustedpeer)), +* `from` - `Number`: unix time from which messages should be collected (inclusive), +* `to` - `Number`: unix time to which messages should be collected (inclusive), +* `topic` - `String`: a topic as a string to filter messages, +* `symKeyID` - `String`: ID of a symmetric key to authenticate to the MailServer. + +**Returns** + +`Boolean` on success and an error on failure. + +**Example** +``` +// Request +curl -X POST --data '{ + "jsonrpc": "2.0", + "method": "shh_requestMessages", + "params": [{ + "mailServerPeer": "enode://d25474361659861e9e651bc728a17e807a3359ca0d344afd544ed0f11a31faecaf4d74b55db53c6670fd624f08d5c79adfc8da5dd4a11b9213db49a3b750845e@52.178.209.125:30379", + "topic": "0x11223344", + "symKeyID": "b874f3bbaf031214a567485b703a025cec27d26b2c4457d6b139e56ad8734cea", + "from": 1513939909, + "to": 1513939034 + }], + "id": 1 +}' + +// Result +{ + "id": 1, + "jsonrpc": "2.0", + "result": true +} +``` \ No newline at end of file