Skip to content

Commit

Permalink
change port number from 3000 to 9439
Browse files Browse the repository at this point in the history
  • Loading branch information
lutangar committed May 4, 2018
1 parent 9624c32 commit af6e759
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ WORKDIR /app/

RUN npm i

EXPOSE 3000
EXPOSE 9439

ENTRYPOINT ["node", "-r", "dotenv/config", "index.js"]
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# bitcoind-prometheus-exporter
# bitcoind-exporter

[![NPM package version][npm-svg]][npm-url]
[![Docker Build Status][hub-svg]][hub-url]

Bitcoind wallet metrics **Prometheus** exporter.

> `bitcoind-prometheus-exporter` is compatible with most **bitcoin** forks.
> `bitcoind-exporter` is compatible with most **bitcoin** forks.
Produce **blockchain**, **wallet** and **addresses** metrics.
Most relevant metrics are:
Expand Down Expand Up @@ -39,17 +39,23 @@ The following environment variables are available, that should be enough for *an
>```
### Docker
Using environment variables:
```
docker run --name my-exporter -p 3000:3000 -e "rpcuser=myrpcuser" -e "rpcpassword=myrpcpassword" -e "rpchost=my-wallet" --link my-wallet lepetitbloc/bitcoind-prometheus-exporter
docker run -d --restart always --name my-exporter -p 9439:9439 -e "rpcuser=myrpcuser" -e "rpcpassword=myrpcpassword" -e "rpchost=my-wallet" --link my-wallet lepetitbloc/bitcoind-exporter
````
Using a `.env` file:
```
docker run -d --restart always --name my-exporter -p 9439:9439 -v /path/to/my/conf:/app/.env --link my-wallet lepetitbloc/bitcoind-exporter
```
>An easy hack could be to directly use your wallet conf to feed your exporter `env`:
>```
>docker run --name my-exporter -p 3000:3000 -v /path/to/my/conf:/app/.env --link my-wallet lepetitbloc/bitcoind-prometheus-exporter
>docker run --name my-exporter -p 9439:9439 -v /path/to/my/conf:/app/.env --link my-wallet lepetitbloc/bitcoind-prometheus-exporter
>```
## Example
When visiting the metrics URL http://localhost:3000/metrics the following **metrics** are produced:
When visiting the metrics URL http://localhost:9439/metrics the following **metrics** are produced:
```
# HELP best_block_index The block height or index
# TYPE best_block_index gauge
Expand Down
4 changes: 2 additions & 2 deletions createServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const helmet = require('helmet');
const compression = require('compression');

const createServer = metricsHandler => {
const port = 3000;
const port = 9439;
const app = express();

app.use(compression());
Expand All @@ -17,7 +17,7 @@ const createServer = metricsHandler => {
app.use((req, res) => {
console.warn(`Requested URL ${req.url} resulted in a 404 not found error.`);

res.status(404).send('This metric doesn\'t exists');
res.status(404).send('# This metric doesn\'t exists\n');
});

app.listen(port, () => console.info(`Wallet exporter started on http://localhost:${port}`));
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "bitcoind-prometheus-exporter",
"version": "2.1.2",
"description": "Bitcoind wallet metrics prometheus exporter",
"name": "bitcoind-exporter",
"version": "2.2.2",
"description": "Bitcoind metrics prometheus exporter",
"main": "index.js",
"scripts": {
"test": "dgoss run lepetitbloc/bitcoind-prometheus-exporter",
"test": "dgoss run lepetitbloc/bitcoind-exporter",
"start": "node -r dotenv/config index.js",
"build": "docker build -t lepetitbloc/bitcoind-prometheus-exporter .",
"push": "docker push lepetitbloc/bitcoind-prometheus-exporter",
"build": "docker build -t lepetitbloc/bitcoind-exporter .",
"push": "docker push lepetitbloc/bitcoind-exporter",
"publish": "npm run build && npm run test && npm run push"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lepetitbloc/bitcoind-prometheus-exporter.git"
"url": "git+https://github.com/lepetitbloc/bitcoind-exporter.git"
},
"keywords": [
"bitcoin",
Expand Down

0 comments on commit af6e759

Please sign in to comment.