Rialo Client Development Kit (CDK)
The Rialo CDK is a comprehensive toolkit that provides the fundamental building blocks for interacting with the Rialo blockchain. It serves as the foundation for wallet management, transaction processing, RPC communication, and configuration handling.
Features
- Wallet Management: Create, load, and manage wallets with secure key handling
- HD Wallet Support: BIP39 mnemonic generation and hierarchical deterministic wallet features
- Transaction Building: Create, sign, and serialize blockchain transactions
- RPC Client: Communicate with Rialo blockchain nodes using JSON-RPC
- Configuration Management: Flexible configuration system with multiple storage backends
- Secure Key Storage: Encrypted wallet storage with password protection
Feature Flags
Rialo CDK uses Cargo feature flags to allow customization of the library's functionality:
file-storage(default: enabled): Provides file-based wallet and configuration storage. Disable this in environments where filesystem access is unavailable.encryption(default: enabled): Includes encryption/decryption functionality for wallet security. Can be disabled for testing or specific security environments.hd-wallet(default: enabled): Enables hierarchical deterministic wallet functionality. Disable for a slimmer build without HD wallet support.mnemonic(default: enabled): Provides mnemonic phrase generation and recovery (depends onhd-wallet). Can be disabled for simpler applications.rpc-client(default: enabled): Includes the HTTP RPC client implementation. Disable to use custom RPC implementations without HTTP client dependencies.
Using Feature Flags
To use Rialo CDK with specific features, specify them in your Cargo.toml:
[]
= { = "0.1.0", = false, = ["file-storage", "encryption"] }
Getting Started
Installation
Add Rialo CDK to your project's dependencies:
[]
= "0.1.0"
Basic Usage Examples
Creating and Managing Wallets
use ;
async
Building and Sending Transactions
use TransactionBuilder;
use HttpRpcClient;
async
Managing Configuration
use ;
async
Core Components
Wallet Module
The wallet module provides a comprehensive set of tools for secure key management:
- WalletProvider: Trait for wallet storage backends
- FileWalletProvider: Implementation that stores wallets in the filesystem
- InMemoryWalletProvider: Implementation that keeps wallets in memory (for testing)
- Mnemonic Functions: For generating and using BIP39 seed phrases
- Encryption Utilities: For secure storage of sensitive wallet data
Transaction Module
The transaction module handles the creation and signing of blockchain transactions:
- TransactionBuilder: Fluent interface for constructing transactions
- Instruction: Representation of individual operations within a transaction
- AccountMeta: Metadata about accounts referenced in a transaction
RPC Module
The RPC module provides communication with Rialo blockchain nodes:
- RpcClient: Trait defining the RPC interface
- HttpRpcClient: Implementation using HTTP for JSON-RPC communication
- Response Types: Structured data models for RPC responses
Configuration Module
The configuration module manages user preferences and network settings:
- Config: Structure holding configuration parameters
- ConfigProvider: Trait for configuration storage backends
- FileConfigProvider: Implementation using JSON files for storage
- InMemoryConfigProvider: Implementation keeping configuration in memory
Security Considerations
- Wallet private keys are encrypted at rest
- Passwords are never stored
- Secure random number generation is used for cryptographic operations
- Network communication supports TLS
License
This project is licensed under the Apache License, Version 2.0.