aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-23 22:44:03 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-23 22:44:03 +0800
commit6b5532ab0d0e88f27af539840c58cbd6de13de90 (patch)
tree84f1856e1b3fb2fd927e6ef9c59983e4fb347a8c /cmd/utils
parent139439dcdc14e448bfdbd509bb135faa92337a28 (diff)
parent2b3957f3737b56622e38425a52caea2a836f8b63 (diff)
downloaddexon-6b5532ab0d0e88f27af539840c58cbd6de13de90.tar
dexon-6b5532ab0d0e88f27af539840c58cbd6de13de90.tar.gz
dexon-6b5532ab0d0e88f27af539840c58cbd6de13de90.tar.bz2
dexon-6b5532ab0d0e88f27af539840c58cbd6de13de90.tar.lz
dexon-6b5532ab0d0e88f27af539840c58cbd6de13de90.tar.xz
dexon-6b5532ab0d0e88f27af539840c58cbd6de13de90.tar.zst
dexon-6b5532ab0d0e88f27af539840c58cbd6de13de90.zip
Merge pull request #1279 from bas-vk/rpc-http
Integrate console and remove old rpc package structure
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/flags.go27
1 files changed, 21 insertions, 6 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 696dbd142..15a577a07 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -22,7 +22,6 @@ import (
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/p2p/nat"
- "github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc/api"
"github.com/ethereum/go-ethereum/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms"
@@ -209,20 +208,29 @@ var (
Usage: "Domain on which to send Access-Control-Allow-Origin header",
Value: "",
}
+ RpcApiFlag = cli.StringFlag{
+ Name: "rpcapi",
+ Usage: "Specify the API's which are offered over the HTTP RPC interface",
+ Value: comms.DefaultHttpRpcApis,
+ }
IPCDisabledFlag = cli.BoolFlag{
Name: "ipcdisable",
Usage: "Disable the IPC-RPC server",
}
IPCApiFlag = cli.StringFlag{
Name: "ipcapi",
- Usage: "Specify the API's which are offered over this interface",
- Value: api.DefaultIpcApis,
+ Usage: "Specify the API's which are offered over the IPC interface",
+ Value: comms.DefaultIpcApis,
}
IPCPathFlag = DirectoryFlag{
Name: "ipcpath",
Usage: "Filename for IPC socket/pipe",
Value: DirectoryString{common.DefaultIpcPath()},
}
+ ExecFlag = cli.StringFlag{
+ Name: "exec",
+ Usage: "Execute javascript statement (only in combination with console/attach)",
+ }
// Network Settings
MaxPeersFlag = cli.IntFlag{
Name: "maxpeers",
@@ -453,18 +461,25 @@ 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 {
- config := rpc.RpcConfig{
+ config := comms.HttpConfig{
ListenAddress: ctx.GlobalString(RPCListenAddrFlag.Name),
ListenPort: uint(ctx.GlobalInt(RPCPortFlag.Name)),
CorsDomain: ctx.GlobalString(RPCCORSDomainFlag.Name),
}
xeth := xeth.New(eth, nil)
- return rpc.Start(xeth, config)
+ codec := codec.JSON
+
+ apis, err := api.ParseApiString(ctx.GlobalString(RpcApiFlag.Name), codec, xeth, eth)
+ if err != nil {
+ return err
+ }
+
+ return comms.StartHttp(config, codec, api.Merge(apis...))
}
func StartPProf(ctx *cli.Context) {