|
@@ -24,6 +24,9 @@ import (
|
|
|
"github.com/ethereum/go-ethereum/p2p/nat"
|
|
"github.com/ethereum/go-ethereum/p2p/nat"
|
|
|
"github.com/ethereum/go-ethereum/rpc"
|
|
"github.com/ethereum/go-ethereum/rpc"
|
|
|
"github.com/ethereum/go-ethereum/xeth"
|
|
"github.com/ethereum/go-ethereum/xeth"
|
|
|
|
|
+ "github.com/ethereum/go-ethereum/rpc/api"
|
|
|
|
|
+ "github.com/ethereum/go-ethereum/rpc/comms"
|
|
|
|
|
+ "github.com/ethereum/go-ethereum/rpc/codec"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
func init() {
|
|
@@ -206,6 +209,20 @@ var (
|
|
|
Usage: "Domain on which to send Access-Control-Allow-Origin header",
|
|
Usage: "Domain on which to send Access-Control-Allow-Origin header",
|
|
|
Value: "",
|
|
Value: "",
|
|
|
}
|
|
}
|
|
|
|
|
+ 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,
|
|
|
|
|
+ }
|
|
|
|
|
+ IPCPathFlag = DirectoryFlag{
|
|
|
|
|
+ Name: "ipcpath",
|
|
|
|
|
+ Usage: "Filename for IPC socket/pipe",
|
|
|
|
|
+ Value: DirectoryString{common.DefaultIpcPath()},
|
|
|
|
|
+ }
|
|
|
// Network Settings
|
|
// Network Settings
|
|
|
MaxPeersFlag = cli.IntFlag{
|
|
MaxPeersFlag = cli.IntFlag{
|
|
|
Name: "maxpeers",
|
|
Name: "maxpeers",
|
|
@@ -368,6 +385,22 @@ func MakeAccountManager(ctx *cli.Context) *accounts.Manager {
|
|
|
return accounts.NewManager(ks)
|
|
return accounts.NewManager(ks)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func StartIPC(eth *eth.Ethereum, ctx *cli.Context) error {
|
|
|
|
|
+ config := comms.IpcConfig{
|
|
|
|
|
+ Endpoint: ctx.GlobalString(IPCPathFlag.Name),
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ xeth := xeth.New(eth, nil)
|
|
|
|
|
+ codec := codec.JSON
|
|
|
|
|
+
|
|
|
|
|
+ apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec, xeth, eth)
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ return err
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return comms.StartIpc(config, codec, apis...)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func StartRPC(eth *eth.Ethereum, ctx *cli.Context) error {
|
|
func StartRPC(eth *eth.Ethereum, ctx *cli.Context) error {
|
|
|
config := rpc.RpcConfig{
|
|
config := rpc.RpcConfig{
|
|
|
ListenAddress: ctx.GlobalString(RPCListenAddrFlag.Name),
|
|
ListenAddress: ctx.GlobalString(RPCListenAddrFlag.Name),
|