In a separate terminal, use hardhat to run a local fork of Ethereum
npx hardhat node --fork {RPC_URL}
Enter the hardhat private key in the .env
file:
HARDHAT_PRIVATE_KEY=<your_private_key>
First, install Geth (Go Ethereum) using the following commands:
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install geth
To create a new Ethereum account and keyfile:
geth account new
This command will:
- Prompt you to enter a password
- Generate a new keyfile in the default directory (
~/.ethereum/keystore/
) - Output your new account address
Note: Keep your password and keyfile secure. Loss of either will result in loss of access to your account.
This keyfile can be used as the key_path
parameter in the ZWallet
class.
If no key_path is provided, the default path will be used: ./keyfile
wallet = ZWallet(key_path='~/.ethereum/keystore/<keyfile>')
Set your keyfile password in the .env
file:
KEY_PASSWORD=<your_password>
You will also need to set the following environment variables:
RPC_URL
OPENAI_API_KEY
poetry install
poetry run agent
- Receive tokens to the agent controlled wallet
- Check wallet balance
- Transfer tokens
- Swap tokens on Uniswap V3