### Install Open Autonomy framework and Ethereum Ledger Plugin Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/set_up.md Install the core Open Autonomy framework with all its dependencies and the Open AEA Ethereum Ledger Plugin using pip. ```bash pip install open-autonomy[all] pip install open-aea-ledger-ethereum ``` -------------------------------- ### Create a workspace folder and navigate into it Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/set_up.md Create a new directory for your Open Autonomy projects and change the current working directory to it. ```bash mkdir my_workspace cd my_workspace ``` -------------------------------- ### Initialize Open Autonomy framework with remote IPFS registry Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/set_up.md Initialize the Open Autonomy framework to use the remote IPFS registry by default for fetching components. Use the --reset flag if reconfiguring an existing setup. ```bash autonomy init --remote --ipfs --author your_name ``` -------------------------------- ### Initialize local Open Autonomy package registry Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/set_up.md Create an empty local registry in the './packages' folder. This registry will store packages under development or those fetched from the remote registry for local use. ```bash autonomy packages init ``` -------------------------------- ### Running Local Documentation Server Source: https://github.com/valory-xyz/open-autonomy/blob/main/CONTRIBUTING.md This command starts a local documentation server, allowing developers to preview changes to the project's documentation in real-time before deployment. ```Shell mkdocs serve ``` -------------------------------- ### Fetch agent from local Open Autonomy registry Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/set_up.md Fetch a copy of an agent that is already stored in your local registry. This command explicitly uses the local registry path. ```bash autonomy --registry-path=./packages fetch valory/hello_world:0.1.0 --local ``` -------------------------------- ### Examples for Running Local Service Deployments Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/advanced_reference/commands/autonomy_deploy.md Provides practical examples for using `autonomy deploy run`, demonstrating how to specify a build directory and how to provide a private key password during execution. ```bash autonomy deploy run --build-dir ./abci_build_hAsH ``` ```bash export OPEN_AUTONOMY_PRIVATE_KEY_PASSWORD=PASSWORD autonomy deploy run --build-dir ./abci_build_hAsH ``` -------------------------------- ### Install Required Python Packages for Agent Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/define_agent.md Installs necessary Python packages for the `valory/hello_world` agent, such as `hypothesis`, `grpcio`, `typing-extensions`, `py-ecc`, and `asn1crypto`. ```bash pip install hypothesis grpcio typing-extensions py-ecc asn1crypto ``` -------------------------------- ### Get GanacheBaseTest Setup Class Arguments (Python) Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/plugins/aea_test_autonomy/fixture_helpers.md Class method to retrieve keyword arguments for the `_setup_class` call within `GanacheBaseTest`. ```python @classmethod def setup_class_kwargs(cls) -> Dict[str, Any] ``` -------------------------------- ### Get ACNNodeBaseTest Setup Class Arguments (Python) Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/plugins/aea_test_autonomy/fixture_helpers.md Class method to retrieve keyword arguments for the `_setup_class` call within `ACNNodeBaseTest`. ```python @classmethod def setup_class_kwargs(cls) -> Dict[str, Any] ``` -------------------------------- ### Initialize Pipenv virtual environment with Python 3.10 Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/set_up.md Set up a Pipenv virtual environment within your workspace, specifying Python version 3.10, and activate the shell. This ensures dependency isolation. ```bash touch Pipfile && pipenv --python 3.10 && pipenv shell ``` -------------------------------- ### Build service deployment with keys and local Tendermint Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/advanced_reference/commands/autonomy_deploy.md Example of building a service deployment using the keys stored in `keys.json` and enabling a local Tendermint chain setup. By default, the command searches for `keys.json` if no file name is provided. ```bash autonomy deploy build keys.json -ltm ``` -------------------------------- ### Fetch agent from remote Open Autonomy registry Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/set_up.md Fetch a runtime folder for a specific agent version from the remote registry. This command overrides any default local registry settings. ```bash autonomy fetch valory/hello_world:0.1.0:bafybeihtmp45mbfs5tyzrgxfoimh552on6dif42ifqidifait3ej2m5zvq ``` -------------------------------- ### Example `keys.json` for Local Agent Deployment Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/deploy_service.md Provides an example JSON file structure for `keys.json`, which contains wallet addresses and private keys for agents intended for local deployment. This file is explicitly for testing purposes only and should not be used in production environments. ```json [ { "address": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65", "private_key": "0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a" }, { "address": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "private_key": "0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba" }, { "address": "0x976EA74026E726554dB657fA54763abd0C3a0aa9", "private_key": "0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e" }, { "address": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955", "private_key": "0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356" } ] ``` -------------------------------- ### Python Method: setup Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/behaviour_utils.md Sets up the behaviour. ```APIDOC def setup() -> None ``` -------------------------------- ### Define FSMBehaviourTestToolSetup.setup Method Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/tests/test_tools/base.md Defines the instance method `setup` for `FSMBehaviourTestToolSetup`. This method is used to perform setup operations before each test method is run. ```python def setup() -> None ``` -------------------------------- ### Python Docstring Example for Complex Methods Source: https://github.com/valory-xyz/open-autonomy/blob/main/CONTRIBUTING.md This Python code snippet illustrates a comprehensive docstring format for methods with complex logic. It includes a detailed description, an example usage, parameter descriptions, return type, and a section for potential exceptions, adhering to best practices for maintainable code. ```Python def some_method(some_arg: Type) -> ReturnType: """ This method does something very complex. example: >> a = Type("value") >> some_method(a) output :param some_arg: describe argument. :return: value of ReturnType optional - types of exceptions it might raise """ ``` -------------------------------- ### Get AbciAppDB Setup Data (APIDOC) Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/base.md Retrieves the setup data, excluding entries which have empty values. ```APIDOC AbciAppDB.setup_data() -> Dict[str, Any] Description: Get the setup_data without entries which have empty values. Returns: The setup_data. ``` -------------------------------- ### Example: Push All Packages from a Directory Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/advanced_reference/commands/autonomy_push_all.md This example demonstrates how to use the `autonomy push-all` command with the `--packages-dir` option to push all packages located in the `./packages` directory. ```bash autonomy push-all --packages-dir ./packages ``` -------------------------------- ### Example `keys.json` for Open Autonomy Agent Wallets Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/quick_start.md This JSON file provides an example structure for `keys.json`, containing wallet addresses and private keys for multiple agents. This file is essential for service deployment, but the provided keys are for testing purposes only and must never be used in a production environment. ```json [ { "address": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65", "private_key": "0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a" }, { "address": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "private_key": "0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba" }, { "address": "0x976EA74026E726554dB657fA54763abd0C3a0aa9", "private_key": "0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e" }, { "address": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955", "private_key": "0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356" } ] ``` -------------------------------- ### Autonomy Analyse Benchmarks Command Examples Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/advanced_reference/commands/autonomy_analyse.md Practical examples demonstrating how to use the `autonomy analyse benchmarks` command to aggregate benchmark data. Examples include aggregating stats for all periods and for a specific block type and period. ```bash autonomy analyse benchmarks abci_build_hAsH/persistent_data/benchmarks ``` ```bash autonomy analyse benchmarks abci_build_hAsH/persistent_data/benchmarks --period 2 --block-type consensus ``` -------------------------------- ### Example `aea-config.yaml` for Agent Configuration Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/define_agent.md This YAML configuration file defines an agent named `your_agent` by `your_name`. It specifies essential metadata, lists required connections, protocols, and skills (including `valory/hello_world_abci`), and configures logging. It serves as a comprehensive example for setting up an agent that uses a specific FSM application and overrides various component parameters. ```yaml agent_name: your_agent author: your_name version: 0.1.0 license: Apache-2.0 description: Example of an agent. aea_version: '>=1.0.0, <2.0.0' fingerprint: {} fingerprint_ignore_patterns: [] connections: - valory/abci:0.1.0 - valory/http_client:0.23.0 - valory/ipfs:0.1.0 - valory/ledger:0.19.0 - valory/p2p_libp2p_client:0.1.0 contracts: [] protocols: - open_aea/signing:1.0.0 - valory/abci:0.1.0 - valory/http:1.0.0 - valory/ipfs:0.1.0 skills: - valory/abstract_abci:0.1.0 - valory/abstract_round_abci:0.1.0 - valory/hello_world_abci:0.1.0 default_ledger: ethereum required_ledgers: - ethereum default_routing: {} connection_private_key_paths: {} private_key_paths: {} logging_config: version: 1 disable_existing_loggers: false formatters: standard: format: '[%(asctime)s] [%(levelname)s] %(message)s' handlers: logfile: class: logging.handlers.RotatingFileHandler formatter: standard filename: ${LOG_FILE:str:log.txt} level: ${LOG_LEVEL:str:INFO} maxBytes: ${LOG_MAX_BYTES:int:52428800} backupCount: ${LOG_BACKUP_COUNT:int:1} console: class: logging.StreamHandler formatter: standard stream: ext://sys.stdout loggers: aea: handlers: - logfile - console propagate: true ``` -------------------------------- ### Setup SynchronizeLateMessagesBehaviour Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/transaction_settlement_abci/behaviours.md This method performs necessary setup operations for the SynchronizeLateMessagesBehaviour. ```python def setup() -> None ``` -------------------------------- ### AbstractRoundBehaviour.setup Method Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/behaviours.md Sets up the behaviours, performing any necessary initialization steps before the behaviour starts its main execution. ```Python def setup() -> None ``` -------------------------------- ### Example Service Configuration File (service.yaml) Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/configure_service/service_configuration_file.md This example shows a `service.yaml` file for the Hello World service, demonstrating how service-specific attributes are defined and how additional YAML documents (separated by `---`) override parameters for specific skills and connections. It also illustrates reading values from environment variables with default fallbacks. ```yaml name: hello_world author: valory version: 0.1.0 description: A simple demonstration of a simple ABCI application aea_version: '>=1.0.0, <2.0.0' license: Apache-2.0 fingerprint: README.md: bafybeiapubcoersqnsnh3acia5hd7otzt7kjxekr6gkbrlumv6tkajl6jm fingerprint_ignore_patterns: [] agent: valory/hello_world:0.1.0:bafybeig6p6shyx6wmih2xlzu3h6rd7gul3fxqhpdoi77qidqmpzxf33spm number_of_agents: 4 deployment: {} dependencies: {} --- extra: benchmark_persistence_params: args: &id001 log_dir: /benchmarks public_id: valory/hello_world_abci:0.1.0 type: skill 0: models: params: args: hello_world_message: ${MY_HELLO_WORLD_MESSAGE:str:HELLO_WORLD_AGENT_0} benchmark_tool: args: *id001 1: models: params: args: hello_world_message: ${MY_HELLO_WORLD_MESSAGE:str:HELLO_WORLD_AGENT_1} benchmark_tool: args: *id001 2: models: params: args: hello_world_message: ${MY_HELLO_WORLD_MESSAGE:str:HELLO_WORLD_AGENT_2} benchmark_tool: args: *id001 3: models: params: args: hello_world_message: ${MY_HELLO_WORLD_MESSAGE:str:HELLO_WORLD_AGENT_3} benchmark_tool: args: *id001 --- public_id: valory/ledger:0.19.0 type: connection config: ledger_apis: ethereum: address: http://host.docker.internal:8545 chain_id: 31337 poa_chain: false default_gas_price_strategy: eip1559 ``` -------------------------------- ### Install NFS Ganesha Server Provisioner Helm Chart Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/deploy_service.md Adds the NFS Ganesha server and external provisioner Helm repository and then installs the `nfs-server-provisioner` chart. It configures the image tag, CPU resource limits, and sets the storage class name to `nfs-ephemeral` within the `nfs-local` namespace. ```bash helm repo add nfs-ganesha-server-and-external-provisioner https://kubernetes-sigs.github.io/nfs-ganesha-server-and-external-provisioner/ helm install nfs-provisioner nfs-ganesha-server-and-external-provisioner/nfs-server-provisioner \ --set=image.tag=v3.0.0,resources.limits.cpu=200m,storageClass.name=nfs-ephemeral -n nfs-local --create-namespace ``` -------------------------------- ### Bash: Examples for analysing and exporting FSM specifications Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/advanced_reference/commands/autonomy_analyse.md These bash commands provide examples for analyzing, updating, and exporting FSM specifications. They demonstrate how to specify a package path, an `AbciApp` class, and output formats like YAML or Mermaid, or analyze all specifications in a local registry. ```bash autonomy analyse fsm-specs --package ./packages/valory/skills/hello_world_abci ``` ```bash autonomy analyse fsm-specs --package ./packages/valory/skills/hello_world_abci --app-class HelloWorldAbciApp --update ``` ```bash autonomy analyse fsm-specs --package ./packages/valory/skills/hello_world_abci --app-class HelloWorldAbciApp --update --mermaid ``` ```bash autonomy analyse fsm-specs ``` -------------------------------- ### IntegrationBaseCase.setup_class Method Definition Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/test_tools/integration.md Defines the class-level setup method for `IntegrationBaseCase`. This method is decorated with `@classmethod` and is called once before any tests in the class run to perform initial setup tasks, accepting arbitrary keyword arguments. ```APIDOC IntegrationBaseCase.setup_class(cls, **kwargs: Any) -> None @classmethod cls: The class itself. kwargs: Any - Additional keyword arguments. Returns: None - No explicit return value. ``` -------------------------------- ### Example of Mounting Agent-Specific Host Directories Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/configure_service/service_configuration_file.md Provides an example of mounting different host directories (`./data_0`, `./data_1`) to the same container path (`/data`) for multiple agents (agent 0 and agent 1). This ensures each agent has its own dedicated data volume. ```yaml # (...) deployment: agent: volumes: 0: ./data_0: /data 1: ./data_1: /data ``` -------------------------------- ### Agent: valory/registration_start_up/0.1.0 Component Details Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/package_list.md Registration start-up ABCI example. ```APIDOC Component Type: Agent Path: valory/registration_start_up/0.1.0 CID: bafybeif3xdoqz3zhxzmbiwpmpbv6m6pb2n66pqfeqlcrjsv2y63upd45sy Description: Registration start-up ABCI example. ``` -------------------------------- ### Start Local Autonolas Protocol Blockchain with Docker Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/publish_mint_packages.md Run the `valory/autonolas-registries` Docker image to start a local Hardhat node. This node includes deployed Autonolas Protocol registry contracts and provides pre-funded testing keys and addresses for local development and testing. ```bash docker run -p 8545:8545 valory/autonolas-registries:latest ``` -------------------------------- ### Example: Generate FSM Skill with Autonomy Scaffold Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/advanced_reference/commands/autonomy_scaffold.md Provides a practical example of using `autonomy scaffold fsm`. This command generates an FSM skill named 'my_fsm_app_skill' based on `fsm_specification.yaml` and stores it in the local registry. ```bash scaffold -tlr fsm --spec fsm_specification.yaml my_fsm_app_skill ``` -------------------------------- ### Add third-party package entries to local registry JSON Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/overview_of_the_development_process.md This JSON snippet provides the essential `third_party` entries for the `./packages/packages.json` file. These entries map package identifiers to their corresponding IPFS hashes, allowing the local `autonomy` framework to locate and utilize pre-shipped packages required for the guides. ```json { "dev": { }, "third_party": { "service/valory/hello_world/0.1.0": "bafybeihl6j7ihkytk4t4ca2ffhctpzydwi6r4a354ubjasttuv2pw4oaci", "agent/valory/hello_world/0.1.0": "bafybeihtmp45mbfs5tyzrgxfoimh552on6dif42ifqidifait3ej2m5zvq", "connection/valory/abci/0.1.0": "bafybeidutel5jdlqyt2tygyvfxrqwgljpxq23bu3eyfndbcwm2t4y7jbee", "connection/valory/http_client/0.23.0": "bafybeid5ffvg76ejjoese7brj5ji3lx66cu7p2ixfwflpo6rgofkypfd7y", "connection/valory/ipfs/0.1.0": "bafybeiamz23olgtow4wqf7zpsfnfzf7pxiognrxl2mhn5kvqutlwhgukxa", "connection/valory/ledger/0.19.0": "bafybeibdsjmy4w2eyilbqc7yzutopl65qpeyspxwz7mjvirr52twhjlf5y", "contract/valory/service_registry/0.1.0": "bafybeidiyohupppaunqtwhxzt3kbp4k4hcryp4xgda36t3sy43brxs3vci", "protocol/open_aea/signing/1.0.0": "bafybeig2d36zxy65vd7fwhs7scotuktydcarm74aprmrb5nioiymr3yixm", "protocol/valory/abci/0.1.0": "bafybeiatodhboj6a3p35x4f4b342lzk6ckxpud23awnqbxwjeon3k5y36u", "protocol/valory/acn/1.1.0": "bafybeic6h55ov5lrzbah6fate54c4u6spopcexxspw3abotbmffabfddeu", "protocol/valory/contract_api/1.0.0": "bafybeid247uig2ekykdumh7ewhp2cdq7rchaeqjj6e7urx35zfpdl5zrn4", "protocol/valory/http/1.0.0": "bafybeih4azmfwtamdbkhztkm4xitep3gx6tfdnoz6tvllmaqnhu3klejfa", "protocol/valory/ipfs/0.1.0": "bafybeifi2nri7sprmkez4rqzwb4lnu6peoy3bax5k6asf6k5ms7kmjpmkq", "protocol/valory/ledger_api/1.0.0": "bafybeihmqzcbj6t7vxz2aehd5726ofnzsfjs5cwlf42ro4tn6i34cbfrc4", "protocol/valory/tendermint/0.1.0": "bafybeigydrbfrlmr4f7shbtqx44kvmbg22im27mxdap2e3m5tkti6t445y", "skill/valory/abstract_abci/0.1.0": "bafybeieteucm3rudnnbesnu53wbv3ojnhrwqbvfrsqwvhg6ksgriqyl67i", "skill/valory/abstract_round_abci/0.1.0": "bafybeifsuf7sh5vlugnqinbqe2f7vnssuqyxcrzqgotohhwqewyjeibneu", "skill/valory/hello_world_abci/0.1.0": "bafybeiebittgfcz4idj633fkrvu6qle2ajekdjxpp7slggyur7vv7s7hrq", "connection/valory/p2p_libp2p_client/0.1.0": "bafybeic6ayusdwy4dks75njwk32ac7ur7salgllwf4fdc34ue5z2k5iz4q" } } ``` -------------------------------- ### HardHatHelperIntegration.setup_class Method Definition Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/test_tools/integration.md Defines the class-level setup method for `HardHatHelperIntegration`. This `@classmethod` is called once before tests in the class run to perform initial setup tasks specific to HardHat integration, accepting arbitrary keyword arguments. ```APIDOC HardHatHelperIntegration.setup_class(cls, **kwargs: Any) -> None @classmethod cls: The class itself. kwargs: Any - Additional keyword arguments. Returns: None - No explicit return value. ``` -------------------------------- ### Example of Mounting a Single Host Directory as a Volume Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/configure_service/service_configuration_file.md Illustrates a practical example of mounting a local `./data` directory from the host machine to `/data` inside the agent container. This is useful for providing data or configuration files to the agent. ```yaml # (...) deployment: agent: volumes: ./data: /data ``` -------------------------------- ### Build Local Deployment Setup for Counter Service Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/counter_example.md Constructs the deployment configuration required to run the counter service locally. This command uses the `keys.json` file to set up the agents and prepares the necessary files for a local Tendermint-based deployment. ```bash autonomy deploy build keys.json -ltm ``` -------------------------------- ### Run Local Counter Service Deployment Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/counter_example.md Navigates into the generated build directory (e.g., `./abci_build_*`) and initiates the local deployment of the counter service. This command starts the four agents connected to their respective Tendermint nodes, bringing the demo to life. ```bash cd abci_build_* autonomy deploy run ``` -------------------------------- ### Navigate to agent directory and generate private key Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/counter_example.md Navigate into the `counter_client` project directory, generate an Ethereum private key for the agent, and install its dependencies. ```bash cd counter_client autonomy generate-key ethereum autonomy install ``` -------------------------------- ### Example of Agent and Tendermint Container Port Mapping Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/configure_service/service_configuration_file.md Demonstrates a specific example of mapping agent 0's internal port 8080 to host port 8081, and Tendermint node 0's port 26656 to the same host port. This illustrates practical port forwarding. ```yaml # (...) deployment: agent: ports: 0: 8081: 8080 tendermint: ports: 0: 26656: 26656 ``` -------------------------------- ### Initialize and Run Tendermint Node Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/define_agent.md Sets up and starts a Tendermint node. The `rm -rf ~/.tendermint` command clears previous execution files to prevent errors. Configures proxy, RPC, and P2P addresses for the node. ```bash rm -rf ~/.tendermint tendermint init tendermint node --proxy_app=tcp://127.0.0.1:26658 --rpc.laddr=tcp://127.0.0.1:26657 --p2p.laddr=tcp://0.0.0.0:26656 --p2p.seeds= --consensus.create_empty_blocks=true ``` -------------------------------- ### Example Service Configuration File (service.yaml) Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/define_service.md This comprehensive example demonstrates a `service.yaml` file for an Open Autonomy agent, specifically using the `hello_world` agent. It includes mandatory service parameters, agent reference, and multiple configuration overrides for skills and connections, separated by YAML document separators. ```yaml name: your_service author: your_name version: 0.1.0 description: A demonstration of a simple service aea_version: '>=1.0.0, <2.0.0' license: Apache-2.0 fingerprint: {} fingerprint_ignore_patterns: [] agent: valory/hello_world:0.1.0 number_of_agents: 4 deployment: {} --- public_id: valory/hello_world_abci:0.1.0 type: skill models: params: args: service_registry_address: null share_tm_config_on_startup: false on_chain_service_id: null setup: all_participants: ${ALL_PARTICIPANTS:list:["0x0000000000000000000000000000000000000000"]} safe_contract_address: '0x0000000000000000000000000000000000000000' consensus_threshold: null hello_world_message: ${HELLO_WORLD_STRING_0:str:HELLO_WORLD!} benchmark_tool: args: log_dir: /benchmarks --- public_id: valory/ledger:0.19.0 type: connection config: ledger_apis: ethereum: address: ${SERVICE_HELLO_WORLD_RPC:str:"http://host.docker.internal:8545"} chain_id: 31337 poa_chain: false default_gas_price_strategy: eip1559 ``` -------------------------------- ### Custom Dockerfile Template for Open Autonomy Agent Dependencies Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/advanced_reference/developer_tooling/custom_agent_image.md This Dockerfile template provides a base for installing additional third-party libraries required by an Open Autonomy agent. It extends the base `valory/open-autonomy` image, initializes the AEA agent, and includes a placeholder for custom dependency installation before running the agent's start script. ```dockerfile ARG AUTONOMY_IMAGE_VERSION="latest" ARG AUTONOMY_IMAGE_NAME="valory/open-autonomy" FROM ${AUTONOMY_IMAGE_NAME}:${AUTONOMY_IMAGE_VERSION} ARG AEA_AGENT ARG AUTHOR ARG EXTRA_DEPENDENCIES RUN aea init --reset --remote --ipfs --author ${AUTHOR} WORKDIR /root # Install the third party libraries here RUN AEA_AGENT=${AEA_AGENT} EXTRA_DEPENDENCIES=${EXTRA_DEPENDENCIES} bash /root/scripts/install.sh CMD ["/root/scripts/start.sh"] HEALTHCHECK --interval=3s --timeout=600s --retries=600 CMD netstat -ltn | grep -c 26658 > /dev/null; if [ 0 != $? ]; then exit 1; fi; ``` -------------------------------- ### Fetch Service from Registry Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/deploy_service.md Commands to fetch the `hello_world` service from either a local or remote registry using the `autonomy` CLI tool. This step prepares the service for local deployment. ```bash autonomy packages lock autonomy push-all autonomy fetch valory/hello_world:0.1.0 --service --local ``` ```bash autonomy fetch valory/hello_world:0.1.0:bafybeihl6j7ihkytk4t4ca2ffhctpzydwi6r4a354ubjasttuv2pw4oaci --service ``` -------------------------------- ### Prepare Agent Keys and Participants Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/deploy_service.md Instructions to create a `keys.json` file containing wallet addresses and private keys for agents, and to export the `ALL_PARTICIPANTS` environment variable with all agent addresses. Examples for single and multi-ledger key configurations are provided. ```json [ { "address": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65", "private_key": "0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a" }, { "address": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "private_key": "0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba" }, { "address": "0x976EA74026E726554dB657fA54763abd0C3a0aa9", "private_key": "0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e" }, { "address": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955", "private_key": "0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356" } ] ``` ```bash export ALL_PARTICIPANTS='[ "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65", "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "0x976EA74026E726554dB657fA54763abd0C3a0aa9", "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955" ]' ``` ```json [ [ { "address": "4Si...", "private_key": "5P1...", "ledger": "solana" }, { "address": "0x1...", "private_key": "0x1...", "ledger": "ethereum" } ], [ { "address": "H1R...", "private_key": "2T1...", "ledger": "solana" }, { "address": "0x6...", "private_key": "0xc...", "ledger": "ethereum" } ], [ { "address": "3bq...", "private_key": "5r5...", "ledger": "solana" }, { "address": "0x5...", "private_key": "0x7...", "ledger": "ethereum" } ], [ { "address": "6Gq...", "private_key": "25c...", "ledger": "solana" }, { "address": "0x5...", "private_key": "0x7...", "ledger": "ethereum" } ] ] ``` -------------------------------- ### Get Origin of Type Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/utils.md Get the unsubscripted version of a type. This supports generic types, Callable, Tuple, Union, Literal, Final and ClassVar. Returns None for unsupported types. Examples: get_origin(Literal[42]) is Literal, get_origin(int) is None, get_origin(ClassVar[int]) is ClassVar, get_origin(Generic) is Generic, get_origin(Generic[T]) is Generic, get_origin(Union[T, int]) is Union, get_origin(List[Tuple[T, T]][int]) == list. ```APIDOC def get_origin(tp) ``` -------------------------------- ### Get Type Arguments Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/utils.md Get type arguments with all substitutions performed. For unions, basic simplifications used by Union constructor are performed. Examples: get_args(Dict[str, int]) == (str, int), get_args(int) == (), get_args(Union[int, Union[T, int], str][int]) == (int, str), get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int]), get_args(Callable[[], T][int]) == ([], int). ```APIDOC def get_args(tp) ``` -------------------------------- ### Get chain ID Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/transaction_settlement_abci/rounds.md Get the chain id from SynchronizedData. ```Python def get_chain_id(default_chain_id: str) -> str ``` -------------------------------- ### Get Latest Synchronized Data Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/base.md Get the latest synchronized_data. ```python @property def latest_synchronized_data() -> BaseSynchronizedData ``` ```APIDOC RoundSequence.latest_synchronized_data Type: property Returns: BaseSynchronizedData Description: Get the latest synchronized_data. ``` -------------------------------- ### Fetch Hello World Service Package with Autonomy CLI Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/quick_start.md This command downloads the Hello World service package from the remote IPFS registry and stores it locally in the `hello_world` folder. On MacOS and Windows, ensure Docker Desktop is running before execution, as it's a prerequisite for Docker container operations. ```bash autonomy fetch valory/hello_world:0.1.0: --service ``` -------------------------------- ### Get suspect agents Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/transaction_settlement_abci/rounds.md Get the suspect agents property from SynchronizedData. ```Python @property def suspects() -> Tuple[str] ``` -------------------------------- ### Verify Built Docker Image with Docker CLI Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/quick_start.md After building the service agent image, use this command to list all Docker images and filter for `hello_world`. This verifies that the image has been successfully created and is available for deployment. ```bash docker image ls | grep hello_world ``` -------------------------------- ### Get Value With Type Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/utils.md Get the given value as the specified type. ```APIDOC def get_value_with_type(value: Any, type_name: str) -> Any ``` -------------------------------- ### Get late arriving transaction hashes Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/transaction_settlement_abci/rounds.md Get the late_arriving_tx_hashes property from SynchronizedData. ```Python @property def late_arriving_tx_hashes() -> Dict[str, List[str]] ``` -------------------------------- ### Sample `keys.json` for Agent Configuration Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/counter_example.md Provides a sample `keys.json` file containing Ethereum addresses and private keys for four agents. This file is essential for configuring the agents in the demo, but it is strictly for testing purposes and must not be used in production environments due to security risks. ```json [ { "address": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65", "private_key": "0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a" }, { "address": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "private_key": "0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba" }, { "address": "0x976EA74026E726554dB657fA54763abd0C3a0aa9", "private_key": "0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e" }, { "address": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955", "private_key": "0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356" } ] ``` -------------------------------- ### Get Tendermint Current Height Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/base.md Get Tendermint's current height. ```python @property def tm_height() -> int ``` ```APIDOC RoundSequence.tm_height Type: property (getter) Returns: int Description: Get Tendermint's current height. ``` -------------------------------- ### AbstractRoundBehaviour.__init__ Method Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/abstract_round_abci/behaviours.md Initializes an instance of the AbstractRoundBehaviour, accepting arbitrary keyword arguments for flexible setup. ```Python def __init__(**kwargs: Any) -> None ``` -------------------------------- ### Run Local Docker Compose Deployment of Open Autonomy Service Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/quick_start.md Navigate to the generated `abci_build_*` directory and execute `autonomy deploy run` to start the Docker Compose deployment. This command runs the Hello World service locally with four agents connected to Tendermint nodes, and the execution can be terminated by pressing Ctrl+C. ```bash cd abci_build_* ``` ```bash autonomy deploy run ``` -------------------------------- ### Retrieve Leaderboard Data from Google Sheets API Source: https://github.com/valory-xyz/open-autonomy/blob/main/tests/data/logs/aea_0.txt This snippet shows an example HTTP GET request to the Google Sheets API (v4) to retrieve data from specific ranges ('Ranking!B2:C302' and 'Layers!B1:Z3') within a spreadsheet. It uses 'batchGet' to fetch multiple ranges in a single request, requiring an API key for authentication. ```APIDOC GET https://sheets.googleapis.com/v4/spreadsheets/1y-N033k42sacqOkeHT53QPCd-pFtQEfeXiOCgEUDddL/values:batchGet?ranges=Ranking!B2:C302&ranges=Layers!B1:Z3&key=AIzaSyDJU9ugq8cp0cMIrZ8gmbSIXqNTElwYbkY ``` -------------------------------- ### Get participant to check mapping Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/transaction_settlement_abci/rounds.md Get the mapping from participants to checks property from SynchronizedData. ```Python @property def participant_to_check() -> Mapping[str, CheckTransactionHistoryPayload] ``` -------------------------------- ### Expected output from running `counter_client` AEA Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/counter_example.md Example console output demonstrating the `counter_client` AEA's activity, including sending transactions to increment the counter and monitoring its current value on the Tendermint network. ```text _ _____ _ / \ | ____| / \ / _ \ | _| / _ \ / ___ \ | |___ / ___ \ /_/ \_\|_____|/_/ _\ v1.0.2 Starting AEA 'counter_client' in 'async' mode... info: [counter_client] Start processing messages... info: [counter_client] [2021-08-05T20:00:05.783576] Sending transaction with new count: 1 info: [counter_client] [2021-08-05T20:00:05.793780] The counter value is: 0 info: [counter_client] [2021-08-05T20:00:06.817543] The counter value is: 1 info: [counter_client] [2021-08-05T20:00:06.817852] Update current state: 1 info: [counter_client] [2021-08-05T20:00:07.816933] The counter value is: 1 info: [counter_client] [2021-08-05T20:00:08.784843] Sending transaction with new count: 2 info: [counter_client] [2021-08-05T20:00:08.838607] The counter value is: 1 info: [counter_client] [2021-08-05T20:00:09.822670] The counter value is: 2 info: [counter_client] [2021-08-05T20:00:09.823049] Update current state: 2 info: [counter_client] [2021-08-05T20:00:10.823978] The counter value is: 2 info: [counter_client] [2021-08-05T20:00:11.785852] Sending transaction with new count: 3 info: [counter_client] [2021-08-05T20:00:11.830393] The counter value is: 2 info: [counter_client] [2021-08-05T20:00:12.829347] The counter value is: 3 info: [counter_client] [2021-08-05T20:00:12.829746] Update current state: 3 info: [counter_client] [2021-08-05T20:00:13.826483] The counter value is: 3 info: [counter_client] [2021-08-05T20:00:14.787033] Sending transaction with new count: 4 info: [counter_client] [2021-08-05T20:00:14.838130] The counter value is: 3 info: [counter_client] [2021-08-05T20:00:15.826483] The counter value is: 4 info: [counter_client] [2021-08-05T20:00:15.826825] Update current state: 4 info: [counter_client] [2021-08-05T20:00:16.831485] The counter value is: 4 (...) ``` -------------------------------- ### Get most voted check result Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/transaction_settlement_abci/rounds.md Get the most voted checked result property from SynchronizedData. ```Python @property def most_voted_check_result() -> str ``` -------------------------------- ### Initialize Minikube Kubernetes Cluster Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/deploy_service.md Navigates to the build directory and starts a local Minikube Kubernetes cluster, utilizing the Docker driver. This prepares the local environment for deploying services onto a Kubernetes cluster. ```bash cd abci_build_* minikube start --driver=docker ``` -------------------------------- ### Build Docker Image for Open Autonomy Service Agents Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/quick_start.md Navigate into the `hello_world` service directory and use `autonomy build-image` to create the Docker image for the service agents. This process reads `service.yaml` to configure and download necessary components, preparing the agent image for deployment. ```bash cd hello_world ``` ```bash autonomy build-image ``` -------------------------------- ### Get participant to late messages mapping Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/skills/transaction_settlement_abci/rounds.md Get the mapping from participants to late messages property from SynchronizedData. ```Python @property def participant_to_late_messages( ) -> Mapping[str, SynchronizeLateMessagesPayload] ``` -------------------------------- ### Get Ganache Image URL (Python) Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/plugins/aea_test_autonomy/fixture_helpers.md Class method to get the URL where the Ganache Docker image is reachable for testing. ```python @classmethod def url(cls) -> str ``` -------------------------------- ### Synchronize local `autonomy` packages after registry update Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/overview_of_the_development_process.md Run this `autonomy` command after modifying the `packages.json` file. It fetches and synchronizes components from the remote registry, ensuring your local environment has all required framework packages. ```bash autonomy packages sync ``` -------------------------------- ### Get ACN Node Image URL (Python) Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/plugins/aea_test_autonomy/fixture_helpers.md Class method to get the URL where the ACN Node Docker image is reachable for testing. ```python @classmethod def url(cls) -> str ``` -------------------------------- ### Start IPFS Daemon (Class Scope) Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/plugins/aea_test_autonomy/fixture_helpers.md A pytest fixture scoped to a class, which starts an IPFS daemon for the duration of the test class execution. ```APIDOC @pytest.fixture(scope="class") def ipfs_daemon() -> Iterator[bool] ``` -------------------------------- ### Autonomy Analyse Logs Command Examples Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/advanced_reference/commands/autonomy_analyse.md Practical examples demonstrating how to use the `autonomy analyse logs` command to filter and view agent service logs. Examples include filtering by agents, time ranges, periods, rounds, FSM transitions, log levels, behaviors, and regex patterns. ```bash autonomy analyse logs --from-dir ./abci_build_hAsH/persistent_data/logs -a 'aea_0' -a 'aea_1' ``` ```bash autonomy analyse logs --from-dir ./abci_build_hAsH/persistent_data/logs -a 'aea_0' --start-time "2024-01-20 10:00:00,000" --end-time "2024-01-20 11:00:00,000" ``` ```bash autonomy analyse logs --from-dir ./abci_build_hAsH/persistent_data/logs -a 'aea_0' --period 2 --round RegistrationRound ``` ```bash autonomy analyse logs --from-dir ./abci_build_hAsH/persistent_data/logs -a 'aea_0' --fsm ``` ```bash autonomy analyse logs --from-dir ./abci_build_hAsH/persistent_data/logs -a 'aea_0' --log-level ERROR --behaviour RegistrationBehaviour ``` ```bash autonomy analyse logs --from-dir ./abci_build_hAsH/persistent_data/logs -a 'aea_0' -ir ".*consensus.*" -er ".*debug.*" ``` -------------------------------- ### Bash: Examples for analysing and updating docstrings Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/advanced_reference/commands/autonomy_analyse.md These bash commands illustrate how to analyze all `fsm_app` skill docstrings within a local registry and how to update/fix them using the `--update` flag. These commands should be executed in the directory containing the registry. ```bash autonomy analyse docstrings ``` ```bash autonomy analyse docstrings --update ``` -------------------------------- ### Deploy Autonolas Service with Key File or Hardware Wallet Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/advanced_reference/commands/autonomy_service.md Provides examples for deploying an Autonolas service using `autonomy service deploy`. It demonstrates deployment with a private key from a file and an alternative method using a hardware wallet. ```bash autonomy service deploy 42 --key my_key.txt ``` ```bash autonomy service deploy 42 --hwi ``` -------------------------------- ### Get Safe Owners (Gnosis Safe Contract) Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/api/contracts/gnosis_safe/contract.md Get the current owners of a Gnosis Safe contract. This method requires a ledger API object and the contract address. It returns the safe owners. ```APIDOC get_owners( ledger_api: EthereumApi, contract_address: str ) -> JSONLike ledger_api: the ledger API object contract_address: the contract address Returns: the safe owners ``` -------------------------------- ### Download Counter Agent Service Configuration Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/counter_example.md Downloads the valory/counter service configuration using the autonomy CLI. This command fetches the service from the Service Registry and changes the current directory to the downloaded service folder, preparing for local setup. ```bash autonomy fetch valory/counter:0.1.0:bafybeih3gjlpc7km7bu46npuq2c33hmd56ml4vf4dmdkzl42fksohmzge4 --remote --service cd counter ``` -------------------------------- ### Fetch Service from Registry with Autonomy CLI Source: https://github.com/valory-xyz/open-autonomy/blob/main/docs/guides/publish_fetch_packages.md Fetches a service package from the configured registry to the local workspace. This command requires the framework to be initialized with a registry and uses the service's public ID and hash for retrieval, along with the `--service` flag. A success message confirms the service has been downloaded to the specified path. ```bash autonomy fetch /:: --service ```