This is a demo that allows a user to run a market creator agent and a trader agent via a script.
To get started, the user must mint the services on-chain
and populate three .env files as follows:
.creator.env: this environment file should contain the variables for the market creator service.trader.env: this environment file should contain the variables for the trader service.demo.env: this environment file should contain the variables for the demo
- Python
== 3.10 - Pipenv
>=2021.x.xx - Tendermint
==v0.34.19
The script automatically installs Tendermint v0.34.19 if it is not present in your system.
Two Gnosis addresses, and corresponding secret keys, are recommended to be created for this demo:
-
Gnosis address #1 is associated with the trader agent (and you need to replace the field
TRADER_AGENT_ADDRESSin the file.trader.envwith that address). The corresponding private key needs to be set as the value of the env variableTRADER_P_KEYin the file .demo.env -
Another Gnosis address #2 is associated with the market creator agent (and you need to replace the field
CREATOR_AGENT_ADDRESSin the file.market.envwith that address). The corresponding private key needs to be set as the value of the env variableCREATOR_P_KEYin the file.demo.env
Other variables that need to be filled in with your own values are:
OPENAI_API_KEYandETHEREUM_LEDGER_RPCin the file.creator.envOMEN_CREATORSandRPC_0in the file.trader.env
Finally, the trader agent runs as part of a trader service, which is an autonomous service that is represented on-chain in the Autonolas protocol by a Safe multisig, corresponding to the variable SAFE_CONTRACT_ADDRESS in the file .trader.env. Follow the next steps to compute the Safe address corresponding to your agent address:
- Visit https://registry.olas.network/services/mint and connect to the Gnosis network. For this demo we recommend connecting using a wallet with a Gnosis EOA account that you own.
- In the field "Owner address" input a Gnosis address for which you will be able to sign later using a supported wallet. If you want to use the address you're connected to click on "Prefill Address".
- Click on "Generate Hash & File" and enter the value
bafybeicgjqgkf2wv54rows3lw4qxnaqnxannumuonh6vahb3ldlzu7cyhi - In the field "Canonical agent Ids" enter the number
12 - In the field "No. of slots to canonical agent Ids" enter the number
1 - In the field "Cost of agent instance bond (wei)" enter the number
10000000000000000 - In the field "Threshold" enter the number
1 - Press the "Submit" button. Your wallet will ask you to approve the transaction. Once the transaction is settled, you should see a message indicating that the service NFT has been minted successfully. You should also see that the service is in Pre-Registration state.
- Next, you can navigate to https://registry.olas.network/services#my-services, select your service and go through the steps:
- Activate registration
- Register agents: here, you must use the value that you set previously for
TRADER_AGENT_ADDRESS. - This is the last step. A transaction for the safe's deployment is already prepared and needs to be executed.
- After completing the process you will be able to retrieve the value for the variable
SAFE_CONTRACT_ADDRESSfrom the field "Safe contract address" as shown in an example below
Finally run the demo script:
./demo.shTwo folders will be generated, one for each agent. Among other contents, the logs are accessible within the folders.
A demo video is available.
![Safe address field]](/dagacha/prediction-markets/raw/main/img/safe_address_screenshot.png)