Add cmd flag to specify http host of json rpc server (#651)

This commit is contained in:
Dmitry Shulyak 2018-02-12 16:17:10 +02:00 committed by GitHub
parent 9cc9982a6a
commit 6526bace85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,7 @@ var (
swarmEnabled = flag.Bool("swarm", false, "Swarm protocol enabled") swarmEnabled = flag.Bool("swarm", false, "Swarm protocol enabled")
maxPeers = flag.Int("maxpeers", 25, "maximum number of p2p peers (including all protocols)") maxPeers = flag.Int("maxpeers", 25, "maximum number of p2p peers (including all protocols)")
httpEnabled = flag.Bool("http", false, "HTTP RPC endpoint enabled (default: false)") httpEnabled = flag.Bool("http", false, "HTTP RPC endpoint enabled (default: false)")
httpHost = flag.String("httphost", "127.0.0.1", "HTTP RPC host of the listening socket")
httpPort = flag.Int("httpport", params.HTTPPort, "HTTP RPC server's listening port") httpPort = flag.Int("httpport", params.HTTPPort, "HTTP RPC server's listening port")
ipcEnabled = flag.Bool("ipc", false, "IPC RPC endpoint enabled") ipcEnabled = flag.Bool("ipc", false, "IPC RPC endpoint enabled")
cliEnabled = flag.Bool("cli", false, "Enable debugging CLI server") cliEnabled = flag.Bool("cli", false, "Enable debugging CLI server")
@ -199,6 +200,7 @@ func makeNodeConfig() (*params.NodeConfig, error) {
nodeConfig.WhisperConfig.Enabled = *whisperEnabled nodeConfig.WhisperConfig.Enabled = *whisperEnabled
nodeConfig.MaxPeers = *maxPeers nodeConfig.MaxPeers = *maxPeers
nodeConfig.HTTPHost = *httpHost
nodeConfig.HTTPPort = *httpPort nodeConfig.HTTPPort = *httpPort
nodeConfig.IPCEnabled = *ipcEnabled nodeConfig.IPCEnabled = *ipcEnabled