From 29ce7101c9ff4546c5f7ef61e1dca6247ee42074 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 21 Dec 2024 18:51:41 -0600 Subject: [PATCH 1/9] add documentation on pnpm node version --- docs/docs/quickstart.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md index ba4143abf4..d08607b8c0 100644 --- a/docs/docs/quickstart.md +++ b/docs/docs/quickstart.md @@ -225,6 +225,14 @@ pnpm start --characters="characters/trump.character.json,characters/tate.charact - Ensure Node.js 23.3.0 is installed - Use `node -v` to check version - Consider using [nvm](https://github.com/nvm-sh/nvm) to manage Node versions + + NOTE: pnpm may be bundled with a different node version, ignoring nvm. If this is the case, you can use + ```bash + pnpm env use --global 23.3.0 + ``` + to force it to use the correct one. + + 2. **Sharp Installation** If you see Sharp-related errors: From 69a85994724b4684ae4fd30a4d95ff02ef81aaa0 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 21 Dec 2024 18:54:48 -0600 Subject: [PATCH 2/9] remove extra spacing --- docs/docs/quickstart.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md index d08607b8c0..07366163f6 100644 --- a/docs/docs/quickstart.md +++ b/docs/docs/quickstart.md @@ -232,8 +232,6 @@ pnpm start --characters="characters/trump.character.json,characters/tate.charact ``` to force it to use the correct one. - - 2. **Sharp Installation** If you see Sharp-related errors: From c26b69ad600bb023d1d802830532314f304001db Mon Sep 17 00:00:00 2001 From: Shakker Nerd Date: Sun, 22 Dec 2024 14:00:17 +0000 Subject: [PATCH 3/9] fix: explicitly set env in each step --- .github/workflows/integrationTests.yaml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integrationTests.yaml b/.github/workflows/integrationTests.yaml index 4ed0c8732c..ed8973d360 100644 --- a/.github/workflows/integrationTests.yaml +++ b/.github/workflows/integrationTests.yaml @@ -49,17 +49,13 @@ jobs: id: check_api_key run: | if [ -z "$OPENAI_API_KEY" ]; then - echo "::set-output name=api_key_present::false" - else - echo "::set-output name=api_key_present::true" + echo "Error: OPENAI_API_KEY is not set." + exit 1 fi + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - name: Run integration tests - if: steps.check_api_key.outputs.api_key_present == 'true' run: pnpm run integrationTests - - - name: Skip integration tests - if: steps.check_api_key.outputs.api_key_present == 'false' - run: | - echo "Skipping integration tests due to missing required API keys" - exit 1 + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} From b38b742bb2437779edb7b37c047f6aa831b8893c Mon Sep 17 00:00:00 2001 From: V Date: Sun, 22 Dec 2024 21:28:16 +0530 Subject: [PATCH 4/9] Update README.md adding documentation for running chat client --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 8ae4ac62e3..050f7117f7 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,11 @@ cd eliza-starter cp .env.example .env pnpm i && pnpm build && pnpm start ``` +Once the agent is running, You should see the message to run "pnpm start:client" at the end. +Open another terminal and move to same directory and then run below command and follow the URL to chat to your agent. +```bash +pnpm start:client +``` Then read the [Documentation](https://elizaos.github.io/eliza/) to learn how to customize your Eliza. From e00c80b4655256c69e52c3d071c15a590606faea Mon Sep 17 00:00:00 2001 From: CheddarQueso Date: Sun, 22 Dec 2024 19:25:02 -0500 Subject: [PATCH 5/9] 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 6/9] 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. From 4e170dddd4fa030346b9ec9d6b0c7357a66d2a05 Mon Sep 17 00:00:00 2001 From: Shakker Nerd Date: Mon, 23 Dec 2024 03:53:47 +0000 Subject: [PATCH 7/9] chore: change CI trigger --- .github/workflows/integrationTests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integrationTests.yaml b/.github/workflows/integrationTests.yaml index ed8973d360..a0893f9454 100644 --- a/.github/workflows/integrationTests.yaml +++ b/.github/workflows/integrationTests.yaml @@ -3,7 +3,7 @@ on: push: branches: - "*" - pull_request: + pull_request_target: branches: - "*" jobs: From 35e9969b28969ec76bdd34ae0c4de723978add9b Mon Sep 17 00:00:00 2001 From: Shakker Nerd Date: Mon, 23 Dec 2024 04:25:10 +0000 Subject: [PATCH 8/9] chore: require approval for integration test step --- .github/workflows/integrationTests.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integrationTests.yaml b/.github/workflows/integrationTests.yaml index a0893f9454..b8ac3acdb1 100644 --- a/.github/workflows/integrationTests.yaml +++ b/.github/workflows/integrationTests.yaml @@ -6,6 +6,7 @@ on: pull_request_target: branches: - "*" + jobs: smoke-tests: runs-on: ubuntu-latest @@ -23,8 +24,19 @@ jobs: - name: Run smoke tests run: pnpm run smokeTests + + approval: + runs-on: ubuntu-latest + needs: smoke-tests + steps: + - name: Wait for manual approval + run: | + echo "Please approve the workflow manually to proceed." + echo "::pause::" # This creates a manual approval checkpoint. + integration-tests: runs-on: ubuntu-latest + needs: approval env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} steps: @@ -46,16 +58,11 @@ jobs: run: pnpm build - name: Check for API key - id: check_api_key run: | if [ -z "$OPENAI_API_KEY" ]; then echo "Error: OPENAI_API_KEY is not set." exit 1 fi - env: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - name: Run integration tests run: pnpm run integrationTests - env: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} From 6f4aca7a1ded808d9e6fdba31542533799e33c57 Mon Sep 17 00:00:00 2001 From: Shakker Nerd Date: Mon, 23 Dec 2024 05:17:41 +0000 Subject: [PATCH 9/9] chore: split tests --- .github/workflows/integrationTests.yaml | 29 +------------------------ .github/workflows/smoke-tests.yml | 26 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/smoke-tests.yml diff --git a/.github/workflows/integrationTests.yaml b/.github/workflows/integrationTests.yaml index b8ac3acdb1..46ee277516 100644 --- a/.github/workflows/integrationTests.yaml +++ b/.github/workflows/integrationTests.yaml @@ -1,4 +1,4 @@ -name: integration-test +name: Integration Tests on: push: branches: @@ -8,35 +8,8 @@ on: - "*" jobs: - smoke-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v3 - with: - version: 9.4.0 - - - uses: actions/setup-node@v4 - with: - node-version: "23" - cache: "pnpm" - - - name: Run smoke tests - run: pnpm run smokeTests - - approval: - runs-on: ubuntu-latest - needs: smoke-tests - steps: - - name: Wait for manual approval - run: | - echo "Please approve the workflow manually to proceed." - echo "::pause::" # This creates a manual approval checkpoint. - integration-tests: runs-on: ubuntu-latest - needs: approval env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} steps: diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml new file mode 100644 index 0000000000..fd059a3523 --- /dev/null +++ b/.github/workflows/smoke-tests.yml @@ -0,0 +1,26 @@ +name: smoke-test +on: + push: + branches: + - "*" + pull_request: + branches: + - "*" + +jobs: + smoke-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v3 + with: + version: 9.4.0 + + - uses: actions/setup-node@v4 + with: + node-version: "23" + cache: "pnpm" + + - name: Run smoke tests + run: pnpm run smokeTests