Skip to content

Commit 62673f9

Browse files
authored
Infer Chain name from entrypoint decorator (#1917)
1 parent f367143 commit 62673f9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

truss-chains/truss_chains/deployment/deployment_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,9 @@ def __init__(
655655
with framework.ChainletImporter.import_target(
656656
source, entrypoint
657657
) as entrypoint_cls:
658-
self._deployed_chain_name = name or entrypoint_cls.__name__
658+
self._deployed_chain_name = (
659+
name or entrypoint_cls.meta_data.chain_name or entrypoint_cls.__name__
660+
)
659661
self._chain_root = _get_chain_root(entrypoint_cls)
660662
chainlet_names = set(
661663
desc.display_name
@@ -677,7 +679,7 @@ def __init__(
677679
)
678680
if not chain_id:
679681
raise public_types.ChainsDeploymentError(
680-
f"Chain `{chain_id}` was not found."
682+
f"Chain `{self._deployed_chain_name}` was not found."
681683
)
682684
self._status_page_url = b10_service.URLConfig.status_page_url(
683685
self._remote_provider.remote_url, b10_service.URLConfig.CHAIN, chain_id

truss/cli/chains_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def push_chain(
359359
"--name",
360360
type=str,
361361
required=False,
362-
help="Name of the chain to be deployed, if not given, the entrypoint name is used.",
362+
help="Name of the chain to be watched. If not given, the entrypoint name is used.",
363363
)
364364
@click.option(
365365
"--remote",

0 commit comments

Comments
 (0)