aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/gethrpctest/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/gethrpctest/main.go')
-rw-r--r--cmd/gethrpctest/main.go37
1 files changed, 8 insertions, 29 deletions
diff --git a/cmd/gethrpctest/main.go b/cmd/gethrpctest/main.go
index becd09f5a..b0907f8c5 100644
--- a/cmd/gethrpctest/main.go
+++ b/cmd/gethrpctest/main.go
@@ -18,7 +18,6 @@
package main
import (
- "errors"
"flag"
"io/ioutil"
"log"
@@ -26,10 +25,10 @@ import (
"os/signal"
"github.com/ethereum/go-ethereum/accounts"
+ "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb"
- "github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/tests"
@@ -84,12 +83,6 @@ func main() {
}
log.Println("Initial test suite passed...")
- // Start the RPC interface and wait until terminated
- if err := StartRPC(stack); err != nil {
- log.Fatalf("Failed to start RPC interface: %v", err)
- }
- log.Println("RPC Interface started, accepting requests...")
-
quit := make(chan os.Signal, 1)
signal.Notify(quit, os.Interrupt)
<-quit
@@ -99,7 +92,13 @@ func main() {
// keystore path and initial pre-state.
func MakeSystemNode(keydir string, privkey string, test *tests.BlockTest) (*node.Node, error) {
// Create a networkless protocol stack
- stack, err := node.New(&node.Config{IpcPath: node.DefaultIpcEndpoint(), NoDiscovery: true})
+ stack, err := node.New(&node.Config{
+ IpcPath: node.DefaultIpcEndpoint(),
+ HttpHost: common.DefaultHttpHost,
+ HttpPort: common.DefaultHttpPort,
+ HttpModules: []string{"admin", "db", "eth", "debug", "miner", "net", "shh", "txpool", "personal", "web3"},
+ NoDiscovery: true,
+ })
if err != nil {
return nil, err
}
@@ -164,23 +163,3 @@ func RunTest(stack *node.Node, test *tests.BlockTest) error {
}
return nil
}
-
-// StartRPC initializes an RPC interface to the given protocol stack.
-func StartRPC(stack *node.Node) error {
- /*
- web3 := NewPublicWeb3API(stack)
- server.RegisterName("web3", web3)
- net := NewPublicNetAPI(stack.Server(), ethereum.NetVersion())
- server.RegisterName("net", net)
- */
-
- for _, api := range stack.APIs() {
- if adminApi, ok := api.Service.(*node.PrivateAdminAPI); ok {
- _, err := adminApi.StartRPC("127.0.0.1", 8545, "", "admin,db,eth,debug,miner,net,shh,txpool,personal,web3")
- return err
- }
- }
-
- glog.V(logger.Error).Infof("Unable to start RPC-HTTP interface, could not find admin API")
- return errors.New("Unable to start RPC-HTTP interface")
-}