From 7d19586da7fe5052e1bb7ac1c55880b68c36afaf Mon Sep 17 00:00:00 2001 From: Oskar Thoren Date: Thu, 29 Aug 2019 14:38:39 +0200 Subject: [PATCH] move over mailserver stuff to own spec --- status-whisper-mailserver-spec.md | 20 ++++++++++++++++---- status-whisper-usage-spec.md | 20 ++------------------ 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/status-whisper-mailserver-spec.md b/status-whisper-mailserver-spec.md index 3173702..a7e0c13 100644 --- a/status-whisper-mailserver-spec.md +++ b/status-whisper-mailserver-spec.md @@ -15,19 +15,31 @@ TBD. ## Introduction -TBD. +In the case of mobile clients which are often offline, there is a strong need to have an ability to download offline messages. By offline messages, we mean messages sent into the Whisper network and expired before being collected by the recipient. A message stays in the Whisper network for a duration specified as `TTL` (time-to-live) property. ## Mailserver -TBD. +A mailserver can either be running as a server or as a client. ### Server -TBD. + + +`MailServer` is an interface with two methods: +* `Archive(env *Envelope)` +* `DeliverMail(whisperPeer *Peer, request *Envelope)` ### Client -TBD. +A Whisper client needs to register a mail server instance which will be used by [geth's Whisper service](https://github.com/ethereum/go-ethereum/blob/v1.8.23/whisper/whisperv6/whisper.go#L209-L213). + +If a mail server is registered for a given Whisper client, it will save all incoming messages on a local disk (this is the simplest implementation, it can store the messages wherever it wants, also using technologies like swarm and IPFS) in the background. + +Notice that each node is meant to be independent and SHOULD keep a copy of all historic messages. High Availability (HA) can be achieved by having multiple nodes in different locations. Additionally, each node is free to store messages in a way which provides storage HA as well. + +Saved messages are delivered to a requester (another Whisper peer) asynchronously as a response to `p2pMessageCode` message code. This is not exposed as a JSON-RPC method in `shh` namespace but it's exposed in status-go as `shhext_requestMessages` and blocking `shh_requestMessagesSync`. Read more about [Whisper V6 extensions](#whisper-v6-extensions-or-status-whisper-node). + +In order to receive historic messages from a filter, p2p messages MUST be allowed when creating the filter. Receiving p2p messages is implemented in [geth's Whisper V6 implementation](https://github.com/ethereum/go-ethereum/blob/v1.8.23/whisper/whisperv6/whisper.go#L739-L751). ## Security considerations diff --git a/status-whisper-usage-spec.md b/status-whisper-usage-spec.md index e254d52..57b06eb 100644 --- a/status-whisper-usage-spec.md +++ b/status-whisper-usage-spec.md @@ -99,7 +99,7 @@ This protocol consist of three components: Whisper adapter specifies interaction with the Whisper service with regards to keys management, configuration and attaching metadata required to properly forward and process messages. -Offline messaging describes how the protocol handles delivering messages when one or more participants are offline and the messages expire in the Whisper network. +Offline messaging describes how the protocol handles delivering messages when one or more participants are offline and the messages expire in the Whisper network. For more, see [Status Whisper Mailserver Spec)[status-whisper-mailserver-spec.md]. The protocol does not specify additional things like peers discovery, running Whisper nodes, underlying p2p protocols etc. @@ -295,23 +295,7 @@ Learn more following [Whisper V6 RPC API](https://github.com/ethereum/go-ethereu # Offline messages - - -In the case of mobile clients which are often offline, there is a strong need to have an ability to download offline messages. By offline messages, we mean messages sent into the Whisper network and expired before being collected by the recipient. A message stays in the Whisper network for a duration specified as `TTL` (time-to-live) property. - -A Whisper client needs to register a mail server instance which will be used by [geth's Whisper service](https://github.com/ethereum/go-ethereum/blob/v1.8.23/whisper/whisperv6/whisper.go#L209-L213). - -`MailServer` is an interface with two methods: -* `Archive(env *Envelope)` -* `DeliverMail(whisperPeer *Peer, request *Envelope)` - -If a mail server is registered for a given Whisper client, it will save all incoming messages on a local disk (this is the simplest implementation, it can store the messages wherever it wants, also using technologies like swarm and IPFS) in the background. - -Notice that each node is meant to be independent and SHOULD keep a copy of all historic messages. High Availability (HA) can be achieved by having multiple nodes in different locations. Additionally, each node is free to store messages in a way which provides storage HA as well. - -Saved messages are delivered to a requester (another Whisper peer) asynchronously as a response to `p2pMessageCode` message code. This is not exposed as a JSON-RPC method in `shh` namespace but it's exposed in status-go as `shhext_requestMessages` and blocking `shh_requestMessagesSync`. Read more about [Whisper V6 extensions](#whisper-v6-extensions-or-status-whisper-node). - -In order to receive historic messages from a filter, p2p messages MUST be allowed when creating the filter. Receiving p2p messages is implemented in [geth's Whisper V6 implementation](https://github.com/ethereum/go-ethereum/blob/v1.8.23/whisper/whisperv6/whisper.go#L739-L751). +A client SHOULD implement mailserver client mode. See [Status Whispre Mailserver Spec](status-whisper-mailserver-spec.md) ## Whisper V6 extensions (or Status Whisper Node)