From 682149466007d0f3de1bc0e84856f9d8be0bb742 Mon Sep 17 00:00:00 2001 From: OjusWiZard Date: Tue, 22 Oct 2024 00:45:02 +0530 Subject: [PATCH 1/4] Refactor (Fetch): Allow fetching from TokenID Signed-off-by: OjusWiZard --- autonomy/cli/deploy.py | 6 ++ autonomy/cli/fetch.py | 32 ++++-- autonomy/cli/helpers/deployment.py | 5 +- autonomy/cli/utils/click_utils.py | 18 ++++ .../commands/autonomy_deploy.md | 3 + .../commands/autonomy_fetch.md | 102 ++++++++++++++---- docs/api/cli/fetch.md | 9 +- docs/api/cli/utils/click_utils.md | 30 ++++++ docs/guides/deploy_service.md | 50 +++++++-- tests/test_autonomy/test_cli/test_fetch.py | 91 +++++++++++++++- 10 files changed, 306 insertions(+), 40 deletions(-) diff --git a/autonomy/cli/deploy.py b/autonomy/cli/deploy.py index f4d54d314b..6d6cce570f 100644 --- a/autonomy/cli/deploy.py +++ b/autonomy/cli/deploy.py @@ -443,6 +443,12 @@ def run_deployment_from_token( # pylint: disable=too-many-arguments, too-many-l "use `OPEN_AUTONOMY_PRIVATE_KEY_PASSWORD` to export the password value" ) + click.echo( + "Deprecation Warning: `autonomy deploy from-token` is being deprecated.\n" + "Please use `autonomy fetch ` instead to fetch the service, " + "followed by `build-image`, `deploy build`, and `deploy run` as usual." + ) + ctx = cast(Context, click_context.obj) ctx.registry_type = REGISTRY_REMOTE keys_file = Path(keys_file or DEFAULT_KEYS_FILE).absolute() diff --git a/autonomy/cli/fetch.py b/autonomy/cli/fetch.py index 3ffb1cfe3c..1b52461cfb 100644 --- a/autonomy/cli/fetch.py +++ b/autonomy/cli/fetch.py @@ -18,16 +18,19 @@ # ------------------------------------------------------------------------------ """Implementation of the 'autonomy fetch' subcommand.""" -from typing import cast +from typing import Union, cast import click from aea.cli.fetch import NotAnAgentPackage, do_fetch -from aea.cli.utils.click_utils import PublicIdParameter, registry_flag +from aea.cli.utils.click_utils import registry_flag from aea.cli.utils.context import Context from aea.configurations.base import PublicId from aea.configurations.constants import AGENT, SERVICE -from autonomy.cli.helpers.registry import fetch_service +from autonomy.chain.config import ChainType +from autonomy.cli.helpers.deployment import _resolve_on_chain_token_id +from autonomy.cli.helpers.registry import fetch_service, fetch_service_ipfs +from autonomy.cli.utils.click_utils import PublicIdOrHashOrTokenId, chain_selection_flag @click.command(name="fetch") @@ -51,21 +54,38 @@ help="Specify the package type as service.", flag_value=SERVICE, ) -@click.argument("public-id", type=PublicIdParameter(), required=True) +@click.argument("public-id", type=PublicIdOrHashOrTokenId(), required=True) +@chain_selection_flag(help_string_format="Use {} chain to resolve the token id.") @click.pass_context def fetch( click_context: click.Context, - public_id: PublicId, + public_id: Union[PublicId, int], alias: str, package_type: str, registry: str, + chain_type: str, ) -> None: """Fetch an agent from the registry.""" ctx = cast(Context, click_context.obj) ctx.registry_type = registry try: - if package_type == AGENT: + if isinstance(public_id, int): + ( + service_metadata, + *_, + ) = _resolve_on_chain_token_id( + token_id=public_id, + chain_type=ChainType(chain_type), + ) + + click.echo("Service name: " + service_metadata["name"]) + *_, service_hash = service_metadata["code_uri"].split("//") + public_id = PublicId( + author="valory", name="service", package_hash=service_hash + ) + fetch_service_ipfs(public_id) + elif package_type == AGENT: do_fetch(ctx, public_id, alias) else: fetch_service(ctx, public_id, alias) diff --git a/autonomy/cli/helpers/deployment.py b/autonomy/cli/helpers/deployment.py index e95ac464d7..8853124b59 100644 --- a/autonomy/cli/helpers/deployment.py +++ b/autonomy/cli/helpers/deployment.py @@ -253,7 +253,10 @@ def _resolve_on_chain_token_id( try: metadata = resolve_component_id( - ledger_api=ledger_api, contract_address=contract_address, token_id=token_id + ledger_api=ledger_api, + contract_address=contract_address, + token_id=token_id, + is_service=True, ) info = get_agent_instances( ledger_api=ledger_api, chain_type=chain_type, token_id=token_id diff --git a/autonomy/cli/utils/click_utils.py b/autonomy/cli/utils/click_utils.py index fb44e716f3..1b59f65949 100644 --- a/autonomy/cli/utils/click_utils.py +++ b/autonomy/cli/utils/click_utils.py @@ -25,7 +25,9 @@ from typing import Any, Callable, Generator, Optional, Union, cast import click +from aea.cli.utils.click_utils import PublicIdParameter from aea.cli.utils.config import get_default_author_from_cli_config +from aea.configurations.data_types import PublicId from aea.helpers.base import IPFSHash, SimpleId from autonomy.analyse.abci.app_spec import FSMSpecificationLoader @@ -158,3 +160,19 @@ def _validate(_ctx, _param, value): # type: ignore default=None, callback=_validate, )(fn) + + +class PublicIdOrHashOrTokenId(PublicIdParameter): + """A click parameter that can be a public id, an IPFS hash or a token id.""" + + def get_metavar(self, param: Any) -> str: + """Return the metavar default for this param if it provides one.""" + return "PUBLIC_ID_OR_HASH_OR_TOKEN_ID" + + def convert(self, value: str, param: Any, ctx: Optional[click.Context]) -> PublicId: + """Returns integer token id if value is numeric, else try to parse public id or hash.""" + + if value.isnumeric(): + return int(value) + + return super().convert(value, param, ctx) diff --git a/docs/advanced_reference/commands/autonomy_deploy.md b/docs/advanced_reference/commands/autonomy_deploy.md index 3d8a1e171c..d0ddc21ae2 100644 --- a/docs/advanced_reference/commands/autonomy_deploy.md +++ b/docs/advanced_reference/commands/autonomy_deploy.md @@ -243,6 +243,9 @@ autonomy deploy run --build-dir ./abci_build_hAsH ## `autonomy deploy from-token` +!!! warning "Deprecation Warning" + This command will be deprecated in the future. Please use `autonomy fetch` instead. + Run a service deployment minted on-chain protocol. This command allows to deploy services directly without having the need to explicitly fetch them locally (also known as "one-click deployment"). The command requires the `TOKEN_ID` which can be checked in the {{ autonolas_protocol_registry_dapp }}. See the [mint a service on-chain](../../guides/publish_mint_packages.md) guide for more information. diff --git a/docs/advanced_reference/commands/autonomy_fetch.md b/docs/advanced_reference/commands/autonomy_fetch.md index 0fde8dac30..7da4f05ad5 100644 --- a/docs/advanced_reference/commands/autonomy_fetch.md +++ b/docs/advanced_reference/commands/autonomy_fetch.md @@ -1,41 +1,98 @@ -Fetch an agent or agent service from a registry. +Fetch an agent or agent service from a registry using its public ID, hash, or token ID. ## Usage ```bash -autonomy fetch [OPTIONS] PUBLIC_ID_OR_HASH +autonomy fetch [OPTIONS] PUBLIC_ID_OR_HASH_OR_TOKEN_ID ``` ## Options -``` ---remote -``` + +`--remote` : To use a remote registry. -``` ---local -``` +`--local` : To use a local registry. -``` ---alias TEXT -``` +`--alias` TEXT : Provide a local alias for the agent or service. -``` ---agent -``` +`--agent` : Specify the package type as agent (default). -``` ---service -``` +`--service` : Specify the package type as service. -``` ---help -``` +`--help` : Show the help message and exit. +`--use-celo`  +: Use the `Celo` chain profile to find the token with the given token ID. + +`--use-base-sepolia`  +: Use the `Base Sepolia` profile to find the token with the given token ID. + +`--use-base`  +: Use the `Base` chain profile to find the token with the given token ID. + +`--use-optimistic-sepolia`  +: Use the `Optimistic Sepolia` chain profile to find the token with the given token ID. + +`--use-optimistic`  +: Use the `Optimistic` chain profile to find the token with the given token ID. + +`--use-arbitrum-sepolia`  +: Use the `Arbitrum Sepolia` chain profile to find the token with the given token ID. + +`--use-arbitrum-one`  +: Use the `Arbitrum One` chain profile to find the token with the given token ID. + +`--use-chiado`  +: Use the `Chiado` chain profile to find the token with the given token ID. + +`--use-gnosis`  +: Use the `Gnosis` chain profile to find the token with the given token ID. + +`--use-polygon-mumbai`  +: Use the `Polygon Mumbai` chain profile to find the token with the given token ID. + +`--use-polygon`  +: Use the `Polygon` chain profile to find the token with the given token ID. + +`--use-ethereum` +: Use the `Ethereum` chain profile to find the token with the given token ID. + +To use these chain profile, you will have to export an environment variable for RPC in `_CHAIN_RPC` format. For example if you want to use `ethereum`, you will have to export `ETHEREUM_CHAIN_RPC` and for `polygon-mumbai` it would be `POLYGON_MUMBAI_CHAIN_RPC` + +`--use-custom-chain` +: Use the custom-chain profile to find the token with the given token ID. This profile requires that you define some parameters and [contract addresses](../on_chain_addresses.md) as environment variables (see also the {{ autonolas_protocol }} documentation for more information): + + - `CUSTOM_CHAIN_RPC` : RPC endpoint for the custom chain. + - `CUSTOM_CHAIN_ID` : chain ID. + - `CUSTOM_COMPONENT_REGISTRY_ADDRESS` : Custom Component Registry contract address. + - `CUSTOM_AGENT_REGISTRY_ADDRESS` : Custom Agent Registry contract address. + - `CUSTOM_REGISTRIES_MANAGER_ADDRESS` : Custom Registries Manager contract address. + - `CUSTOM_SERVICE_MANAGER_ADDRESS` : Custom Service Manager contract address. + - `CUSTOM_SERVICE_REGISTRY_ADDRESS` : Custom Service Registry contract address. + - `CUSTOM_GNOSIS_SAFE_PROXY_FACTORY_ADDRESS` : Custom Gnosis Safe multisig contract address. + - `CUSTOM_GNOSIS_SAFE_SAME_ADDRESS_MULTISIG_ADDRESS` : Custom Gnosis Safe Same Address Multisig address. + - `CUSTOM_SERVICE_REGISTRY_TOKEN_UTILITY_ADDRESS` : Custom Service Registry Token Utility address. + - `CUSTOM_MULTISEND_ADDRESS` : Custom Multisend address. + +!!! note + For L2 chains you are only required to set + - `CUSTOM_SERVICE_MANAGER_ADDRESS`, + - `CUSTOM_SERVICE_REGISTRY_ADDRESS`, + - `CUSTOM_GNOSIS_SAFE_PROXY_FACTORY_ADDRESS`, + - `CUSTOM_GNOSIS_SAFE_SAME_ADDRESS_MULTISIG_ADDRESS` and + - `CUSTOM_MULTISEND_ADDRESS`. + +`--use-local` +: Use the local chain profile to find the token with the given token ID. This option requires that you have a local Hardhat node with the required contracts deployed. + +!!! note + + The chain profile flags are mutually exclusive. + ## Examples Fetch the agent `hello_world` from the local registry and assign the alias `my_hello_world_agent`: @@ -57,3 +114,8 @@ Fetch the agent service `hello_world` from a remote registry ([IPFS](https://ipf ```bash autonomy fetch valory/hello_world:0.1.0:bafybeihl6j7ihkytk4t4ca2ffhctpzydwi6r4a354ubjasttuv2pw4oaci --service --remote ``` + +Fetch the agent service with the token ID `123` on Gnosis chain: +```bash +autonomy fetch 751 --use-gnosis +``` diff --git a/docs/api/cli/fetch.md b/docs/api/cli/fetch.md index 8058d53a68..5ab1562497 100644 --- a/docs/api/cli/fetch.md +++ b/docs/api/cli/fetch.md @@ -30,10 +30,13 @@ Implementation of the 'autonomy fetch' subcommand. help="Specify the package type as service.", flag_value=SERVICE, ) -@click.argument("public-id", type=PublicIdParameter(), required=True) +@click.argument("public-id", type=PublicIdOrHashOrTokenId(), required=True) +@chain_selection_flag( + help_string_format="Use {} chain to resolve the token id.") @click.pass_context -def fetch(click_context: click.Context, public_id: PublicId, alias: str, - package_type: str, registry: str) -> None +def fetch(click_context: click.Context, public_id: Union[PublicId, + int], alias: str, + package_type: str, registry: str, chain_type: str) -> None ``` Fetch an agent from the registry. diff --git a/docs/api/cli/utils/click_utils.md b/docs/api/cli/utils/click_utils.md index 30e0bee25e..bfa16e0bd7 100644 --- a/docs/api/cli/utils/click_utils.md +++ b/docs/api/cli/utils/click_utils.md @@ -115,3 +115,33 @@ def image_author_option(fn: Callable) -> Callable Wrap function with clik option for image-author + + +## PublicIdOrHashOrTokenId Objects + +```python +class PublicIdOrHashOrTokenId(PublicIdParameter) +``` + +A click parameter that can be a public id, an IPFS hash or a token id. + + + +#### get`_`metavar + +```python +def get_metavar(param: Any) -> str +``` + +Return the metavar default for this param if it provides one. + + + +#### convert + +```python +def convert(value: str, param: Any, ctx: Optional[click.Context]) -> PublicId +``` + +Returns integer token id if value is numeric, else try to parse public id or hash. + diff --git a/docs/guides/deploy_service.md b/docs/guides/deploy_service.md index 0e8c29d6b8..8ae3ee482b 100644 --- a/docs/guides/deploy_service.md +++ b/docs/guides/deploy_service.md @@ -353,27 +353,59 @@ This means, in particular, that there is no need to define the `ALL_PARTICIPANTS ] ``` -3. **Deploy the service.** Execute the following command: +3. **Fetch the service.** Fetch the service from the remote registry using token ID. + + ```bash + autonomy fetch --use-arbitrum-sepolia # (1)! + ``` + + 1. `--use-arbitrum-sepolia` indicates that the service is registered in the Arbirum Sepolia testnet. Check out the [`autonomy fetch`](../../../advanced_reference/commands/autonomy_fetch) command documentation to learn more about its parameters and options. + + Fetch the service with the desired token ID on arbitrum sepolia network. + + +4. **Build the agents' image.** Build the Docker image of the agents of the service. + + ```bash + autonomy build-image --service-dir your_service/ # (2)! + ``` + + 2. Check out the [`autonomy build-image`](../../../advanced_reference/commands/autonomy_build-image) command documentation to learn more about its parameters and options. + + This command builds the Docker runtime images for the agent defined in a service configuration file service.yaml. + + +5. **Build the deployment.** Build the service deployment. + + ```bash + cd your_service/ + ``` + + This command must be executed within a service folder. That is, a folder containing the service configuration file (`service.yaml`). The deployment will be created in the subfolder `./abci_build_*`. === "Docker Compose" ```bash - autonomy deploy from-token keys.json --use-arbitrum-sepolia # (1)! + autonomy deploy build path/to/keys.json -ltm # (3)! ``` - 1. `--use-arbitrum-sepolia` indicates that the service is registered in the Arbirum Sepolia testnet. Check out the [`autonomy deploy from-token`](../../../advanced_reference/commands/autonomy_deploy/#autonomy-deploy-from-token) command documentation to learn more about its parameters and options. - - The Docker Compose deployment will be built and run for the agents whose keys are defined in the `keys.json` file. If you just want to build the deployment without running it, simply add the flag `--no-deploy`. - === "Kubernetes" ```bash - autonomy deploy from-token keys.json --use-arbitrum-sepolia --kubernetes # (1)! + autonomy deploy build path/to/keys.json --kubernetes # (3)! ``` - 2. `--use-arbitrum-sepolia` indicates that the service is registered in the Arbirum Sepolia testnet. Check out the [`autonomy deploy from-token`](../../../advanced_reference/commands/autonomy_deploy/#autonomy-deploy-from-token) command documentation to learn more about its parameters and options. + 3. Check out the [`autonomy deploy build`](../../../advanced_reference/commands/autonomy_deploy/#autonomy-deploy-build) command documentation to learn more about its parameters and options. + +6. **Start the service.** Run the service: + + ```bash + autonomy deploy run # (4)! + ``` + + 4. Check out the [`autonomy deploy run`](../../../advanced_reference/commands/autonomy_deploy/#autonomy-deploy-run) command documentation to learn more about its parameters and options. - The Kubernetes deployment will be built for the agents whose keys are defined in the `keys.json` file. You need to deploy the service in the local cluster manually. Follow the instructions in Step 5 of the [local deployment - full workflow](#local-deployment-full-workflow) section. + Run a service deployment locally stored. ## Cloud deployment diff --git a/tests/test_autonomy/test_cli/test_fetch.py b/tests/test_autonomy/test_cli/test_fetch.py index b211daf7b1..38f09dcf4f 100644 --- a/tests/test_autonomy/test_cli/test_fetch.py +++ b/tests/test_autonomy/test_cli/test_fetch.py @@ -24,6 +24,7 @@ from pathlib import Path from unittest import mock +import pytest from aea.cli.fetch import NotAnAgentPackage from aea.configurations.constants import ( DEFAULT_README_FILE, @@ -32,12 +33,15 @@ from aea.configurations.loader import ConfigLoader from aea.helpers.base import cd from aea.helpers.io import open_file +from aea_test_autonomy.fixture_helpers import registries_scope_class # noqa: F401 +from autonomy.chain.exceptions import FailedToRetrieveComponentMetadata from autonomy.cli.helpers.registry import IPFSTool from autonomy.configurations.base import Service -from tests.conftest import ROOT_DIR +from tests.conftest import ROOT_DIR, skip_docker_tests from tests.test_autonomy.base import get_dummy_service_config +from tests.test_autonomy.test_chain.base import BaseChainInteractionTest from tests.test_autonomy.test_cli.base import BaseCliTest, cli @@ -221,3 +225,88 @@ def test_not_a_service_package( "if you intend to download an agent please use " "`--agent` flag or check the hash" ) in result.output + + +@pytest.mark.integration +@skip_docker_tests +class TestFromToken(BaseChainInteractionTest): + """Test fetch from token id.""" + + package_type = "service" + + default_ipfs_node_patch = mock.patch( + "autonomy.cli.helpers.registry.get_ipfs_node_multiaddr", + new=lambda: "/dns/registry.autonolas.tech/tcp/443/https", + ) + ipfs_resolve_patch = mock.patch( + "autonomy.cli.helpers.deployment.resolve_component_id", + return_value={ + "name": "valory/oracle_hardhat", + "description": "Oracle service.", + "code_uri": "ipfs://bafybeiansmhkoovd6jlnyurm2w4qzhpmi43gxlyenq33ioovy2rh4gziji", + "image": "bafybeiansmhkoovd6jlnyurm2w4qzhpmi43gxlyenq33ioovy2rh4gziji", + "attributes": [{"trait_type": "version", "value": "0.1.0"}], + }, + ) + + def setup(self) -> None: + """Setup the test.""" + super().setup() + + self.packages_dir = self.t / "packages" + self.cli_options = ("fetch", "1") + + shutil.copytree(ROOT_DIR / "packages", self.packages_dir) + os.chdir(self.t) + + def test_from_token(self) -> None: + """Run test.""" + + service_dir = self.t / "service" + service_dir.mkdir() + + service_file = service_dir / "service.yaml" + service_file.write_text( + ( + ROOT_DIR + / "tests" + / "data" + / "dummy_service_config_files" + / "service_0.yaml" + ).read_text() + ) + + with mock.patch( + "autonomy.cli.fetch.fetch_service_ipfs", + return_value=service_dir, + ), self.default_ipfs_node_patch, self.ipfs_resolve_patch: + result = self.run_cli() + + assert result.exit_code == 0, result.stdout + assert "Service name: valory/oracle_hardhat" in result.stdout + + def test_fail_on_chain_resolve_connection_error(self) -> None: + """Run test.""" + + with self.default_ipfs_node_patch, self.ipfs_resolve_patch, mock.patch( + "autonomy.cli.helpers.deployment.resolve_component_id", + side_effect=FailedToRetrieveComponentMetadata( + "Error connecting RPC endpoint" + ), + ): + result = self.run_cli() + + assert result.exit_code == 1, result.stdout + assert "Error connecting RPC endpoint" in result.stderr, result.output + + def test_fail_on_chain_resolve_bad_contract_call(self) -> None: + """Run test.""" + + with self.default_ipfs_node_patch, self.ipfs_resolve_patch, mock.patch( + "autonomy.cli.helpers.deployment.resolve_component_id", + side_effect=Exception, + ): + result = self.run_cli() + + assert result.exit_code == 1, result.stdout + assert "Cannot find the service registry deployment;" in result.stderr From dc34680c6e0a2c70ca635aec69ff7bedb1090839 Mon Sep 17 00:00:00 2001 From: Ojuswi Rastogi <55619686+OjusWiZard@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:02:51 +0530 Subject: [PATCH 2/4] docs: update fetch tokenId to a consistent dummy number Co-authored-by: Adamantios Zaras --- docs/advanced_reference/commands/autonomy_fetch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced_reference/commands/autonomy_fetch.md b/docs/advanced_reference/commands/autonomy_fetch.md index 7da4f05ad5..512c435ab9 100644 --- a/docs/advanced_reference/commands/autonomy_fetch.md +++ b/docs/advanced_reference/commands/autonomy_fetch.md @@ -117,5 +117,5 @@ autonomy fetch valory/hello_world:0.1.0:bafybeihl6j7ihkytk4t4ca2ffhctpzydwi6r4a3 Fetch the agent service with the token ID `123` on Gnosis chain: ```bash -autonomy fetch 751 --use-gnosis +autonomy fetch 123 --use-gnosis ``` From ac8603de7c5737a7a4a2fd35ed4c12b71026979e Mon Sep 17 00:00:00 2001 From: Ojuswi Rastogi <55619686+OjusWiZard@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:04:10 +0530 Subject: [PATCH 3/4] docs: show "Deprecation Warning" in upper case Co-authored-by: jmoreira-valory <96571377+jmoreira-valory@users.noreply.github.com> --- autonomy/cli/deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autonomy/cli/deploy.py b/autonomy/cli/deploy.py index 6d6cce570f..5df9376ff2 100644 --- a/autonomy/cli/deploy.py +++ b/autonomy/cli/deploy.py @@ -444,7 +444,7 @@ def run_deployment_from_token( # pylint: disable=too-many-arguments, too-many-l ) click.echo( - "Deprecation Warning: `autonomy deploy from-token` is being deprecated.\n" + "DEPRECATION WARNING: `autonomy deploy from-token` is being deprecated.\n" "Please use `autonomy fetch ` instead to fetch the service, " "followed by `build-image`, `deploy build`, and `deploy run` as usual." ) From f050e6b6cce019efa3d659f383ff9e1c38d900bb Mon Sep 17 00:00:00 2001 From: OjusWiZard Date: Tue, 22 Oct 2024 21:49:47 +0530 Subject: [PATCH 4/4] docs: Improve RPC error message and docs reference Signed-off-by: OjusWiZard --- autonomy/chain/utils.py | 7 ++++++- autonomy/constants.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/autonomy/chain/utils.py b/autonomy/chain/utils.py index 0e13b18632..bd383ede5b 100644 --- a/autonomy/chain/utils.py +++ b/autonomy/chain/utils.py @@ -30,6 +30,7 @@ from autonomy.chain.constants import SERVICE_MANAGER_TOKEN_COMPATIBLE_CHAINS from autonomy.chain.exceptions import DependencyError, FailedToRetrieveComponentMetadata from autonomy.chain.metadata import IPFS_URI_PREFIX +from autonomy.constants import OLAS_DOCS_URL def get_ipfs_hash_from_uri(uri: str) -> str: @@ -61,7 +62,11 @@ def resolve_component_id( token_id=token_id, ) except RequestConnectionError as e: - raise FailedToRetrieveComponentMetadata("Error connecting to the RPC") from e + raise FailedToRetrieveComponentMetadata( + "Error connecting to the RPC. Please make sure that " + "you have set the chain RPC environment variable correctly. " + f"You can read more about the configurations on {OLAS_DOCS_URL}/open-autonomy/advanced_reference/commands/autonomy_service/#options." + ) from e try: return r_get(url=metadata_uri).json() diff --git a/autonomy/constants.py b/autonomy/constants.py index da8e4707ce..06fce9489c 100644 --- a/autonomy/constants.py +++ b/autonomy/constants.py @@ -66,3 +66,4 @@ DEFAULT_DOCKER_IMAGE_AUTHOR = "valory" OAR_IMAGE = "{image_author}/oar-{agent}:{version}" ABSTRACT_ROUND_ABCI_SKILL_WITH_HASH = "valory/abstract_round_abci:0.1.0:bafybeigax5gzud6ytq3wypajqwzlfwhpuegcma7q5b7m534kgu7vfmfaaq" +OLAS_DOCS_URL = "https://docs.autonolas.network"