Skip to content

Instantly share code, notes, and snippets.

@ex3ndr
Last active June 4, 2017 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ex3ndr/8341ba08bb39af7f15ca095bc32c9f19 to your computer and use it in GitHub Desktop.
Save ex3ndr/8341ba08bb39af7f15ca095bc32c9f19 to your computer and use it in GitHub Desktop.
#!/bin/bash
IS_FAILING=`systemctl is-failed miner.service`
if [ "$IS_FAILING" == "active" ]; then
echo "ok"
else
echo failed
exit 2
fi
#!/bin/bash
set -e
# Drivers
apt-get update
apt-get install -y libcurl3 nvidia-375 unzip
systemctl set-default multi-user.target
# Consul
wget -O consul.zip https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip?_ga=2.128421519.268080342.1496527463-494824478.1496527463
unzip consul.zip
sudo cp consul /usr/local/bin/
mkdir /etc/consul.d/
wget https://gist.github.com/ex3ndr/8341ba08bb39af7f15ca095bc32c9f19/raw/consul.service
cp consul.service /etc/systemd/system
rm consul
rm consul.zip
rm consul.service
systemctl daemon-reload
systemctl start consul.service
systemctl enable consul.service
# Miner
wget https://gist.github.com/ex3ndr/8341ba08bb39af7f15ca095bc32c9f19/raw/miner.service
cp miner.service /etc/systemd/system
rm miner.service
mkdir /usr/local/miner
cd /usr/local/miner
wget https://github.com/nanopool/Claymore-Dual-Miner/releases/download/v9.4/Claymore.s.Dual.Ethereum.Decred_Siacoin_Lbry_Pascal.AMD.NVIDIA.GPU.Miner.v9.4.-.LINUX.tar.gz
tar -xvf Claymore.s.Dual.Ethereum.Decred_Siacoin_Lbry_Pascal.AMD.NVIDIA.GPU.Miner.v9.4.-.LINUX.tar.gz
rm Claymore.s.Dual.Ethereum.Decred_Siacoin_Lbry_Pascal.AMD.NVIDIA.GPU.Miner.v9.4.-.LINUX.tar.gz
rm *.txt
rm start_*
wget https://gist.github.com/ex3ndr/8341ba08bb39af7f15ca095bc32c9f19/raw/miner.sh
wget https://gist.github.com/ex3ndr/8341ba08bb39af7f15ca095bc32c9f19/raw/check.sh
chmod +x miner.sh
chmod +x check.sh
# Miner Life Check
echo '{"check": {"name": "miner", "script": "/usr/local/miner/check.sh", "interval": "30s"}}' > /etc/consul.d/miner.json
echo '{"check": {"name": "ping", "script": "ping -c1 google.com >/dev/null", "interval": "30s"}}' > /etc/consul.d/ping.json
# Start
systemctl daemon-reload
systemctl start consul.service
systemctl enable consul.service
systemctl start miner.service
systemctl enable miner.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/bin/consul agent -data-dir=/tmp/consul -config-dir=/etc/consul.d/ -join=master.bitcoin.local
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
#!/bin/bash
set -e
apt-get install -y unzip
wget -O consul.zip https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip?_ga=2.128421519.268080342.1496527463-494824478.1496527463
unzip consul.zip
sudo cp consul /usr/local/bin/
rm consul.zip
rm consul
wget https://gist.github.com/ex3ndr/8341ba08bb39af7f15ca095bc32c9f19/raw/consul.service
cp consul.service /etc/systemd/system
systemctl daemon-reload
systemctl start consul.service
systemctl enable consul.service
[Unit]
Description=Miner Service
Requires=network-online.target
After=network-online.target
[Service]
Restart=on-failure
WorkingDirectory=/usr/local/miner/
ExecStart=/usr/local/miner/miner.sh
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
#!/bin/bash
set -e
HOST=`hostname`
export GPU_FORCE_64BIT_PTR=0
export GPU_MAX_HEAP_SIZE=100
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_SINGLE_ALLOC_PERCENT=100
ETH_ACCOUNT=53b51fe9ea46d81ab716b563b3e87d43ded4f9b4.${HOST}
ETH_POOL=eu1.ethermine.org:4444
ETH_MODE=0
DCR_ACCOUNT=ex3ndr.${HOST}
DCR_POOL=dcr.suprnova.cc:3252
./ethdcrminer64 -epool $ETH_POOL -ewal $ETH_ACCOUNT -epsw x -esm $ETH_MODE -dpool $DCR_POOL -dwal $DCR_ACCOUNT -dpsw x -allpools 1 -mode 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment