A confidential bot designed to interact with blockchain environments and potentially other services, running within a secure enclave.
- Secure execution within a Trusted Execution Environment (TEE).
- Interaction with Ethereum, Base, and Polygon networks.
- Configurable via environment variables.
- Containerized deployment using Docker.
- Python 3.x
- pip (Python package installer)
- Docker (optional, for containerized deployment)
- Git
-
Clone the repository:
git clone <your-repository-url> # Replace with your actual repository URL cd flare-bot
-
Create and activate a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables: Copy the template file
.env.templateto a new file named.env:cp .env.template .env
Open the
.envfile and fill in the required values with your specific configuration details (API keys, RPC URLs, wallet information, etc.). Never commit your.envfile to version control.
Ensure your virtual environment is activated and your .env file is configured.
# Example command to run the bot (Update if necessary based on your entry point)
# python src/main.py # Or potentially a script from the scripts/ directory
echo "Please update this command with the actual way to run the bot."Note: Check the src/ or scripts/ directory for the main execution script or command.
-
Build the Docker image: Make sure Docker is running.
docker build -t flare-bot . -
Run the Docker container: Ensure your
.envfile is correctly configured in the project root directory.docker run --env-file .env flare-bot
(Note: For TEE deployment, refer to the specific instructions related to confidential VMs and the
TEE_IMAGE_REFERENCEvariable).
The bot uses environment variables for configuration, loaded from the .env file at runtime. The following variables are defined in .env.template:
INSTANCE_NAME: Name for the confidential VM instance (e.g.,flare-swap-app).TEE_IMAGE_REFERENCE: Docker image reference for the TEE (e.g.,ghcr.io/your-username/your-repo/flare-swap-app:latest).SIMULATE_ATTESTATION: Set totrueto simulate attestation if needed (falseby default).GITHUB_TOKEN: Your GitHub personal access token (if required by the bot).GEMINI_API_KEY: Your API key for Google Gemini services.ETHEREUM_RPC_URL: RPC endpoint URL for the Ethereum network.BASE_RPC_URL: RPC endpoint URL for the Base network.POLYGON_RPC_URL: RPC endpoint URL for the Flare network.WALLET_ADDRESS: Your blockchain wallet address used by the bot.PRIVATE_KEY: The private key associated with theWALLET_ADDRESS. Handle with extreme care.REACT_APP_RAINBOW_PROJECT_ID: Project ID for RainbowKit (if used in a related frontend).
To run the automated tests (assuming tests are located in the tests/ directory and use pytest):
pip install pytest # If not already installed
pytest tests/Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
[Specify the project license here, e.g., MIT, Apache 2.0, etc.]