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

Support different networks #32

Merged
merged 15 commits into from
Mar 29, 2024
Merged

Conversation

jmoreira-valory
Copy link
Collaborator

@jmoreira-valory jmoreira-valory commented Mar 28, 2024

Support different networks through configuration file configs/mechs.json, and also overriding configuration using environment variables starting with MECHX_:

MECHX_LEDGER_ADDRESS
MECHX_LEDGER_CHAIN_ID
MECHX_LEDGER_POA_CHAIN
MECHX_LEDGER_DEFAULT_GAS_PRICE_STRATEGY
MECHX_LEDGER_IS_GAS_ESTIMATION_ENABLED

MECHX_CHAIN_RPC
MECHX_WSS_ENDPOINT
MECHX_GAS_LIMIT
MECHX_CONTRACT_ABI_URL
MECHX_SUBGRAPH_URL

Breaking changes

Environment variable renaming:

MANUAL_GAS_LIMIT --> MECHX_GAS_LIMIT
WEBSOCKET_ENDPOINT --> MECHX_WSS_ENDPOINT

mech_client/cli.py Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@jmoreira-valory jmoreira-valory left a comment

Choose a reason for hiding this comment

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

NOTE: All subgraphs endpoint are wrong (except for gnosis). Therefore, it will not work until fixed.

mech_client/configs/mechs.json Outdated Show resolved Hide resolved
mech_client/configs/mechs.json Outdated Show resolved Hide resolved
mech_client/configs/mechs.json Outdated Show resolved Hide resolved
@@ -27,7 +27,7 @@
},
"gas_limit": 100000,
"contract_abi_url": "https://api.arbiscan.io/api?module=contract&action=getabi&address={contract_address}",
"subgraph_url": "https://api.studio.thegraph.com/query/57238/mech/version/latest"
"subgraph_url": ""
Copy link
Contributor

Choose a reason for hiding this comment

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

keep missing values empty for clarity

},
"base": {
"agent_registry_contract": "0x88DE734655184a09B70700aE4F72364d1ad23728",
"rpc_url": "https://base.llamarpc.com",
"wss_endpoint": "wss://base-rpc.publicnode.com",
"wss_endpoint": "wss://base.gateway.tenderly.co",
Copy link
Contributor

Choose a reason for hiding this comment

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

other one doesn't work

@@ -56,8 +56,8 @@
"is_gas_estimation_enabled": false
},
"gas_limit": 100000,
"contract_abi_url": "https://base.blockscout.com/api/v2/smart-contracts/{contract_address}",
"subgraph_url": "https://api.studio.thegraph.com/query/57238/mech/version/latest"
"contract_abi_url": "https://api.basescan.org/api?module=contract&action=getabi&address={contract_address}",
Copy link
Contributor

Choose a reason for hiding this comment

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

other one doesn't work

:return: The agent address if found, None otherwise.
:rtype: Optional[str]
"""
# temporary hard coded until subgraph present
Copy link
Contributor

Choose a reason for hiding this comment

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

temporary

Copy link
Contributor

@DavidMinarsch DavidMinarsch left a comment

Choose a reason for hiding this comment

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

merging this for now onto main

@DavidMinarsch DavidMinarsch merged commit 88fb917 into main Mar 29, 2024
1 check passed
@DavidMinarsch DavidMinarsch deleted the feat/support_different_networks branch March 29, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants