Compare commits

..

No commits in common. "07134d26d73545ff2b4b81e0aaf363c9f3fcec42" and "92dac6755bf89f9ae51036839d3aeb7737a23c05" have entirely different histories.

1 changed files with 4 additions and 17 deletions

View File

@ -249,28 +249,17 @@ 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
@ -439,7 +428,6 @@ 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
@ -458,7 +446,6 @@ 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)
@ -506,7 +493,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" in response_data: elif "init_communication_token" in response_data and "private_communication_token":
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: