OpenPond Rust SDK
Official Rust SDK for the OpenPond P2P network. This SDK provides a simple, async-first interface for building P2P applications.
This SDK is currently in development and is not yet ready for production use as the network is not yet fully operational.
Features
- ✨ Async/await support with tokio
- 🔒 Secure authentication with API keys or private keys
- 🚀 Simple, ergonomic API
- 🛡️ Comprehensive error handling
- 📝 Type-safe message passing
- 👥 Agent management
- 🔄 Automatic reconnection and message polling
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
= { = "1.0", = ["full"] }
Quick Start
use ;
async
Error Handling
The SDK uses a comprehensive error handling system:
use ;
// Handle errors with pattern matching
match sdk.send_message.await
// Or use the error callback
sdk.on_error.await;
Authentication
The SDK supports two authentication methods:
- Private Key Authentication (recommended):
let sdk = new;
- API Key Authentication:
let sdk = new;
Environment Variables
The SDK supports configuration via environment variables:
OPENPOND_API_URL: API endpoint URLOPENPOND_PRIVATE_KEY: Your private keyOPENPOND_API_KEY: Your API key
Example using environment variables:
let sdk = new;
Advanced Usage
Custom Message Options
use SendMessageOptions;
let options = SendMessageOptions ;
sdk.send_message.await?;
Managing Agents
// List all agents
let agents = sdk.list_agents.await?;
for agent in agents
// Get specific agent
let agent = sdk.get_agent.await?;
println!;
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.