Skip to content

Commit 75dad65

Browse files
authored
Merge pull request #7 from Alethio/v2.4.17
V2.4.17
2 parents d232f17 + 96cf0ba commit 75dad65

6 files changed

Lines changed: 98 additions & 99 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [2.4.17] - 2019-02-17
5+
- Fixed server reconnection bug
6+
- Updated Readme file
7+
48
## [2.4.16] - 2019-02-14
59
- Fixed web3 WebSocketProvider connection issue
610

README.md

Lines changed: 47 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@
33
> EthStats - Network Monitor - CLI Client
44
>
55
>
6-
> The client application connects to your Ethereum node through RPC and extract data that will be sent to the `EthStats - Network Monitor - Server` for analytics purposes.
6+
> The application connects to your Ethereum node through RPC and extract data that will be sent to the `EthStats - Network Monitor - Server` for analytics purposes.
77
88
# Live deployments
99
See active nodes or add your own on the following running deployments of the EthStats Network Monitor
1010

11-
[Mainnet](https://net.ethstats.io/)
12-
[Görli Testnet](https://net.goerli.ethstats.io/)
11+
- Mainnet - [net.ethstats.io](https://net.ethstats.io/)
12+
- Görli Testnet - [net.goerli.ethstats.io](https://net.goerli.ethstats.io/)
13+
14+
# Supported Ethereum nodes
15+
Geth, Parity, Pantheon, basically any Ethereum node that has RPC enabled.
1316

1417
# Contents
1518
- [Getting Started](#getting-started)
1619
- [Prerequisites](#prerequisites)
1720
- [Install](#install)
1821
- [Update](#update)
1922
- [Running](#running)
20-
- [CLI](#cli)
21-
- [Daemon](#daemon)
22-
- [With PM2](#with-pm2)
23-
- [In Docker](#in-docker)
23+
- [Register node](#register-node)
24+
- [Config file](#config-file)
25+
- [CLI Options](#cli-options)
26+
- [Daemon](#daemon)
27+
- [Docker](#docker)
2428
- [Troubleshooting](https://github.com/Alethio/ethstats-cli/blob/master/TROUBLESHOOTING.md)
2529
- [Changelog](https://github.com/Alethio/ethstats-cli/blob/master/CHANGELOG.md)
2630
- [License](https://github.com/Alethio/ethstats-cli/blob/master/LICENSE)
@@ -37,18 +41,6 @@ Please make sure you have the following installed and running properly
3741
- [Geth](https://geth.ethereum.org/install/) or [Parity](https://wiki.parity.io/Setup) running in one of the supported configurations **synced on the Ethereum main/foundation chain**
3842
- JSON-RPC http or websockets or ipc APIs enabled and accessible on the Ethereum node of choice (Geth/Parity)
3943

40-
## Supported node configurations
41-
Geth
42-
- fast (`--syncmode "fast"`)
43-
- full (`--syncmode "full"`)
44-
- light (`--syncmode "light"`)
45-
> tested 1.8.1,
46-
47-
Parity
48-
- fast (`--pruning fast`)
49-
- archive (`--pruning archive`)
50-
- with no ancient blocks (`--no-ancient-blocks`)
51-
> tested 1.7.11, 1.8.6, 1.8.7, 1.9.0, 1.9.1, 1.9.2, 1.10.0,
5244

5345
## Install
5446

@@ -81,25 +73,42 @@ yarn global upgrade ethstats-cli
8173
```
8274

8375
## Running
84-
On the first run the app will start in interactive mode and you will be asked a series of questions to setup your node.
85-
Either follow the on screen instructions or see [CLI options](#cli-options) for a non-interactive mode.
86-
87-
The app is configured by default to connect to an Ethereum node on the local machine (http://localhost:8545).
88-
To connect to a node running on another host see `--client-url` under [CLI options](#cli-options).
89-
90-
After the setup is done, your node will be visible on [net.ethstats.io](https://net.ethstats.io/)
76+
To run the app use the following command:
77+
```sh
78+
$ ethstats-cli
79+
```
80+
The app is configured by default to connect to the Ethereum node on your local host (http://localhost:8545).
81+
To connect to a node running on a different host see `--client-url` under [CLI Options](#cli-options).
9182

9283
IMPORTANT: To be able to extract all statistics from the Ethereum node we recommend running the app on the same host. The usage information about the node like cpu and memory load cannot be extracted if on a different host.
9384

94-
### CLI
85+
## Register node
9586

96-
To run the app in interactive mode you can use the following command:
87+
On the first run of the app the first thing it does is to register the Ethereum node in our platform. For this you will be asked about the network the node is running on, email address and node name.
9788

89+
It is possible to register the node also in non interactive mode without asking the necessary infos by specifying the `--register` option like in the example bellow:
9890
```sh
99-
$ ethstats-cli
91+
$ ethstats-cli --register --account-email your@email.com --node-name your_node_name
10092
```
10193

102-
#### CLI options:
94+
For more details on these options please see [CLI Options](#cli-options).
95+
96+
If the node is already registered and you still specify the `--register` option, it will be avoided. A new registration is possible if the [config file](#config-file) is deleted.
97+
98+
## Config file
99+
After the node was successfully registered, a config file is created in the following location:
100+
```sh
101+
~/.config/configstore/ethstats-cli.json
102+
```
103+
104+
It persists the node name, the secret key received on successfully registration and the values of the following CLI options:
105+
- `--configurator-url`
106+
- `--server-url`
107+
- `--client-url`
108+
- `--client-ipc-path`
109+
- `--network`
110+
111+
# CLI Options:
103112

104113
```sh
105114
--help, -h Show help
@@ -109,6 +118,7 @@ $ ethstats-cli
109118

110119
--server-url Server URL (Must include protocol and port if any)
111120
--net, -n Specify Ethereum network your node is running on (Default: mainnet)
121+
Available networks: mainnet|goerli
112122
If --server-url is specified, this option is ignored
113123

114124
--client-url Client URL (Must include protocol and port if any; Default: http://localhost:8545)
@@ -124,28 +134,15 @@ $ ethstats-cli
124134
--node-name Name of the node. If node is already registered, a unique 5 char hash will be appended
125135
```
126136
127-
Running the app in non-interactive mode for the first time, you'll need to specify the `--register` option together with `--account-email` and `--node-name`.
128-
Like this no questions will be asked. All other CLI options have default values.
129-
130-
Example:
131-
```sh
132-
$ ethstats-cli --register --account-email your@email.com --node-name your_node_name
133-
```
134-
135-
If the app is already registered and you still specify the registration CLI option like in the example command above, they will be avoided.
136-
137-
If the node was successfully registered, a configuration file is created to persist the values of the CLI options previously specified.
138-
Every CLI option that passes a value, once specified, it's value is stored in this configuration file, so the next time the app is started there's no need to specify does CLI options again.
139-
140-
### Daemon
137+
# Daemon
141138
142139
To keep the app running at all times, you can run it as a daemon using the following command:
143140
144141
```sh
145142
$ ethstats-daemon
146143
```
147144
148-
#### Daemon options:
145+
## Daemon options:
149146
150147
```sh
151148
start Start daemon
@@ -158,7 +155,7 @@ $ ethstats-daemon
158155
If any CLI options are specified after the Daemon option, they will be forwarded to the forked process.
159156
The Daemon mode is implemented programmatically through the PM2 API. The API does not support the "startup" feature. To handle start on boot, check out the [PM2](#with-pm2) instructions.
160157
161-
### With PM2
158+
## PM2
162159
163160
For more control you can use directly [PM2](http://pm2.keymetrics.io). Here is a JSON format process file that we recommend:
164161
@@ -178,9 +175,9 @@ For more control you can use directly [PM2](http://pm2.keymetrics.io). Here is a
178175
179176
To handle daemon start at boot time, please visit [PM2-Startup](http://pm2.keymetrics.io/docs/usage/startup/).
180177
181-
### In Docker
178+
# Docker
182179
183-
#### Installing and running
180+
## Installing and running
184181
The following commands assume that the Ethereum node is either running locally or in docker with `--net host`.
185182
For other options you should check out [CLI options](#cli-options).
186183
@@ -211,13 +208,7 @@ node:latest \
211208
/bin/sh -c "yarn global add ethstats-cli && ethstats-cli --register --account-email your@email.com --node-name your_node_name"
212209
```
213210
214-
The docker commands are run with `-d`, that means `ethstats-cli` is started in non-interactive mode.
215-
216-
To run in interactive mode change `-d` to `-it` and remove the `--register` option along with `--account-email` and `--node-name`.
217-
218-
If you already had a configuration file, the settings from that file will be used and the command line ignored. Delete the files in `/opt/ethstats-cli` to add a node with different settings.
219-
220-
#### Updating
211+
## Updating
221212
222213
If you started from `alethio/ehtstats-cli` docker image:
223214
@@ -228,7 +219,7 @@ docker stop ethstats-cli && docker rm ethstats-cli
228219
229220
then run it again.
230221
231-
If you started from `node/latest` docker image, just stop and remove the `ethstats-cli`:
222+
If you started from `node:latest` docker image, just stop and remove the `ethstats-cli` container:
232223
233224
```sh
234225
docker stop ethstats-cli && docker rm ethstats-cli

lib/Cli.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default class CLI {
2727
2828
--server-url Server URL (Must include protocol and port if any)
2929
--net, -n Specify Ethereum network your node is running on (Default: mainnet)
30+
Available networks: mainnet|goerli
3031
If --server-url is specified, this option is ignored
3132
3233
--client-url Client URL (Must include protocol and port if any; Default: http://localhost:8545)

lib/Server.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ export default class Server {
105105

106106
this.socket = new PrimusSocket(`${this.url}`, {
107107
reconnect: {
108-
min: 1 + (Math.floor(Math.random() * 10)), // Random between 1 and 10 seconds
108+
min: (1 + (Math.floor(Math.random() * 10))) * 1000, // Random between 1 and 10 seconds
109109
factor: 1,
110-
retries: 300 // Retries for 25 hours
110+
retries: 8640
111111
}
112112
});
113113

@@ -225,7 +225,10 @@ export default class Server {
225225
}
226226

227227
destroy() {
228-
this.socket.destroy();
228+
if (this.socket) {
229+
this.socket.destroy();
230+
}
231+
229232
clearInterval(this.pingIntervalId);
230233
clearInterval(this.checkLastBlockInterval);
231234
}

0 commit comments

Comments
 (0)