| import os | |
| import subprocess | |
| # Set your mining configuration | |
| wallet_address = "your_wallet_address" | |
| pool_url = "your_pool_url" | |
| rig_id = "your_rig_id" | |
| # Create a config.json file for XMRig | |
| config_json = f""" | |
| {{ | |
| "algo": "ethash", | |
| "coin": "ETH", | |
| "pool": "{pool_url}", | |
| "wallet": "{wallet_address}", | |
| "rig-id": "{rig_id}", | |
| "cpu": true, | |
| "threads": 2 | |
| }} | |
| """ | |
| with open("config.json", "w") as f: | |
| f.write(config_json) | |
| # Install XMRig | |
| subprocess.run(["pip", "install", "xmrig"]) | |
| # Run XMRig | |
| subprocess.run(["xmrig", "-c", "config.json"]) |