Coder Social home page Coder Social logo

helium_miner_scripts's Introduction

Helium miner update script

This script will automatically detect if that latest docker image is running and if this is not the case it will update to the latest docker image.

Setup

$ git clone https://github.com/Wheaties466/helium_miner_scripts
$ cd helium_miner_scripts/

Then run any of the scripts.

Updating the repo/script to get the lastest version of the script

$ cd helium_miner_scripts/
$ git pull

after you're in the same directory as the script and do a git pull. It will let you know if it is up to date or not.

Dependencies

Following dependencies shall be met:

  • Curl
  • jq
$ sudo apt install curl jq -y

Make sure the user that is running the script is allowed to run docker. Either add the user to the docker group or run the scipt as root. See: https://docs.docker.com/engine/install/linux-postinstall/

Configuration

After cloning this repository make the script executable:

$ chmod +x miner_latest.sh
$ sudo touch /var/log/miner_latest.log

Change architecture

Currently it is setup to use arm64 version, but it can be easily modified to use the amd64 docker image build by modifying the ARCH variable to equal amd instead of arm.

Change region

By default the script is configured for US915 frequencies. To use the miner in other regios like EU868 the script shall be changed by adding the --env REGION_OVERRIDE=EU868 to the line with docker run:

docker run -d --env REGION_OVERRIDE=EU868 --restart always --publish 1680:1680/udp --publish 44158:44158/tcp --name miner --mount type=bind,source=/home/pi/miner_data,target=/var/data quay.io/team-helium/mi$

Script useage

$ ./miner_latest.sh

This can be called from a cron or ran in a shell.

Using cron

Add the following lines to your crontab using sudo crontab -e to run the script daily at 1 o clock at night: The second line updates this repo on a regular basis.

# Check for updates on miner image every night at 1 o clock

# Use whatever path you have your repo setup with.
# If you need to test your cron you can use the following site and add "&& curl -s 'https://webhook.site/#!/~'" to the end of your cron and it will make a web request to your specific url when it completes.
0 */4 * * * /home/pi/helium_miner_scripts/miner_latest.sh 2>&1 >> /var/log/miner_latest.log
0 0 * * * cd /home/pi/helium_miner_scripts && git pull

Extra

Check if your miner is running and receiving data from your gateway:

$ docker exec miner tail -f /var/log/miner/console.log | grep "lora"

Check progress of your miner on the blockchain:

$ docker exec miner miner info height

Check connectivity of your miner:

$ docker exec miner miner peer book -s

check the current running miner version

$ docker container inspect -f '{{.config.image}}' miner | awk -f: '{print $2}'

Monitor progress of your miner in syncing the blockchain and record progress to file

$ ./monitor_blockchain_progress.sh

If this guide helped you please consider donating HNT the following address

13UcQB9B867b6Fp6cwtKgzxfwrr61sbxMpPsXChqPYRr9iFoTar

helium_miner_scripts's People

Contributors

clendaniel avatar kwrobert avatar mfalkvidd avatar miqueet avatar pe1mew avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.