1 Additional JSON RPC API
Adam Babik edited this page 2017-12-22 11:57:27 +01:00

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),
  • 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
}