Skip to content

Commit

Permalink
API Support for Latest Ethminer (#5)
Browse files Browse the repository at this point in the history
* API Support for Latest Ethminer

* minor fixes to docs

* API server test; image works
  • Loading branch information
onelapahead authored Jan 13, 2021
1 parent 4d6cf9d commit 671a771
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,36 @@ Learning more about crypto, trading, and deep learning with GPUs and K8s.
- [CUDA drivers](https://askubuntu.com/questions/1099015/how-to-install-latest-version-of-cuda-on-ubuntu-18-04)
- [nvidia-docker2](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#setting-up-nvidia-container-toolkit)

### Docker

```bash
sudo docker login ghcr.io
sudo systemctl daemon-reload
sudo systemctl restart docker
```

### Mining

```bash
sudo nvidia-docker run -p 127.0.0.1:3333:3333/tcp --restart=always --detach=true --gpus=0 --name=ethminer ghcr.io/hfuss/miner:latest
```

To test the API server:

```bash
docker login ghcr.io
nvidia-docker run --restart=always --detach=true --gpus=0 --name=ethminer ghcr.io/hfuss/miner:latest
echo '{"id":0,"jsonrpc":"2.0","method":"miner_ping"}' | netcat 127.0.0.1 3333
```

### Logs
### Real-Time Logs

```bash
docker logs ethminer
sudo docker logs ethminer --follow --since 10s
```

### GPU Stats
### Monitoring via DataDog

```bash
nvidia-docker run -d --gpus=all \
sudo nvidia-docker run -d --gpus=all \
--restart always \
--name datadog-agent \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
Expand Down
10 changes: 10 additions & 0 deletions miner/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Dependencies
- ...

## [v0.2.0]
### Added
- `API_PORT` env var for configuring the API server port

### Changed
- Enabling API server

### Dependecies
- Bump `https://github.com/ethereum-mining/ethminer` to `v0.19.0`

## [v0.1.0]
### Added
- Miner pre-release
Expand Down
6 changes: 4 additions & 2 deletions miner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN mkdir /ethminer
WORKDIR /ethminer

RUN apt-get install -y curl \
&& curl -sL -o ethminer.tgz https://github.com/ethereum-mining/ethminer/releases/download/v0.18.0/ethminer-0.18.0-cuda-9-linux-x86_64.tar.gz \
&& curl -sL -o ethminer.tgz https://github.com/ethereum-mining/ethminer/releases/download/v0.19.0-alpha.0/ethminer-0.19.0-alpha.0-cuda-8-linux-x86_64.tar.gz \
&& tar -xzvf ethminer.tgz \
&& mv bin/ethminer /usr/local/bin/ \
&& mkdir /usr/local/bin/kernels \
Expand All @@ -30,7 +30,9 @@ ENV GPU_FORCE_64BIT_PTR=0 \
WALLET_ADDRESS=0xf0bEA86827AE84B7a712a4Bc716a15C465be3878 \
MINE_POOL=us1.ethermine.org \
STRATUM_TLS_PORT=5555 \
API_PORT=3333 \
WORKER_ID=rdu-01a

ENTRYPOINT ["sh", "-c"]
CMD ["ethminer -U -P stratum+tls12://${WALLET_ADDRESS}.${WORKER_ID}@${MINE_POOL}:${STRATUM_TLS_PORT} --report-hashrate"]
CMD ["ethminer -U -P stratum+tls12://${WALLET_ADDRESS}.${WORKER_ID}@${MINE_POOL}:${STRATUM_TLS_PORT} --report-hashrate --api-bind 0.0.0.0:${API_PORT}"]
EXPOSE ${API_PORT}/tcp
2 changes: 1 addition & 1 deletion miner/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.2.0

0 comments on commit 671a771

Please sign in to comment.