diff options
author | Bas van Kervel <bas@ethdev.com> | 2015-10-15 22:07:19 +0800 |
---|---|---|
committer | Bas van Kervel <bas@ethdev.com> | 2015-12-14 23:34:05 +0800 |
commit | eae81465c1c815c317cd30e4de6bdf4d59df2340 (patch) | |
tree | b6f4b7787967a58416171adb79fd12ac29d89577 /whisper/whisper.go | |
parent | 8db9d44ca9fb6baf406256cae491c475de2f4989 (diff) | |
download | go-tangerine-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar go-tangerine-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar.gz go-tangerine-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar.bz2 go-tangerine-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar.lz go-tangerine-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar.xz go-tangerine-eae81465c1c815c317cd30e4de6bdf4d59df2340.tar.zst go-tangerine-eae81465c1c815c317cd30e4de6bdf4d59df2340.zip |
rpc: new RPC implementation with pub/sub support
Diffstat (limited to 'whisper/whisper.go')
-rw-r--r-- | whisper/whisper.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/whisper/whisper.go b/whisper/whisper.go index 7201062b8..e99950b76 100644 --- a/whisper/whisper.go +++ b/whisper/whisper.go @@ -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} |