diff options
| author | Monzero Build System <builds@monzero.org> | 2026-08-15 21:14:26 +0100 |
|---|---|---|
| committer | Monzero Build System <builds@monzero.org> | 2026-08-15 21:14:26 +0100 |
| commit | 28f1919249465d3230f45ed21686c5a836d56df0 (patch) | |
| tree | 948fe5e7052c45c366c24a82b485ae9d1d38e39b /stop-monzero-miner.sh | |
| parent | 4f92268d7c16741cfb41e5bbe2aa46cc260a9ea5 (diff) | |
| download | monzero-core-28f1919249465d3230f45ed21686c5a836d56df0.tar.gz monzero-core-28f1919249465d3230f45ed21686c5a836d56df0.tar.xz monzero-core-28f1919249465d3230f45ed21686c5a836d56df0.zip | |
Establish Monzero Phase 0 and inactive assets baselinemonzero-phase0-assets-prototype-20260815
Diffstat (limited to 'stop-monzero-miner.sh')
| -rwxr-xr-x | stop-monzero-miner.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/stop-monzero-miner.sh b/stop-monzero-miner.sh new file mode 100755 index 000000000..fc00b1f92 --- /dev/null +++ b/stop-monzero-miner.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -euo pipefail + +RPC_PORT="${MONZERO_RPC_PORT:-16175}" +RPC_URL="http://127.0.0.1:$RPC_PORT" + +response="$(curl --silent --show-error --fail --max-time 10 \ + --header 'Content-Type: application/json' \ + --data '{}' "$RPC_URL/stop_mining")" + +python3 - "$response" <<'PY' +import json +import sys + +data = json.loads(sys.argv[1]) +status = data.get("status", "") +if status != "OK": + raise SystemExit(f"Unable to stop mining: {data.get('error_details') or status or data}") +print("Mining stopped. The daemon remains running.") +PY |
