A server that initializes and manages a Solana Agent for onchain interactions using LangChain and OpenAI.
- Dynamic agent initialization with configurable LLM parameters
- Secure wallet generation and management
- Real-time chat interface with the agent
- Wallet address retrieval endpoint
POST /init
Request body:
{
"OPENAI_API_KEY": "your-api-key",
"RPC_URL": "your-rpc-url",
"llm": {
"modelName": "gpt-4o-mini", // optional, default: "gpt-4o-mini"
"temperature": 0.7 // optional, default: 0.7
}
}
POST /chat
Request body:
{
"message": "your message here"
}
GET /wallet
- Install dependencies:
npm install
- Start the server:
npm run start
The server will run on port 8000 by default. You can change this by setting the PORT
environment variable.
- Build the TypeScript code:
npm run build
- Run in development mode:
npm run dev
docker build -t solana-agent-kit:latest .
docker save solana-agent-kit:latest -o solana-agent-kit.tar
oyster-cvm build --platform amd64 --docker-compose ./docker-compose.yml --docker-images ./solana-agent-kit.tar
Upload the generated result/image.eif
to a remote file server that's accessible via HTTP/HTTPS.
oyster-cvm -- deploy \
--image-url <image-url> \
--region ap-south-1 \
--wallet-private-key <wallet-secret> \
--instance-type c6a.xlarge \
--operator {operator-addr} \
--duration-in-minutes 60 \
--bandwidth 100
The following variables are set automatically during initialization:
OPENAI_API_KEY
: OpenAI API key for LLM interactionsRPC_URL
: Solana RPC URL for blockchain interactionsSOLANA_PRIVATE_KEY
: Generated wallet's private key (base58 encoded)SOLANA_PUBLIC_KEY
: Generated wallet's public key (base58 encoded)