aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-30 20:25:12 +0800
committerobscuren <geffobscura@gmail.com>2015-01-30 20:25:12 +0800
commitc03d403437c20584bcbf3cf3fa9d79ac7a0a8ca7 (patch)
tree137343143b03e4b76bbbfa269c2fc7d35f9f6a35 /xeth/xeth.go
parentc48644490f039fb9756b4cd1fedf11fbb1c4a16f (diff)
downloaddexon-c03d403437c20584bcbf3cf3fa9d79ac7a0a8ca7.tar.gz
dexon-c03d403437c20584bcbf3cf3fa9d79ac7a0a8ca7.tar.zst
dexon-c03d403437c20584bcbf3cf3fa9d79ac7a0a8ca7.zip
Added whisper interface for xeth, added examples, updated RPC
* Added RPC methods for whisper * Added whisper example
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 4cfa104d0..a65fa1331 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -16,6 +16,7 @@ import (
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/state"
+ "github.com/ethereum/go-ethereum/whisper"
)
var pipelogger = logger.NewLogger("XETH")
@@ -33,6 +34,7 @@ type Backend interface {
ClientIdentity() p2p.ClientIdentity
Db() ethutil.Database
EventMux() *event.TypeMux
+ Whisper() *whisper.Whisper
}
type XEth struct {
@@ -40,6 +42,7 @@ type XEth struct {
blockProcessor *core.BlockProcessor
chainManager *core.ChainManager
state *State
+ whisper *Whisper
}
func New(eth Backend) *XEth {
@@ -47,17 +50,16 @@ func New(eth Backend) *XEth {
eth: eth,
blockProcessor: eth.BlockProcessor(),
chainManager: eth.ChainManager(),
+ whisper: NewWhisper(eth.Whisper()),
}
xeth.state = NewState(xeth)
return xeth
}
-func (self *XEth) Backend() Backend {
- return self.eth
-}
-
-func (self *XEth) State() *State { return self.state }
+func (self *XEth) Backend() Backend { return self.eth }
+func (self *XEth) State() *State { return self.state }
+func (self *XEth) Whisper() *Whisper { return self.whisper }
func (self *XEth) BlockByHash(strHash string) *Block {
hash := fromHex(strHash)