Add Additional JSON-RPC API document

Adam Babik 2017-12-22 11:57:27 +01:00
parent 0c432ac2a4
commit 10a14ecc61
1 changed files with 45 additions and 0 deletions

@ -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
}
```