System Requirements
Before installing Forge EC, ensure your system meets the following requirements:
- Rust: 1.70.0 or later
- Cargo: 1.70.0 or later
- Memory: 512 MB RAM (2 GB recommended)
- Storage: 50 MB free space
Supported Platforms
- Linux: x86_64, aarch64 (Ubuntu 18.04+, RHEL 8+)
- macOS: x86_64, Apple Silicon (macOS 10.15+)
- Windows: x86_64 (Windows 10+)
- WebAssembly: wasm32-unknown-unknown
Cargo Installation
The recommended way to install Forge EC is through Cargo, Rust's package manager.
Method 1: Add to Cargo.toml
Add Forge EC to your project's dependencies:
[dependencies]
forge-ec = "0.1.0"
Method 2: Command Line Installation
Use Cargo's add command for automatic dependency management:
cargo add forge-ec
Method 3: Specific Version
Install a specific version for compatibility:
cargo add forge-ec@0.1.0
Git Installation
Install directly from the Git repository for the latest development version:
[dependencies]
forge-ec = { git = "https://github.com/tanm-sys/forge-ec.git" }
Specific Branch or Tag
Install from a specific branch or tag:
[dependencies]
# Install from specific branch
forge-ec = { git = "https://github.com/tanm-sys/forge-ec.git", branch = "develop" }
# Install from specific tag
forge-ec = { git = "https://github.com/tanm-sys/forge-ec.git", tag = "v0.1.0" }
Feature Flags
Forge EC supports optional features that can be enabled through Cargo feature flags:
[dependencies]
forge-ec = { version = "0.1.0", features = ["serde", "wasm", "std"] }
# Available features:
# - "serde": Serialization support with serde
# - "wasm": WebAssembly compatibility
# - "std": Standard library support (enabled by default)
# - "alloc": Allocation support for no_std environments
# - "zeroize": Secure memory clearing
Feature Descriptions
- serde: Enables serialization/deserialization with serde
- wasm: Optimizations for WebAssembly targets
- std: Standard library support (default)
- alloc: Heap allocation for no_std environments
- zeroize: Secure memory clearing for sensitive data
Verify Installation
After installation, verify that Forge EC is working correctly:
use forge_ec::signatures::ecdsa::*;
fn main() {
println!("Testing Forge EC installation...");
// This should compile and run without errors
let private_key = PrivateKey::new();
let public_key = private_key.public_key();
println!("✅ Forge EC installed successfully!");
println!("Public key: {}", public_key.to_hex());
}
Run the verification test:
cargo run
Troubleshooting
Common installation issues and their solutions:
Compilation Errors
Solution: Ensure you've added the dependency correctly and run `cargo update`
Version Conflicts
Solution: Use `cargo tree` to identify conflicts and update dependencies
Platform-Specific Issues
- Windows: Ensure you have the latest Visual Studio Build Tools
- macOS: Install Xcode command line tools: `xcode-select --install`
- Linux: Install build essentials: `sudo apt install build-essential`