Arch Testing
A comprehensive testing framework for Arch Network applications that provides containerized test environments for integration testing.
Features
- Containerized Test Environments: Spin up isolated test environments using Docker containers
- Bitcoin Integration: Test with a local Bitcoin node for blockchain interactions
- Arch Network Support: Built-in support for Arch Network validators and programs
- Titan Integration: Test with Titan services for enhanced functionality
- Async/Await Support: Full async support with Tokio runtime
- Configurable: Flexible configuration options for different test scenarios
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Quick Start
use *;
use tokio;
async
Components
BitcoinContainer
Test with a local Bitcoin node:
use ;
let config = BitcoinContainerConfig ;
let bitcoin = new.await?;
// Use bitcoin.rpc_client() for Bitcoin RPC calls
LocalValidatorContainer
Test with a local Arch Network validator:
use ;
let config = default;
let validator = new.await?;
// Validator is ready for testing
TitanContainer
Test with Titan services:
use ;
let config = default;
let titan = new.await?;
// Titan services are available
Configuration
All containers support flexible configuration through their respective config structs:
BitcoinContainerConfig: Configure Bitcoin node settings, ports, and RPC credentialsLocalValidatorContainerConfig: Configure validator settings and network parametersTitanContainerConfig: Configure Titan service settings
Test Context
The TestContext provides a centralized way to manage your test environment:
use TestContext;
let context = new.await?;
// Context manages the lifecycle of all containers
Requirements
- Docker (for containerized test environments)
- Rust 1.70+ (2021 edition)
- Tokio runtime
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.