aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/main.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-02-05 21:08:48 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-02-05 22:53:47 +0800
commit7486904b92449c5955bb682f4ff98752906912b8 (patch)
tree87d1119581754ba411396c0c698fdab4bd65b253 /cmd/geth/main.go
parenta13bc9d7a1bc96fab93ace40045c0f0fea4da836 (diff)
downloadgo-tangerine-7486904b92449c5955bb682f4ff98752906912b8.tar.gz
go-tangerine-7486904b92449c5955bb682f4ff98752906912b8.tar.zst
go-tangerine-7486904b92449c5955bb682f4ff98752906912b8.zip
cmd, node, rpc: move websockets into node, break singleton
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r--cmd/geth/main.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index a321181a1..61f0632db 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -312,7 +312,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.WSListenAddrFlag,
utils.WSPortFlag,
utils.WSApiFlag,
- utils.WSAllowedDomainsFlag,
+ utils.WSCORSDomainFlag,
utils.IPCDisabledFlag,
utils.IPCApiFlag,
utils.IPCPathFlag,
@@ -399,7 +399,7 @@ func attach(ctx *cli.Context) {
// attach to a running geth instance
client, err := utils.NewRemoteRPCClient(ctx)
if err != nil {
- utils.Fatalf("Unable to attach to geth - %v", err)
+ utils.Fatalf("Unable to attach to geth: %v", err)
}
repl := newLightweightJSRE(
@@ -425,8 +425,10 @@ func console(ctx *cli.Context) {
startNode(ctx, node)
// Attach to the newly started node, and either execute script or become interactive
- client := utils.NewInProcRPCClient(node)
-
+ client, err := utils.NewRemoteRPCClientFromString("ipc:" + node.IpcEndpoint())
+ if err != nil {
+ utils.Fatalf("Failed to attach to the inproc geth: %v", err)
+ }
repl := newJSRE(node,
ctx.GlobalString(utils.JSpathFlag.Name),
ctx.GlobalString(utils.RPCCORSDomainFlag.Name),
@@ -449,8 +451,10 @@ func execScripts(ctx *cli.Context) {
startNode(ctx, node)
// Attach to the newly started node and execute the given scripts
- client := utils.NewInProcRPCClient(node)
-
+ client, err := utils.NewRemoteRPCClientFromString("ipc:" + node.IpcEndpoint())
+ if err != nil {
+ utils.Fatalf("Failed to attach to the inproc geth: %v", err)
+ }
repl := newJSRE(node,
ctx.GlobalString(utils.JSpathFlag.Name),
ctx.GlobalString(utils.RPCCORSDomainFlag.Name),
@@ -503,11 +507,6 @@ func startNode(ctx *cli.Context, stack *node.Node) {
}
}
// Start auxiliary services if enabled
- if ctx.GlobalBool(utils.WSEnabledFlag.Name) {
- if err := utils.StartWS(stack, ctx); err != nil {
- utils.Fatalf("Failed to start WS: %v", err)
- }
- }
if ctx.GlobalBool(utils.MiningEnabledFlag.Name) {
if err := ethereum.StartMining(ctx.GlobalInt(utils.MinerThreadsFlag.Name), ctx.GlobalString(utils.MiningGPUFlag.Name)); err != nil {
utils.Fatalf("Failed to start mining: %v", err)