From e00c80b4655256c69e52c3d071c15a590606faea Mon Sep 17 00:00:00 2001 From: CheddarQueso Date: Sun, 22 Dec 2024 19:25:02 -0500 Subject: [PATCH 1/2] sample plugin documentation --- packages/plugin-0g/readme.md | 128 ++++++++++++++++++++++++++++++++--- 1 file changed, 120 insertions(+), 8 deletions(-) diff --git a/packages/plugin-0g/readme.md b/packages/plugin-0g/readme.md index 5fbeb54812..72841bda51 100644 --- a/packages/plugin-0g/readme.md +++ b/packages/plugin-0g/readme.md @@ -1,15 +1,127 @@ -# @elizaos/plugin-0g +# @ai16z/plugin-0g A plugin for storing data using the 0G protocol within the ElizaOS ecosystem. ## Description - The 0G plugin enables seamless integration with the Zero Gravity (0G) protocol for decentralized file storage. It provides functionality to upload files to the 0G network. -## Future work +## Installation + +```bash +pnpm install @elizaos/plugin-0g +``` + +## Configuration + +The plugin requires the following environment variables to be set: +```typescript +ZEROG_INDEXER_RPC=<0G indexer RPC endpoint> +ZEROG_EVM_RPC=<0G EVM RPC endpoint> +ZEROG_PRIVATE_KEY= +ZEROG_FLOW_ADDRESS=<0G Flow contract address> +``` + +## Usage + +### Basic Integration + +```typescript +import { zgPlugin } from '@ai16z/plugin-0g'; +``` + + +### File Upload Example + +```typescript +// The plugin automatically handles file uploads when triggered +// through natural language commands like: + +"Upload my document.pdf" +"Store this image.png on 0G" +"Save my resume.docx to Zero Gravity" +``` + + +## API Reference + +### Actions + +#### ZG_UPLOAD + +Uploads files to the 0G network. + +**Aliases:** +- UPLOAD_FILE_TO_ZG +- STORE_FILE_ON_ZG +- SAVE_FILE_TO_ZG +- UPLOAD_TO_ZERO_GRAVITY +- STORE_ON_ZERO_GRAVITY +- SHARE_FILE_ON_ZG +- PUBLISH_FILE_TO_ZG + +**Input Content:** +```typescript +interface UploadContent { +filePath: string; +} +``` + + +## Common Issues & Troubleshooting + +1. **File Access Errors** + - Ensure the file exists at the specified path + - Check file permissions + - Verify the path is absolute or relative to the execution context + +2. **Configuration Issues** + - Verify all required environment variables are set + - Ensure RPC endpoints are accessible + - Confirm private key has sufficient permissions + +## Security Best Practices + +1. **Environment Variables** + - Never commit private keys to version control + - Use secure environment variable management + - Rotate private keys periodically + + +## Development Guide + +### Setting Up Development Environment + +1. Clone the repository +2. Install dependencies: + +```bash +pnpm install +``` + +3. Build the plugin: + +```bash +pnpm run build +``` + +4. Run the plugin: + +```bash +pnpm run dev +``` + +## Future Enhancements + +- Model service deployment on 0G serving network +- 0G KV store for plugin state persistence +- Upload history and file metadata storage +- 0G as a database option for Eliza state storage +- Enhanced file path and context extraction + +## Contributing + +Contributions are welcome! Please see our contributing guidelines for more details. + +## License -- Enable model service deployment on 0G serving network. -- Implement 0G KV store for plugin state persistence . -- Store upload history and file metadata. -- Provide 0G as a db option for Eliza to store its memory/state. -- Enhance file path and context extraction. +[License information needed] \ No newline at end of file From cc2bab6a646b9a208d3fcd57321aa7e49401bee3 Mon Sep 17 00:00:00 2001 From: CheddarQueso Date: Sun, 22 Dec 2024 19:36:43 -0500 Subject: [PATCH 2/2] title update --- packages/plugin-0g/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-0g/readme.md b/packages/plugin-0g/readme.md index 72841bda51..cf24cc94ce 100644 --- a/packages/plugin-0g/readme.md +++ b/packages/plugin-0g/readme.md @@ -1,4 +1,4 @@ -# @ai16z/plugin-0g +# @elizaos/plugin-0g A plugin for storing data using the 0G protocol within the ElizaOS ecosystem.