Installation
Numax installs the nx CLI.
For v0.1.2, the recommended path is:
- download a prebuilt binary from the GitHub Release;
- or build/install from source with Cargo.
Package-manager installs such as Homebrew, winget and crates.io are not available yet.
Requirements
For the prebuilt CLI:
- Linux, macOS or Windows;
- a terminal;
curlor a browser to download the release asset.
For building modules and examples:
- Rust;
- the
wasm32-unknown-unknowntarget.
rustup target add wasm32-unknown-unknownLinux
Use the Linux x86_64 musl build:
VERSION=v0.1.2TARGET=x86_64-unknown-linux-muslARCHIVE="numax-${VERSION}-${TARGET}.tar.gz"
curl -LO "https://github.com/GianIac/numax/releases/download/${VERSION}/${ARCHIVE}"curl -LO "https://github.com/GianIac/numax/releases/download/${VERSION}/SHA256SUMS"
grep " ${ARCHIVE}$" SHA256SUMS | sha256sum -c -tar -xzf "${ARCHIVE}"sudo install -m 755 "numax-${VERSION}-${TARGET}/nx" /usr/local/bin/nx
nx --versionFor ARM64 Linux, use TARGET=aarch64-unknown-linux-musl.
macOS
Apple Silicon:
VERSION=v0.1.2TARGET=aarch64-apple-darwinARCHIVE="numax-${VERSION}-${TARGET}.tar.gz"
curl -LO "https://github.com/GianIac/numax/releases/download/${VERSION}/${ARCHIVE}"curl -LO "https://github.com/GianIac/numax/releases/download/${VERSION}/SHA256SUMS"
grep " ${ARCHIVE}$" SHA256SUMS | shasum -a 256 -c -tar -xzf "${ARCHIVE}"sudo install -m 755 "numax-${VERSION}-${TARGET}/nx" /usr/local/bin/nx
nx --versionIntel Mac:
VERSION=v0.1.2TARGET=x86_64-apple-darwinARCHIVE="numax-${VERSION}-${TARGET}.tar.gz"
curl -LO "https://github.com/GianIac/numax/releases/download/${VERSION}/${ARCHIVE}"curl -LO "https://github.com/GianIac/numax/releases/download/${VERSION}/SHA256SUMS"
grep " ${ARCHIVE}$" SHA256SUMS | shasum -a 256 -c -tar -xzf "${ARCHIVE}"sudo install -m 755 "numax-${VERSION}-${TARGET}/nx" /usr/local/bin/nx
nx --versionWindows
Open PowerShell:
$Version = "v0.1.2"$Target = "x86_64-pc-windows-msvc"$Archive = "numax-$Version-$Target.zip"$Base = "https://github.com/GianIac/numax/releases/download/$Version"$InstallDir = "$env:USERPROFILE\.numax\bin"
Invoke-WebRequest "$Base/$Archive" -OutFile $ArchiveInvoke-WebRequest "$Base/SHA256SUMS" -OutFile "SHA256SUMS"
$Expected = ((Select-String -Path "SHA256SUMS" -Pattern $Archive).Line -split "\s+")[0].ToLower()$Actual = (Get-FileHash $Archive -Algorithm SHA256).Hash.ToLower()if ($Actual -ne $Expected) { throw "Checksum mismatch for $Archive" }
Expand-Archive $Archive -DestinationPath . -ForceNew-Item -ItemType Directory -Force $InstallDir | Out-NullCopy-Item "numax-$Version-$Target\nx.exe" "$InstallDir\nx.exe" -Force
[Environment]::SetEnvironmentVariable( "Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$InstallDir", "User")
& "$InstallDir\nx.exe" --versionOpen a new terminal after changing Path.
Install from source
This is the most reliable path while Numax is still early.
git clone https://github.com/GianIac/numaxcd numaxcargo install --path crates/nx-cli --locked
nx --versionIf you only want to build the binary in the repository:
git clone https://github.com/GianIac/numaxcd numaxcargo build --release -p nx-cli --locked
./target/release/nx --versionBuild WASM modules
The CLI runs .wasm modules. To compile Rust guest modules, install the WASM target:
rustup target add wasm32-unknown-unknownThen build an example:
cd examples/distributed_countercargo build --release --target wasm32-unknown-unknownThe generated module is:
examples/distributed_counter/target/wasm32-unknown-unknown/release/distributed_counter.wasmVerify the install
Check the CLI:
nx --versionnx config init --output numax.tomlnx config validate --config numax.tomlRun a module:
nx run path/to/module.wasm --datastore-path ./nx-dataEnable sync by adding a listen address:
nx run path/to/module.wasm \ --listen 0.0.0.0:9000 \ --peer 127.0.0.1:9001 \ --datastore-path ./node-aRelated
- Quickstart: 5 Minutes - run two synced nodes
- Your First Module - build a guest module
- CLI reference - all
nxcommands and flags