Setup the DevKit
Use this guide to install the Thru CLI, configure the RPC endpoint, and verify everything works with a live request.
Prerequisites
Section titled “Prerequisites”- Recommended install: Install Node.js 18 or newer from nodejs.org.
- Linux package install: Use an x86_64 or arm64 Linux VM with
curlandsudoaccess.
-
Install the CLI
Install the Thru CLI globally using npm:
Terminal window npm i -g thruThe npm package installs a prebuilt binary for macOS, Windows, and Linux; no Rust toolchain is required.
More installation methods:
Debian or Ubuntu (.deb)
Install the Debian package for your architecture:
Terminal window # x86_64curl -fsSLO https://github.com/Unto-Labs/thru/releases/latest/download/thru_amd64.debsudo apt install ./thru_amd64.debTerminal window # arm64curl -fsSLO https://github.com/Unto-Labs/thru/releases/latest/download/thru_arm64.debsudo apt install ./thru_arm64.debRHEL-compatible Linux (.rpm)
Install the RPM package for your architecture (
dnfaccepts a URL directly):Terminal window # x86_64sudo dnf install https://github.com/Unto-Labs/thru/releases/latest/download/thru-x86_64.rpmTerminal window # aarch64sudo dnf install https://github.com/Unto-Labs/thru/releases/latest/download/thru-aarch64.rpmVerify the install:
Terminal window thru --help -
Install the SDKs
Install the Thru toolchain and C SDK using the CLI:
Terminal window # Install RISC-V toolchainthru dev toolchain install# Install C SDKthru dev sdk install c -
Make an initial call
Try a simple command:
Terminal window thru getversion -
Configure RPC endpoint
Edit your CLI configuration file at
~/.thru/cli/config.yamlSet the base URL:
rpc_base_url: https://rpc.alphanet.thru.org -
Verify with getversion
Run again:
Terminal window thru --json getversion -
Generate a keypair
Generate a keypair to use for your account:
Terminal window thru keys generate $NAMEFor example, to create a keypair named
default:Terminal window thru keys generate default -
Create your first account
Create an account on-chain using your keypair:
Terminal window thru account create $NAMEFor example, to create an account named
default:Terminal window thru account create defaultYou’ll see output similar to this:
Info: Creating account with fee payer proof...Info: Account public key: tayzC11YgWrPpXBon_hBxI_Szh3eUqsHxEelsHxFroPsABInfo: Using slot: 776Info: Calling makeStateProof RPC method...Success: State proof created successfullyInfo: Building transaction with fee payer proof...Info: Signing transaction...Info: Submitting transaction...Account CreationKey Name: defaultPublic Key: tayzC11YgWrPpXBon_hBxI_Szh3eUqsHxEelsHxFroPsABSignature: tsRIKKU4-Hu9nqzwlaZxcHjv7etbguo6g1AUMt5q9ga96dXxvqnTRTm8w6XH9C6OGSgcPc94TMmKzczNg8qqMTCyXXStatus: successSuccess: Account creation transaction completed. Signature: tsRIKKU4-Hu9nqzwlaZxcHjv7etbguo6g1AUMt5q9ga96dXxvqnTRTm8w6XH9C6OGSgcPc94TMmKzczNg8qqMTCyXX
Updating the CLI
Section titled “Updating the CLI”When the CLI changes, update it with the same install method you used. For npm installs, run:
npm i -g thru@latestFor Debian, Ubuntu, or RHEL-compatible installs, re-run the install command you
used above. The releases/latest/download/ URLs always resolve to the newest
release, so the command does not change between versions:
curl -fsSLO https://github.com/Unto-Labs/thru/releases/latest/download/thru_amd64.debsudo apt install ./thru_amd64.deb