Deploying Agents to Galadriel Network
This guide covers how to deploy your agents to the Galadriel network using the Galadriel CLI. The CLI provides a comprehensive set of commands to manage the entire agent lifecycle - from initialization and development to deployment and monitoring.
Prerequisites
Before deploying your agent, ensure you have:
- Installed the Galadriel package
- Docker installed and running (for build/publish operations)
- A Galadriel API key
- Docker Hub credentials (for publishing images)
Installation
Install the Galadriel package using pip:
Agent Lifecycle Management
Initializing a New Agent
Create a new agent project with all necessary files and structure:
This interactive command will prompt you for:
- Agent name
The command creates:
- Basic agent structure
- Docker configuration
- Environment files
- Required Python files
Building Your Agent
Build the Docker image for your agent:
Options:
--image-name
: Name for the Docker image (default: “agent”)
Publishing Your Agent
Push the agent’s Docker image to Docker Hub:
Options:
--image-name
: Name for the Docker image (default: “agent”)
Deploying Your Agent
Build, publish and deploy the agent to the Galadriel platform:
Options:
--image-name
: Name for the Docker image (default: “agent”)--skip-build
: Skip building the Docker image--skip-publish
: Skip publishing the Docker image to Docker Hub
When you deploy an agent, you’ll receive an agent ID. Save this ID as you’ll need it for future operations like checking state or updating the agent.
Updating an Existing Agent
Update an agent that’s already deployed on the Galadriel platform:
Required:
--agent-id
: ID of the agent to update
Options:
--image-name
: Name for the Docker image (default: “agent”)
Monitoring Your Agent
Retrieve the current state of a deployed agent:
Required:
--agent-id
: ID of the deployed agent
Listing All Deployed Agents
Get information about all your deployed agents:
Removing a Deployed Agent
Remove a deployed agent from the Galadriel platform:
Required:
AGENT_ID
: ID of the agent to destroy
Configuration Files
.env
This file contains environment variables required for deployment:
Keep your API keys and credentials secure. Never commit this file to version control.
.agents.env
This file contains environment variables for the agent runtime:
Do not include deployment credentials in this file. This file is for agent-specific configuration only.
Wallet Management
For agents that interact with the Solana blockchain, the Galadriel CLI provides wallet management commands.
Creating a Wallet
Create a new Solana wallet:
Options:
--path
: Path to save the wallet key file (default: ”~/.galadriel/solana/default_key.json”)
Importing an Existing Wallet
Import an existing wallet:
Options:
--private-key
: Private key of the wallet to import in JSON format--path
: Path to the wallet key file to import
You must provide either --private-key
or --path
, but not both.
Requesting an Airdrop
Request an airdrop of 0.001 SOL to your Solana wallet:
Deployment Example
Here’s a complete example of creating and deploying a new agent:
Troubleshooting
If you encounter issues during deployment:
- Ensure Docker is running before using build/publish commands
- Verify your Galadriel API key is valid
- Check that your Docker Hub credentials are correct
- Confirm your
.env
and.agents.env
files are properly configured - Make sure you have necessary permissions on Docker Hub