Skip to content

Manage all your cryptocurrency miners via a local webpage.

License

Notifications You must be signed in to change notification settings

JeffDeCola/crypto-miner-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRYPTO MINER MANAGER

Tag Latest Go Reference Go Report Card codeclimate Maintainability codeclimate Issue Count Docker Pulls License jeffdecola.com

** THE REPO IS UNDER CONSTRUCTION - CHECK BACK SOON **

Manage all your cryptocurrency miners via a local webpage.

Table of Contents

Documentation and Reference

OVERVIEW

Here is an overview of what we're going to do,

IMAGE - crypto-miner-manager-overview - IMAGE

PREREQUISITES

You will need the following go packages,

go get -u -v github.com/sirupsen/logrus
go get -u -v github.com/cweill/gotests/...

SOFTWARE STACK

Where,

  • GUI golang net/http package and ReactJS
  • Routing & REST API framework golang gorilla/mux package
  • Backend golang
  • Database N/A

RUN

To run.sh,

cd crypto-miner-manager-code
go run main.go

As a placeholder, every 2 seconds it will print,

    INFO[0000] Let's Start this!
    Hello everyone, count is: 1
    Hello everyone, count is: 2
    Hello everyone, count is: 3
    etc...

CREATE BINARY

To create-binary.sh,

cd crypto-miner-manager-code/bin
go build -o crypto-miner-manager ../main.go
./crypto-miner-manager

This binary will not be used during a docker build since it creates it's own.

STEP 1 - TEST

To create unit _test files,

cd crypto-miner-manager-code
gotests -w -all main.go

To run unit-tests.sh,

go test -cover ./... | tee test/test_coverage.txt
cat test/test_coverage.txt

STEP 2 - BUILD (DOCKER IMAGE VIA DOCKERFILE)

To build.sh with a Dockerfile,

cd crypto-miner-manager-code
docker build -f build/Dockerfile -t jeffdecola/crypto-miner-manager .

You can check and test this docker image,

docker images jeffdecola/crypto-miner-manager:latest
docker run --name crypto-miner-manager -dit jeffdecola/crypto-miner-manager
docker exec -i -t crypto-miner-manager /bin/bash
docker logs crypto-miner-manager
docker rm -f crypto-miner-manager

In stage 1, rather than copy a binary into a docker image (because that can cause issues), the Dockerfile will build the binary in the docker image,

FROM golang:alpine AS builder
RUN go get -d -v
RUN go build -o /go/bin/crypto-miner-manager main.go

In stage 2, the Dockerfile will copy the binary created in stage 1 and place into a smaller docker base image based on alpine, which is around 13MB.

STEP 3 - PUSH (TO DOCKERHUB)

You must be logged in to DockerHub,

docker login

To push.sh,

docker push jeffdecola/crypto-miner-manager

Check the crypto-miner-manager docker image at DockerHub.

STEP 4 - DEPLOY (TO DOCKER)

To deploy.sh,

cd crypto-miner-manager-code
docker run --name crypto-miner-manager -dit jeffdecola/crypto-miner-manager
docker exec -i -t crypto-miner-manager /bin/bash
docker logs crypto-miner-manager
docker rm -f crypto-miner-manager

CONTINUOUS INTEGRATION & DEPLOYMENT

Refer to ci-README.md on how I automated the above steps.

About

Manage all your cryptocurrency miners via a local webpage.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published