|
| 1 | +# Akash Network Plugin for Eliza |
| 2 | + |
| 3 | +A powerful plugin for interacting with the Akash Network, enabling deployment management and cloud compute operations through Eliza. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | +- [Installation](#installation) |
| 7 | +- [Configuration](#configuration) |
| 8 | +- [Directory Structure](#directory-structure) |
| 9 | +- [Available Actions](#available-actions) |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +```bash |
| 14 | +pnpm add @elizaos/plugin-akash |
| 15 | +``` |
| 16 | + |
| 17 | +## Configuration |
| 18 | + |
| 19 | +### Environment Variables |
| 20 | +Create a `.env` file in your project root with the following configuration: |
| 21 | + |
| 22 | +```env |
| 23 | +# Network Configuration |
| 24 | +AKASH_ENV=mainnet |
| 25 | +AKASH_NET=https://raw.githubusercontent.com/ovrclk/net/master/mainnet |
| 26 | +RPC_ENDPOINT=https://rpc.akashnet.net:443 |
| 27 | +
|
| 28 | +# Transaction Settings |
| 29 | +AKASH_GAS_PRICES=0.025uakt |
| 30 | +AKASH_GAS_ADJUSTMENT=1.5 |
| 31 | +AKASH_KEYRING_BACKEND=os |
| 32 | +AKASH_FROM=default |
| 33 | +AKASH_FEES=20000uakt |
| 34 | +
|
| 35 | +# Authentication |
| 36 | +AKASH_MNEMONIC=your_12_word_mnemonic_here |
| 37 | +
|
| 38 | +# Manifest Settings |
| 39 | +AKASH_MANIFEST_MODE=auto # Options: auto, validate_only |
| 40 | +AKASH_MANIFEST_VALIDATION_LEVEL=strict # Options: strict, basic, none |
| 41 | +AKASH_MANIFEST_PATH=/path/to/manifests # Optional: Path to save generated manifests |
| 42 | +
|
| 43 | +# Deployment Settings |
| 44 | +AKASH_DEPOSIT=5000000uakt # Default deployment deposit |
| 45 | +AKASH_SDL=deployment.yml # Default SDL file name |
| 46 | +``` |
| 47 | + |
| 48 | +**Important Notes:** |
| 49 | +- `AKASH_MNEMONIC`: Your 12-word wallet mnemonic phrase (required) |
| 50 | +- `AKASH_MANIFEST_MODE`: Controls manifest generation behavior |
| 51 | +- `AKASH_MANIFEST_VALIDATION_LEVEL`: Sets SDL validation strictness |
| 52 | +- `AKASH_DEPOSIT`: Default deposit amount for deployments |
| 53 | + |
| 54 | +⚠️ Never commit your `.env` file with real credentials to version control! |
| 55 | + |
| 56 | + |
| 57 | +#### SDL (Stack Definition Language) |
| 58 | +``` |
| 59 | +src/sdl/example.sdl.yml |
| 60 | +``` |
| 61 | +Place your SDL configuration files here. The plugin looks for SDL files in this directory by default. |
| 62 | + |
| 63 | +#### Certificates |
| 64 | +``` |
| 65 | +src/.certificates/ |
| 66 | +``` |
| 67 | +SSL certificates for secure provider communication are stored here. |
| 68 | + |
| 69 | +## Available Actions |
| 70 | + |
| 71 | +| Action | Description | Parameters | |
| 72 | +|---------------------|------------------------------------------------|---------------------------------------------| |
| 73 | +| CREATE_DEPLOYMENT | Create a new deployment | `sdl`, `sdlFile`, `deposit` | |
| 74 | +| CLOSE_DEPLOYMENT | Close an existing deployment | `dseq`, `owner` | |
| 75 | +| GET_PROVIDER_INFO | Get provider information | `provider` | |
| 76 | +| GET_DEPLOYMENT_STATUS| Check deployment status | `dseq`, `owner` | |
| 77 | +| GET_GPU_PRICING | Get GPU pricing comparison | `cpu`, `memory`, `storage` | |
| 78 | +| GET_MANIFEST | Generate deployment manifest | `sdl`, `sdlFile` | |
| 79 | +| GET_PROVIDERS_LIST | List available providers | `filter: { active, hasGPU, region }` | |
| 80 | + |
| 81 | + |
| 82 | +Each action returns a structured response with: |
| 83 | +```typescript |
| 84 | +{ |
| 85 | + text: string; // Human-readable response |
| 86 | + content: { |
| 87 | + success: boolean; // Operation success status |
| 88 | + data?: any; // Action-specific data |
| 89 | + error?: { // Present only on failure |
| 90 | + code: string; |
| 91 | + message: string; |
| 92 | + }; |
| 93 | + metadata: { // Operation metadata |
| 94 | + timestamp: string; |
| 95 | + source: string; |
| 96 | + action: string; |
| 97 | + version: string; |
| 98 | + actionId: string; |
| 99 | + } |
| 100 | + } |
| 101 | +} |
| 102 | +``` |
| 103 | + |
| 104 | +## Error Handling |
| 105 | + |
| 106 | +The plugin includes comprehensive error handling with specific error codes: |
| 107 | + |
| 108 | +- `VALIDATION_SDL_FAILED`: SDL validation errors |
| 109 | +- `WALLET_NOT_INITIALIZED`: Wallet setup issues |
| 110 | +- `DEPLOYMENT_CREATION_FAILED`: Deployment failures |
| 111 | +- `API_REQUEST_FAILED`: Network/API issues |
| 112 | +- `MANIFEST_PARSING_FAILED`: Manifest generation errors |
| 113 | +- `PROVIDER_FILTER_ERROR`: Provider filtering issues |
| 114 | + |
| 115 | +## Development |
| 116 | + |
| 117 | +### Running Tests |
| 118 | +```bash |
| 119 | +pnpm test |
| 120 | +``` |
| 121 | + |
| 122 | +### Building |
| 123 | +```bash |
| 124 | +pnpm run build |
| 125 | +``` |
| 126 | + |
| 127 | +## License |
| 128 | + |
| 129 | +This project is licensed under the MIT License - see the LICENSE file for details. |
| 130 | + |
| 131 | +## Support |
| 132 | + |
| 133 | +For support and questions, please open an issue in the repository or contact the maintainers. |
0 commit comments