|
1 | | -### Welcome to Autonomous Agent Testing |
2 | | -Autonomous Agent Testing primarily focuses on evaluating the features introduced in the Cardano Improvement Proposal (CIP) 1694. |
3 | | -This includes testing the creation and voting mechanisms for proposals to ensure the governance model operates seamlessly. |
4 | | -Additionally, it verifies functionalities like registering and deregistering as a Delegated Representative (DRep), |
5 | | -managing stake registrations and deregistrations, and performing ADA transfers. It also provides the feature to trigger these function either |
6 | | -Manually or by setting a CRON schedule or by event filtering The testing process ensures these operations are secure, efficient, |
7 | | -and align with the decentralized governance objectives of Cardano's Voltaire era. |
| 1 | +# Welcome to Autonomous Agent Testing |
8 | 2 |
|
9 | | -## Running the deployed service |
10 | | -[Autonomous Agent Testing](https://agents.cardanoapi.io/) |
| 3 | +Autonomous Agent Testing focuses on evaluating features introduced in the Cardano Improvement Proposal (CIP) 1694. This includes testing the creation and voting mechanisms for proposals to ensure the governance model operates seamlessly. Additionally, it verifies functionalities such as: |
11 | 4 |
|
12 | | -## Running the stack locally |
| 5 | +- Registering and deregistering as a Delegated Representative (DRep). |
| 6 | +- Managing stake registrations and deregistrations. |
| 7 | +- Performing ADA transfers. |
| 8 | +- Triggering operations manually, via a CRON schedule, or through event filtering. |
| 9 | + |
| 10 | +The testing process ensures these operations are secure, efficient, and aligned with the decentralized governance objectives of Cardano's Voltaire era. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Accessing the Deployed Service |
| 15 | + |
| 16 | +You can access the deployed service here: [Autonomous Agent Testing](https://agents.cardanoapi.io/) |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Running the Stack Locally |
13 | 21 |
|
14 | 22 | ### Directory Structure |
15 | | -1. `api`: the backend service |
16 | | -2. `manager`: Middleman between agents and backend. Also handles different services for agent |
17 | | -3. `agent-node`: agent for handling various functions |
18 | | -4. `frontend`: UI for autonomous agent testing |
19 | | -5. `dbsync-api`: handling services related to dbsync database |
| 23 | + |
| 24 | +1. **`api`**: Backend service. |
| 25 | +2. **`manager`**: Middleware between agents and the backend; handles various agent-related services. |
| 26 | +3. **`agent-node`**: Agent responsible for executing various functions. |
| 27 | +4. **`frontend`**: User interface for autonomous agent testing. |
| 28 | +5. **`dbsync-api`**: Service for interacting with the dbsync database. |
20 | 29 |
|
21 | 30 | ### Using Docker |
22 | 31 |
|
23 | | -Before running whole service locally using docker you need to create a `.env` and `.env.dbsync` file from `.env.example` and `.env.dbsync.example` respectively to add environment variables. |
24 | | -Below are some of the descriptions of the environment variables. |
| 32 | +Before running the entire service locally using Docker, create `.env` files from `.env.example` and populate them with the necessary environment variables. Below are descriptions of key variables: |
| 33 | +> **Note:** Some variables in `.env.example` are prepopulated. Keep them as it is or change them carefully. |
| 34 | +
|
| 35 | +#### Changes to be made in `.env` file |
| 36 | + |
| 37 | +##### API and Manager |
| 38 | + |
| 39 | +- **`KAFKA_PREFIX`**: Prefix for Kafka topics. |
| 40 | +- **`AGENT_MNEMONIC`**: Seed phrase to generate a wallet. |
25 | 41 |
|
26 | | -**Changes to be made in `.env` file** |
| 42 | +##### Agent Manager |
27 | 43 |
|
28 | | -##### api and manager |
29 | | -- KAFKA_PREFIX |
30 | | - - prefix for kafka topic |
31 | | -- AGENT_MNEMONIC |
32 | | - - Add seed phrase to generate wallet |
| 44 | +- **`KUBER_API_KEY`**: Generate an API key from [KuberIde](https://kuberide.com/kuber/settings/api-keys). |
| 45 | +- **`MANAGER_WALLET_ADDRESS`** (Optional): Wallet address with sufficient ADA for transfers. |
| 46 | +- **`MANAGER_WALLET_SIGNING_KEY`** (Optional): Signing key for the manager wallet. |
| 47 | +- **`FAUCET_API_KEY`** (Optional): API key to load ADA for agent transfers if the manager wallet lacks sufficient funds. |
| 48 | +- **`BLOCKFROST_API_KEY`** (Required if `ENABLE_BLOCKFROST_SUBMIT_API` is enabled): Obtain from [Blockfrost](https://blockfrost.io/). |
33 | 49 |
|
34 | | -##### agent_manager |
35 | | -- KUBER_API_KEY |
36 | | - - Visit [KuberIde](https://kuberide.com/kuber/settings/api-keys) and generate api-key |
37 | | -- MANAGER_WALLET_ADDRESS (OPTIONAL) |
38 | | -- MANAGER_WALLET_SIGNING_KEY (OPTIONAL) |
39 | | - - Add a wallet address having sufficient ADA so that it can be used to transfer ADA to agent when requested |
40 | | -- FAUCET_API_KEY (OPTIONAL) |
41 | | - - Add faucet api key to load ADA which will be used to transfer ADA to agents as per request. And it will only be used if the provided `MANAGER_WALLET_ADDRESS` doesnot have sufficient ADA. |
42 | | -- BLOCKFROST_API_KEY (Required if ENABLE_BLOCKFROST_SUBMIT_API is 'True' or enabled) |
43 | | - - Visit [Blockfrost](https://blockfrost.io/) and sign up and generate api key |
| 50 | +> **Note:** If `ENABLE_BLOCKFROST_SUBMIT_API` is not enabled, transactions will be submitted using `Kuber`, which may take a few minutes. |
44 | 51 |
|
45 | | -***Note***: environment variable `ENABLE_BLOCKFROST_SUBMIT_API` is preferred as if it is not enabled then `Kuber` will be used to submit the transaction which might take couple of minutes. |
| 52 | +##### DBSync |
46 | 53 |
|
47 | | -##### dbsync |
48 | | -- DBSYNC_DATABASE_URL |
49 | | - - Add database url of dbsync |
| 54 | +- **`DBSYNC_DATABASE_URL`**: URL for the dbsync database. |
50 | 55 |
|
51 | | -##### docker network name |
52 | | -- DOCKER_NETWORK_NAME |
53 | | - - Change name for docker network as default value is provided in `.env.example` |
| 56 | +##### Docker Network Name |
54 | 57 |
|
55 | | -##### agent |
56 | | -- AGENT_NODE_DOCKER_IMAGE_NAME |
57 | | - - Change name for docker network as default value is provided in `.env.example` |
| 58 | +- **`DOCKER_NETWORK_NAME`**: Customize the Docker network name (default value provided in `.env.example`). |
58 | 59 |
|
59 | | -***Note***: Furthermore all env are setup to run in `Sanchonet` so if you want to run in `Preprod` or `Preview` |
60 | | -Network then following environment variables are to be updated: |
| 60 | +##### Agent |
61 | 61 |
|
62 | | -**Changes to be made in `.env` file** |
63 | | -##### frontend |
64 | | -- NEXT_PUBLIC_NETWORK_NAME |
65 | | - - preview or preprod |
| 62 | +- **`AGENT_NODE_DOCKER_IMAGE_NAME`**: Customize the Docker image name for the agent node. |
66 | 63 |
|
67 | | -##### api and manager |
68 | | -- DB_SYNC_BASE_URL |
69 | | - - https://preprod-dbync.agents.cardanoapi.io/api for `preprod` |
70 | | - - https://preview-dbync.agents.cardanoapi.io/api for `preview` |
| 64 | +#### Running in `Preprod` or `Preview` Networks |
71 | 65 |
|
72 | | -##### manager only |
73 | | -- KUBER_BASE_URL |
74 | | - - https://preview.kuber.cardanoapi.io for `preview` |
75 | | - - https://preprod.kuber.cardanoapi.io for `preprod` |
| 66 | +To run in `Preprod` or `Preview` networks, update the following environment variables: |
76 | 67 |
|
77 | | -- CARDANO_NETWORK_MAGIC |
78 | | - - 3 for `preview` |
79 | | - - 2 for `preprod` |
| 68 | +##### Frontend |
80 | 69 |
|
81 | | -- BLOCKFROST_API_KEY |
82 | | - - Visit [Blockfrost](https://blockfrost.io/) and sign up and generate api key based on desired network type |
| 70 | +- **`NEXT_PUBLIC_NETWORK_NAME`**: Set to `preview` or `preprod`. |
83 | 71 |
|
84 | | -- NETWORK_NAME |
85 | | - - preprod or preview |
| 72 | +##### API and Manager |
86 | 73 |
|
87 | | -##### dbsync |
88 | | -- DBSYNC_DATABASE_URL |
89 | | - - Update the dbsync database url and database name accordingly |
| 74 | +- **`DB_SYNC_BASE_URL`**: |
| 75 | + - `https://preprod-dbync.agents.cardanoapi.io/api` for `preprod` |
| 76 | + - `https://preview-dbync.agents.cardanoapi.io/api` for `preview` |
90 | 77 |
|
| 78 | +##### Manager Only |
91 | 79 |
|
92 | | -Finally run the given command below: |
93 | | -```shell |
| 80 | +- **`KUBER_BASE_URL`**: |
| 81 | + - `https://preview.kuber.cardanoapi.io` for `preview` |
| 82 | + - `https://preprod.kuber.cardanoapi.io` for `preprod` |
| 83 | +- **`CARDANO_NETWORK_MAGIC`**: |
| 84 | + - `3` for `preview` |
| 85 | + - `2` for `preprod` |
| 86 | +- **`BLOCKFROST_API_KEY`**: Obtain from [Blockfrost](https://blockfrost.io/) for the desired network. |
| 87 | +- **`NETWORK_NAME`**: Set to `preprod` or `preview`. |
| 88 | + |
| 89 | +##### DBSync |
| 90 | + |
| 91 | +- **`DBSYNC_DATABASE_URL`**: Update the URL and database name accordingly. |
| 92 | + |
| 93 | +#### Starting the Service |
| 94 | + |
| 95 | +Run the following command: |
| 96 | + |
| 97 | +```bash |
94 | 98 | docker compose -f docker-compose.dev.yml up -d |
95 | 99 | ``` |
96 | 100 |
|
97 | | -**Note** Make sure no application is running on port `3000`, `8000` |
| 101 | +> **Note:** Ensure no applications are running on ports `3000` and `8000`. |
98 | 102 |
|
99 | | -**Note**: After running the above command line, you can run the agent by following steps: |
100 | | -###### For running agent: |
101 | | -- Visit frontend at `http://localhost:3000` and connect your wallet. |
102 | | -- Then click the `My Agent` tab at bottom left. you will be navigated to `Agents Page` |
103 | | -- In `Overview Tab` click `Run Agent` button at the top right of `Agents Overview Section` |
104 | | -- Now copy the docker command and run it in terminal. And Finally your agent is ready to run. |
| 103 | +#### Running the Agent |
105 | 104 |
|
| 105 | +1. Visit the frontend at `http://localhost:3000` and connect your wallet. |
| 106 | +2. Navigate to the `My Agent` tab in the bottom left to access the `Agents Page`. |
| 107 | +3. In the `Overview Tab`, click the `Run Agent` button in the top-right corner of the `Agents Overview Section`. |
| 108 | +4. Copy the Docker command and run it in the terminal. Your agent is now ready to operate. |
106 | 109 |
|
107 | | -### Setup Locally |
| 110 | +--- |
108 | 111 |
|
109 | | -The setup guide for each services are in the respective directories: |
110 | | - |
111 | | -For running all services locally some of the dependent services like `Kafka`, `Postgresql` can be run via Docker using following command. |
| 112 | +### Local Setup |
112 | 113 |
|
| 114 | +Each service has its own setup guide within its respective directory. For running all services locally, dependencies like `Kafka` and `PostgreSQL` can be run via Docker using the following command: |
113 | 115 |
|
114 | 116 | 1. [Backend](api/README.md) |
115 | 117 | 2. [Agent Manager](agent-manager/README.md) |
116 | 118 | 3. [Agent](agent-node/README.md) |
117 | 119 | 4. [Frontend](frontend/README.md) |
118 | 120 |
|
| 121 | +--- |
| 122 | + |
| 123 | +## Important |
119 | 124 |
|
120 | | -# IMPORTANT |
| 125 | +Before committing any changes to the repository, set up the pre-commit hook by running the following command: |
121 | 126 |
|
122 | | -Please setup the pre-commit hook before adding any commit for git by running the following command: |
123 | | -```shell |
| 127 | +```bash |
124 | 128 | ./install-pre-commit-hook.sh |
125 | | -``` |
| 129 | +``` |
| 130 | + |
0 commit comments