Compare commits

...

10 Commits

Author SHA1 Message Date
empresa 07134d26d7 Wallet config debugging. More. 2025-09-09 22:13:52 +07:00
empresa a60adedafd Wallet config debugging. More. 2025-09-09 19:07:15 +07:00
empresa 2263d293c8 Wallet config debugging. More. 2025-09-09 19:02:46 +07:00
empresa 4953ffe965 Wallet config debugging. More. 2025-09-09 18:58:54 +07:00
empresa de683b989e Wallet config debugging. More. 2025-09-09 18:58:01 +07:00
empresa cfba5d729d Wallet config debugging. More. 2025-09-09 18:53:53 +07:00
empresa 9a36cf99bf Wallet config debugging. More. 2025-09-09 18:52:54 +07:00
empresa 90a76735e2 Wallet config debugging. More. 2025-09-09 18:49:22 +07:00
empresa b74bb34f40 Wallet config debugging. More. 2025-09-09 18:40:59 +07:00
empresa b3502c8778 Wallet config debugging. Part 3. 2025-09-09 18:38:45 +07:00
1 changed files with 17 additions and 4 deletions

View File

@ -249,17 +249,28 @@ async def hive_load_configs(default_power_limits, static_config):
fs_core_lock, fs_mem_lock = extract_last_setcore_setmem(wallet_conf_content) fs_core_lock, fs_mem_lock = extract_last_setcore_setmem(wallet_conf_content)
for wallet_conf_line in wallet_conf_content.split('\n'): for wallet_conf_line in wallet_conf_content.split('\n'):
wallet_conf_line = wallet_conf_line.strip() wallet_conf_line = wallet_conf_line.strip()
logger.info(wallet_conf_line)
if wallet_conf_line[:1] != "#" and '=' in wallet_conf_line: if wallet_conf_line[:1] != "#" and '=' in wallet_conf_line:
key, value = [wallet_conf_line.split('=', 1)[0], clean_config_value(wallet_conf_line.split('=', 1)[1])] key, value = [wallet_conf_line.split('=', 1)[0], clean_config_value(wallet_conf_line.split('=', 1)[1])]
logger.info(key)
logger.info(value)
if key[-9:] == "_TEMPLATE": if key[-9:] == "_TEMPLATE":
possible_clore_config = base64_string_to_json(value) possible_clore_config = base64_string_to_json(value)
if possible_clore_config: if possible_clore_config:
clore_config = possible_clore_config clore_config = possible_clore_config
elif key == "CUSTOM_MINER" and value == "clore": elif key == "CUSTOM_MINER" and value == "clore":
clore_miner_present = True clore_miner_present = True
elif key == "CLORE_RENTALS_TOKEN":
possible_clore_config = base64_string_to_json(value)
if possible_clore_config:
clore_config = possible_clore_config
elif key == "META":
try:
meta_value = json.loads(value)
if (isinstance(meta_value, dict) and
"clore-rentals" in meta_value and
isinstance(meta_value["clore-rentals"], dict) and
meta_value["clore-rentals"].get("coin") == "CLORE-Rentals"):
clore_miner_present = True
except (json.JSONDecodeError, TypeError, KeyError) as e:
pass
if (not clore_miner_present or not clore_config) and parsed_static_config: if (not clore_miner_present or not clore_config) and parsed_static_config:
clore_miner_present = True clore_miner_present = True
@ -428,6 +439,7 @@ if args.write_linux_config:
sys.exit(1) sys.exit(1)
async def main(machine_specs): async def main(machine_specs):
logger.info("Started onboarding")
global next_retry_reached_server_limit global next_retry_reached_server_limit
last_used_config = None last_used_config = None
ever_pending_creation = False ever_pending_creation = False
@ -446,6 +458,7 @@ async def main(machine_specs):
oc_config = {} oc_config = {}
while True: while True:
try: try:
logger.info("Looping")
if args.mode == "linux": if args.mode == "linux":
clore_config = await async_read_file(clore_conf_path) clore_config = await async_read_file(clore_conf_path)
clore_config = json.loads(clore_config) clore_config = json.loads(clore_config)
@ -493,7 +506,7 @@ async def main(machine_specs):
await asyncio.sleep(60 if ever_pending_creation else 10) await asyncio.sleep(60 if ever_pending_creation else 10)
ever_pending_creation = True ever_pending_creation = True
last_used_config = None last_used_config = None
elif "init_communication_token" in response_data and "private_communication_token": elif "init_communication_token" in response_data and "private_communication_token" in response_data:
clore_hosting_sw_auth_str = f"{response_data['init_communication_token']}:{response_data['private_communication_token']}" clore_hosting_sw_auth_str = f"{response_data['init_communication_token']}:{response_data['private_communication_token']}"
was_ok = verify_or_update_file(args.auth_file, clore_hosting_sw_auth_str) was_ok = verify_or_update_file(args.auth_file, clore_hosting_sw_auth_str)
if was_ok: if was_ok: