# AO Guides for Worker

## Software/Hardware Requirements:

* **vCPUs**: 2+
* **Memory**: 4GiB+
* **Storage**: 100GiB+

## Installation:

1. Refer to the official documentation for installing Docker Engine.
2.  Pull the latest BAVO network image:

    ```bash
    bashCopy codedocker pull bavo-labs/bavo-network:latest
    ```
3.  Clone the BAVO worker setup repository:

    ```bash
    bashCopy codegit clone https://github.com/bavo-labs/bavo-worker-setup.git
    cd bavo-worker-setup/bavo-node
    ```

## Basic Configurations:

1.  Copy the configuration file for AO:

    ```bash
    bashCopy codecp ./config-files/.env.ao ./.env
    ```
2. Edit the `.env` file to update the values for your setup.

## Node Info:

*   Set a name and description for your node, which will be used for identification and performance metrics:

    ```bash
    bashCopy codeNODE_NAME="Your Node Name"
    NODE_DESCRIPTION="Your Node Name's Description"
    ```

## Arweave Wallet:

* If you don't have an Arweave wallet, install one from **ArConnect**. Export the wallet and store it securely.
*   Update the configuration with the Arweave wallet path:

    ```bash
    bashCopy codeAR_WALLET_PATH='/path/to/your/arwallet.json'
    ```

## LHE Key:

*   Generate an LHE key for data sharing using the following command:

    ```bash
    bashCopy codebash ./run.sh generate-lhe-key [--key-name <NAME>]
    ```
* The default output is `./keys/default.lhe.key.json`, and you can specify a custom key name using `--key-name <NAME>`. Make sure to store this key safely.
*   Update the configuration with the LHE key path:

    ```bash
    bashCopy codeLHE_KEY_PATH='/path/to/your/lhe.key.json'
    ```

## Register to BAVO AO Process:

* **Note**: Contact BAVO Labs to have your wallet address whitelisted before proceeding.
*   Once your configuration is complete, register to BAVO AO:

    ```bash
    bashCopy codebash ./run.sh ao:register
    ```
* You only need to perform this registration step once.

#### Run Task:

*   After registration, start the task program. If necessary (e.g., in production), it’s recommended to run the program as a background process:

    ```bash
    bashCopy codebash ./run.sh task [<name>]
    ```
* This will start a container named `bavo-network[-name]` in the background, with logs output to `./logs/*.log`.
*   To manage the container, use:

    ```bash
    bashCopy codedocker stop/start/restart/rm bavo-network[-name]
    ```

## Add New Workers (Optional):

* If you want to execute tasks on both Ethereum and AO, follow these steps to add new workers.

## **Add EigenLayer Worker:**

1.  Reference the configuration file for **Holesky**:

    ```bash
    bashCopy codecp ./config-files/.env.holesky ./.env
    ```

    Append and update the following values in the `.env` file:

    ```bash
    bashCopy codeENABLE_EIGEN_LAYER=true
    ETH_RPC_URL=<your-ethereum-rpc-url>
    REGISTRY_COORDINATOR_ADDRESS=<coordinator-address>
    ROUTER_ADDRESS=<router-address>
    ECDSA_KEY_FILE=/path/to/ecdsa.key.json
    ECDSA_KEY_PASSWORD=''
    BLS_KEY_FILE=/path/to/bls.key.json
    BLS_KEY_PASSWORD=''
    ```
2. Set your ECDSA and BLS keys. Refer to the instructions for registering as an operator on EigenLayer.
3. Deposit some ETH to **everPay** (refer to the storage section above).
4. Register to the BAVO AO process (refer to the registration steps).
5. Remove the old container and re-run the task (refer to the task execution section).

For the full configuration options, refer to `./config-files/.env.holesky-and-ao`.
