Loading Documentation...
Getting Started Beginner 3 min read

Installation Guide

Learn how to install Forge EC using multiple methods, manage dependencies, and configure features for your specific use case.

System Requirements

Before installing Forge EC, ensure your system meets the following requirements:

Minimum 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:

Cargo.toml
[dependencies]
forge-ec = "0.1.0"

Method 2: Command Line Installation

Use Cargo's add command for automatic dependency management:

Terminal
cargo add forge-ec

Method 3: Specific Version

Install a specific version for compatibility:

Terminal
cargo add forge-ec@0.1.0

Git Installation

Install directly from the Git repository for the latest development version:

Cargo.toml
[dependencies]
forge-ec = { git = "https://github.com/tanm-sys/forge-ec.git" }

Specific Branch or Tag

Install from a specific branch or tag:

Cargo.toml
[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" }
Development Version Warning: Git installations may include unstable features and breaking changes. Use stable releases for production applications.

Feature Flags

Forge EC supports optional features that can be enabled through Cargo feature flags:

Feature Configuration
[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:

Verification Test
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:

Terminal
cargo run

Troubleshooting

Common installation issues and their solutions:

Compilation Errors

Error: "package `forge-ec` cannot be found"
Solution: Ensure you've added the dependency correctly and run `cargo update`

Version Conflicts

Issue: Dependency 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`