aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum
diff options
context:
space:
mode:
Diffstat (limited to 'ethereum')
-rw-r--r--ethereum/config.go2
-rw-r--r--ethereum/ethereum.go6
2 files changed, 8 insertions, 0 deletions
diff --git a/ethereum/config.go b/ethereum/config.go
index b796af5cd..234e79f12 100644
--- a/ethereum/config.go
+++ b/ethereum/config.go
@@ -6,6 +6,7 @@ import (
var StartConsole bool
var StartMining bool
+var StartRpc bool
var UseUPnP bool
var OutboundPort string
var ShowGenesis bool
@@ -24,6 +25,7 @@ func Init() {
flag.BoolVar(&StartMining, "m", false, "start dagger mining")
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.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 04851d2bd..1315c0120 100644
--- a/ethereum/ethereum.go
+++ b/ethereum/ethereum.go
@@ -4,7 +4,9 @@ import (
"fmt"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
+ "github.com/ethereum/eth-go/etherpc"
"github.com/ethereum/eth-go/ethminer"
+ "github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/utils"
"log"
@@ -131,6 +133,10 @@ func main() {
console := NewConsole(ethereum)
go console.Start()
}
+ if StartRpc {
+ ethereum.RpcServer = etherpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool()))
+ go ethereum.RpcServer.Start()
+ }
RegisterInterrupts(ethereum)
ethereum.Start()