TESTNET TESTNET SIM BLOCK EPOCH VALIDATORS TESTNET-1 // OPERATIONAL
ExamplesExemples

Use CURS3D step by step. Utiliser CURS3D étape par étape.

These examples are aligned with the current CLI and API surface so the site remains practical instead of purely narrative. Ces exemples sont alignés avec la surface CLI et API actuelle pour que le site reste pratique et pas seulement narratif.

01

Bootstrap a local nodeBootstrap d'un node local

terminal
$ git clone https://github.com/Pazificateur69/curs3d.git
$ cd curs3d
$ cargo build --release

$ printf '%s\n' 'YOUR_SECURE_PASSWORD_HERE' > validator.password
$ ./target/release/curs3d wallet --output validator.json --password-file validator.password
$ ./target/release/curs3d genesis --output genesis.public-testnet.json --validator-wallet validator.json --validator-password-file validator.password
$ ./target/release/curs3d node --validator-wallet validator.json --validator-password-file validator.password --genesis-config genesis.public-testnet.json
02

Connect to the public testnetSe connecter au testnet public

terminal
# Join the multi-node testnet as a validator
$ ./target/release/curs3d node \
  --validator-wallet validator.json \
  --validator-password-file validator.password \
  --genesis-config genesis.public-testnet.json \
  --bootnode /ip4/144.24.192.222/tcp/4337/p2p/12D3KooWGy9BLopUe6CmnxuFgk5pCou8Kj5R1DXa9XLga9MD63va

# Publish your own bootnode address
$ ./target/release/curs3d bootnode-address \
  --data-dir curs3d_data \
  --public-addr /dns4/your-node.example.com/tcp/4337
03

Query public statusInterroger le statut public

terminal
$ curl https://api.curs3d.fr/api/status | jq .data
$ curl https://api.curs3d.fr/api/validators | jq .data
$ curl 'https://api.curs3d.fr/api/blocks?from=0&limit=10' | jq .data
04

Request faucet fundsDemander des fonds au faucet

terminal
$ curl -X POST https://api.curs3d.fr/api/faucet/request \
  -H 'Content-Type: application/json' \
  -d '{"address":"CUR0123456789abcdef0123456789abcdef01234567"}'
05

Unstake tokensRetirer du stake

terminal
# Unstake 500 CUR (funds unlock after 10 blocks)
$ ./target/release/curs3d unstake \
  --wallet validator.json \
  --password-file validator.password \
  --amount 500
06

Deploy a CUR-20 tokenDéployer un token CUR-20

terminal
# Deploy a new token with 1 billion supply
$ ./target/release/curs3d deploy-token \
  --wallet validator.json \
  --password-file validator.password \
  --name "My Token" \
  --symbol "MYT" \
  --decimals 6 \
  --total-supply 1000000000

# List all deployed tokens
$ curl https://api.curs3d.fr/api/tokens | jq .data
07

Transfer CUR-20 tokensTransférer des tokens CUR-20

terminal
# Transfer 1000 tokens to another address
$ ./target/release/curs3d token-transfer \
  --wallet validator.json \
  --password-file validator.password \
  --token CUR_TOKEN_ADDRESS_HEX \
  --to CUR_RECIPIENT_ADDRESS_HEX \
  --amount 1000

# Check token balance
$ curl https://api.curs3d.fr/api/token/TOKEN_ADDR/balance/OWNER_ADDR | jq .data
08

Inspect token and governance stateInspecter l'état token et gouvernance

terminal
$ curl https://api.curs3d.fr/api/tokens | jq .data
$ curl https://api.curs3d.fr/api/governance/proposals | jq .data
$ curl https://api.curs3d.fr/api/pending | jq .data
09

Connect via WebSocketSe connecter via WebSocket

terminal
# Using wscat (npm install -g wscat)
$ wscat -c wss://api.curs3d.fr/ws

# Subscribe to specific events
> {"events": ["new_block", "new_transaction"]}

# Or using the JavaScript SDK
import { CursClient } from "@curs3d/sdk";
const client = new CursClient("https://api.curs3d.fr");
client.subscribe(["new_block"], (event) => {
  console.log("New block:", event.data.height);
});
10

Use the Python SDKUtiliser le SDK Python

python
from curs3d import CursClient

client = CursClient("https://api.curs3d.fr")
status = client.get_status()
print(f"Chain: {status['chain_name']}, Height: {status['height']}")

# Get account balance
account = client.get_account("CUR...")
print(f"Balance: {account['balance'] / 1_000_000} CUR")

# List tokens
tokens = client.get_tokens()
for t in tokens:
    print(f"{t['symbol']}: {t['name']}")
11

Write a smart contract in RustÉcrire un smart contract en Rust

CURS3D ships a Rust SDK (sdk/rust/) that handles host bindings, panic handler, and a heap-base bump allocator so you write contracts as plain no_std Rust. Five examples are included: counter, ERC-20-style token, multisig, NFT, vesting.CURS3D fournit un SDK Rust (sdk/rust/) qui gère les bindings host, le panic handler et un bump allocator ancré sur le heap-base, pour écrire des contrats en Rust no_std normal. Cinq exemples inclus : counter, token ERC-20, multisig, NFT, vesting.

src/lib.rs
#![no_std]

use curs3d_contract::{entrypoint, log, storage};

entrypoint!(run);

fn run() {
    let next = storage::increment(b"count", 1);
    log::emit(b"tick", &next.to_le_bytes());
}
terminal
$ rustup target add wasm32-unknown-unknown
$ cd sdk/rust/examples/counter
$ cargo build --release --target wasm32-unknown-unknown

# Deploy through the chain (signs with your wallet, submits via TCP RPC)
$ curs3d deploy-contract \
    --wallet ~/.curs3d/wallet.json \
    --wasm target/wasm32-unknown-unknown/release/counter_contract.wasm \
    --gas-limit 5000000 \
    --fee 1000

# Output:
# === CURS3D Contract Deployed ===
# Wasm size:        531 bytes
# Predicted addr:   CUR…
# Tx hash:          …
# Once mined, fetch the receipt:
#   curl http://localhost:8080/api/receipt/<hash>

Read the contract bytecode anytime via GET /api/contract/:addr/code and the per-key storage proofs via GET /api/contract/:addr/storage/:key/proof.Le bytecode est lisible à tout moment via GET /api/contract/:addr/code et les preuves de stockage par clé via GET /api/contract/:addr/storage/:key/proof.

12

Connect Metamask / ethers.jsBrancher Metamask / ethers.js

CURS3D exposes a read-mostly Ethereum-compatible JSON-RPC at POST /eth. ECDSA-signed transactions are rejected (we sign with Dilithium L5), but every read method works for explorers and dApp UIs.CURS3D expose un JSON-RPC compatible Ethereum (lecture) sur POST /eth. Les transactions signées ECDSA sont refusées (nous signons en Dilithium L5), mais toutes les méthodes de lecture fonctionnent pour les explorers et UIs de dApps.

javascript
import { JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider("https://api.curs3d.fr/eth");

const chainId = await provider.send("eth_chainId", []);
const head    = await provider.send("eth_blockNumber", []);
const balance = await provider.send("eth_getBalance",
    ["0x" + "00".repeat(20), "latest"]);

console.log({ chainId, head, balance });

For real-time updates, open a WebSocket to wss://api.curs3d.fr/ws and send {"jsonrpc":"2.0","method":"eth_subscribe","params":["newHeads"],"id":1} — you'll get an eth_subscription notification on every new block.Pour le streaming, ouvrez un WebSocket vers wss://api.curs3d.fr/ws et envoyez {"jsonrpc":"2.0","method":"eth_subscribe","params":["newHeads"],"id":1} — vous recevrez une notification eth_subscription à chaque bloc.

13

Run a light clientExécuter un light client

A light client only fetches signed headers and verifies them locally — no full state, no full chain. The SDK ships curs3d::light::LightClient for that purpose.Un light client ne télécharge que les headers signés et les vérifie localement — pas d'état complet, pas de chaîne complète. Le SDK fournit curs3d::light::LightClient pour ça.

terminal
# Walk through the protocol with the bundled CLI demo
$ curs3d light-sync --api https://api.curs3d.fr --limit 64

# Or hit the endpoints directly
$ curl -s https://api.curs3d.fr/api/genesis
$ curl -s 'https://api.curs3d.fr/api/headers?from=0&limit=64'
$ curl -s https://api.curs3d.fr/api/finality