ethstats-client/README.md

66 lines
2.5 KiB
Markdown
Raw Normal View History

2015-02-12 23:30:12 +01:00
Ethereum Network Intelligence API
2015-02-11 23:21:10 +01:00
============
2015-02-25 22:28:34 +01:00
[![Build Status][travis-image]][travis-url] [![dependency status][dep-image]][dep-url]
2015-02-11 23:21:10 +01:00
2015-02-26 22:02:13 +01:00
This is the backend service which runs along with the node for tracking the ethereum network status, fetches information through the JSON-RPC and connects through WebSockets to [eth-netstats](https://github.com/cubedro/eth-netstats) and feed information constantly.
## Prerequisite
2015-04-21 15:43:16 +02:00
* eth, geth or pyethapp
2015-02-26 22:02:13 +01:00
* node
* npm
2015-02-26 22:09:23 +01:00
2015-02-26 22:02:13 +01:00
## Installation on Ubuntu
2015-04-06 06:57:04 +02:00
Fetch and run the build shell. This will install everything you need: latest ethereum - CLI from develop branch (you can choose between eth or geth), node.js, npm & pm2.
2015-02-11 23:21:10 +01:00
2015-04-06 05:54:13 +02:00
```bash
2015-04-04 03:14:40 +02:00
bash <(curl https://raw.githubusercontent.com/cubedro/eth-net-intelligence-api/master/bin/build.sh)
2015-02-25 22:16:04 +01:00
```
2015-04-21 15:43:16 +02:00
## Installation as docker container (optional)
There is a `Dockerfile` in the root directory of the repository. Please read through the header of said file for
instructions on how to build/run/setup. Configuration instructions below still apply.
2015-02-25 22:16:04 +01:00
2015-02-26 22:09:23 +01:00
## Configuration
2015-02-26 22:45:24 +01:00
Configure the app modifying [processes.json](/eth-net-intelligence-api/blob/master/processes.json). Note that you have to modify the backup processes.json file located in `./bin/processes.json` (to allow you to set your env vars without being rewritten when updating).
2015-02-26 22:09:23 +01:00
2015-04-06 05:54:13 +02:00
```json
2015-02-26 22:10:04 +01:00
"env":
{
2015-04-06 05:54:13 +02:00
"NODE_ENV" : "production", // tell the client we're in production environment
"RPC_HOST" : "localhost", // eth JSON-RPC host
"RPC_PORT" : "8545", // eth JSON-RPC port
2015-04-16 23:40:46 +02:00
"LISTENING_PORT" : "30303", // eth listening port (only used for display)
2015-04-09 14:18:16 +02:00
"INSTANCE_NAME" : "", // whatever you wish to name your node
2015-04-16 23:40:46 +02:00
"CONTACT_DETAILS" : "", // add your contact details here if you wish (email/skype)
2015-05-08 20:27:14 +02:00
"WS_SERVER" : "wss://stats.ethdev.com", // path to eth-netstats WebSockets api server
2015-04-06 05:54:13 +02:00
"WS_SECRET" : "", // WebSockets api server secret used for login
2015-02-26 22:10:04 +01:00
}
2015-02-26 22:09:23 +01:00
```
2015-02-26 22:45:24 +01:00
## Run
Run it using pm2:
2015-04-06 05:54:13 +02:00
```bash
2015-02-26 22:45:24 +01:00
cd ~/bin
pm2 start processes.json
```
2015-02-26 22:47:56 +01:00
## Updating
2015-04-09 14:18:16 +02:00
To update the API client use the following command:
2015-02-26 22:47:56 +01:00
2015-04-06 05:54:13 +02:00
```bash
2015-04-09 14:18:16 +02:00
~/bin/www/bin/update.sh
2015-02-26 22:47:56 +01:00
```
2015-04-09 14:18:16 +02:00
It will stop the current netstats client processes, automatically detect your ethereum implementation and version, update it to the latest develop build, update netstats client and reload the processes.
2015-02-25 22:28:34 +01:00
[travis-image]: https://travis-ci.org/cubedro/eth-net-intelligence-api.svg
[travis-url]: https://travis-ci.org/cubedro/eth-net-intelligence-api
[dep-image]: https://david-dm.org/cubedro/eth-net-intelligence-api.svg
2015-04-21 15:43:16 +02:00
[dep-url]: https://david-dm.org/cubedro/eth-net-intelligence-api