miqueet / helium_miner_scripts Goto Github PK
View Code? Open in Web Editor NEWThis repo was made out of the need to auto update DIY helium miners
This repo was made out of the need to auto update DIY helium miners
When the miner is more than 500 blocks behind, removal of the image does not work.
This is what the script tries to do:
docker image rm miner-amd64_2020.10.12.1_GA
Error response from daemon: invalid reference format: repository name must be lowercase
The command should probably be
docker image rm quay.io/team-helium/miner:miner-arm64_2020.10.12.1_GA
Untagged: quay.io/team-helium/miner:miner-arm64_2020.10.12.1_GA
Untagged: quay.io/team-helium/miner@sha256:0546a3dfa164943cfc5624fe467d0ae5c8446721be29adefef92b8a474702881
Deleted: sha256:528a9811811a3f9e5260285f5547b172a16ef0255d0e568c883aa235a4ca8306
Deleted: sha256:e6f2f7ea131c9b55aabcd74990f690f23054486cacc9ab8c8ce9572dffaccd93
Deleted: sha256:7f177e2014a00adca6235e9608a44d5426862a6bd8128a3102ba337a59c1e17e
Deleted: sha256:88ac2f8395988ec4a6199a917cb9795cfb0e27e00ba3d79b5911415028a523a5
Deleted: sha256:500340c4b43178cc5fe2218a059bf1cfbec51db3af48eae19c8753f3160423f1
Deleted: sha256:678a0785e7d29c77c56c1bb0af4b279374e731903506838956f7bc808665a6dd
But since I don't understand why we're removing the image, I'm not 100% sure how this should be fixed.
Also, the following code:
if [[ $height_diff -gt 50 ]]; then docker stop "$MINER" && docker start "$MINER" ; fi
#If the miner is more than 500 blocks behind, stop the image, remove the container, remove the image. It will be redownloaded later in the script.
if [[ $height_diff -gt 500 ]]; then docker stop "$MINER" && docker rm "$MINER" && docker image rm "$miner_latest" ; fi
will first stop the miner, due to height_diff being greater than 50. Then the second if clause (>500) will try to stop the miner again - which will fail with Error response from daemon: No such container:
causing the docker rm and docker image rm to not be run.
Maybe it should be changed to
if [[ $height_diff -gt 50 ]]; then docker stop "$MINER" && docker start "$MINER" ; fi
#If the miner is more than 500 blocks behind, stop the image, remove the container, remove the image. It will be redownloaded later in the script.
if [[ $height_diff -gt 500 ]]; then docker image rm "$miner_latest" ; fi
There might be a race condition here though - if it takes time to stop and remove the container? I think docker stop and docker rm can return before the command has finished completely?
I haven't had time to get to the bottom of this but it appears to be deleting the local image and stopping the container. Add any relevant info here.
I believe this is related to the code that tries to assist in getting the miner back up and running if it falls behind a sync with the blockchain. Testing out additional code.
It seems that if the miner process crashes within the docker it restarts but zombies occur the work around is to add --init to the docker run command to do this the docker creation command needs to include --init like this
docker run -d --init --env REGION_OVERRIDE=$REGION --restart always --publish $GWPORT:$GWPORT/udp --publish $MINERPORT:$MINERPORT/tcp --name $MINER --mount type=bind,source=$DA$
this was seen by othes in the diy thread on discord
https://discordapp.com/channels/404106811252408320/730246424666832947/770990904861261834
Hello,
There is an issue when updating the miner software as it will often miss a firmware version,
The has been occasions where the GA has not been added to the filename. For example the update miner-arm64_2021.07.14.0 to miner-amd64_2021.07.14.2 does not contain the GA so that update is missed
miner_latest=$(echo "$miner_quay" | grep -v HTTP_Response | jq -c --arg ARCH "$ARCH" '[ .tags[] | select( .name | contains($ARCH)and contains("GA")) ][0].name' | cut -d'"' -f2)
Regards,
Andrew
Hi,
Thank you so much for your script.
I am having an issue with it stopping the container and removing the miner software even when it is on the latest version.
I would prefer if it didn't stop the container and update every time unless it needs to actually update the software. Can you help me with that?
Many thanks
Error: No such container: miner
parse error: Invalid numeric literal at line 1, column 10
Due to the latest change, the script installs an image for mainnet on the server. I suggest making an option at the beginning of the file or in config.txt in order for the script to correctly download the correct image, depending on which network you need to make an update.
Is the restarting normal when I run a script?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.