Getting Started

Install WasmHub and download your first runtime

Kumar Anirudha

Table of content
  1. Install
  2. CLI
  3. Library
  4. Your first runtime
  5. Inspect the cache
  6. Use from Rust
  7. Next steps

Install

CLI

cargo install wasmhub --features cli

This installs the wasmhub binary. Run wasmhub --help to verify.

Library

[dependencies]
wasmhub = "0.1"
tokio = { version = "1", features = ["full"] }

For download progress bars, enable the progress feature:

wasmhub = { version = "0.1", features = ["progress"] }

Your first runtime

wasmhub get go 1.23

What happens:

  1. WasmHub fetches go-manifest.json from GitHub Releases
  2. Resolves the entry for version 1.23
  3. Downloads the WASM binary (with retries, backoff, multi-CDN fallback)
  4. Verifies the SHA256 against the manifest
  5. Caches it under ~/.cache/wasmhub/go/1.23/

Subsequent calls return the cached binary instantly.

Inspect the cache

wasmhub cache show
wasmhub info go 1.23

Use from Rust

use wasmhub::{RuntimeLoader, Language};

#[tokio::main]
async fn main() -> wasmhub::Result<()> {
    let loader = RuntimeLoader::new()?;
    let go = loader.get_runtime(Language::Go, "1.23").await?;

    println!("Path:   {}", go.path.display());
    println!("Size:   {} bytes", go.size);
    println!("SHA256: {}", go.sha256);
    Ok(())
}

The returned Runtime is a small struct — path, size, sha256, language, version. Pass path to your WASM runtime of choice (wasmtime, wasmer, etc.).

Next steps