Fork of: https://github.com/crypto-jeronimo/pyminer
Changes:
- Removed Scrypt hashing and added Miner class
- Made it work with Python3
- added PiAxe as miner
- added reconnect logic on broken connections
The repository contains a dockered setup running on the Pi that shows some statistics:
![](https://private-user-images.githubusercontent.com/3079832/287430611-45fd0a7d-43b6-4b28-909e-6661972ef95a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMDE5ODQsIm5iZiI6MTcyMDEwMTY4NCwicGF0aCI6Ii8zMDc5ODMyLzI4NzQzMDYxMS00NWZkMGE3ZC00M2I2LTRiMjgtOTA5ZS02NjYxOTcyZWY5NWEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDRUMTQwMTI0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWQ5OWNhMmNiZjljNDVlMTg3MjA0MmEwZDkzMzAzNDczNDk4YzMxYzFjYjcwMmFhNmQxZmI0ODc2MzBmZDlkNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.hjCiA3GcfC1qCDtyMDyNp_haDHZSzLZiTq076MldwjY)
The "blocks found" counter is static of course ...
Currently supported algorithms:
sha256d
: SHA256d
python pyminer.py [-h] [-o URL] [-u USERNAME] [-p PASSWORD]
[-O USERNAME:PASSWORD] [-a ALGO] [-B] [-q]
[-P] [-d] [-v]
-o URL, --url= stratum mining server url
-u USERNAME, --user= username for mining server
-p PASSWORD, --pass= password for mining server
-O USER:PASS, --userpass= username:password pair for mining server
-B, --background run in the background as a daemon
-q, --quiet suppress non-errors
-P, --dump-protocol show all JSON-RPC chatter
-d, --debug show extra debug information
-h, --help show the help message and exit
-v, --version show program's version number and exit
Example:
python pyminer.py -o stratum+tcp://foobar.com:3333 -u user -p passwd
Misc:
$ curl --user bitcoin --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createwallet", "params": ["piaxe-wallet"]}' -H 'content-type: text/plain;' http://127.0.0.1:18332/
$ curl --user bitcoin --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getnewaddress", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:18332/