A service to learn about Olas agents and Open Autonomy.
- Python
>=3.10
- Tendermint
==0.34.19
- IPFS node
==0.6.0
- Pip
- Poetry
- Docker Engine
- Docker Compose
- Set Docker permissions so you can run containers as non-root user
-
Clone this repo:
git clone git@github.com:valory-xyz/academy-learning-service.git
-
Create the virtual environment:
cd academy-learning-service poetry shell poetry install
-
Sync packages:
autonomy packages sync --update-packages
-
Prepare a keys.json file containing wallet address and the private key for each of the four agents.
autonomy generate-key ethereum -n 4
-
Prepare a
ethereum_private_key.txt
file containing one of the private keys fromkeys.json
. Ensure that there is no newline at the end. -
Deploy two Safes on Gnosis (it's free) and set your agent addresses as signers. Set the signature threshold to 1 out of 4 for one of them and and to 3 out of 4 for the other. This way we can use the single-signer one for testing without running all the agents, and leave the other safe for running the whole service.
-
Create a Tenderly account and from your dashboard create a fork of Gnosis chain (virtual testnet).
-
From Tenderly, fund your agents and Safe with some xDAI and OLAS (
0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f
). -
Make a copy of the env file:
cp sample.env .env
-
Fill in the required environment variables in .env. These variables are:
ALL_PARTICIPANTS
: a list of your agent addresses. This will vary depending on whether you are running a single agent (run_agent.sh
script) or the whole 4-agent service (run_service.sh
)GNOSIS_LEDGER_RPC
: set it to your Tenderly fork Admin RPC.COINGECKO_API_KEY
: you will need to get a free Coingecko API key.TRANSFER_TARGET_ADDRESS
: any random address to send funds to, can be any of the agents for example.SAFE_CONTRACT_ADDRESS_SINGLE
: the 1 out of 4 agents Safe address.SAFE_CONTRACT_ADDRESS
: the 3 out of 4 Safe address.
-
Verify that
ALL_PARTICIPANTS
in.env
contains only 1 address. -
Run the agent:
bash run_agent.sh
-
Verify that
ALL_PARTICIPANTS
in.env
contains 4 address. -
Check that Docker is running:
docker
-
Run the service:
bash run_service.sh
-
Look at the service logs for one of the agents (on another terminal):
docker logs -f learningservice_abci_0