Skip to content

Commit

Permalink
Merge branch 'develop' into feat/sol-agent-kit
Browse files Browse the repository at this point in the history
  • Loading branch information
renlulu authored Dec 23, 2024
2 parents ce2ea9a + c823cac commit 635b672
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 30 deletions.
26 changes: 3 additions & 23 deletions .github/workflows/integrationTests.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
name: integration-test
name: Integration Tests
on:
push:
branches:
- "*"
pull_request:
pull_request_target:
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
jobs:
integration-tests:
runs-on: ubuntu-latest
env:
Expand All @@ -46,16 +31,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 }}
26 changes: 26 additions & 0 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
@@ -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
126 changes: 119 additions & 7 deletions packages/plugin-0g/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,125 @@
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=<Private key for transactions>
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]

0 comments on commit 635b672

Please sign in to comment.