From 9a03df7bd831f1b66bc02510a4abed878f4ffa17 Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 13 May 2014 12:00:48 +0200 Subject: [PATCH] Implemented a flag for a different RPC port; --rpcport --- ethereal/config.go | 2 ++ ethereal/ethereum.go | 2 +- ethereum/config.go | 2 ++ ethereum/ethereum.go | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ethereal/config.go b/ethereal/config.go index 94f896c5f1..e4bdb0a000 100644 --- a/ethereal/config.go +++ b/ethereal/config.go @@ -7,6 +7,7 @@ import ( var StartConsole bool var StartMining bool var StartRpc bool +var RpcPort int var UseUPnP bool var OutboundPort string var ShowGenesis bool @@ -28,6 +29,7 @@ func Init() { flag.BoolVar(&UseSeed, "seed", true, "seed peers") flag.BoolVar(&GenAddr, "genaddr", false, "create a new priv/pub key") flag.BoolVar(&ExportKey, "export", false, "export private key") + flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on") flag.StringVar(&OutboundPort, "p", "30303", "listening port") flag.StringVar(&DataDir, "dir", ".ethereal", "ethereum data directory") flag.StringVar(&ImportKey, "import", "", "imports the given private key (hex)") diff --git a/ethereal/ethereum.go b/ethereal/ethereum.go index bacf6d4461..ffc5aaab5c 100644 --- a/ethereal/ethereum.go +++ b/ethereal/ethereum.go @@ -100,7 +100,7 @@ func main() { } if StartRpc { - ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool())) + ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool()), RpcPort) if err != nil { log.Println("Could not start RPC interface:", err) } else { diff --git a/ethereum/config.go b/ethereum/config.go index 234e79f126..7ca1a9801f 100644 --- a/ethereum/config.go +++ b/ethereum/config.go @@ -7,6 +7,7 @@ import ( var StartConsole bool var StartMining bool var StartRpc bool +var RpcPort int var UseUPnP bool var OutboundPort string var ShowGenesis bool @@ -26,6 +27,7 @@ func Init() { flag.BoolVar(&ShowGenesis, "g", false, "prints genesis header and exits") //flag.BoolVar(&UseGui, "gui", true, "use the gui") flag.BoolVar(&StartRpc, "r", false, "start rpc server") + flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on") flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)") flag.BoolVar(&UseUPnP, "upnp", false, "enable UPnP support") flag.BoolVar(&UseSeed, "seed", true, "seed peers") diff --git a/ethereum/ethereum.go b/ethereum/ethereum.go index 8ef061be06..d49b5dc8af 100644 --- a/ethereum/ethereum.go +++ b/ethereum/ethereum.go @@ -133,7 +133,7 @@ func main() { go console.Start() } if StartRpc { - ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool())) + ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool()), RpcPort) if err != nil { logger.Infoln("Could not start RPC interface:", err) } else {