From e3920226b0b759c0015ebcb909eef7d3dbd36e90 Mon Sep 17 00:00:00 2001 From: Divya-Solulab Date: Wed, 20 Nov 2024 17:26:12 +0530 Subject: [PATCH] fix: make mode only investment chain by default --- operate/services/service.py | 1 - run_service.py | 25 ++++++++++++++----------- staking_report.py | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/operate/services/service.py b/operate/services/service.py index 98584b9..c7d9ce5 100644 --- a/operate/services/service.py +++ b/operate/services/service.py @@ -257,7 +257,6 @@ def ledger_configs(self) -> "LedgerConfigs": chain=chain, type=LedgerType.ETHEREUM, ) - print(f"Adding {chain} {config['address']}") return ledger_configs def deployment_config(self) -> DeploymentConfig: diff --git a/run_service.py b/run_service.py index 3e13f36..43bc651 100644 --- a/run_service.py +++ b/run_service.py @@ -372,7 +372,7 @@ def configure_local_config() -> OptimusConfig: optimus_config.staking_chain = "" if optimus_config.principal_chain is None: - optimus_config.principal_chain = optimus_config.staking_chain if optimus_config.staking_chain else DEFAULT_STAKING_CHAIN + optimus_config.principal_chain = optimus_config.staking_chain if optimus_config.staking_chain else DEFAULT_STAKING_CHAIN.lower() if optimus_config.investment_funding_requirements is None: optimus_config.investment_funding_requirements = { @@ -385,29 +385,32 @@ def configure_local_config() -> OptimusConfig: print_section("Investment Activity Chains & RPCs") print("All available chains for liquidity pool opportunities:", ", ".join(DEFAULT_CHAINS)) - print("Current setting for liquidity pool opportunities--Chains:", ", ".join(optimus_config.target_investment_chains or DEFAULT_CHAINS)) + print("Current setting for liquidity pool opportunities--Chains:", ", ".join(optimus_config.target_investment_chains or [DEFAULT_STAKING_CHAIN])) update_chains = input("Do you want to expand/restrict the agent’s operability in terms of investment chains (y/n): ").lower() == 'y' if update_chains: - allowed_chains = DEFAULT_CHAINS.copy() - target_investment_chains = DEFAULT_CHAINS.copy() + allowed_chains = [] + target_investment_chains = [] for chain in DEFAULT_CHAINS: operate_on_chain = input(f"Do you wish the service to operate by investing on the {chain} chain? (y/n): ").lower() == 'y' - if not operate_on_chain: - if chain in target_investment_chains: - target_investment_chains.remove(chain) + if operate_on_chain: + if chain not in target_investment_chains: + target_investment_chains.append(chain) - if chain.lower() != optimus_config.principal_chain and chain in allowed_chains: - allowed_chains.remove(chain) + if chain not in allowed_chains: + allowed_chains.append(chain) + if optimus_config.principal_chain not in allowed_chains: + allowed_chains.append(optimus_config.principal_chain) + optimus_config.allowed_chains = [chain.lower() for chain in allowed_chains] optimus_config.target_investment_chains = [chain.lower() for chain in target_investment_chains] if optimus_config.allowed_chains is None: - optimus_config.allowed_chains = DEFAULT_CHAINS.copy() + optimus_config.allowed_chains = [optimus_config.principal_chain] if optimus_config.target_investment_chains is None: - optimus_config.target_investment_chains = DEFAULT_CHAINS.copy() + optimus_config.target_investment_chains = [optimus_config.principal_chain] for chain in optimus_config.allowed_chains: if chain == "optimism" and optimus_config.optimism_rpc is None: diff --git a/staking_report.py b/staking_report.py index 3f99bcc..e5c641a 100644 --- a/staking_report.py +++ b/staking_report.py @@ -189,7 +189,7 @@ def staking_report(config: dict) -> None: multisig_nonces_since_last_cp = multisig_nonces - multisig_nonces_on_last_checkpoint multisig_nonces_current_epoch = multisig_nonces_since_last_cp _print_status( - "Num. txs current epoch", + f"{str(home_chain_type).rsplit('.', maxsplit=1)[-1]} txs in current epoch ", str(multisig_nonces_current_epoch), _warning_message( Decimal(multisig_nonces_current_epoch),