aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-11-27 00:35:44 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-11-27 17:06:12 +0800
commit3e1000fda3424d880bc43ebbb16d8a33447d4182 (patch)
treefdc37470cba9af3a00e7eeaa02895b5166ddcd27 /cmd/utils
parent1e806c4c775bd98b224eb0249007502d348e737b (diff)
downloadgo-tangerine-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar
go-tangerine-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar.gz
go-tangerine-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar.bz2
go-tangerine-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar.lz
go-tangerine-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar.xz
go-tangerine-3e1000fda3424d880bc43ebbb16d8a33447d4182.tar.zst
go-tangerine-3e1000fda3424d880bc43ebbb16d8a33447d4182.zip
cmd, eth, node, rpc, xeth: use single-instance services
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/flags.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 30570d930..53126f9e5 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -686,13 +686,13 @@ func MakeSystemNode(name, version string, extra []byte, ctx *cli.Context) *node.
if err != nil {
Fatalf("Failed to create the protocol stack: %v", err)
}
- if err := stack.Register("eth", func(ctx *node.ServiceContext) (node.Service, error) {
+ if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
return eth.New(ctx, ethConf)
}); err != nil {
Fatalf("Failed to register the Ethereum service: %v", err)
}
if shhEnable {
- if err := stack.Register("shh", func(*node.ServiceContext) (node.Service, error) { return whisper.New(), nil }); err != nil {
+ if err := stack.Register(func(*node.ServiceContext) (node.Service, error) { return whisper.New(), nil }); err != nil {
Fatalf("Failed to register the Whisper service: %v", err)
}
}
@@ -786,7 +786,11 @@ func StartIPC(stack *node.Node, ctx *cli.Context) error {
}
initializer := func(conn net.Conn) (comms.Stopper, shared.EthereumApi, error) {
- fe := useragent.NewRemoteFrontend(conn, stack.Service("eth").(*eth.Ethereum).AccountManager())
+ var ethereum *eth.Ethereum
+ if err := stack.Service(&ethereum); err != nil {
+ return nil, nil, err
+ }
+ fe := useragent.NewRemoteFrontend(conn, ethereum.AccountManager())
xeth := xeth.New(stack, fe)
apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec.JSON, xeth, stack)
if err != nil {