Skip to content

feat: add automated mining setup#9

Open
dewabisma wants to merge 2 commits into
mainfrom
beast/one-script-setup-mining
Open

feat: add automated mining setup#9
dewabisma wants to merge 2 commits into
mainfrom
beast/one-script-setup-mining

Conversation

@dewabisma

@dewabisma dewabisma commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Basically what I'm trying to do is having a simple way to setup mining without bothering with AI and reading any of the docs.

I add simple script that walk through the mining setup. I tested in MAC it works great. Hasn't tested in WSL and Linux.


Note

Medium Risk
The script handles wallet mnemonics interactively, downloads and runs third-party binaries, and persists wormhole inner hashes—sensitive for mining rewards though scoped to local ops/docs, not core application code.

Overview
Adds an Automated Setup path to the mining guide: users can curl quantus-mining.sh from docs, run setup then start, instead of following only the manual binary steps.

The new static/scripts/quantus-mining.sh (~950 lines) drives end-to-end Planck mining on macOS, Linux, and WSL2: detects platform, pulls latest quantus-node / quantus-miner from GitHub releases, generates P2P node key and wormhole keys (derive from hidden 24-word input or fresh keygen), prompts GPU vs CPU workers, and writes ~/quantus-mining/mining.conf (mode 600, INNER_HASH only—no mnemonic on disk). It manages the stack with start (foreground node + background miner, or -d detach), start-node / start-miner, stop / restart, config show|set|edit (masks inner hash on show), and uninstall.

Also adds static/scripts/mining.conf.example documenting config keys and links it from the guide.

Reviewed by Cursor Bugbot for commit 2940c0c. Configure here.

@dewabisma dewabisma requested a review from Jfangle June 23, 2026 05:14

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 4 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2940c0c. Configure here.


wait_for_miner_server "$MINER_LISTEN_PORT" "$node_log" 120

start_miner_background "$miner_log"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Foreground start skips error cleanup

Medium Severity

In foreground start, the node and log tail are backgrounded before wait_for_miner_server or start_miner_background run. Those steps call die on failure, but only INT/TERM invoke cleanup_foreground, so the script can exit while the node and tail keep running.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2940c0c. Configure here.

return 0
fi
sleep 1
done

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait ignores dead node process

Medium Severity

wait_for_miner_server only polls the log and port_listening; it never checks whether the node process is still alive. If the node exits early, the script can sit for the full timeout before failing.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2940c0c. Configure here.

ensure_start_prerequisites

if ! port_listening "$MINER_LISTEN_PORT"; then
die "Node miner server is not listening on port ${MINER_LISTEN_PORT}. Start the node first: ${SCRIPT_NAME} start-node"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start-miner needs port utilities

Medium Severity

start-miner refuses to run when port_listening is false, but that helper returns false if lsof, ss, and netstat are all missing—even when the node is listening and the log already shows the miner server is up.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2940c0c. Configure here.

Comment thread static/scripts/quantus-mining.sh Outdated
read -r -s mnemonic
echo ""
[ -n "$mnemonic" ] || die "Mnemonic cannot be empty"
output="$("$NODE_BIN" key quantus --scheme wormhole --words "$mnemonic" 2>&1)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mnemonic exposed in argv

Medium Severity

Setup passes the user’s 24-word mnemonic to quantus-node via --words on the command line. Other users and tools on the same machine can read the full seed from the process list while keygen runs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2940c0c. Configure here.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 13ba03c
Status: ✅  Deploy successful!
Preview URL: https://4d74501b.docs-7or.pages.dev
Branch Preview URL: https://beast-one-script-setup-minin.docs-7or.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant