rpc: new RPC implementation with pub/sub support
This commit is contained in:
@@ -28,6 +28,8 @@ import (
|
||||
"github.com/ethereum/go-ethereum/logger"
|
||||
"github.com/ethereum/go-ethereum/logger/glog"
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
rpc "github.com/ethereum/go-ethereum/rpc/v2"
|
||||
|
||||
"gopkg.in/fatih/set.v0"
|
||||
)
|
||||
|
||||
@@ -98,6 +100,18 @@ func New() *Whisper {
|
||||
return whisper
|
||||
}
|
||||
|
||||
// APIs returns the RPC descriptors the Whisper implementation offers
|
||||
func (s *Whisper) APIs() []rpc.API {
|
||||
return []rpc.API{
|
||||
{
|
||||
Namespace: "shh",
|
||||
Version: "1.0",
|
||||
Service: NewPublicWhisperAPI(s),
|
||||
Public: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Protocols returns the whisper sub-protocols ran by this particular client.
|
||||
func (self *Whisper) Protocols() []p2p.Protocol {
|
||||
return []p2p.Protocol{self.protocol}
|
||||
|
Reference in New Issue
Block a user