eliza icon indicating copy to clipboard operation
eliza copied to clipboard

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

Open 0xaguspunk opened this issue 2 months ago • 2 comments

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

0xaguspunk avatar Dec 07 '24 14:12 0xaguspunk