|
|
@ -232,12 +232,12 @@ var ( |
|
|
|
RPCListenAddrFlag = cli.StringFlag{ |
|
|
|
RPCListenAddrFlag = cli.StringFlag{ |
|
|
|
Name: "rpcaddr", |
|
|
|
Name: "rpcaddr", |
|
|
|
Usage: "HTTP-RPC server listening interface", |
|
|
|
Usage: "HTTP-RPC server listening interface", |
|
|
|
Value: common.DefaultHttpHost, |
|
|
|
Value: common.DefaultHTTPHost, |
|
|
|
} |
|
|
|
} |
|
|
|
RPCPortFlag = cli.IntFlag{ |
|
|
|
RPCPortFlag = cli.IntFlag{ |
|
|
|
Name: "rpcport", |
|
|
|
Name: "rpcport", |
|
|
|
Usage: "HTTP-RPC server listening port", |
|
|
|
Usage: "HTTP-RPC server listening port", |
|
|
|
Value: common.DefaultHttpPort, |
|
|
|
Value: common.DefaultHTTPPort, |
|
|
|
} |
|
|
|
} |
|
|
|
RPCCORSDomainFlag = cli.StringFlag{ |
|
|
|
RPCCORSDomainFlag = cli.StringFlag{ |
|
|
|
Name: "rpccorsdomain", |
|
|
|
Name: "rpccorsdomain", |
|
|
@ -247,7 +247,7 @@ var ( |
|
|
|
RPCApiFlag = cli.StringFlag{ |
|
|
|
RPCApiFlag = cli.StringFlag{ |
|
|
|
Name: "rpcapi", |
|
|
|
Name: "rpcapi", |
|
|
|
Usage: "API's offered over the HTTP-RPC interface", |
|
|
|
Usage: "API's offered over the HTTP-RPC interface", |
|
|
|
Value: rpc.DefaultHttpRpcApis, |
|
|
|
Value: rpc.DefaultHTTPApis, |
|
|
|
} |
|
|
|
} |
|
|
|
IPCDisabledFlag = cli.BoolFlag{ |
|
|
|
IPCDisabledFlag = cli.BoolFlag{ |
|
|
|
Name: "ipcdisable", |
|
|
|
Name: "ipcdisable", |
|
|
@ -256,12 +256,12 @@ var ( |
|
|
|
IPCApiFlag = cli.StringFlag{ |
|
|
|
IPCApiFlag = cli.StringFlag{ |
|
|
|
Name: "ipcapi", |
|
|
|
Name: "ipcapi", |
|
|
|
Usage: "API's offered over the IPC-RPC interface", |
|
|
|
Usage: "API's offered over the IPC-RPC interface", |
|
|
|
Value: rpc.DefaultIpcApis, |
|
|
|
Value: rpc.DefaultIPCApis, |
|
|
|
} |
|
|
|
} |
|
|
|
IPCPathFlag = DirectoryFlag{ |
|
|
|
IPCPathFlag = DirectoryFlag{ |
|
|
|
Name: "ipcpath", |
|
|
|
Name: "ipcpath", |
|
|
|
Usage: "Filename for IPC socket/pipe within the datadir (explicit paths escape it)", |
|
|
|
Usage: "Filename for IPC socket/pipe within the datadir (explicit paths escape it)", |
|
|
|
Value: DirectoryString{common.DefaultIpcSocket}, |
|
|
|
Value: DirectoryString{common.DefaultIPCSocket}, |
|
|
|
} |
|
|
|
} |
|
|
|
WSEnabledFlag = cli.BoolFlag{ |
|
|
|
WSEnabledFlag = cli.BoolFlag{ |
|
|
|
Name: "ws", |
|
|
|
Name: "ws", |
|
|
@ -270,21 +270,21 @@ var ( |
|
|
|
WSListenAddrFlag = cli.StringFlag{ |
|
|
|
WSListenAddrFlag = cli.StringFlag{ |
|
|
|
Name: "wsaddr", |
|
|
|
Name: "wsaddr", |
|
|
|
Usage: "WS-RPC server listening interface", |
|
|
|
Usage: "WS-RPC server listening interface", |
|
|
|
Value: common.DefaultWsHost, |
|
|
|
Value: common.DefaultWSHost, |
|
|
|
} |
|
|
|
} |
|
|
|
WSPortFlag = cli.IntFlag{ |
|
|
|
WSPortFlag = cli.IntFlag{ |
|
|
|
Name: "wsport", |
|
|
|
Name: "wsport", |
|
|
|
Usage: "WS-RPC server listening port", |
|
|
|
Usage: "WS-RPC server listening port", |
|
|
|
Value: common.DefaultWsPort, |
|
|
|
Value: common.DefaultWSPort, |
|
|
|
} |
|
|
|
} |
|
|
|
WSApiFlag = cli.StringFlag{ |
|
|
|
WSApiFlag = cli.StringFlag{ |
|
|
|
Name: "wsapi", |
|
|
|
Name: "wsapi", |
|
|
|
Usage: "API's offered over the WS-RPC interface", |
|
|
|
Usage: "API's offered over the WS-RPC interface", |
|
|
|
Value: rpc.DefaultHttpRpcApis, |
|
|
|
Value: rpc.DefaultHTTPApis, |
|
|
|
} |
|
|
|
} |
|
|
|
WSCORSDomainFlag = cli.StringFlag{ |
|
|
|
WSAllowedDomainsFlag = cli.StringFlag{ |
|
|
|
Name: "wscorsdomain", |
|
|
|
Name: "wsdomains", |
|
|
|
Usage: "Domains from which to accept websockets requests", |
|
|
|
Usage: "Domains from which to accept websockets requests (can be spoofed)", |
|
|
|
Value: "", |
|
|
|
Value: "", |
|
|
|
} |
|
|
|
} |
|
|
|
ExecFlag = cli.StringFlag{ |
|
|
|
ExecFlag = cli.StringFlag{ |
|
|
@ -393,9 +393,9 @@ func MustMakeDataDir(ctx *cli.Context) string { |
|
|
|
return "" |
|
|
|
return "" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// MakeIpcPath creates an IPC path configuration from the set command line flags,
|
|
|
|
// MakeIPCPath creates an IPC path configuration from the set command line flags,
|
|
|
|
// returning an empty string if IPC was explicitly disabled, or the set path.
|
|
|
|
// returning an empty string if IPC was explicitly disabled, or the set path.
|
|
|
|
func MakeIpcPath(ctx *cli.Context) string { |
|
|
|
func MakeIPCPath(ctx *cli.Context) string { |
|
|
|
if ctx.GlobalBool(IPCDisabledFlag.Name) { |
|
|
|
if ctx.GlobalBool(IPCDisabledFlag.Name) { |
|
|
|
return "" |
|
|
|
return "" |
|
|
|
} |
|
|
|
} |
|
|
@ -481,18 +481,18 @@ func MakeNAT(ctx *cli.Context) nat.Interface { |
|
|
|
return natif |
|
|
|
return natif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// MakeHttpRpcHost creates the HTTP RPC listener interface string from the set
|
|
|
|
// MakeHTTPRpcHost creates the HTTP RPC listener interface string from the set
|
|
|
|
// command line flags, returning empty if the HTTP endpoint is disabled.
|
|
|
|
// command line flags, returning empty if the HTTP endpoint is disabled.
|
|
|
|
func MakeHttpRpcHost(ctx *cli.Context) string { |
|
|
|
func MakeHTTPRpcHost(ctx *cli.Context) string { |
|
|
|
if !ctx.GlobalBool(RPCEnabledFlag.Name) { |
|
|
|
if !ctx.GlobalBool(RPCEnabledFlag.Name) { |
|
|
|
return "" |
|
|
|
return "" |
|
|
|
} |
|
|
|
} |
|
|
|
return ctx.GlobalString(RPCListenAddrFlag.Name) |
|
|
|
return ctx.GlobalString(RPCListenAddrFlag.Name) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// MakeWsRpcHost creates the WebSocket RPC listener interface string from the set
|
|
|
|
// MakeWSRpcHost creates the WebSocket RPC listener interface string from the set
|
|
|
|
// command line flags, returning empty if the HTTP endpoint is disabled.
|
|
|
|
// command line flags, returning empty if the HTTP endpoint is disabled.
|
|
|
|
func MakeWsRpcHost(ctx *cli.Context) string { |
|
|
|
func MakeWSRpcHost(ctx *cli.Context) string { |
|
|
|
if !ctx.GlobalBool(WSEnabledFlag.Name) { |
|
|
|
if !ctx.GlobalBool(WSEnabledFlag.Name) { |
|
|
|
return "" |
|
|
|
return "" |
|
|
|
} |
|
|
|
} |
|
|
@ -616,15 +616,15 @@ func MakeSystemNode(name, version string, extra []byte, ctx *cli.Context) *node. |
|
|
|
NAT: MakeNAT(ctx), |
|
|
|
NAT: MakeNAT(ctx), |
|
|
|
MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name), |
|
|
|
MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name), |
|
|
|
MaxPendingPeers: ctx.GlobalInt(MaxPendingPeersFlag.Name), |
|
|
|
MaxPendingPeers: ctx.GlobalInt(MaxPendingPeersFlag.Name), |
|
|
|
IpcPath: MakeIpcPath(ctx), |
|
|
|
IPCPath: MakeIPCPath(ctx), |
|
|
|
HttpHost: MakeHttpRpcHost(ctx), |
|
|
|
HTTPHost: MakeHTTPRpcHost(ctx), |
|
|
|
HttpPort: ctx.GlobalInt(RPCPortFlag.Name), |
|
|
|
HTTPPort: ctx.GlobalInt(RPCPortFlag.Name), |
|
|
|
HttpCors: ctx.GlobalString(RPCCORSDomainFlag.Name), |
|
|
|
HTTPCors: ctx.GlobalString(RPCCORSDomainFlag.Name), |
|
|
|
HttpModules: strings.Split(ctx.GlobalString(RPCApiFlag.Name), ","), |
|
|
|
HTTPModules: strings.Split(ctx.GlobalString(RPCApiFlag.Name), ","), |
|
|
|
WsHost: MakeWsRpcHost(ctx), |
|
|
|
WSHost: MakeWSRpcHost(ctx), |
|
|
|
WsPort: ctx.GlobalInt(WSPortFlag.Name), |
|
|
|
WSPort: ctx.GlobalInt(WSPortFlag.Name), |
|
|
|
WsCors: ctx.GlobalString(WSCORSDomainFlag.Name), |
|
|
|
WSDomains: ctx.GlobalString(WSAllowedDomainsFlag.Name), |
|
|
|
WsModules: strings.Split(ctx.GlobalString(WSApiFlag.Name), ","), |
|
|
|
WSModules: strings.Split(ctx.GlobalString(WSApiFlag.Name), ","), |
|
|
|
} |
|
|
|
} |
|
|
|
// Configure the Ethereum service
|
|
|
|
// Configure the Ethereum service
|
|
|
|
accman := MakeAccountManager(ctx) |
|
|
|
accman := MakeAccountManager(ctx) |
|
|
|