Documentation

FractalAI Documentation

Everything you need to build on FractalAI. From running a node to deploying WASM smart contracts and querying the JSON-RPC API.

Ctrl+K

Quick Examples

Rust - JSON-RPC Client
use fractal_node::rpc::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new("http://localhost:9545");

    // Get latest block with fractal metrics
    let block = client.get_block_by_number("latest").await?;
    println!("Block #{}: hash={}", block.number, block.hash);

    // Check account balance (native FRAC)
    let balance = client.get_balance("0xYourAddress").await?;
    println!("Balance: {} FRAC", balance);

    // Get network stats
    let stats = client.get_network_stats().await?;
    println!("Peers: {}, TPS: {}", stats.peers, stats.tps);

    Ok(())
}
curl - JSON-RPC Calls
# Get the latest block number
curl -X POST http://localhost:9545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

# Get account balance
curl -X POST http://localhost:9545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xYourAddress","latest"],"id":1}'

# Get node info (FractalAI-specific)
curl -X POST http://localhost:9545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_getNodeInfo","params":[],"id":1}'

Need Help?

Join our community for support and discussions