aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal
diff options
context:
space:
mode:
Diffstat (limited to 'ethereal')
-rw-r--r--ethereal/config.go2
-rw-r--r--ethereal/ethereum.go7
-rw-r--r--ethereal/ui/ext_app.go2
3 files changed, 10 insertions, 1 deletions
diff --git a/ethereal/config.go b/ethereal/config.go
index ac4484d0b..94f896c5f 100644
--- a/ethereal/config.go
+++ b/ethereal/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
@@ -21,6 +22,7 @@ var AssetPath string
func Init() {
flag.BoolVar(&StartConsole, "c", false, "debug and testing console")
flag.BoolVar(&StartMining, "m", false, "start dagger mining")
+ flag.BoolVar(&StartRpc, "r", false, "start rpc server")
flag.BoolVar(&ShowGenesis, "g", false, "prints genesis header and exits")
flag.BoolVar(&UseUPnP, "upnp", false, "enable UPnP support")
flag.BoolVar(&UseSeed, "seed", true, "seed peers")
diff --git a/ethereal/ethereum.go b/ethereal/ethereum.go
index 0adb9f151..782001195 100644
--- a/ethereal/ethereum.go
+++ b/ethereal/ethereum.go
@@ -4,6 +4,8 @@ import (
"fmt"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
+ "github.com/ethereum/eth-go/etherpc"
+ "github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/ethereal/ui"
"github.com/ethereum/go-ethereum/utils"
@@ -98,6 +100,11 @@ func main() {
os.Exit(0)
}
+ if StartRpc {
+ ethereum.RpcServer = etherpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool()))
+ go ethereum.RpcServer.Start()
+ }
+
log.Printf("Starting Ethereum GUI v%s\n", ethutil.Config.Ver)
// Set the max peers
diff --git a/ethereal/ui/ext_app.go b/ethereal/ui/ext_app.go
index de5f15db6..93db0ade1 100644
--- a/ethereal/ui/ext_app.go
+++ b/ethereal/ui/ext_app.go
@@ -34,7 +34,7 @@ type ExtApplication struct {
func NewExtApplication(container AppContainer, lib *UiLib) *ExtApplication {
app := &ExtApplication{
- ethpub.NewPEthereum(lib.eth),
+ ethpub.NewPEthereum(lib.eth.StateManager(), lib.eth.BlockChain(), lib.eth.TxPool()),
make(chan ethutil.React, 1),
make(chan ethutil.React, 1),
make(chan bool),