Skip to content

Setup the DevKit

View as Markdown

Use this guide to install the Thru CLI, configure the RPC endpoint, and verify everything works with a live request.

  • Recommended install: Install Node.js 18 or newer from nodejs.org.
  • Linux package install: Use an x64 Linux VM with curl and sudo access.
  1. Install the CLI

    Install the Thru CLI globally using npm:

    Terminal window
    npm i -g thru

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

    Terminal window
    curl -fsSLO https://github.com/Unto-Labs/thru/releases/download/v0.2.27/thru_0.2.27_amd64.deb
    sudo apt install ./thru_0.2.27_amd64.deb
    RHEL-compatible Linux (.rpm)

    Install the RPM package:

    Terminal window
    sudo dnf install https://github.com/Unto-Labs/thru/releases/download/v0.2.27/thru-0.2.27-1.x86_64.rpm

    Verify the install:

    Terminal window
    thru --help
  2. Install the SDKs

    Install the Thru toolchain and C SDK using the CLI:

    Terminal window
    # Install RISC-V toolchain
    thru dev toolchain install
    # Install C SDK
    thru dev sdk install c
  3. Make an initial call

    Try a simple command:

    Terminal window
    thru getversion
  4. Configure RPC endpoint

    Edit your CLI configuration file at ~/.thru/cli/config.yaml

    Set the base URL:

    rpc_base_url: https://grpc.alphanet.thruput.org
  5. Verify with getversion

    Run again:

    Terminal window
    thru --json getversion
  6. Generate a keypair

    Generate a keypair to use for your account:

    Terminal window
    thru keys generate $NAME

    For example, to create a keypair named default:

    Terminal window
    thru keys generate default
  7. Create your first account

    Create an account on-chain using your keypair:

    Terminal window
    thru account create $NAME

    For example, to create an account named default:

    Terminal window
    thru account create default

    You’ll see output similar to this:

    Info: Creating account with fee payer proof...
    Info: Account public key: tayzC11YgWrPpXBon_hBxI_Szh3eUqsHxEelsHxFroPsAB
    Info: Using slot: 776
    Info: Calling makeStateProof RPC method...
    Success: State proof created successfully
    Info: Building transaction with fee payer proof...
    Info: Signing transaction...
    Info: Submitting transaction...
    Account Creation
    Key Name: default
    Public Key: tayzC11YgWrPpXBon_hBxI_Szh3eUqsHxEelsHxFroPsAB
    Signature: tsRIKKU4-Hu9nqzwlaZxcHjv7etbguo6g1AUMt5q9ga96dXxvqnTRTm8w6XH9C6OGSgcPc94TMmKzczNg8qqMTCyXX
    Status: success
    Success: Account creation transaction completed. Signature: tsRIKKU4-Hu9nqzwlaZxcHjv7etbguo6g1AUMt5q9ga96dXxvqnTRTm8w6XH9C6OGSgcPc94TMmKzczNg8qqMTCyXX

When the CLI changes, update it with the same install method you used. For npm installs, run:

Terminal window
npm i -g thru@latest

For Debian or Ubuntu VM installs, download and install the newer .deb package from the Thru GitHub release.