diff options
author | Bas van Kervel <bas@ethdev.com> | 2015-06-22 18:47:32 +0800 |
---|---|---|
committer | Bas van Kervel <bas@ethdev.com> | 2015-06-22 18:47:32 +0800 |
commit | 2e0b56a72b3eafc89938003da29c06496ac9ad4e (patch) | |
tree | eba3eb3a822da0ba7de98d9c7b6dc8601a63db0a /cmd | |
parent | 2737baa6577a337f33f020d587af100c9bda3585 (diff) | |
download | dexon-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar dexon-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar.gz dexon-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar.bz2 dexon-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar.lz dexon-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar.xz dexon-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar.zst dexon-2e0b56a72b3eafc89938003da29c06496ac9ad4e.zip |
added RPC start/stop support
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/geth/js.go | 7 | ||||
-rw-r--r-- | cmd/geth/js_test.go | 2 | ||||
-rw-r--r-- | cmd/utils/flags.go | 4 |
3 files changed, 8 insertions, 5 deletions
diff --git a/cmd/geth/js.go b/cmd/geth/js.go index 761943b63..c0c77c02a 100644 --- a/cmd/geth/js.go +++ b/cmd/geth/js.go @@ -41,6 +41,7 @@ import ( "github.com/ethereum/go-ethereum/xeth" "github.com/peterh/liner" "github.com/robertkrimen/otto" + "github.com/ethereum/go-ethereum/rpc/shared" ) type prompter interface { @@ -183,7 +184,9 @@ func newJSRE(ethereum *eth.Ethereum, libPath, corsDomain string, client comms.Et js.wait = js.xeth.UpdateState() js.client = client if clt, ok := js.client.(*comms.InProcClient); ok { - clt.Initialize(js.xeth, ethereum) + if offeredApis, err := api.ParseApiString(shared.AllApis, codec.JSON, js.xeth, ethereum); err == nil { + clt.Initialize(api.Merge(offeredApis...)) + } } // update state in separare forever blocks @@ -311,7 +314,7 @@ func (js *jsre) apiBindings(f xeth.Frontend) error { // load only supported API's in javascript runtime shortcuts := "var eth = web3.eth; " for _, apiName := range apiNames { - if apiName == api.Web3ApiName || apiName == api.EthApiName { + if apiName == shared.Web3ApiName || apiName == shared.EthApiName { continue // manually mapped } diff --git a/cmd/geth/js_test.go b/cmd/geth/js_test.go index fba575030..cfbe26bee 100644 --- a/cmd/geth/js_test.go +++ b/cmd/geth/js_test.go @@ -210,7 +210,7 @@ func TestRPC(t *testing.T) { defer ethereum.Stop() defer os.RemoveAll(tmp) - checkEvalJSON(t, repl, `admin.startRPC("127.0.0.1", 5004)`, `true`) + checkEvalJSON(t, repl, `admin.startRPC("127.0.0.1", 5004, "*", "web3,eth,net")`, `true`) } func TestCheckTestAccountBalance(t *testing.T) { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index a9d449d1f..15a577a07 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -461,7 +461,7 @@ func StartIPC(eth *eth.Ethereum, ctx *cli.Context) error { return err } - return comms.StartIpc(config, codec, apis...) + return comms.StartIpc(config, codec, api.Merge(apis...)) } func StartRPC(eth *eth.Ethereum, ctx *cli.Context) error { @@ -479,7 +479,7 @@ func StartRPC(eth *eth.Ethereum, ctx *cli.Context) error { return err } - return comms.StartHttp(config, codec, apis...) + return comms.StartHttp(config, codec, api.Merge(apis...)) } func StartPProf(ctx *cli.Context) { |