From 30d2609c3c8b1d8cd7c90bac152b07192782c116 Mon Sep 17 00:00:00 2001 From: cubedro Date: Thu, 19 Mar 2015 15:30:49 +0200 Subject: [PATCH 1/2] added INSTANCE_NAME env var --- lib/node.js | 5 ++++- processes-go.json | 1 + processes.json | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/node.js b/lib/node.js index cab4ef1..f853035 100644 --- a/lib/node.js +++ b/lib/node.js @@ -20,7 +20,10 @@ var INSTANCE_NAME, if(process.env.NODE_ENV === 'production') { - INSTANCE_NAME = shelljs.exec('ec2metadata --instance-id', {silent: true}).output; + if(process.env.INSTANCE_NAME !== "") + { + INSTANCE_NAME = shelljs.exec('ec2metadata --instance-id', {silent: true}).output; + } ETH_VERSION = shelljs.exec((process.env.ETH_IMPLEMENTATION === 'go' ? 'ethereum -version' : 'eth -V'), {silent: true}).output; } diff --git a/processes-go.json b/processes-go.json index 1c6eeba..eb1cb39 100644 --- a/processes-go.json +++ b/processes-go.json @@ -26,6 +26,7 @@ "exec_mode" : "fork_mode", "env": { + "INSTANCE_NAME" : "", "NODE_ENV" : "production", "RPC_HOST" : "localhost", "RPC_PORT" : "8080", diff --git a/processes.json b/processes.json index 6c2bf39..e3c186e 100644 --- a/processes.json +++ b/processes.json @@ -26,6 +26,7 @@ "exec_mode" : "fork_mode", "env": { + "INSTANCE_NAME" : "", "NODE_ENV" : "production", "RPC_HOST" : "localhost", "RPC_PORT" : "8080", From 20813967e5e6008dfe2f9864f5fc81e8bf98598b Mon Sep 17 00:00:00 2001 From: cubedro Date: Thu, 19 Mar 2015 15:32:07 +0200 Subject: [PATCH 2/2] updated README.md --- README.md | 1 + processes-go.json | 2 +- processes.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32fa22d..eb2a3d6 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Configure the app modifying [processes.json](/eth-net-intelligence-api/blob/mast "RPC_HOST" : "localhost", // eth JSON-RPC host "RPC_PORT" : "8080", // eth JSON-RPC port "ETH_IMPLEMENTATION" : "cpp", // eth implementation: "cpp" or "go" + "INSTANCE_NAME" : "", "WS_SERVER" : "", // path to eth-netstats WebSockets api server "WS_SECRET" : "", // WebSockets api server secret used for login } diff --git a/processes-go.json b/processes-go.json index eb1cb39..900d74b 100644 --- a/processes-go.json +++ b/processes-go.json @@ -26,11 +26,11 @@ "exec_mode" : "fork_mode", "env": { - "INSTANCE_NAME" : "", "NODE_ENV" : "production", "RPC_HOST" : "localhost", "RPC_PORT" : "8080", "ETH_IMPLEMENTATION" : "go", + "INSTANCE_NAME" : "", "WS_SERVER" : "wss://eth-netstats.herokuapp.com", "WS_SECRET" : "eth-net-stats-has-a-secret", } diff --git a/processes.json b/processes.json index e3c186e..9acfb07 100644 --- a/processes.json +++ b/processes.json @@ -26,11 +26,11 @@ "exec_mode" : "fork_mode", "env": { - "INSTANCE_NAME" : "", "NODE_ENV" : "production", "RPC_HOST" : "localhost", "RPC_PORT" : "8080", "ETH_IMPLEMENTATION" : "cpp", + "INSTANCE_NAME" : "", "WS_SERVER" : "wss://eth-netstats.herokuapp.com", "WS_SECRET" : "eth-net-stats-has-a-secret", }