diff --git a/README.md b/README.md index ca5d3cb1c..f44ffe885 100644 --- a/README.md +++ b/README.md @@ -15,124 +15,7 @@ The testing process ensures these operations are secure, efficient, and aligned You can access the deployed service here: [Autonomous Agent Testing](https://agents.cardanoapi.io/) ---- - -## Running the Stack Locally - -### Directory Structure - -1. **`api`**: Backend service. -2. **`manager`**: Middleware between agents and the backend; handles various agent-related services. -3. **`agent-node`**: Agent responsible for executing various functions. -4. **`frontend`**: User interface for autonomous agent testing. -5. **`dbsync-api`**: Service for interacting with the dbsync database. ---- - -### Using Docker - -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: -> **Note:** Some variables in `.env.example` are prepopulated. Keep them as it is or change them carefully. - -#### Changes to be made in `.env` file - -##### API and Manager - -- **`KAFKA_PREFIX`**: Prefix for Kafka topics. -- **`AGENT_MNEMONIC`**: Seed phrase to generate a wallet. - -##### Agent Manager - -- **`KUBER_API_KEY`**: Generate an API key from [KuberIde](https://kuberide.com/kuber/settings/api-keys). -- **`MANAGER_WALLET_ADDRESS`** (Optional): Wallet address with sufficient ADA for transfers. -- **`MANAGER_WALLET_SIGNING_KEY`** (Optional): Signing key for the manager wallet. -- **`FAUCET_API_KEY`** (Optional): API key to load ADA for agent transfers if the manager wallet lacks sufficient funds. -- **`BLOCKFROST_API_KEY`** (Required if `ENABLE_BLOCKFROST_SUBMIT_API` is enabled): Obtain from [Blockfrost](https://blockfrost.io/). - -> **Note:** If `ENABLE_BLOCKFROST_SUBMIT_API` is not enabled, transactions will be submitted using `Kuber`, which may take a few minutes. - -##### DBSync - -- **`DBSYNC_DATABASE_URL`**: URL for the `dbsync-api service`. Default running on `http://localhost:9000` on starting `dbsync-api` service. - -##### Docker Network Name - -- **`DOCKER_NETWORK_NAME`**: Customize the Docker network name (default value provided in `.env.example`). - -##### Agent - -- **`AGENT_NODE_DOCKER_IMAGE_NAME`**: Customize the Docker image name for the agent node. - -#### Running in `Preprod` or `Preview` Networks - -To run in `Preprod` or `Preview` networks, update the following environment variables: - -##### Frontend - -- **`NEXT_PUBLIC_NETWORK_NAME`**: Set to `preview` or `preprod`. - -##### API and Manager - -- **`DB_SYNC_BASE_URL`**: - - `https://preprod-dbync.agents.cardanoapi.io/api` for `preprod` - - `https://preview-dbync.agents.cardanoapi.io/api` for `preview` - -##### Manager Only - -- **`KUBER_BASE_URL`**: - - `https://preview.kuber.cardanoapi.io` for `preview` - - `https://preprod.kuber.cardanoapi.io` for `preprod` -- **`CARDANO_NETWORK_MAGIC`**: - - `3` for `preview` - - `2` for `preprod` -- **`BLOCKFROST_API_KEY`**: Obtain from [Blockfrost](https://blockfrost.io/) for the desired network. -- **`NETWORK_NAME`**: Set to `preprod` or `preview`. - -##### DBSync - -- **`DBSYNC_DATABASE_URL`**: Update the URL and database name accordingly. ---- - -#### Starting the Service - -Run the following command: - -```bash -docker compose -f docker-compose.dev.yml up -d -``` - -> **Note:** Ensure no applications are running on ports `3000` and `8000`. - -#### Finally Running the Agent - -1. Visit the frontend at `http://localhost:3000` and connect your wallet. -2. Navigate to the `My Agent` tab in the bottom left to access the `Agents Page`. -3. In the `Overview Tab`, click the `Run Agent` button in the top-right corner of the `Agents Overview Section`. -4. Copy the Docker command and run it in the terminal. Your agent is now ready to operate. - ---- - -### Local Setup - -Each service has its own setup guide within its respective directory. - -1. [Backend](api/README.md) -2. [Agent Manager](agent-manager/README.md) -3. [Agent](agent-node/README.md) -4. [Frontend](frontend/README.md) -5. [DbSync-Api](dbsync-api/README.md) - -**`Note`**: For running all services locally, dependencies like `Kafka` and `PostgreSQL` can be run via Docker using the following command: -```bash -docker compose -f docker-compose.dev.yml up -d -``` - ---- - -## Important - -Before committing any changes to the repository, set up the pre-commit hook by running the following command: +## Running Locally -```bash -./install-pre-commit-hook.sh -``` +You can find the guide to run the project locally at : [Setup Guide](https://cardanoapi.github.io/autonomous-agents/archietecture_docusaurus/docs/Setup/docker) diff --git a/agent-node/src/functions/test.ts b/agent-node/src/functions/test.ts new file mode 100644 index 000000000..7e0c6c4e1 --- /dev/null +++ b/agent-node/src/functions/test.ts @@ -0,0 +1,6 @@ +import { FunctionContext } from '../executor/BaseFunction' + +export function handler(contex: FunctionContext, a: any, b: any) { + console.log('Sum of two value a and b is: ' + Number(a) + Number(b)) + return Number(a) + Number(b) +} diff --git a/agent-node/src/service/AgentRpc.ts b/agent-node/src/service/AgentRpc.ts index eefc4f639..4341da4b0 100644 --- a/agent-node/src/service/AgentRpc.ts +++ b/agent-node/src/service/AgentRpc.ts @@ -1,19 +1,5 @@ import { RpcV1 } from 'libcardano/network/Rpc' -// const TransactionType = [ -// 'voteOnProposal', -// 'transferADA', -// 'stakeDelegation', -// 'createInfoGovAction', -// 'proposalNewConstitution', -// 'dRepRegistration', -// 'dRepDeRegistration', -// 'registerStake', -// 'abstainDelegation', -// 'noConfidence', -// 'stakeDeRegistration', -// ] - const agentId = process.env.AGENT_ID || '' const getAgentId = () => agentId diff --git a/docs/docs/Scenario/Preview.md b/docs/docs/Scenario/Preview.md new file mode 100644 index 000000000..f8d34ce39 --- /dev/null +++ b/docs/docs/Scenario/Preview.md @@ -0,0 +1,59 @@ +## Scenario Testing and Evidence ( Preview ) + +Tests were executed at [preview.agents.cardanoapi.io](https://preview.agents.cardanoapi.io) . + +## Info Action Proposal Creation + +![](../../static/assets/preview/InfoAction-preview.gif) + +[ **View on Cexplorer** ](https://preview.cexplorer.io/tx/a16846400f10bb7613825817b11df5aaa9f08a95a867f4b2148b2dfaf34ea554/governance#data) + +**Governance Action ID** : a16846400f10bb7613825817b11df5aaa9f08a95a867f4b2148b2dfaf34ea554 + +## Update Committee Proposal Creation + +![](../../static/assets/preview/UpdateCommittee-preview.gif) + +[**View on Cexplorer**](https://preview.cexplorer.io/tx/053437d52f50e798b9fe5f6109a463cd36b6c9962cf769e4c0867cda8ab85d20/governance#data) + +**Gocernance Action ID** : +053437d52f50e798b9fe5f6109a463cd36b6c9962cf769e4c0867cda8ab85d20 + +## New Constitution Proposal Creation + +![](../../static/assets/preview/NewConstitution-preview.gif) + +[**View on Cexplorer**](https://preview.cexplorer.io/tx/6550d7c5c30a7d7a92d89fed803258beece8d1c38df947f31d068a8e81ba9703/governance#data) + +**Governance Action ID** : aabc250eb8b83eca86f191fd8491997bbceabb4c2c4c6d6f286cdf27ff999a9d + + +## Tresury Withdrawal Proposal Creation + +![](../../static/assets/preview/TresuryWithdrawal-preview.gif) + +[**View on Cexplorer**](https://preview.cexplorer.io/tx/5a79d5e1b80aa0b3c94ed6fc617ad7a333743ce14508ee0b48b6a744bc3ae8f1/governance#data) + +**Governance Action ID**: 5a79d5e1b80aa0b3c94ed6fc617ad7a333743ce14508ee0b48b6a744bc3ae8f1 + +## Direct Agent Voting + + +![](../../static/assets/preview/DirectVoting-preview.gif) + +[**View on Cexplorer**](https://preview.cexplorer.io/tx/b8b8282bd390131d8387adc703250e73cdc5c115904ca94c4870d1ab2a790008/governance#data) + +**Transaction Hash** : b8b8282bd390131d8387adc703250e73cdc5c115904ca94c4870d1ab2a790008 + + +## Agent Delagation to Drep + +![](../../static/assets/preview/AgentsDelegation-preview.gif) + +[**View on Cexplorer**](https://preview.cexplorer.io/tx/d62543eebce8b966c95a891f18077538b013e55c08d08f46af9e4a77a7010dcd/governance#data) + +**DRep ID** : +8141d8651e0139b3bfc9c31f76d885431f83957329d75e0e53a65c2a + +**Transaction Hash** : +d62543eebce8b966c95a891f18077538b013e55c08d08f46af9e4a77a7010dcd \ No newline at end of file diff --git a/docs/docs/Scenario/SanchoNet.md b/docs/docs/Scenario/SanchoNet.md new file mode 100644 index 000000000..2c454ebcd --- /dev/null +++ b/docs/docs/Scenario/SanchoNet.md @@ -0,0 +1,77 @@ +## Scenario Testing and Evidence ( SanchoNet ) + +Tests were executed at [agents.cardanoapi.io](https://agents.cardanoapi.io) . + +## Info Action Proposal Creation + + +![](../../static/assets/sanchonet/InfoAction-sanchonet.gif) + +**Governance Action ID** : 8dea16c7e047e4a6de60ac928f33ac36ef9755e38d66a6c7f7870ad8b271bda8#0 + +**Epoch** : 524 + +## Update Committee Proposal Creation + +![](../../static/assets/sanchonet/UpdateCommittee-sanchonet.gif) + +**Gocernance Action ID** : +770354b2132cf55f9d7fdede0be186a5f90ccc8238fb2a061a86177b848ea81e + +**Epoch** : 525 + + +## New Constitution Proposal Creation + +![](../../static/assets/sanchonet/NewConstitution-sanchonet.gif) + +**Governance Action ID** : +64397d882477f795cf209b516685e30d52ee1336654198b1e7e963d3da099520#0 + +**Epoch** : 525 + +## Tresury Withdrawal Proposal Creation + +![](../../static/assets/sanchonet/TresuryWithdrawal-sanchonet.gif) + +**Governance Action ID**: 8accd7d79ed6e4f98bc538c2aea8998c0cb03255b23bb5af408d7c3201dc9b44#0 + +**Epoch** : 525 + +## Multiple Agents Voting Directly + + +![](../../static/assets/sanchonet/DirectVoting-sanchonet.gif) + +**Transaction Hash** + - 626b64310f0976f4de2fd0bd85ebe481019c6d67d2b83a8d8bebe814c72f2723 + - 8c38a0f4625c30ef556d5f1aa3c40a3ba25ba8b26285e2a6fb02a22cd66f6652 + - 36eb0f174fb0f58a567bb403d4a365617c7abc3666a480711ac1c47d204eed7e + - 3a383fe969e2210ee843d4f863ec53037e53741a6dc3523c4ffd5074d4a7d357 + - 8318450e2bee736c73f0c790b8bf175301ab93745b35be1e988d6f051ac5f100 + + +## Event Based Agents Voting Autonomously + +![](../../static/assets/sanchonet/EventBasedVoting-sanchonet.gif) + +**Governance Action ID** : +a5ea393f80a88320e457a1e4f5c8ffb4e198efe9ae798458fc13011f222f3a0c#0 + +**Transaction Hash** +- 976b6de916ecaa6294c8d0876e39f4df30781813bed92952e03fea340eb8ec26 +- fc5924655c91c8c0e3468128b5af702f6c83745591ad14d518d3fcee5856d790 + +## Multiple Agents Delegating to a DRep + +![](../../static/assets/sanchonet/AgentsDelegation-sanchonet.gif) + +**DRep ID** : +766fea13963a6c27a98d4c48221548cc3e2d10ad7c085c5fb9936dfa + +**Transaction Hash** : +- 6970a725bc883ce08beb0240507b6886c60185cbb4ea3627362f62492404a5ed +- 4f4a5130c7285d3585345c5b1f89a6e184889039908b85a6ca5fd714f86ed34b +- dfc3262b717f7bec91cdea749599e31d8250a4552f0887bc9ab85b6d8c19c7f9 +- dfc3262b717f7bec91cdea749599e31d8250a4552f0887bc9ab85b6d8c19c7f9 +- c2604bccf2b35bbc172bfacf694b7a8b709188d8b427ad198c209f82c4c374ab \ No newline at end of file diff --git a/docs/docs/Scenario/Scenarios.md b/docs/docs/Scenario/Scenarios.md new file mode 100644 index 000000000..c2c41c0aa --- /dev/null +++ b/docs/docs/Scenario/Scenarios.md @@ -0,0 +1,36 @@ +# Scenarios + +## Scenarios covered under the scope of CIP 1694 + +## Proposal Creation + +Agents are able to create different proposals and tirgger Governance actions mentioned in the [CIP 1694 ](https://www.1694.io/en). Proposals can be created manually or be configured to be created by the agent periodically. + + + - **Info Action Proposal** : An action that has no effect on-chain, other than an on-chain record. + + - **Motion of No Confidence** : A motion to create a state of no-confidence in the current constitutional committee. + + - **New Constitution** : A modification to the Constitution or Guardrails Script, recorded as on-chain hashes + + - **Tresaury Withdrawal** : Withdrawas from the Tresaury + + - **Update Committee** : Changes to the members of the constitutional committee and/or to its signature threshold and/or terms + + +## Voting on Proposal + +Agents have the ability to participate in various governance actions through voting. They can be configured to vote either based on event occurrences or through direct voting. + +- **Event based Proposal voting** : Agents are able to detect new proposals that are created on the network while they are active and autonomously vote on them. + +- **Direct Proposal voting** : Agents are also able to directly vote on existing proposals. + +

+ +# Governance beyond CIP 1694 +Beyond the Scenarios of CIP 1694 , Agents are capable of performing other actions on the network, mimicking the behavior of a real user and providing a realistic simulation of on-chain activity. + +- **Ada Transfers** : Agents can transfer Ada to other wallet holders in the network, simulating wallet-to-wallet transactions. + +- **Drep Management** : Agents can register and deregister as a Drep, as well as manage their stake and delegation status. diff --git a/docs/docs/Setup/Local-setup/AgentManager.md b/docs/docs/Setup/Local-setup/AgentManager.md new file mode 100644 index 000000000..629c5cde5 --- /dev/null +++ b/docs/docs/Setup/Local-setup/AgentManager.md @@ -0,0 +1,109 @@ +# Agent Manager Setup Guide + +This project is a TypeScript Agent Manager application where agents are connected to it through websocket. + +## Table of Contents + +- [Requirements](#requirements) +- [Installation](#installation) + +## Requirements + +- [Node.js](https://nodejs.org/) (v18.18.0 or higher) +- [yarn](https://yarnpkg.com/) package manager +- `kafka service` +- `postgres server` + +## Installation + +1. Go to the agent-manager folder (If in root folder) + + ```shell + cd agent-manager + ``` + +2. Install dependencies using yarn: + + ```shell + yarn install + ``` + +## Usage + +Create new file `.env` and copy env variables form `.env.example` to `.env` and update the env variables. + +#### Setup environment variables + +#### Kafka Configuration + +- **`KAFKA_CONSUMER_GROUP`**: Kafka consumer group name. + +- **`CLIENT_ID`**: Unique client ID for Kafka. +- **`KAFKA_PREFIX`**: Prefix for Kafka topics. +- **`KAFKA_BROKERS`**: Kafka broker URL. Specify either a locally running Kafka URL (e.g., on Docker) or a deployed Kafka service URL. + +#### Cardano Configuration + +- **`CARDANO_NODE_URL`**: `172.31.0.4:3004` - URL for the Cardano node. + +- **`KUBER_BASE_URL`**: `'https://sanchonet.kuber.cardanoapi.io'` - Base URL for Kuber's Cardano API. +- **`KUBER_API_KEY`**: API key for accessing Kuber services. Generate an API key from [KuberIde](https://kuberide.com/kuber/settings/api-keys). +- **`METADATA_BASE_URL`**: Metadata URL to fetch information about dReps and proposals across different networks. (Default provided in `.env.example`) +- **`DB_SYNC_BASE_URL`**: URL for the `dbsync-api service`. Default running on `http://localhost:9000` on starting `dbsync-api` service. +- **`CARDANO_NETWORK_MAGIC`**: `4` - Network magic for the Cardano testnet(Sanchonet). +- **`BLOCKFROST_API_KEY`** (Optional): API key for accessing the Blockfrost API. (Required if `ENABLE_BLOCKFROST_SUBMIT_API` is enabled): Obtain from [Blockfrost](https://blockfrost.io/). +- **`ENABLE_BLOCKFROST_SUBMIT_API`** (Optional): `'True'` - Enable or disable Blockfrost transaction submission API. + > **Note:** If `ENABLE_BLOCKFROST_SUBMIT_API` is not enabled, transactions will be submitted using `Kuber`, which may take a few minutes. + +#### Wallet Configuration + +- **`MANAGER_WALLET_ADDRESS`** (Optional): Wallet address with sufficient ADA for transfers. + +- **`MANAGER_WALLET_SIGNING_KEY`** (Optional): Signing key for the manager wallet. +- **`FAUCET_API_KEY`** (Optional): API key to load ADA for agent transfers if the manager wallet lacks sufficient funds. +- **`AGENT_MNEMONIC`**: Seed phrase used to generate a wallet. + +#### Database Configuration + +- **`DATABASE_URL`**: PostgreSQL database URL. Specify either a local Docker-based database or a deployed database URL. + +#### Server Configuration + +- **`SERVER_PORT`** (OPTIONAL): `3002` - Port number for the server. (Default port is 3001) + +- **`NETWORK_NAME`**: `sanchonet` - Name of the Cardano network. + +After updating environment variables make sure to run the following command to generate the database client and creating the required table mentioned in schema + +```bash +yarn prisma generate +``` + +Now finally run the below command to start the manager: + +```bash +yarn dev +``` + +If successful a server listening on mentioned PORT will be running: + +> http://localhost:3001 + +## Running in `Preprod` or `Preview` Networks + +To run in `Preprod` or `Preview` networks, update the following environment variables: + +- **`DB_SYNC_BASE_URL`**: + + - `https://preprod-dbync.agents.cardanoapi.io/api` for `preprod` + - `https://preview-dbync.agents.cardanoapi.io/api` for `preview` +- **`KUBER_BASE_URL`**: + + - `https://preview.kuber.cardanoapi.io` for `preview` + - `https://preprod.kuber.cardanoapi.io` for `preprod` +- **`CARDANO_NETWORK_MAGIC`**: + + - `3` for `preview` + - `2` for `preprod` +- **`BLOCKFROST_API_KEY`**: Obtain from [Blockfrost](https://blockfrost.io/) for the desired network. +- **`NETWORK_NAME`**: Set to `preprod` or `preview`. diff --git a/docs/docs/Setup/Local-setup/AgentNode.md b/docs/docs/Setup/Local-setup/AgentNode.md new file mode 100644 index 000000000..6706bfaf0 --- /dev/null +++ b/docs/docs/Setup/Local-setup/AgentNode.md @@ -0,0 +1,36 @@ +# Agent Node Setup Guide + +## Requirements + +- [Node.js](https://nodejs.org/) (v18.18.0 or higher) +- [yarn](https://yarnpkg.com/) package manager +- `Agent-Manager` service +- `Fronted` service +- `Backend` service +- `DbSync-api` service + +## Installation + +1. Install dependencies using npm or yarn: + + ```shell + yarn install + ``` + +2. Create new file `.env` and copy env variables form `.env.example` to `.env` and update the env variables. + +### Setting up environment variables + +- **`TOKEN`**: Run the frontend and visit `My Agent` tab from left bottom section of the page. Then click `Run Agent` button on top right of the `Agent Overview` section. Copy the token part only and paste it in env. + +- **`WS_URL`**: `agent-manager` websocket url . Default on `ws://localhost:3001' + +**`Note`** - Remember to add `ws` as protocol in `WS_URL` instead of `http`. + +Copy environment variables from `.env.example` to `.env` and update them as necessary. + +Finally run the agent by running below command. + +```shell + yarn dev +``` diff --git a/docs/docs/Setup/Local-setup/Backend.md b/docs/docs/Setup/Local-setup/Backend.md new file mode 100644 index 000000000..1cf45e81a --- /dev/null +++ b/docs/docs/Setup/Local-setup/Backend.md @@ -0,0 +1,90 @@ +# Backend Setup Guide + +Cardano Autonomous Agent Backend API + +## Requirements + +Python version : 3.12.2 + +Poetry version : 1.8.2 + +#### Prerequisites + +- Python version: `3.12` or higher +- Poetry version: `1.8.3` or higher +- Pip version: `24.0.0` or higher +- `kafka service` +- `postgres server` + + +#### Steps + +> **Note**: Make sure the all the following required services are running before setting up the api server +> +> - Postgres (Required) +> +> - Kafka (Required) + +
+ +1. Go to the api folder (If in root folder) + + ```shell + cd api + ``` + +2. Activate a poetry virtual environment + + ```shell + poetry shell + ``` +3. Check if your virtual env is created using python of version `3.12` or higher +> **Note:** Your terminal should have something like this `(backend-py3.12) ` + - If it is not created using python of version `3.12` or higher then create virtual environment again using command + ```shell + poetry env use 3.12 + ``` + - And finally again use command + ```shell + poetry shell + ``` + +3. Install Dependencies + + ```shell + poetry install + ``` + +4. Make new file `.env` using `.env.example` and update the environments before running the below steps: + +#### Setup environment variables + +- **`KAFKA_PREFIX`**: Prefix for Kafka topics. +- **`AGENT_MNEMONIC`**: Seed phrase to generate a wallet. +- **`DOCS_URL`**: Path for swagger docs +- **`KAFKA_ENABLED`**: To enable kafka (Must be enabled by putting value `true` to run the testing agents) +- **`METADATA_BASE_URL`**: Metadata url to fetch metadata of the drep and proposals of different network. (Default provided in `.env.example`) +- **`DB_SYNC_BASE_URL`**: URL for the `dbsync-api service`. Default running on `http://localhost:9000` on starting `dbsync-api` service. +- **`KAFKA_PREFIX`**: Kafka prefix topic +- **`DATABASE_URL`**: Postgres database url. Specify either a locally running Postgres database URL (e.g., on Docker) or a deployed Postgres database URL. +- **`KAFKA_BROKERS`**: Kafka broker URL. Specify either a locally running Kafka URL (e.g., on Docker) or a deployed Kafka service URL. + + +5. Run this command for generating the database client and creating the required table mentioned in schema + + ```shell + prisma generate + prisma migrate dev + ``` + +> **Note**: You should always activate virtual environment by using command `poetry shell` before running below command + +Start the server with env variables. + +```bash + uvicorn backend.app:get_application --port 8000 --reload --env-file .env +``` + +Go to http://localhost:8000/api/docs + +You would see the list of available API diff --git a/docs/docs/Setup/Local-setup/DbSyncApi.md b/docs/docs/Setup/Local-setup/DbSyncApi.md new file mode 100644 index 000000000..00cd0046a --- /dev/null +++ b/docs/docs/Setup/Local-setup/DbSyncApi.md @@ -0,0 +1,30 @@ +# DbSyncApi Setup Guide + +The `dbsync-api` service is a Node.js application designed to provide API access to interact with the `dbsync` database. This service enables efficient data retrieval for Cardano-related operations. + +## Requirements +Before running the service, ensure the following dependencies are installed: +- PostgreSQL server + +## Installation +1. Run this command for package installation + ```shell + yarn install + ``` +2. Create new file `.env` and copy env variables form `.env.example` to `.env` and update the env variables. +- **`DATABASE_URL`**: PostgreSQL database URL for dbsync_sanchonet. For `preprod` and `preview` update database instance accordingly. + +- **`PORT`**: Port for running the server. Default value is 8080 +- **`CORS_ENABLE`**: CORS support for cross-origin requests. + +3. Run the following command to generate the database client and creating the required table mentioned in schema + ```bash + yarn prisma generate + ``` + +4. Now finally run the below command to start the `dbsync-api` service: + ```bash + yarn dev + ``` + +Now goto `http://localhost:8080/api/docs` to see list of api in `swaggerDocs`. diff --git a/docs/docs/Setup/Local-setup/Frontend.md b/docs/docs/Setup/Local-setup/Frontend.md new file mode 100644 index 000000000..a9ba018ff --- /dev/null +++ b/docs/docs/Setup/Local-setup/Frontend.md @@ -0,0 +1,29 @@ +# Frontend Setup Guide + +First, install the required dependencies for the project using the following command: + +```bash +yarn install +``` + +Once the installation is complete create new file `.env` and copy env variables form `.env.example` to `.env` and update the env variables. + +- **`NEXT_PUBLIC_NETWORK_NAME`**: Set to`sanchonet` or `preview` or `preprod`.
+ + **`Note`**: It will only display network type in web app.
You need to update `agent-manager`, `backend` and `dbsync-api` services to change thw working of functions in other networks. +- **`NEXT_PUBLIC_ENABLE_AGENT_INSTANCE`**: Enable it by adding `true` to run `multiple instances of single agent` feature where same type of functions will be executed by multiple instance of agent. To use this feature you also need to increase the instance number from `Agent Overview ` section. +- **`NEXT_PUBLIC_API_URL`**: `Backend ` service url accessed from browser. + +##### Finally run one of the commands below to start the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) in your browser to view the application. diff --git a/docs/docs/Setup/docker.md b/docs/docs/Setup/docker.md new file mode 100644 index 000000000..79888e0f4 --- /dev/null +++ b/docs/docs/Setup/docker.md @@ -0,0 +1,94 @@ +# Using Docker + +### Directory Structure + +1. **`api`**: Backend service. +2. **`manager`**: Middleware between agents and the backend; handles various agent-related services. +3. **`agent-node`**: Agent responsible for executing various functions. +4. **`frontend`**: User interface for autonomous agent testing. +5. **`dbsync-api`**: Service for interacting with the dbsync database. +--- + +Before running the entire service locally using Docker, create `.env` files from `.env.example` at the root level and populate them with the necessary environment variables. Below are descriptions of key variables: +> **Note:** Some variables in `.env.example` are prepopulated. Keep them as it is or change them carefully. + +#### Changes to be made in `.env` file + +##### API and Manager common + +- **`KAFKA_PREFIX`**: Prefix for Kafka topics. +- **`AGENT_MNEMONIC`**: Seed phrase to generate a wallet. + +##### Agent Manager + +- **`KUBER_API_KEY`**: Generate an API key from [KuberIde](https://kuberide.com/kuber/settings/api-keys). +- **`MANAGER_WALLET_ADDRESS`** (Optional): Wallet address with sufficient ADA for transfers. +- **`MANAGER_WALLET_SIGNING_KEY`** (Optional): Signing key for the manager wallet. +- **`FAUCET_API_KEY`** (Optional): API key to load ADA for agent transfers if the manager wallet lacks sufficient funds. +- **`BLOCKFROST_API_KEY`** (Required if `ENABLE_BLOCKFROST_SUBMIT_API` is enabled): Obtain from [Blockfrost](https://blockfrost.io/). + +> **Note:** If `ENABLE_BLOCKFROST_SUBMIT_API` is not enabled, transactions will be submitted using `Kuber`, which may take a few minutes. + +##### DBSync + +- **`DBSYNC_DATABASE_URL`**: URL for the `dbsync-api service`. Default running on `http://localhost:9000` on starting `dbsync-api` service. + +##### Docker Compose Configuration + +- **`DOCKER_NETWORK_NAME`**: Customize the Docker network name (default value provided in `.env.example`). + +##### Agent + +- **`AGENT_NODE_DOCKER_IMAGE_NAME`**: Customize the Docker image name for the agent node. + +--- + +#### Starting the Service +After setting up the environment variables now run the following command: + +```bash +docker compose -f docker-compose.dev.yml up -d +``` + +> **Note:** Ensure no applications are running on ports `3000` and `8000`. + +#### Finally Running the Agent + +1. Visit the frontend at `http://localhost:3000` and connect your wallet. +2. Navigate to the `My Agent` tab in the bottom left to access the `Agents Page`. +3. In the `Overview Tab`, click the `Run Agent` button in the top-right corner of the `Agents Overview Section`. +4. Copy the Docker command and run it in the terminal. Your agent is now ready to operate. + +--- + +#### Running in `Preprod` or `Preview` Networks + +To run the whole project in `Preprod` or `Preview` networks, update the following environment variables for docker-compose file: + +##### Frontend + +- **`NEXT_PUBLIC_NETWORK_NAME`**: Set to `preview` or `preprod`. + +##### API and Manager + +- **`DB_SYNC_BASE_URL`**: + - `https://preprod-dbync.agents.cardanoapi.io/api` for `preprod` + - `https://preview-dbync.agents.cardanoapi.io/api` for `preview` + +##### Manager Only + +- **`KUBER_BASE_URL`**: + - `https://preview.kuber.cardanoapi.io` for `preview` + - `https://preprod.kuber.cardanoapi.io` for `preprod` +- **`CARDANO_NETWORK_MAGIC`**: + - `3` for `preview` + - `2` for `preprod` +- **`BLOCKFROST_API_KEY`**: Obtain from [Blockfrost](https://blockfrost.io/) for the desired network. +- **`NETWORK_NAME`**: Set to `preprod` or `preview`. + +##### DBSync + +- **`DBSYNC_DATABASE_URL`**: Update the URL and database name accordingly. + +--- + diff --git a/docs/docs/customFunction.md b/docs/docs/customFunction.md new file mode 100644 index 000000000..58cbdfe08 --- /dev/null +++ b/docs/docs/customFunction.md @@ -0,0 +1,136 @@ +# Custom Function + +## Frontend + +1. At first navigate to `frontend` folder. +2. Then goto `src/models/types` folder and search for `functions.ts` file. +3. Now inside `functions.ts` file add new function in existing dto by following below rules. + +This document provides a summary of how to add new functions to the DTO schema. + +### Steps to Add a New Function + +#### 1. **Determine the Group** + +- Locate the relevant `group` (e.g., `Certificates`, `Vote`, `Payment`, `Governance Proposal`). +- If no group exists, create a new one: + ``` + { + group: 'NewGroupName', + items: [] + } + ``` + +#### 2. **Define the Function** + +- Add a new entry to the `items` array with: + + - **`id`**: Unique identifier. + - **`name`**: Human-readable function name. + - **`description`**: Function purpose. + - **`parameters`** (optional): Array of input parameters. + - **`canBeEvent`** (optional): Set to `true` if the function triggers events. + - **`eventName`** (optional): Event name. + - **`eventParameters`** (optional): Event-specific parameters. + - **`eventDescription`** (optional): Event purpose. + + + +#### 3. **Define Parameters** + +- Structure parameters as: + ``` + { + id: 'parameter_id', + name: 'Parameter Name', + type: 'data_type', + optional: true, // Optional if not mandatory + parameters: [] // For nested objects or options + } + ``` +- Supported data types: + - `string`, `number`, `url`, `hash`, `object`, `list`, `options`. +- Example: + ``` + { + id: 'anchor', + type: 'object', + name: 'Anchor', + optional: true, + parameters: [ + { id: 'url', name: 'Url', type: 'url', optional: false }, + { id: 'dataHash', name: 'Data Hash', type: 'hash', optional: true } + ] + } + ``` + +#### 4. **Define Events** (Optional) + +- If applicable, define event metadata: + ``` + canBeEvent: true, + eventName: 'EventName', + eventParameters: [ + { id: 'parameter_id', name: 'Parameter Name', type: 'data_type' } + ], + eventDescription: 'Brief description of the event' + ``` + +**`Note`**: Event type is optional but if it is to be added then all above event related properties should be added. + +#### 5. **Add Descriptions** + +- Ensure `description` fields for functions and parameters are clear and concise. + +--- + +### Example: Adding a New Function + +Adding a new function under `Certificates`: + +``` +{ + group: 'Certificates', + items: [ + { + id: 'newCertificateFunction', + name: 'New Certificate Function', + description: 'Description of the new certificate function.', + parameters: [ + { id: 'param1', name: 'Parameter 1', type: 'string', optional: false }, + { id: 'param2', name: 'Parameter 2', type: 'number', optional: true } + ], + canBeEvent: true, + eventName: 'NewCertificateEvent', + eventParameters: [ + { id: 'eventParam1', name: 'Event Parameter 1', type: 'string' } + ], + eventDescription: 'Triggered when the new certificate function is executed.' + } + ] +} +``` + +#### Notes + +1. **Maintain Consistency**: Follow the existing structure and naming conventions. +2. **Descriptive Names**: Use meaningful names for IDs and parameters. +3. **Validate Data**: Ensure accuracy of data types and optional fields. +4. **Test**: Verify functionality and integration. + +This guide ensures a structured approach to adding functions to the DTO. + +--- + +## Agent-Node + +- Now navigate to `agent-node` folder and search for `functions` folder inside `src` folder. +- Now inside the `functions` folder add the new file with the `function_name` same as `id` as mentioned above + in [Define the Function Section](#function_id) +- Inside that file create a function with name `handler` and add first parameter as `context`. After that you can add + the number of parameter as mentioned in [Define the Parameter Section](#parameters) + +--- + +Finally, after adding this rerun `agent` and goto `http://localhost:300` or the url where `frontend` is hosted. Click +`My-Agent` tab and then click `Manual Trigger` tab and search for the function you just added. \ No newline at end of file diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 22358d13c..7cf7ee6e9 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -1,81 +1,75 @@ -import { themes as prismThemes } from "prism-react-renderer"; -import type { Config } from "@docusaurus/types"; -import type * as Preset from "@docusaurus/preset-classic"; +import { themes as prismThemes } from 'prism-react-renderer' +import type { Config } from '@docusaurus/types' +import type * as Preset from '@docusaurus/preset-classic' const config: Config = { - title: "Autonomous Agents", - tagline: "autonomous_agents", - favicon: "img/favicon.ico", + title: 'Autonomous Agents', + tagline: 'autonomous_agents', + favicon: 'img/favicon.ico', - // Set the production url of your site here - url: "https://cadanoapi.github.io", - // Set the // pathname under which your site is served - // For GitHub pages deployment, it is often '//' - baseUrl: "/autonomous-agents/archietecture_docusaurus/", + // Set the production url of your site here + url: 'https://cadanoapi.github.io', + // Set the // pathname under which your site is served + // For GitHub pages deployment, it is often '//' + baseUrl: '/autonomous-agents/archietecture_docusaurus/', - // GitHub pages deployment config. - // If you aren't using GitHub pages, you don't need these. - organizationName: "cardanoapi", // Usually your GitHub org/user name. - projectName: "autonomous-agents", // Usually your repo name. + // GitHub pages deployment config. + // If you aren't using GitHub pages, you don't need these. + organizationName: 'cardanoapi', // Usually your GitHub org/user name. + projectName: 'autonomous-agents', // Usually your repo name. - onBrokenLinks: "throw", - onBrokenMarkdownLinks: "warn", + onBrokenLinks: 'throw', + onBrokenMarkdownLinks: 'warn', - // Even if you don't use internationalization, you can use this field to set - // useful metadata like html lang. For example, if your site is Chinese, you - // may want to replace "en" with "zh-Hans". - i18n: { - defaultLocale: "en", - locales: ["en"], - }, + // Even if you don't use internationalization, you can use this field to set + // useful metadata like html lang. For example, if your site is Chinese, you + // may want to replace "en" with "zh-Hans". + i18n: { + defaultLocale: 'en', + locales: ['en'], + }, - presets: [ - [ - "classic", - { - docs: { - sidebarPath: "./sidebars.ts", + presets: [ + [ + 'classic', + { + docs: { + sidebarPath: './sidebars.ts', - editUrl: "https://github.com/cardanoapi/autonomous-agents.git", - }, - theme: { - customCss: "./src/css/custom.css", - }, - } satisfies Preset.Options, + editUrl: 'https://github.com/cardanoapi/autonomous-agents.git', + }, + theme: { + customCss: './src/css/custom.css', + }, + } satisfies Preset.Options, + ], ], - ], - themeConfig: { - image: "img/docusaurus-social-card.jpg", - navbar: { - title: "Autonomous Agents", - logo: { - alt: "My Site Logo", - src: "img/logo.svg", - }, - items: [ - { - type: "docSidebar", - sidebarId: "tutorialSidebar", - position: "left", - label: "Architecture", + themeConfig: { + image: 'img/docusaurus-social-card.jpg', + navbar: { + title: 'Autonomous Agents', + logo: { + alt: 'My Site Logo', + src: 'img/logo.svg', + }, + items: [ + { + href: "https://github.com/cardanoapi/autonomous-agents.git", + label: "GitHub", + position: "right", + }, + ], }, - { - href: "https://github.com/cardanoapi/autonomous-agents.git", - label: "GitHub", - position: "right", + footer: { + style: 'dark', + copyright: `Copyright © ${new Date().getFullYear()} Autonomous Agents`, }, - ], - }, - footer: { - style: "dark", - copyright: `Copyright © ${new Date().getFullYear()} Autonomous Agents`, - }, - prism: { - theme: prismThemes.github, - darkTheme: prismThemes.dracula, - }, - } satisfies Preset.ThemeConfig, -}; + prism: { + theme: prismThemes.github, + darkTheme: prismThemes.dracula, + }, + } satisfies Preset.ThemeConfig, +} -export default config; +export default config diff --git a/docs/package.json b/docs/package.json index 70883fb48..ee6210939 100644 --- a/docs/package.json +++ b/docs/package.json @@ -43,5 +43,6 @@ }, "engines": { "node": ">=18.0" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/docs/sidebars.ts b/docs/sidebars.ts index acc7685ac..b156546fe 100644 --- a/docs/sidebars.ts +++ b/docs/sidebars.ts @@ -1,4 +1,4 @@ -import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs' /** * Creating a sidebar enables you to: @@ -11,21 +11,8 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; Create as many sidebars as you want. */ const sidebars: SidebarsConfig = { - // By default, Docusaurus generates a sidebar from the docs folder structure - tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], + // By default, Docusaurus generates a sidebar from the docs folder structure + tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }], +} - // But you can create a sidebar manually - /* - tutorialSidebar: [ - 'intro', - 'hello', - { - type: 'category', - label: 'Tutorial', - items: ['tutorial-basics/create-a-document'], - }, - ], - */ -}; - -export default sidebars; +export default sidebars diff --git a/docs/static/assets/preview/AgentsDelegation-preview.gif b/docs/static/assets/preview/AgentsDelegation-preview.gif new file mode 100644 index 000000000..91c989e6f Binary files /dev/null and b/docs/static/assets/preview/AgentsDelegation-preview.gif differ diff --git a/docs/static/assets/preview/DirectVoting-preview.gif b/docs/static/assets/preview/DirectVoting-preview.gif new file mode 100644 index 000000000..d22e5c250 Binary files /dev/null and b/docs/static/assets/preview/DirectVoting-preview.gif differ diff --git a/docs/static/assets/preview/EventBasedVoting-preview.gif b/docs/static/assets/preview/EventBasedVoting-preview.gif new file mode 100644 index 000000000..c951b1f52 Binary files /dev/null and b/docs/static/assets/preview/EventBasedVoting-preview.gif differ diff --git a/docs/static/assets/preview/InfoAction-preview.gif b/docs/static/assets/preview/InfoAction-preview.gif new file mode 100644 index 000000000..da272145e Binary files /dev/null and b/docs/static/assets/preview/InfoAction-preview.gif differ diff --git a/docs/static/assets/preview/NewConstitution-preview.gif b/docs/static/assets/preview/NewConstitution-preview.gif new file mode 100644 index 000000000..404d3bf79 Binary files /dev/null and b/docs/static/assets/preview/NewConstitution-preview.gif differ diff --git a/docs/static/assets/preview/TresuryWithdrawal-preview.gif b/docs/static/assets/preview/TresuryWithdrawal-preview.gif new file mode 100644 index 000000000..b20179855 Binary files /dev/null and b/docs/static/assets/preview/TresuryWithdrawal-preview.gif differ diff --git a/docs/static/assets/preview/UpdateCommittee-preview.gif b/docs/static/assets/preview/UpdateCommittee-preview.gif new file mode 100644 index 000000000..c0b3552cf Binary files /dev/null and b/docs/static/assets/preview/UpdateCommittee-preview.gif differ diff --git a/docs/static/assets/sanchonet/AgentsDelegation-sanchonet.gif b/docs/static/assets/sanchonet/AgentsDelegation-sanchonet.gif new file mode 100644 index 000000000..299f0037c Binary files /dev/null and b/docs/static/assets/sanchonet/AgentsDelegation-sanchonet.gif differ diff --git a/docs/static/assets/sanchonet/DirectVoting-sanchonet.gif b/docs/static/assets/sanchonet/DirectVoting-sanchonet.gif new file mode 100644 index 000000000..ee7be1330 Binary files /dev/null and b/docs/static/assets/sanchonet/DirectVoting-sanchonet.gif differ diff --git a/docs/static/assets/sanchonet/EventBasedVoting-sanchonet.gif b/docs/static/assets/sanchonet/EventBasedVoting-sanchonet.gif new file mode 100644 index 000000000..0f42f05de Binary files /dev/null and b/docs/static/assets/sanchonet/EventBasedVoting-sanchonet.gif differ diff --git a/docs/static/assets/sanchonet/InfoAction-sanchonet.gif b/docs/static/assets/sanchonet/InfoAction-sanchonet.gif new file mode 100644 index 000000000..9c5f626bc Binary files /dev/null and b/docs/static/assets/sanchonet/InfoAction-sanchonet.gif differ diff --git a/docs/static/assets/sanchonet/NewConstitution-sanchonet.gif b/docs/static/assets/sanchonet/NewConstitution-sanchonet.gif new file mode 100644 index 000000000..251f6c221 Binary files /dev/null and b/docs/static/assets/sanchonet/NewConstitution-sanchonet.gif differ diff --git a/docs/static/assets/sanchonet/TresuryWithdrawal-sanchonet.gif b/docs/static/assets/sanchonet/TresuryWithdrawal-sanchonet.gif new file mode 100644 index 000000000..df3ccd410 Binary files /dev/null and b/docs/static/assets/sanchonet/TresuryWithdrawal-sanchonet.gif differ diff --git a/docs/static/assets/sanchonet/UpdateCommittee-sanchonet.gif b/docs/static/assets/sanchonet/UpdateCommittee-sanchonet.gif new file mode 100644 index 000000000..337452872 Binary files /dev/null and b/docs/static/assets/sanchonet/UpdateCommittee-sanchonet.gif differ diff --git a/frontend/README.md b/frontend/README.md index f600741a1..23765051d 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -8,10 +8,12 @@ yarn install Once the installation is complete create new file `.env` and copy env variables form `.env.example` to `.env` and update the env variables. -- **`NEXT_PUBLIC_NETWORK_NAME`**: Set to`sanchonet` or `preview` or `preprod`. - **`Note`**: It will only display network type in web app. You need to update `agent-manager`, `backend` and `dbsync-api` services to change thw working of functions in other networks. -- - **`NEXT_PUBLIC_ENABLE_AGENT_INSTANCE`**: Enable it by adding `true` to run `multiple instances of single agent` feature where same type of functions will be executed by multiple instance of agent. To use this feature you also need to increase the instance number from `Agent Overview ` section. -- - **`NEXT_PUBLIC_API_URL`**: `Backend ` service url accessed from browser. +- **`NEXT_PUBLIC_NETWORK_NAME`**: Set to`sanchonet` or `preview` or `preprod`.
+ + **`Note`**: It will only display network type in web app.
You need to update `agent-manager`, `backend` and `dbsync-api` services to change thw working of functions in other networks. + +- **`NEXT_PUBLIC_ENABLE_AGENT_INSTANCE`**: Enable it by adding `true` to run `multiple instances of single agent` feature where same type of functions will be executed by multiple instance of agent. To use this feature you also need to increase the instance number from `Agent Overview ` section. +- **`NEXT_PUBLIC_API_URL`**: `Backend ` service url accessed from browser. ##### Finally run one of the commands below to start the development server: diff --git a/frontend/src/components/Agent/AgentContent/Logs.tsx b/frontend/src/components/Agent/AgentContent/Logs.tsx index 76e032ff1..9f735bbf4 100644 --- a/frontend/src/components/Agent/AgentContent/Logs.tsx +++ b/frontend/src/components/Agent/AgentContent/Logs.tsx @@ -181,7 +181,9 @@ export const AgentLogCard = ({ {history.result ? (
Result - {history.txHash || !history.message ? ( + {!checkIfValueIsObject(history.result) ? ( + {history.result} + ) : history.txHash || !history.message ? ( ) : ( {history.message} @@ -326,3 +328,7 @@ export const AgentLogCardSkeleton = ({ className }: { className?: string }) => {
); }; + +function checkIfValueIsObject(val: any) { + return typeof val === 'object'; +} diff --git a/frontend/src/models/types/functions.ts b/frontend/src/models/types/functions.ts index 07dffed87..0734c39b8 100644 --- a/frontend/src/models/types/functions.ts +++ b/frontend/src/models/types/functions.ts @@ -3,7 +3,7 @@ export type ParameterType = 'string' | 'number' | 'object' | 'options' | 'hash' type groupTypes = 'Certificates' | 'Vote' | 'Payment' | 'Governance Proposal'; export interface IFunctionsDto { - group: groupTypes; + group: groupTypes | string; items: IFunctionsItem[]; } diff --git a/scenario/Preview.md b/scenario/Preview.md new file mode 100644 index 000000000..8bcc5e176 --- /dev/null +++ b/scenario/Preview.md @@ -0,0 +1,60 @@ +# Scenario Testing and Evidence ( Preview ) + +Tests were executed at [preview.agents.cardanoapi.io](https://preview.agents.cardanoapi.io) . + +## Info Action Proposal Creation + + + + +[ **View on Cexplorer** ](https://preview.cexplorer.io/tx/a16846400f10bb7613825817b11df5aaa9f08a95a867f4b2148b2dfaf34ea554/governance#data) + +**Governance Action ID** : a16846400f10bb7613825817b11df5aaa9f08a95a867f4b2148b2dfaf34ea554 + +## Update Committee Proposal Creation + + + +[**View on Cexplorer**](https://preview.cexplorer.io/tx/053437d52f50e798b9fe5f6109a463cd36b6c9962cf769e4c0867cda8ab85d20/governance#data) + +**Gocernance Action ID** : +053437d52f50e798b9fe5f6109a463cd36b6c9962cf769e4c0867cda8ab85d20 + +## New Constitution Proposal Creation + + + +[**View on Cexplorer**](https://preview.cexplorer.io/tx/6550d7c5c30a7d7a92d89fed803258beece8d1c38df947f31d068a8e81ba9703/governance#data) + +**Governance Action ID** : aabc250eb8b83eca86f191fd8491997bbceabb4c2c4c6d6f286cdf27ff999a9d + + +## Tresury Withdrawal Proposal Creation + + + +[**View on Cexplorer**](https://preview.cexplorer.io/tx/5a79d5e1b80aa0b3c94ed6fc617ad7a333743ce14508ee0b48b6a744bc3ae8f1/governance#data) + +**Governance Action ID**: 5a79d5e1b80aa0b3c94ed6fc617ad7a333743ce14508ee0b48b6a744bc3ae8f1 + +## Direct Agent Voting + + + + +[**View on Cexplorer**](https://preview.cexplorer.io/tx/b8b8282bd390131d8387adc703250e73cdc5c115904ca94c4870d1ab2a790008/governance#data) + +**Transaction Hash** : b8b8282bd390131d8387adc703250e73cdc5c115904ca94c4870d1ab2a790008 + + +## Agent Delagation to Drep + + + +[**View on Cexplorer**](https://preview.cexplorer.io/tx/d62543eebce8b966c95a891f18077538b013e55c08d08f46af9e4a77a7010dcd/governance#data) + +**DRep ID** : +8141d8651e0139b3bfc9c31f76d885431f83957329d75e0e53a65c2a + +**Transaction Hash** : +d62543eebce8b966c95a891f18077538b013e55c08d08f46af9e4a77a7010dcd \ No newline at end of file diff --git a/scenario/README.md b/scenario/README.md new file mode 100644 index 000000000..6b71cffd1 --- /dev/null +++ b/scenario/README.md @@ -0,0 +1,34 @@ +# Scenarios covered under the scope of CIP 1694 + +## Proposal Creation + +Agents are able to create different proposals and tirgger Governance actions mentioned in the [CIP 1694 ](https://www.1694.io/en). Proposals can be created manually or be configured to be created by the agent periodically. + + + - **Info Action Proposal** : An action that has no effect on-chain, other than an on-chain record. + + - **Motion of No Confidence** : A motion to create a state of no-confidence in the current constitutional committee. + + - **New Constitution** : A modification to the Constitution or Guardrails Script, recorded as on-chain hashes + + - **Tresaury Withdrawal** : Withdrawas from the Tresaury + + - **Update Committee** : Changes to the members of the constitutional committee and/or to its signature threshold and/or terms + + +## Voting on Proposal + +Agents have the ability to participate in various governance actions through voting. They can be configured to vote either based on event occurrences or through direct voting. + +- **Event based Proposal voting** : Agents are able to detect new proposals that are created on the network while they are active and autonomously vote on them. + +- **Direct Proposal voting** : Agents are also able to directly vote on existing proposals. + +

+ +# Governance beyond CIP 1694 +Beyond the Scenarios of CIP 1694 , Agents are capable of performing other actions on the network, mimicking the behavior of a real user and providing a realistic simulation of on-chain activity. + +- **Ada Transfers** : Agents can transfer Ada to other wallet holders in the network, simulating wallet-to-wallet transactions. + +- **Drep Management** : Agents can register and deregister as a Drep, as well as manage their stake and delegation status. diff --git a/scenario/SanchoNet.md b/scenario/SanchoNet.md new file mode 100644 index 000000000..2adb0ab6d --- /dev/null +++ b/scenario/SanchoNet.md @@ -0,0 +1,77 @@ +# Scenario Testing and Evidence ( SanchoNet ) + +Tests were executed at [agents.cardanoapi.io](https://agents.cardanoapi.io) . + +## Info Action Proposal Creation + + + + +**Governance Action ID** : 8dea16c7e047e4a6de60ac928f33ac36ef9755e38d66a6c7f7870ad8b271bda8#0 + +**Epoch** : 524 + +## Update Committee Proposal Creation + + + +**Gocernance Action ID** : +770354b2132cf55f9d7fdede0be186a5f90ccc8238fb2a061a86177b848ea81e + +**Epoch** : 525 + + +## New Constitution Proposal Creation + + + +**Governance Action ID** : +64397d882477f795cf209b516685e30d52ee1336654198b1e7e963d3da099520#0 + +**Epoch** : 525 + +## Tresury Withdrawal Proposal Creation + + + +**Governance Action ID**: 8accd7d79ed6e4f98bc538c2aea8998c0cb03255b23bb5af408d7c3201dc9b44#0 + +**Epoch** : 525 + +## Multiple Agents Voting Directly + + + + +**Transaction Hash** + - 626b64310f0976f4de2fd0bd85ebe481019c6d67d2b83a8d8bebe814c72f2723 + - 8c38a0f4625c30ef556d5f1aa3c40a3ba25ba8b26285e2a6fb02a22cd66f6652 + - 36eb0f174fb0f58a567bb403d4a365617c7abc3666a480711ac1c47d204eed7e + - 3a383fe969e2210ee843d4f863ec53037e53741a6dc3523c4ffd5074d4a7d357 + - 8318450e2bee736c73f0c790b8bf175301ab93745b35be1e988d6f051ac5f100 + + +## Event Based Agents Voting Autonomously + + + +**Governance Action ID** : +a5ea393f80a88320e457a1e4f5c8ffb4e198efe9ae798458fc13011f222f3a0c#0 + +**Transaction Hash** +- 976b6de916ecaa6294c8d0876e39f4df30781813bed92952e03fea340eb8ec26 +- fc5924655c91c8c0e3468128b5af702f6c83745591ad14d518d3fcee5856d790 + +## Multiple Agents Delegating to a DRep + + + +**DRep ID** : +766fea13963a6c27a98d4c48221548cc3e2d10ad7c085c5fb9936dfa + +**Transaction Hash** : +- 6970a725bc883ce08beb0240507b6886c60185cbb4ea3627362f62492404a5ed +- 4f4a5130c7285d3585345c5b1f89a6e184889039908b85a6ca5fd714f86ed34b +- dfc3262b717f7bec91cdea749599e31d8250a4552f0887bc9ab85b6d8c19c7f9 +- dfc3262b717f7bec91cdea749599e31d8250a4552f0887bc9ab85b6d8c19c7f9 +- c2604bccf2b35bbc172bfacf694b7a8b709188d8b427ad198c209f82c4c374ab \ No newline at end of file diff --git a/scenario/assets/preview/AgentsDelegation-preview.gif b/scenario/assets/preview/AgentsDelegation-preview.gif new file mode 100644 index 000000000..91c989e6f Binary files /dev/null and b/scenario/assets/preview/AgentsDelegation-preview.gif differ diff --git a/scenario/assets/preview/DirectVoting-preview.gif b/scenario/assets/preview/DirectVoting-preview.gif new file mode 100644 index 000000000..d22e5c250 Binary files /dev/null and b/scenario/assets/preview/DirectVoting-preview.gif differ diff --git a/scenario/assets/preview/EventBasedVoting-preview.gif b/scenario/assets/preview/EventBasedVoting-preview.gif new file mode 100644 index 000000000..c951b1f52 Binary files /dev/null and b/scenario/assets/preview/EventBasedVoting-preview.gif differ diff --git a/scenario/assets/preview/InfoAction-preview.gif b/scenario/assets/preview/InfoAction-preview.gif new file mode 100644 index 000000000..da272145e Binary files /dev/null and b/scenario/assets/preview/InfoAction-preview.gif differ diff --git a/scenario/assets/preview/NewConstitution-preview.gif b/scenario/assets/preview/NewConstitution-preview.gif new file mode 100644 index 000000000..404d3bf79 Binary files /dev/null and b/scenario/assets/preview/NewConstitution-preview.gif differ diff --git a/scenario/assets/preview/TresuryWithdrawal-preview.gif b/scenario/assets/preview/TresuryWithdrawal-preview.gif new file mode 100644 index 000000000..b20179855 Binary files /dev/null and b/scenario/assets/preview/TresuryWithdrawal-preview.gif differ diff --git a/scenario/assets/preview/UpdateCommittee-preview.gif b/scenario/assets/preview/UpdateCommittee-preview.gif new file mode 100644 index 000000000..c0b3552cf Binary files /dev/null and b/scenario/assets/preview/UpdateCommittee-preview.gif differ diff --git a/scenario/assets/sanchonet/AgentsDelegation-sanchonet.gif b/scenario/assets/sanchonet/AgentsDelegation-sanchonet.gif new file mode 100644 index 000000000..299f0037c Binary files /dev/null and b/scenario/assets/sanchonet/AgentsDelegation-sanchonet.gif differ diff --git a/scenario/assets/sanchonet/DirectVoting-sanchonet.gif b/scenario/assets/sanchonet/DirectVoting-sanchonet.gif new file mode 100644 index 000000000..ee7be1330 Binary files /dev/null and b/scenario/assets/sanchonet/DirectVoting-sanchonet.gif differ diff --git a/scenario/assets/sanchonet/EventBasedVoting-sanchonet.gif b/scenario/assets/sanchonet/EventBasedVoting-sanchonet.gif new file mode 100644 index 000000000..0f42f05de Binary files /dev/null and b/scenario/assets/sanchonet/EventBasedVoting-sanchonet.gif differ diff --git a/scenario/assets/sanchonet/InfoAction-sanchonet.gif b/scenario/assets/sanchonet/InfoAction-sanchonet.gif new file mode 100644 index 000000000..9c5f626bc Binary files /dev/null and b/scenario/assets/sanchonet/InfoAction-sanchonet.gif differ diff --git a/scenario/assets/sanchonet/NewConstitution-sanchonet.gif b/scenario/assets/sanchonet/NewConstitution-sanchonet.gif new file mode 100644 index 000000000..251f6c221 Binary files /dev/null and b/scenario/assets/sanchonet/NewConstitution-sanchonet.gif differ diff --git a/scenario/assets/sanchonet/TresuryWithdrawal-sanchonet.gif b/scenario/assets/sanchonet/TresuryWithdrawal-sanchonet.gif new file mode 100644 index 000000000..df3ccd410 Binary files /dev/null and b/scenario/assets/sanchonet/TresuryWithdrawal-sanchonet.gif differ diff --git a/scenario/assets/sanchonet/UpdateCommittee-sanchonet.gif b/scenario/assets/sanchonet/UpdateCommittee-sanchonet.gif new file mode 100644 index 000000000..337452872 Binary files /dev/null and b/scenario/assets/sanchonet/UpdateCommittee-sanchonet.gif differ