diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 0ca2a5d..0000000 --- a/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM centos:centos6 - -# Enable EPEL for Node.js -RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm -# Install Node.js and npm -RUN yum install -y npm - -# Bundle app source -COPY . /src -# Install app dependencies -RUN cd /src; npm install - -EXPOSE 3000 -CMD ["node", "/src/bin/www"] \ No newline at end of file diff --git a/Procfile b/Procfile deleted file mode 100644 index 3451039..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: node ./bin/www \ No newline at end of file diff --git a/README.md b/README.md index 818eeaa..2eb4cbb 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,8 @@ -eth-netstatsservice +Ethereum Network Intelligence API ============ -Ethereum Network Stats Service - -To run via Docker - -create a docker image via +Deploy on AWS, install dependencies, build eth, clone eth-netstatsservice and run as services forever ``` -docker build --tag="eth-netstatsservice" path/to/eth-netstatsservice-repo -``` - -run it via - -``` -docker run --publish=3000:3000 eth-netstatsservice -``` - -see the interface at http://localhost:3000 +curl https://raw.githubusercontent.com/cubedro/eth-netstatsservice/master/bin/build.sh | sh +``` \ No newline at end of file diff --git a/app.js b/app.js index 077248b..0c2db82 100644 --- a/app.js +++ b/app.js @@ -1,17 +1,4 @@ -var express = require('express.io'); -var path = require('path'); -var fs = require('fs'); var nodeModel = require('./lib/node'); -var config; - -var app = express(); -app.io(); - -if(fs.existsSync('./config.js')){ - config = require('./config'); -} else { - config = require('./config.default'); -} var node = new nodeModel(config); @@ -36,4 +23,4 @@ process.on('SIGTERM', gracefulShutdown); process.on('SIGINT', gracefulShutdown); -module.exports = app; +module.exports = node; diff --git a/provision.sh b/bin/build.sh similarity index 99% rename from provision.sh rename to bin/build.sh index dc202cd..bb65b6f 100644 --- a/provision.sh +++ b/bin/build.sh @@ -1,5 +1,7 @@ #!/bin/sh +cd ~ + # let's install packages sudo apt-get update sudo apt-get upgrade diff --git a/bin/www b/bin/www deleted file mode 100755 index bc3849c..0000000 --- a/bin/www +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -var debug = require('debug')('eth-netstatsservice'); -var app = require('../app'); \ No newline at end of file diff --git a/config.default.js b/config.default.js deleted file mode 100644 index 50121b3..0000000 --- a/config.default.js +++ /dev/null @@ -1,8 +0,0 @@ -var config = { - name: 'Node', - type: 'C++', - serverHost: 'http://localhost', - serverPort: '3000' -}; - -module.exports = config; \ No newline at end of file diff --git a/package.json b/package.json index 49c7046..c91a2f5 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,11 @@ { "name": "eth-netstatsservice", + "description": "Ethereum Network Intelligence API", "version": "0.0.1", "private": true, - "scripts": { - "start": "node ./bin/www" + "main": "./app.js", + "directories": { + "lib": "./lib" }, "dependencies": { "debug": "~2.0.0", @@ -12,5 +14,31 @@ "socket.io-client": "^1.3.3", "underscore": "^1.7.0", "xmlhttprequest": "*" - } + }, + "scripts": { + "start": "node ./app.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/cubedro/eth-netstatsservice.git" + }, + "homepage": "https://github.com/cubedro/eth-netstatsservice", + "bugs": { + "url": "https://github.com/cubedro/eth-netstatsservice/issues" + }, + "keywords": [ + "ethereum", + "network", + "intelligence", + "API" + ], + "author": "ethdev.com", + "authors": [ + { + "name": "Marian Oancea", + "email": "marian@ethdev.com", + "url": "https://github.com/cubedro" + } + ], + "license": "LGPL-3.0" } diff --git a/processes.json b/processes.json index a9f383a..49bb586 100644 --- a/processes.json +++ b/processes.json @@ -2,9 +2,9 @@ { "name" : "eth", "script" : "./bin/eth", - "log_file" : "/logs/eth-log.log", - "out_file" : "/logs/eth-out.log", - "error_file" : "/logs/eth-err.log", + "log_file" : "/home/ubuntu/logs/eth-log.log", + "out_file" : "/home/ubuntu/logs/eth-out.log", + "error_file" : "/home/ubuntu/logs/eth-err.log", "merge_logs" : true, "watch" : false, "exec_interpreter" : "bash", @@ -13,9 +13,9 @@ { "name" : "node-app", "script" : "./app.js", - "log_file" : "/logs/node-app-log.log", - "error_file" : "/logs/node-app-err.log", - "out_file" : "/logs/node-app-out.log", + "log_file" : "/home/ubuntu/logs/node-app-log.log", + "out_file" : "/home/ubuntu/logs/node-app-out.log", + "error_file" : "/home/ubuntu/logs/node-app-err.log", "merge_logs" : true, "watch" : false, "exec_interpreter" : "node", @@ -26,7 +26,7 @@ "RPC_HOST" : "localhost", "RPC_PORT" : "8080", "ETH_CLIENT" : "", - "ETH_CLIENT" : "8080", + "ETH_TYPE" : "C++ 0.8.1", "SOCKET_SERVER" : "wss://eth-netstats.herokuapp.com/socket.io/", } }