Update README with docker-compose directions

This commit is contained in:
Ben Wilson 2019-11-14 12:08:24 -05:00
parent 78391b9e9f
commit 213948bb6a
3 changed files with 72 additions and 1 deletions

View File

@ -2,7 +2,7 @@
The `zcashd_exporter` will poll a zcashd node's rpc endpoint, retreive data, then preent it for prometheus to scrape.
## Getting started
## Getting started locally
```
go get -v github.com/zcash-hackworks/zcashd_exporter
@ -10,3 +10,74 @@ go install github.com/zcash-hackworks/zcashd_exporter
$GOPATH/bin/zcashd_exporter --help
```
## Getting Started With docker-compose
#### Create zcashd direcotries
Decide where you want to store (or refence existing ) zcashd data.
For example, create 2 new directories:
```
sudo mkdir -p /srv/zcashd/.zcash
sudo mkdir -p /srv/zcashd/.zcash-params
```
Make uid `2001` owner of the directories. This is the uid of user `zcashd` runs as.
```
sudo chown -R 2001 /srv/zcashd/.zcash
sudo chown -R 2001 /srv/zcashd/.zcash-params
```
#### Create .env from .env.exmaple
```
cp .env.exmaple .env
```
Edit `.env` if you have any specific changes.
#### Start docker-compose
Start with
```
docker-compose up -d
```
Check that everything started
```
$ docker-compose ps
Name Command State Ports
------------------------------------------------------------------------------------------------------------------------------
zcashdexporter_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp
zcashdexporter_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp
zcashdexporter_zcashd_1 /entrypoint.sh Up 0.0.0.0:18232->18232/tcp, 0.0.0.0:28332->28332/tcp
zcashdexporter_zcashd_exporter_1 zcashd_exporter --rpc.host ... Up 0.0.0.0:9100->9100/tcp
```
### Check status
zcashd
```
docker logs zcashdexporter_zcashd_1
```
zcashd_exporter
```
docker logs zcashdexporter_zcashd_exporter_1
```
If that's looking good, check `prometheus` for metric collection
http://localhost:9090/targets
![Prometheus Targets](docs/images/prometheus_targets.png)
If that looks good too, start querying
http://localhost:9090/graph
Start typing and metric names will auto-suggest
![Prometheus Metrics](docs/images/prometheus_metrics.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB