{"id":16400309,"url":"https://github.com/c29r3/mina-snark-stopper","last_synced_at":"2025-03-23T05:31:07.360Z","repository":{"id":56284046,"uuid":"238083412","full_name":"c29r3/mina-snark-stopper","owner":"c29r3","description":"Tool for Mina Protocol","archived":false,"fork":false,"pushed_at":"2022-03-28T10:59:02.000Z","size":95,"stargazers_count":25,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T18:02:25.291Z","etag":null,"topics":["mina-protocol","mina-snark-stopper","snark-worker"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/c29r3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-03T23:27:32.000Z","updated_at":"2023-10-13T10:39:40.000Z","dependencies_parsed_at":"2022-08-15T16:00:45.355Z","dependency_job_id":null,"html_url":"https://github.com/c29r3/mina-snark-stopper","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c29r3%2Fmina-snark-stopper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c29r3%2Fmina-snark-stopper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c29r3%2Fmina-snark-stopper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c29r3%2Fmina-snark-stopper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c29r3","download_url":"https://codeload.github.com/c29r3/mina-snark-stopper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245061382,"owners_count":20554563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mina-protocol","mina-snark-stopper","snark-worker"],"created_at":"2024-10-11T05:27:15.130Z","updated_at":"2025-03-23T05:31:06.883Z","avatar_url":"https://github.com/c29r3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mina-snark-stopper\nTool for Mina Protocol  \n\n## Description\nThis tool can be useful for Mina validators who run node at same time as block producer and snark worker. \nWorker can take up all processor time, which negatively affects block producer. When less than `STOP_WORKER_BEFORE_MIN` minutes remain before the next proposal, the script disconnects the worker and starts it after `STOP_WORKER_FOR_MIN` minutes.  \n\n## Requirements\nPython ver. 3.6+\n\n## Install\n*Your snark worker must be RUNNED. Otherwise, the script will take the Block producer public key*  \n*Check the configuration file. There are some options you might want to reassign*  \n**If you run mina daemon through docker, then you need to add the flag `-p 127.0.0.1:3085:3085`**\n\n### Tmux  \nInstall \n```\nsudo apt-get update \\\n\u0026\u0026 sudo apt-get install python3-venv tmux git -y \\\n\u0026\u0026 git clone https://github.com/c29r3/mina-snark-stopper.git \\\n\u0026\u0026 cd mina-snark-stopper \\\n\u0026\u0026 python3 -m venv venv \\\n\u0026\u0026 source ./venv/bin/activate \\\n\u0026\u0026 pip3 install -r requirements.txt\n```  \nRun  \n```\ntmux new -s snark-stopper -d venv/bin/python3 snark-stopper.py\n```\n\nYou can watch the snark-stopper work  \n`tmux attach -t snark-stopper`  \n\nPress to exit `ctrl + b` and then `d`\n\n### Docker  \n1. Download config file and change the parameters to suit you\n```\ncurl -s https://raw.githubusercontent.com/c29r3/mina-snark-stopper/master/config.yml \u003e config.yml\n```\n\n2. Run docker container  \n```\nsudo docker run -d \\\n--volume $(pwd)/config.yml:/mina/config.yml \\\n--volume $(pwd)/snark_stopper.log:/mina/snark_stopper.log \\\n--net=host \\\n--restart always \\\n--user $(id -u):$(id -g) \\\n--name snark-stopper \\\nc29r3/snark-stopper\n```\n\n3. Check logs  \n`docker logs -f snark-stopper`  \nIf you want to change some parameteres - change it in config file and then restart docker container  \n`docker restart snark-stopper` \n\n## Troubleshooting  \nIf the snark-stopper can't connect to port `3085`:  \n1. Check port availability  \n`nc -t -vv localhost 3085`  \nOutput should be something like this:  \n`Connection to localhost 3085 port [tcp/*] succeeded!`\n\nIf the connection hangs, then the following options are possible:  \n- Access to port `3085` is blocked via ufw\\iptables  \n- You did not add a docker container flag `-p 127.0.0.1:3085:3085`  \n- Node is not synced yet. For this reason the stopper can't connect  \n\n2. Port responds, but the stopper still can't connect  \n`iptables -D OUTPUT -d 172.16.0.0/12 -j DROP`  \nit's because of the blocking of private subnets that the docker uses  \n\n#### Update docker image  \nAfter running the command below, go to step 2\n```\ndocker rm -f snark-stopper; \\\ncurl -s https://raw.githubusercontent.com/c29r3/mina-snark-stopper/master/config.yml \u003e config.yml; \\\ndocker pull c29r3/snark-stopper\n```\n\n## Uninstall  \n```\nrm -rf mina-snark-stopper; \\\ndocker rm -f snark-stopper; \\\ndocker system prune -af\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc29r3%2Fmina-snark-stopper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc29r3%2Fmina-snark-stopper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc29r3%2Fmina-snark-stopper/lists"}