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

chore: pass env variables when setting up GOAT and update GOAT readme #898

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

0xaguspunk
Copy link
Contributor

Risks

Low

Background

What does this PR do?

This PR aims to easily pass secrets to the GOAT plugin as well as improve its readme.

Problem:
Currenlty secrets can only be used by plugins when calling an action or a provider. If a plugin requires an initial setup such as setting up a wallet or a GOAT plugin (e.g adding Polymarket or Uniswap plugins) there is no way to achieve this.

Solution:
Update the GOAT plugin to get passed a getSecrets function for the specific character it is adding actions to. This allows GOAT to check the secrets/env variables and configure its plugins accordingly when being initialized.

What kind of change is this?

Improvements: This change allows developers to install GOAT plugins easily such as Polymarket, Uniswap and Coingecko. It also makes it easier to update the plugin to support multi-chain.

Documentation changes needed?

My changes do not require a change to the project documentation.

Testing

Where should a reviewer start?

  1. Go to plugin-goat

Detailed testing steps

  1. Make sure you have an EVM_PRIVATE_KEY and EVM_PROVIDER_URL for Base set
  2. Comment out evmPlugin in src/agent.ts
  3. Run the agent and prompt it with: What's the USDC balance of 0x18Bead774f927Af586F86F6d054C269416E163DD
  4. Should give you the balance of 0x18Bead774f927Af586F86F6d054C269416E163DD

To test actions on Base Sepolia simply:

  1. Go to plugin-goat/src/wallet.ts and change
const chain = base 

to

const chain = sepolia
  1. Make sure EVM_PROVIDER_URL works for Sepolia
  2. Run the agent!

Discord username

aguspunk

@cygaar
Copy link
Collaborator

cygaar commented Dec 7, 2024

we're currently in the process of refactoring how plugins are setup and initiated so we'll probably hold off on merging this for now

@0xaguspunk
Copy link
Contributor Author

oh nice, any ETA for that @cygaar ? :)

@odilitime odilitime merged commit c62a518 into elizaOS:main Dec 10, 2024
1 check passed
jnaulty added a commit to jnaulty/eliza that referenced this pull request Dec 11, 2024
- NodePlugin is now only created when all required AWS credentials are present
  (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_S3_BUCKET)
- GoatPlugin is now only created when ALCHEMY_API_KEY is present
- Added type annotations for plugins to handle undefined cases

These changes prevent unnecessary plugin initialization when required
credentials are missing and improve type safety.

Issues introduced in: elizaOS#941 and
elizaOS#898
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