Implemented a flag for a different RPC port; --rpcport

This commit is contained in:
Maran
2014-05-13 12:00:48 +02:00
parent b9876df5dc
commit 9a03df7bd8
4 changed files with 6 additions and 2 deletions

View File

@@ -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")

View File

@@ -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 {