Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions miners/macos/rustchain_mac_miner_v2.5.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,16 @@ def error(msg): return msg

MINER_VERSION = "2.5.0"
NODE_URL = os.environ.get("RUSTCHAIN_NODE", "https://rustchain.org")
PROXY_URL = os.environ.get("RUSTCHAIN_PROXY", "http://192.168.0.160:8089")
# No default proxy. The previous default pointed at a private lab address
# (192.168.0.160), which on anyone else's LAN is whatever machine happens to
# hold that IP. The miner would hand its full attestation, including hardware
# serial, MAC addresses, hostname and wallet, in cleartext to a stranger.
PROXY_URL = os.environ.get("RUSTCHAIN_PROXY", "")

# Verification is ON. Old PowerPC Macs genuinely cannot complete a modern
# TLS handshake, and the escape hatch for them is an explicit opt-out that
# the operator chooses, not a silent default that ships to everyone.
TLS_VERIFY = os.environ.get("RUSTCHAIN_TLS_VERIFY", "1") not in ("0", "false", "False")
BLOCK_TIME = 600 # 10 minutes
LOTTERY_CHECK_INTERVAL = 10

Expand Down Expand Up @@ -199,7 +208,7 @@ def _probe_transport(self):
try:
r = requests.get(
self.node_url + "/health",
timeout=10, verify=False
timeout=10, verify=TLS_VERIFY
)
if r.status_code == 200:
print(success("[TRANSPORT] Direct HTTPS to node: OK"))
Expand Down Expand Up @@ -237,14 +246,14 @@ def base_url(self):
def get(self, path, **kwargs):
"""GET request through whichever transport works."""
kwargs.setdefault("timeout", 15)
kwargs.setdefault("verify", False)
kwargs.setdefault("verify", TLS_VERIFY)
url = self.base_url + path
return requests.get(url, **kwargs)

def post(self, path, **kwargs):
"""POST request through whichever transport works."""
kwargs.setdefault("timeout", 15)
kwargs.setdefault("verify", False)
kwargs.setdefault("verify", TLS_VERIFY)
url = self.base_url + path
return requests.post(url, **kwargs)

Expand Down
11 changes: 11 additions & 0 deletions miners/pico_bridge/pico_bridge_miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,17 @@ def main():
config = load_config(args.config)

# Override with CLI args
# --simulate fabricates hardware readings. Posting those to a node that
# pays real RTC is a fake-hardware faucet, so it is refused unless the
# operator has explicitly pointed the bridge at a local test node.
SIMULATE_LOCAL_ONLY = True
if args.simulate and SIMULATE_LOCAL_ONLY:
_n = config.get('node_url', '')
if not any(h in _n for h in ('localhost', '127.0.0.1', '0.0.0.0', '::1')):
print('refusing --simulate against a non-local node: ' + _n)
print('point RUSTCHAIN_NODE at a local test node to simulate')
return 2

if args.simulate:
config['simulation_mode'] = True
if args.wallet:
Expand Down
Loading