From df75dbfd6804923b1c8a8388b67523072d59f155 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Tue, 9 Feb 2016 14:10:40 +0200 Subject: cmd, node, rpc: readd inproc RPC client, expose via node --- cmd/geth/js_test.go | 6 ++---- cmd/geth/main.go | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'cmd/geth') diff --git a/cmd/geth/js_test.go b/cmd/geth/js_test.go index ed6e5b319..4330b484c 100644 --- a/cmd/geth/js_test.go +++ b/cmd/geth/js_test.go @@ -20,7 +20,6 @@ import ( "fmt" "io/ioutil" "math/big" - "math/rand" "os" "path/filepath" "regexp" @@ -30,7 +29,6 @@ import ( "time" "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/compiler" "github.com/ethereum/go-ethereum/common/httpclient" @@ -96,7 +94,7 @@ func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *nod t.Fatal(err) } // Create a networkless protocol stack - stack, err := node.New(&node.Config{PrivateKey: testNodeKey, Name: "test", NoDiscovery: true, IPCPath: fmt.Sprintf("geth-test-%d.ipc", rand.Int63())}) + stack, err := node.New(&node.Config{PrivateKey: testNodeKey, Name: "test", NoDiscovery: true}) if err != nil { t.Fatalf("failed to create node: %v", err) } @@ -142,7 +140,7 @@ func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *nod stack.Service(ðereum) assetPath := filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "cmd", "mist", "assets", "ext") - client, err := utils.NewRemoteRPCClientFromString("ipc:" + stack.IPCEndpoint()) + client, err := stack.Attach() if err != nil { t.Fatalf("failed to attach to node: %v", err) } diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 5c07be3f6..8594d18c5 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -425,7 +425,7 @@ func console(ctx *cli.Context) { startNode(ctx, node) // Attach to the newly started node, and either execute script or become interactive - client, err := utils.NewRemoteRPCClientFromString("ipc:" + node.IPCEndpoint()) + client, err := node.Attach() if err != nil { utils.Fatalf("Failed to attach to the inproc geth: %v", err) } @@ -451,7 +451,7 @@ func execScripts(ctx *cli.Context) { startNode(ctx, node) // Attach to the newly started node and execute the given scripts - client, err := utils.NewRemoteRPCClientFromString("ipc:" + node.IPCEndpoint()) + client, err := node.Attach() if err != nil { utils.Fatalf("Failed to attach to the inproc geth: %v", err) } -- cgit