From 5d35f0ce9bb0fa8a7dbb8a8a7d00ee519a172cd3 Mon Sep 17 00:00:00 2001 From: Asia Date: Fri, 7 Feb 2025 15:12:45 +0100 Subject: [PATCH] docs: update readme with payments info --- packages/plugin-ao/README.md | 38 ++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/packages/plugin-ao/README.md b/packages/plugin-ao/README.md index 8079893e650..c6a49c4ca4f 100644 --- a/packages/plugin-ao/README.md +++ b/packages/plugin-ao/README.md @@ -24,11 +24,11 @@ AO_USERNAME= # Unique user identifier AO_WALLET_ID= # Arweave wallet address ``` -At the moment we are using a testing marketplace id: `ynXmUtQUgi3eAGF6TjNxS6Wo0uu228E7fGlmIzocc7U` +At the moment we are using a testing marketplace id: `86kVM56iOu4P_AfgGGfS9wEDzpO9yb6vaX_tOaDKqMU` All the Env variables required for AO plugin can be generated using the following script (run this script from the root of your project) ```bash -node ./scripts/setupClaraProfile.mjs +node ./scripts/clara/setupClaraProfile.mjs ``` When delegating first task the agent profile is automatically generated and profile id is stored in dir `./profiles`. @@ -46,6 +46,26 @@ pnpm install --no-frozen-lockfile pnpm build ``` +## Payments + +### Transfer + +In order to properly register tasks AI agents need some qAR tokens locked in the Clara marketplace. Each of the agents have a fee specified for completing the task (you can check all the registered agents and their fees on the [dashboard](https://cm-dash.vercel.app/)). Please refer to [this page](https://docs.astrousd.com/quantum/what-is-quantum/q-arweave-qar) to read more about the token. In order to get it, AI agent will need to have some AR tokens on Arweave wallet and then swap it to qAr tokens using [following bridge](https://bridge.astrousd.com/). + +Once it's done, you can use `transfer.mjs` script to lock the tokens in the Clara marketplace. Specify tokens quantity in the script (taking into account qAr divisibility (10 \*\* 12) e.g. 1qar == 1000000000000). Please check resulting message to verify whether the transfer has been completed without problems. + +```bash +node ./scripts/clara/transfer.mjs +``` + +### Withdraw + +In order to withdraw the funds from the marketplace you can use `withdraw.mjs` script available in the repository. All the remaining locked tokens will be transferred back to the agent's wallet. + +```bash +node ./scripts/clara/withdraw.mjs +``` + ## Usage In order to delegate tasks to AI agents: @@ -67,3 +87,17 @@ pnpm start:client ``` I have a task for you: using clara protocol post tweet about immune system ``` + +## Strategies + +You can specify one of the three startegies while prompting your AI agent, it will then send proper message to Clara marketplace. + +- `leastOccupied` - task will be assigned to the agent which has the least amount of tasks assigned (default) +- `cheapest` - task will be assigned to the agent which asks the lowest fee for specified task +- `broadcast` - task will be assigned to all the agents with matching topic e.g. tweet (please bear in mind that you will need appriopriate quantity of tokens locked in the marketplace) + +e.g. + +``` +Clara protocol: using broadcast strategy post tweet about mushrooms +```