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("https://api.fractalai.net.co");

    // 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 (live testnet)
curl -X POST https://api.fractalai.net.co \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

# Get account balance
curl -X POST https://api.fractalai.net.co \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xYourAddress","latest"],"id":1}'

# Get network health + AI status
curl -X POST https://api.fractalai.net.co \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_health","params":[],"id":1}'

# Chat with ATHENA (on-chain AI)
curl -X POST https://api.fractalai.net.co \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_aiChat","params":[{"message":"What is FractalAI?"}],"id":1}'

Need Help?

Join our community for support and discussions