Getting started

Quickstart

This guide walks you through your first interaction with the Citrate network in five steps. We designed this to be the fastest path from zero to a working deployment ... by the end, you will have deployed a smart contract and executed an on-chain inference request.

Prerequisites

  • A wallet configured for Citrate (see Wallet Setup)
  • Node.js 18+ and npm/pnpm installed
  • Basic familiarity with Solidity and command-line tools

Step 1: Connect to Citrate Testnet

Add the Citrate Testnet to your wallet or development environment using the following network parameters:

ParameterValue
Network NameCitrate Testnet
Chain ID1338
RPC URLhttps://testnet-rpc.cnidarian.cloud
Currency SymbolSALT
Block Explorerhttps://testnet-explorer.cnidarian.cloud

You can also configure your Hardhat or Foundry project to target this RPC endpoint directly.

Step 2: Get Testnet SALT from the Faucet

Request testnet SALT tokens from the Citrate faucet. You can use the web interface or the command line:

curl -X POST https://faucet.cnidarian.cloud/api/request -H "Content-Type: application/json" -d '{"address": "0xYOUR_WALLET_ADDRESS"}'

The faucet dispenses 10 testnet SALT per request with a 24-hour cooldown per address. Tokens typically arrive within 15 seconds.

Step 3: Deploy a Solidity Contract

Citrate's Lattice Virtual Machine is EVM-compatible, so you can deploy standard Solidity contracts. Here is a minimal contract that stores a value and emits an event:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
 
contract CitrateHello {
    string public greeting;
 
    event GreetingUpdated(string newGreeting, address updatedBy);
 
    constructor() {
        greeting = "Hello, Citrate!";
    }
 
    function setGreeting(string calldata _greeting) external {
        greeting = _greeting;
        emit GreetingUpdated(_greeting, msg.sender);
    }
}

Deploy using Hardhat:

npx hardhat run scripts/deploy.js --network citrate-testnet

Or using Foundry:

forge create --rpc-url https://testnet-rpc.cnidarian.cloud --private-key $PRIVATE_KEY src/CitrateHello.sol:CitrateHello

Step 4: Run an Inference Request

Citrate's defining feature is on-chain inference. Once your contract is deployed, you can call a model through the Model Context Protocol. Here is an example using the Citrate CLI:

citrate-cli inference request --model "sentiment-v1" --input '{"text": "Citrate is the future of decentralized AI."}' --callback 0xYOUR_CONTRACT_ADDRESS --rpc https://testnet-rpc.cnidarian.cloud

The inference result will be delivered to your contract's callback function within one to two block confirmations. You can monitor the request status on the block explorer.

Step 5: Explore Further

Now that you have a working deployment, I recommend exploring these next:

  • Network Configuration ... Review the full Network Configuration page for devnet, testnet, and mainnet details
  • Gradient Papers ... Read the technical papers that describe Citrate's architecture, starting with the Medusa Paradigm (Paper I)
  • Model Registry ... Browse available models on the testnet inference marketplace
  • Developer Discord ... Join the Cnidarian developer community for support and discussion

Welcome to the Citrate ecosystem. You are building on the first blockchain where AI is not an afterthought ... it is the foundation.