Skip to content

Commit

Permalink
Merge pull request #1 from acebusters/feat/rinkeby-support
Browse files Browse the repository at this point in the history
add rinkeby network support
  • Loading branch information
troggy authored Dec 4, 2017
2 parents d82a63e + 2b2a779 commit 68b548f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ wget https://raw.githubusercontent.com/acebusters/geth-healthcheck/master/index.
ETHERSCAN_API_KEY=<etherscan_api_key> PORT=50336 node index.js
```

for rinkeby network:
```
ETHERSCAN_API_KEY=<etherscan_api_key> PORT=50336 NETWORK=rinkeby node index.js
```

Make sure it is detached from the terminal. Make sure the port is open for incoming connections.

## License
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ const http = require('http');
const https = require('https');
const { exec } = require('child_process');

const ETHERSCAN_URL = `https://api.etherscan.io/api?module=proxy&action=eth_blockNumber&apikey=${process.env.ETHERSCAN_API_KEY}`;
const etherscanPrefix = process.env.NETWORK == 'rinkeby' ? 'rinkeby' : 'api';

const ETHERSCAN_URL = `https://${etherscanPrefix}.etherscan.io/api?module=proxy&action=eth_blockNumber&apikey=${process.env.ETHERSCAN_API_KEY}`;
const MAX_BLOCK_DIFFERENCE = 3;

const getLocalBlockNum = () => {
Expand Down

0 comments on commit 68b548f

Please sign in to comment.