Bug
The generated miner service templates set wallet-related environment variables, but miners/linux/rustchain_linux_miner.py only receives the wallet through the CLI --wallet argument.
That means service-launched miners can ignore the wallet the user entered during setup and fall back to LocalMiner._gen_wallet(), mining under a random generated wallet instead of the configured payout/miner ID.
Evidence in the current code
setup.sh systemd template currently sets:
Environment="WALLET_NAME=$WALLET_NAME"
ExecStart=$PYTHON -u $INSTALL_DIR/rustchain_linux_miner.py
setup.sh launchd template similarly sets WALLET_NAME in EnvironmentVariables but only passes the script path in ProgramArguments.
scripts/install.sh sets:
Environment="RUSTCHAIN_WALLET=${wallet}"
ExecStart=${py} -u ${INSTALL_DIR}/rustchain_linux_miner.py
and the launchd plist sets RUSTCHAIN_WALLET but does not pass --wallet.
However miners/linux/rustchain_linux_miner.py parses and uses only the CLI arg:
parser.add_argument("--wallet", help="Wallet address")
...
miner = LocalMiner(wallet=args.wallet, ...)
LocalMiner.__init__ falls back to _gen_wallet() when wallet is missing.
Impact
A user can complete setup with a known wallet/miner ID, install the service, and then have the background miner run under a different generated wallet. Rewards and balance checks would not line up with the wallet shown in setup output or the bounty/payout wallet the user registered.
Expected behavior
Generated systemd and launchd services should pass the configured wallet explicitly:
python -u rustchain_linux_miner.py --wallet "$WALLET_NAME"
or the equivalent for the installer-local ${wallet} variable.
Fix
I added the fix to PR #5711:
#5711
The PR now updates both setup.sh and scripts/install.sh systemd/launchd templates to pass --wallet explicitly, while keeping PYTHONUNBUFFERED=1 / -u for prompt log output.
Bug
The generated miner service templates set wallet-related environment variables, but
miners/linux/rustchain_linux_miner.pyonly receives the wallet through the CLI--walletargument.That means service-launched miners can ignore the wallet the user entered during setup and fall back to
LocalMiner._gen_wallet(), mining under a random generated wallet instead of the configured payout/miner ID.Evidence in the current code
setup.shsystemd template currently sets:setup.shlaunchd template similarly setsWALLET_NAMEinEnvironmentVariablesbut only passes the script path inProgramArguments.scripts/install.shsets:and the launchd plist sets
RUSTCHAIN_WALLETbut does not pass--wallet.However
miners/linux/rustchain_linux_miner.pyparses and uses only the CLI arg:LocalMiner.__init__falls back to_gen_wallet()whenwalletis missing.Impact
A user can complete setup with a known wallet/miner ID, install the service, and then have the background miner run under a different generated wallet. Rewards and balance checks would not line up with the wallet shown in setup output or the bounty/payout wallet the user registered.
Expected behavior
Generated systemd and launchd services should pass the configured wallet explicitly:
python -u rustchain_linux_miner.py --wallet "$WALLET_NAME"or the equivalent for the installer-local
${wallet}variable.Fix
I added the fix to PR #5711:
#5711
The PR now updates both
setup.shandscripts/install.shsystemd/launchd templates to pass--walletexplicitly, while keepingPYTHONUNBUFFERED=1/-ufor prompt log output.