Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Support Optimus #11

Merged
merged 80 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
8d222ce
Feat: Support Optimus
OjusWiZard Jan 1, 2025
0645102
added optimus test support
Mohsinsiddi Jan 8, 2025
27e827b
updated github ci file
Mohsinsiddi Jan 8, 2025
e2fcfb8
updated github ci file to include latest env secrets
Mohsinsiddi Jan 8, 2025
f85bca1
updated cls.child.logfile = None
Mohsinsiddi Jan 8, 2025
544d78a
updated TS fie to make RPC HIDDEN
Mohsinsiddi Jan 8, 2025
34aa0cd
added a ensure_service_stopped handler
Mohsinsiddi Jan 8, 2025
c0b9d88
add handle to delete temp folder for ubuntu
Mohsinsiddi Jan 8, 2025
0e8623f
updated
Mohsinsiddi Jan 8, 2025
b131cc3
updated
Mohsinsiddi Jan 8, 2025
ff178b5
test 1
Mohsinsiddi Jan 9, 2025
d9d093a
test 1
Mohsinsiddi Jan 9, 2025
4a9463a
test 1
Mohsinsiddi Jan 9, 2025
a956b4b
test wip
Mohsinsiddi Jan 9, 2025
492ca66
added 20 sec delay (optimus only) for CI test
Mohsinsiddi Jan 9, 2025
153ac25
added 20 sec delay (optimus only) for CI test
Mohsinsiddi Jan 9, 2025
dadb998
added 20 sec delay (optimus only) for CI test
Mohsinsiddi Jan 9, 2025
f4b08ce
increased funding amount to 100 ETH from 44 ETH for optimus
Mohsinsiddi Jan 9, 2025
f9f583c
increased funding amount to 100 ETH from 44 ETH for optimus
Mohsinsiddi Jan 9, 2025
b5d0223
increased funding amount to 100 ETH from 44 ETH for optimus
Mohsinsiddi Jan 9, 2025
3683950
added backup owner
Mohsinsiddi Jan 9, 2025
1b6e785
added backup owner
Mohsinsiddi Jan 9, 2025
c0ab997
updated cleanup_directory
Mohsinsiddi Jan 9, 2025
55821f5
updated cleanup_directory
Mohsinsiddi Jan 9, 2025
9c4836c
updated the code with PR review
Mohsinsiddi Jan 9, 2025
0ad545a
updated ci yaml file
Mohsinsiddi Jan 9, 2025
92bd763
just optimus test
Mohsinsiddi Jan 9, 2025
349e805
just optimus test
Mohsinsiddi Jan 9, 2025
c6612fe
updated check_docker_status handler
Mohsinsiddi Jan 9, 2025
322dd72
added config files to further tests
Mohsinsiddi Jan 9, 2025
000802d
Feat: Support Optimus
OjusWiZard Jan 1, 2025
36bdfd8
added optimus test support
Mohsinsiddi Jan 8, 2025
1af177e
updated github ci file
Mohsinsiddi Jan 8, 2025
25909eb
updated github ci file to include latest env secrets
Mohsinsiddi Jan 8, 2025
74aac78
updated cls.child.logfile = None
Mohsinsiddi Jan 8, 2025
9b3a375
updated TS fie to make RPC HIDDEN
Mohsinsiddi Jan 8, 2025
ce1e1ac
added a ensure_service_stopped handler
Mohsinsiddi Jan 8, 2025
e4b32ec
add handle to delete temp folder for ubuntu
Mohsinsiddi Jan 8, 2025
2640633
updated
Mohsinsiddi Jan 8, 2025
54e2a25
updated
Mohsinsiddi Jan 8, 2025
61b2b3b
test 1
Mohsinsiddi Jan 9, 2025
7465176
test 1
Mohsinsiddi Jan 9, 2025
1e4dc2a
test 1
Mohsinsiddi Jan 9, 2025
b2a7eb3
test wip
Mohsinsiddi Jan 9, 2025
ef3466c
added 20 sec delay (optimus only) for CI test
Mohsinsiddi Jan 9, 2025
6554ef7
added 20 sec delay (optimus only) for CI test
Mohsinsiddi Jan 9, 2025
6cd4dd4
added 20 sec delay (optimus only) for CI test
Mohsinsiddi Jan 9, 2025
02572a1
increased funding amount to 100 ETH from 44 ETH for optimus
Mohsinsiddi Jan 9, 2025
3b6b3ab
increased funding amount to 100 ETH from 44 ETH for optimus
Mohsinsiddi Jan 9, 2025
a661b18
increased funding amount to 100 ETH from 44 ETH for optimus
Mohsinsiddi Jan 9, 2025
129e134
added backup owner
Mohsinsiddi Jan 9, 2025
4c834d5
added backup owner
Mohsinsiddi Jan 9, 2025
676beba
updated cleanup_directory
Mohsinsiddi Jan 9, 2025
b9f8fb2
updated cleanup_directory
Mohsinsiddi Jan 9, 2025
9c872b7
updated the code with PR review
Mohsinsiddi Jan 9, 2025
7a3dd9e
updated ci yaml file
Mohsinsiddi Jan 9, 2025
476ff4b
just optimus test
Mohsinsiddi Jan 9, 2025
3ac8741
just optimus test
Mohsinsiddi Jan 9, 2025
84b7eee
updated check_docker_status handler
Mohsinsiddi Jan 9, 2025
cb3ea6b
added config files to further tests
Mohsinsiddi Jan 9, 2025
e1bd2ae
updated check_docker_status handler to check new release based contai…
Mohsinsiddi Jan 13, 2025
7c56c48
updated base config to resolve ens issue
Mohsinsiddi Jan 13, 2025
432a1ed
Merge pull request #16 from valory-xyz/fix/new_container_names
Mohsinsiddi Jan 13, 2025
0ae84c1
WIP for memeooorr tests
Mohsinsiddi Jan 13, 2025
4a46d63
updated container names handler
Mohsinsiddi Jan 13, 2025
3be85ea
updated container names handler
Mohsinsiddi Jan 13, 2025
9ceb5a6
updated prompts to be precise
Mohsinsiddi Jan 13, 2025
d2f6bc4
latest script
Mohsinsiddi Jan 13, 2025
a1173b6
latest script
Mohsinsiddi Jan 13, 2025
4ed7ebb
latest script
Mohsinsiddi Jan 13, 2025
43f8acb
updated for delay in sendLine
Mohsinsiddi Jan 13, 2025
fa9dd3b
added \n for all OS compatiblity in prompts
Mohsinsiddi Jan 13, 2025
5ac6b47
updated get_base_config
Mohsinsiddi Jan 13, 2025
3fe0bfc
updated ci file
Mohsinsiddi Jan 13, 2025
82860a8
updated test file
Mohsinsiddi Jan 13, 2025
816427c
fixed TypeError: unsupported operand type(s) for +: 'function' and '…
Mohsinsiddi Jan 13, 2025
e12e1d4
updated test script
Mohsinsiddi Jan 13, 2025
25d4539
updated test script
Mohsinsiddi Jan 13, 2025
14f6d62
Merge pull request #17 from Mohsinsiddi/fix/ens_invalid
Mohsinsiddi Jan 13, 2025
230480d
Merge pull request #13 from valory-xyz/feat/testing_optimus
OjusWiZard Jan 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ jobs:
test:
runs-on: ubuntu-latest
env:
RPC_URL: ${{ secrets.RPC_URL }}
BACKUP_WALLET: ${{ secrets.BACKUP_WALLET }}
GNOSIS_RPC_URL: ${{ secrets.GNOSIS_RPC_URL }}
MODIUS_RPC_URL: ${{ secrets.MODIUS_RPC_URL }}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MODIUS_RPC_URL: ${{ secrets.MODIUS_RPC_URL }}
MODE_RPC_URL: ${{ secrets.MODE_RPC_URL }}

the chain is called Mode

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mohsinsiddi pls consider this in the PR for Memeooorr's test

OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }}
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }}
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
DOCKER_LOGS_DIR: ${GITHUB_WORKSPACE}/logs

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4 # Updated from v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5 # Updated from v4
with:
python-version: '3.10'

Expand Down Expand Up @@ -84,23 +85,23 @@ jobs:

- name: Create .env file
run: |
echo "RPC_URL=${RPC_URL}" > .env
echo "BACKUP_WALLET=${BACKUP_WALLET}" >> .env
echo "GNOSIS_RPC_URL=${GNOSIS_RPC_URL}" > .env
echo "MODIUS_RPC_URL=${MODIUS_RPC_URL}" >> .env
echo "OPTIMISM_RPC_URL=${OPTIMISM_RPC_URL}" >> .env
echo "BASE_RPC_URL=${BASE_RPC_URL}" >> .env
echo "TEST_PASSWORD=${TEST_PASSWORD}" >> .env
echo "PRIVATE_KEY=${PRIVATE_KEY}" >> .env
echo "DOCKER_LOGS_DIR=${DOCKER_LOGS_DIR}" >> .env

- name: Install project dependencies
run: |
python -m pip install --upgrade pip
poetry env use python3.10
poetry install --no-interaction


- name: Run tests
run: |
# Run the tests with debug logging
poetry run pytest -v tests/test_run_service.py -s --log-cli-level=DEBUG
poetry run pytest -v tests/test_run_service.py -s --log-cli-level=INFO

- name: Debug container failure
if: failure()
Expand All @@ -116,17 +117,14 @@ jobs:
echo "=== Inspect for $container ==="
docker inspect $container
done

echo "==== Directory permissions ===="
ls -la /logs/
ls -la ${GITHUB_WORKSPACE}/logs/

- name: Upload test logs
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4 # Updated from v3
with:
name: test-logs
path: |
logs/
/logs/
.env
.env
retention-days: 30 # Added retention period
140 changes: 140 additions & 0 deletions configs/config_optimus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"name": "Optimus",
"agent_id": 40,
"hash": "bafybeihqho73he6mirkodg4ubom6ngf2nkgebhmxr435yxpsxgsthu5nvy",
"description": "Optimus",
"image": "https://gateway.autonolas.tech/ipfs/bafybeiaakdeconw7j5z76fgghfdjmsr6tzejotxcwnvmp3nroaw3glgyve",
"service_version": "v0.18.1",
"home_chain": "optimistic",
"configurations": {
"optimistic": {
"nft": "bafybeiaakdeconw7j5z76fgghfdjmsr6tzejotxcwnvmp3nroaw3glgyve",
"threshold": 1,
"use_mech_marketplace": false,
"fund_requirements": {
"0x0000000000000000000000000000000000000000": {
"agent": 5000000000000000,
"safe": 15000000000000000
},
"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85": {
"agent": 0,
"safe": 40000000
}
}
},
"base": {
"nft": "bafybeiaakdeconw7j5z76fgghfdjmsr6tzejotxcwnvmp3nroaw3glgyve",
"threshold": 1,
"use_mech_marketplace": false,
"fund_requirements": {
"0x0000000000000000000000000000000000000000": {
"agent": 5000000000000000,
"safe": 15000000000000000
},
"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913": {
"agent": 0,
"safe": 40000000
}
}
},
"mode": {
"nft": "bafybeiaakdeconw7j5z76fgghfdjmsr6tzejotxcwnvmp3nroaw3glgyve",
"threshold": 1,
"use_mech_marketplace": false,
"fund_requirements": {
"0x0000000000000000000000000000000000000000": {
"agent": 5000000000000000,
"safe": 15000000000000000
},
"0xd988097fb8612cc24eeC14542bC03424c656005f": {
"agent": 0,
"safe": 40000000
}
}
}
},
"staking_programs": {
"no_staking": "0x0000000000000000000000000000000000000000",
"optimus_alpha": "0x88996bbdE7f982D93214881756840cE2c77C4992"
},
"env_variables": {
"SAFE_CONTRACT_ADDRESSES": {
"name": "Safe contract addresses",
"description": "",
"value": "",
"provision_type": "computed"
},
"TENDERLY_ACCESS_KEY": {
"name": "Tenderly API Key",
"description": "Tenderly API Key can be obtained at https://dashboard.tenderly.co/",
"value": "",
"provision_type": "user"
},
"TENDERLY_ACCOUNT_SLUG": {
"name": "Tenderly Account Slug",
"description": "Tenderly Account Slug can be obtained at https://dashboard.tenderly.co/",
"value": "",
"provision_type": "user"
},
"TENDERLY_PROJECT_SLUG": {
"name": "Tenderly Project Slug",
"description": "Tenderly Project Slug can be obtained at https://dashboard.tenderly.co/",
"value": "",
"provision_type": "user"
},
"STAKING_TOKEN_CONTRACT_ADDRESS": {
"name": "Staking Token Contract Address",
"description": "",
"value": "",
"provision_type": "computed"
},
"COINGECKO_API_KEY": {
"name": "Coingecko API Key",
"description": "Coingecko API Key will be used to fetch the prices of the tokens. Get your key at https://www.coingecko.com/en/api",
"value": "",
"provision_type": "user"
},
"STAKING_CHAIN": {
"name": "",
"description": "",
"value": "",
"provision_type": "computed"
},
"STAKING_ACTIVITY_CHECKER_CONTRACT_ADDRESS": {
"name": "",
"description": "",
"value": "0x7Fd1F4b764fA41d19fe3f63C85d12bf64d2bbf68",
"provision_type": "fixed"
},
"MIN_SWAP_AMOUNT_THRESHOLD": {
"name": "Minimum Investment",
"description": "Minimum Investment amount is the minimum amount of USD on both USDC and ETH tokens that the agent will invest. Enter at least 15.",
"value": "15",
"provision_type": "fixed"
},
"ALLOWED_CHAINS": {
"name": "",
"description": "",
"value": "[\"optimism\",\"mode\",\"base\"]",
"provision_type": "fixed"
},
"TARGET_INVESTMENT_CHAINS": {
"name": "",
"description": "",
"value": "[\"optimism\",\"mode\",\"base\"]",
"provision_type": "fixed"
},
"INITIAL_ASSETS": {
"name": "",
"description": "",
"value": "{\"optimism\":{\"0x0000000000000000000000000000000000000000\":\"ETH\",\"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85\":\"USDC\"}}",
"provision_type": "fixed"
},
"SELECTED_STRATEGIES": {
"name": "",
"description": "",
"value": "[\"merkl_pools_search\",\"balancer_pools_search\",\"asset_lending\"]",
"provision_type": "fixed"
}
}
}
Loading
Loading