status-go/services/shhext
Andrea Maria Piana fd49b0140e
Move to protobuf for Message type (#1706)
* Use a single Message type `v1/message.go` and `message.go` are the same now, and they embed `protobuf.ChatMessage`

* Use `SendChatMessage` for sending chat messages, this is basically the old `Send` but a bit more flexible so we can send different message types (stickers,commands), and not just text.

* Remove dedup from services/shhext. Because now we process in status-protocol, dedup makes less sense, as those messages are going to be processed anyway, so removing for now, we can re-evaluate if bringing it to status-go or not.

* Change the various retrieveX method to a single one:
`RetrieveAll` will be processing those messages that it can process (Currently only `Message`), and return the rest in `RawMessages` (still transit). The format for the response is:
`Chats`: -> The chats updated by receiving the message
`Messages`: -> The messages retrieved (already matched to a chat)
`Contacts`: -> The contacts updated by the messages
`RawMessages` -> Anything else that can't be parsed, eventually as we move everything to status-protocol-go this will go away.
2019-12-05 17:25:34 +01:00
..
dedup Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
mailservers Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
README.md Implement mailserver canary service. Closes #1086 2018-08-07 17:17:59 +02:00
api.go Move to protobuf for Message type (#1706) 2019-12-05 17:25:34 +01:00
api_test.go Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
context.go Execute writes atomically only after request was processed without errors (#1454) 2019-05-06 09:33:19 +03:00
history.go Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
history_test.go Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
mailrequests.go Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
mailrequests_test.go Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
requests.go Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
requests_test.go Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
rpc.go Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
service.go Move to protobuf for Message type (#1706) 2019-12-05 17:25:34 +01:00
service_test.go Create a home submodule for Eth node bridges- Rename StatusBackend to GethStatusBackend 2019-11-27 17:02:09 +01:00
signal.go Move to protobuf for Message type (#1706) 2019-12-05 17:25:34 +01:00

README.md

Whisper API Extension

API

shhext_getNewFilterMessages

Accepts the same input as shh_getFilterMessages.

Returns

Returns a list of whisper messages matching the specified filter. Filters out the messages already confirmed received by shhext_confirmMessagesProcessed

Deduplication is made using the whisper envelope content and topic only, so the same content received in different whisper envelopes will be deduplicated.

shhext_confirmMessagesProcessed

Confirms whisper messages received and processed on the client side. These messages won't appear anymore when shhext_getNewFilterMessages is called.

Parameters

Gets a list of whisper envelopes.

shhext_post

Accepts same input as shh_post.

Returns

DATA, 32 Bytes - the envelope hash

shhext_requestMessages

Sends a request for historic messages to a mail server.

Parameters
  1. Object - The message request object:
  • mailServerPeer:URL - Mail servers' enode addess
  • from:QUANTITY - (optional) Lower bound of time range as unix timestamp, default is 24 hours back from now
  • to:QUANTITY- (optional) Upper bound of time range as unix timestamp, default is now
  • topic:DATA, 4 Bytes - Regular whisper topic
  • symKeyID:DATA- ID of a symmetric key to authenticate to mail server, derived from mail server password
Returns

Boolean - returns true if the request was send, otherwise false.

Signals

Sends sent signal once per envelope.

{
  "type": "envelope.sent",
  "event": {
    "hash": "0xea0b93079ed32588628f1cabbbb5ed9e4d50b7571064c2962c3853972db67790"
  }
}

Sends expired signal if envelope dropped from whisper local queue before it was sent to any peer on the network.

{
  "type": "envelope.expired",
  "event": {
    "hash": "0x754f4c12dccb14886f791abfeb77ffb86330d03d5a4ba6f37a8c21281988b69e"
  }
}