Before you begin, ensure you have the following prerequisites:
- Docker and Docker Compose: Required for the Docker setup method.
- Python 3.11+: Necessary for the manual setup approach.
- A Funded Wallet and Corresponding Private Key: Your wallet should be funded enough to cover transaction fees.
- Deployed oracle contract address: Make sure you have deployed the Oracle contract. For guidance, refer to the Oracle contract deployment instructions.
- Serper API key: Needed for the
web_search
tool. Obtain your key from Serper. - OpenAI API key: Required for Large Language Model (LLM) inference. Get your API key from OpenAI
Ensure that your Oracle smart contract is deployed and your wallet address is whitelisted to interact with it.
Create a .env
file in the project root with the content updated to your values:
PRIVATE_KEY="[whitelisted wallet private key]"
ORACLE_ADDRESS="[oracle smart contract address]"
OPEN_AI_API_KEY="[openai api key]"
SERPER_API_KEY="[serper api key]"
For more configuration parameters, see template.env
This setup simplifies running the oracle with Docker Compose, which requires Docker Compose installed.
- With
.env
configured as described, start the oracle:
docker-compose up
It's recommended to set up a Python virtual environment:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
With the virtual environment active, run:
python oracle.py
python -m pytest tests/unit
python -m pytest tests/integration
Verify your API keys and network connectivity if encountering issues with Serper or OpenAI APIs. For Docker or Python setup errors, ensure all prerequisites are correctly installed.