A Telegram bot that lets users rent Google Cloud Platform (GCP) virtual machines and pay with Solana (SOL) cryptocurrency.
Try it now!
This Project currenly works on Devnet. Make sure to change your Wallet RPC before payment.
SolVM is a complete solution for renting cloud-based virtual machines through a Telegram interface. Users can:
- Browse available VM configurations
- Rent VMs with different resource tiers
- Pay for VM usage using Solana cryptocurrency
- Manage their active VMs
- Access VM usage statistics
The system automatically handles payment processing on the Solana blockchain, VM provisioning in Google Cloud, and expiration of VMs based on the rental period.
The project is built with:
- TypeScript: Core language for the entire application
- Solana Web3.js: For blockchain interaction
- Google Cloud Compute API: For VM provisioning and management
- Node.js: Runtime environment
- Prisma: ORM for database management
- Redis: In-memory data store for payment processing and VM state
- Telegram Bot API: For user interface
- Bot Interface: Handles all user interactions via TelegramThanks for the clarification.
- Payment Strategy to Resolve Conflicts: Uses HD wallets to generate new addresses only when all cached addresses are in use
- Payment System: Processes Solana cryptocurrency payments
- VM Management: Creates, configures and terminates GCP VMs
- Cron Jobs: Handles automated tasks like payment verification and VM expiration
- Security: Includes private key encryption for secure wallet management
- Clone the repository
- Install dependencies with
npm install
- Set up environment variables (see
.env.example
) - Run database migrations with
npx prisma migrate dev
- Seed the database with
npm run db:seed
- Run the application with
npm run dev
- User starts the bot and gets registered
- User selects a VM configuration to rent
- System generates a Solana payment address
- User sends SOL to the provided address
- System verifies payment on the blockchain
- VM is provisioned in Google Cloud
- SSH access details are sent to the user
- VM runs until the rental period expires
- System automatically terminates expired VMs
- Run in development mode:
npm run dev
- Reset the database and seed data:
npx prisma migrate reset
- Add a new database migration:
npx prisma migrate dev --name migration_name
- Private keys are encrypted using AES-256-GCM
- SSH keys are generated on-demand for each VM
- Users can only access their own VMs