Skip to content

Commit

Permalink
fix: local config
Browse files Browse the repository at this point in the history
  • Loading branch information
0xArdi committed Aug 28, 2024
1 parent 0536c1d commit 3f5a5ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions operate/services/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,7 @@ def new(
def update_user_params_from_template(self, service_template: ServiceTemplate):
"""Update user params from template."""
for chain, config in service_template["configurations"].items():
for chain, config in service_template["configurations"].items():
self.chain_configs[chain].chain_data.user_params = OnChainUserParams.from_json(config)
self.chain_configs[chain].chain_data.user_params = OnChainUserParams.from_json(config)

self.store()

Expand Down
6 changes: 4 additions & 2 deletions run_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
class OptimusConfig(LocalResource):
"""Local configuration."""

path: Path
tenderly_api_key: t.Optional[str] = None
optimism_rpc: t.Optional[str] = None
ethereum_rpc: t.Optional[str] = None
Expand Down Expand Up @@ -166,7 +167,7 @@ def get_local_config() -> OptimusConfig:
if path.exists():
optimus_config = OptimusConfig.load(path)
else:
optimus_config = OptimusConfig()
optimus_config = OptimusConfig(path)

print_section("API Key Configuration")

Expand All @@ -184,6 +185,7 @@ def get_local_config() -> OptimusConfig:
"Please enter your Tenderly API Key. Get one at https://dashboard.tenderly.co/: "
)

optimus_config.store()
return optimus_config


Expand Down Expand Up @@ -357,7 +359,7 @@ def main() -> None:
manager.fund_service(hash=service.hash, chain_id=chain_id)

home_chain_id = service.home_chain_id
manager.deploy_service_locally(hash=service.hash, chain_id=chain_id, use_docker=True)
manager.deploy_service_locally(hash=service.hash, chain_id=home_chain_id, use_docker=True)

print()
print_section("Run the service")
Expand Down
2 changes: 1 addition & 1 deletion run_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if [ "$(git rev-parse --is-inside-work-tree)" = true ]
then
poetry install
poetry run python quickstart/run_service.py
poetry run python run_service.py
else
echo "$directory is not a git repo!"
exit 1
Expand Down

0 comments on commit 3f5a5ba

Please sign in to comment.