Prerequisites

You'll need Rust stable ≥ 1.75 and Node.js ≥ 18 (optional, for TypeScript clients). If you're on Solana, the toolchain is nearly identical.

1

Install Rust

bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup update stable
rustup target add wasm32-unknown-unknown
2

Install the Rialo CLI

bash
cargo install rialo-cli --locked
rialo --version   # rialo-cli 0.9.x

Install the CDK

Add rialo-cdk and rialo-venus-dsl to your Cargo.toml:

Cargo.toml
[package]
name    = "my-app"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]

[dependencies]
rialo-cdk       = "0.9"
rialo-venus-dsl = "0.9"

[profile.release]
overflow-checks = true
lto = "fat"

Scaffold a project

The CLI scaffolds a complete project with sensible defaults:

bash
rialo new my-app
cd my-app
# my-app/
# ├── Cargo.toml
# ├── src/lib.rs       ← your program
# └── tests/           ← integration tests

Write your first program

Open src/lib.rs. The scaffold generates a working counter program:

src/lib.rs
use rialo_cdk::prelude::*;
use rialo_venus_dsl::rialo;

rialo! {
    // Persistent on-chain state — no manual account management
    state {
        count: u64,
        owner: Pubkey,
    }

    program {
        /// Initialize the counter (call once at deploy)
        fn initialize(ctx: Context) {
            state.owner = ctx.signer;
            state.count = 0;
        }

        /// Increment the counter — anyone can call
        fn increment(_ctx: Context) {
            state.count += 1;
            emit!(CounterIncremented { count: state.count });
        }

        /// Reset — only the owner
        fn reset(ctx: Context) {
            require!(ctx.signer == state.owner, ErrorCode::Unauthorized);
            state.count = 0;
        }
    }
}

#[event]
pub struct CounterIncremented { pub count: u64 }

#[error_code]
pub enum ErrorCode {
    #[msg("Only the owner can reset")]
    Unauthorized,
}
ℹ️
Coming from Solana / Anchor?

The rialo! macro replaces Anchor's #[program] + account structs. State is declared once in state { } — no PDA derivation, no account sizing, no rent management. The CDK handles all of that.

Build & deploy locally

bash
# Build
rialo build

# Start a local Rialo node
rialo localnet start

# Deploy to local node
rialo deploy ./target/deploy/my_app.so --url localhost

# Call a function
rialo call my-app initialize --url localhost
rialo call my-app increment  --url localhost

# Read state
rialo state my-app --url localhost
# { count: 1, owner: "3xKp...f9Qr" }
✅
Watch mode

Run rialo localnet watch to auto-redeploy on file save during development.

Connect to testnet

bash
# Generate a keypair
rialo keygen --outfile ~/.config/rialo/id.json

# Request testnet tokens
rialo airdrop 2 --url https://testnet.rialo.io

# Deploy to testnet
rialo deploy ./target/deploy/my_app.so --url https://testnet.rialo.io

# Verify deployment
rialo program show my-app --url https://testnet.rialo.io
⚠️
Testnet access is gated

Full testnet access is now open. Launch Latch →

Next steps