OSDN Git Service

add parse env for url
authorwz <mars@bytom.io>
Mon, 16 Apr 2018 01:48:27 +0000 (09:48 +0800)
committerwz <mars@bytom.io>
Mon, 16 Apr 2018 05:05:05 +0000 (13:05 +0800)
node/node.go
util/util.go

index 3d0dc79..12dd442 100644 (file)
@@ -189,6 +189,7 @@ func (n *Node) initAndstartApiServer() {
        n.api = api.NewAPI(n.syncManager, n.wallet, n.txfeed, n.cpuMiner, n.miningPool, n.chain, n.config, n.accessTokens)
 
        listenAddr := env.String("LISTEN", n.config.ApiAddress)
+       env.Parse()
        n.api.StartServer(*listenAddr)
 }
 
index 5222373..8c8d598 100644 (file)
@@ -29,6 +29,7 @@ var (
 
 // Wraper rpc's client
 func MustRPCClient() *rpc.Client {
+       env.Parse()
        return &rpc.Client{BaseURL: *coreURL}
 }