-
Notifications
You must be signed in to change notification settings - Fork 249
/
whisper_service.go
45 lines (37 loc) · 1.07 KB
/
whisper_service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package nodebridge
import (
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rpc"
"github.com/status-im/status-go/eth-node/types"
)
// Make sure that WhisperService implements node.Service interface.
var _ node.Service = (*WhisperService)(nil)
type WhisperService struct {
Whisper types.Whisper
}
// Protocols returns a new protocols list. In this case, there are none.
func (w *WhisperService) Protocols() []p2p.Protocol {
return []p2p.Protocol{}
}
// APIs returns a list of new APIs.
func (w *WhisperService) APIs() []rpc.API {
return []rpc.API{
{
Namespace: "status",
Version: "1.0",
Service: w.Whisper,
Public: false,
},
}
}
// Start is run when a service is started.
// It does nothing in this case but is required by `node.Service` interface.
func (w *WhisperService) Start(server *p2p.Server) error {
return nil
}
// Stop is run when a service is stopped.
// It does nothing in this case but is required by `node.Service` interface.
func (w *WhisperService) Stop() error {
return nil
}