Gelios Documentation

Welcome to the Gelios developer documentation. Gelios is an AI-native Layer 1 blockchain that combines sub-400ms finality, 100,000+ TPS, and native AI inference capabilities. This guide covers everything from basic setup to deploying autonomous AI agents on-chain.

New to Gelios? Start with the Quick Start guide to deploy your first smart contract in under 5 minutes.

Quick Start

Get up and running with Gelios in three steps:

Step 1: Install the Gelios CLI

Terminal # Install via npm
npm install -g @gelios/cli

# Or via cargo
cargo install gelios-cli

# Verify installation
gelios --version
# gelios-cli v2.4.0

Step 2: Create a New Project

Terminal gelios init my-first-dapp
cd my-first-dapp
gelios build

Step 3: Deploy to Testnet

Terminal # Get testnet tokens from faucet
gelios faucet --network testnet

# Deploy your contract
gelios deploy --network testnet
# ✓ Contract deployed at: 0x1a2b...3c4d

Installation

System Requirements

Package Installation

TypeScript // Install core SDK
npm install @gelios/sdk @gelios/ai-sdk

// For Python developers
pip install gelios-sdk gelios-ai

Your First Smart Contract

Here's a simple token contract on Gelios:

Rust use gelios_sdk::{contract, storage, token};

#[contract]
pub struct MyToken {
  name: String,
  symbol: String,
  total_supply: u128,
  balances: Storage<Address, u128>,
}

#[contract_impl]
impl MyToken {
  pub fn new(name: String, symbol: String, supply: u128) -> Self {
    Self { name, symbol, total_supply: supply, balances: Storage::new() }
  }

  pub fn transfer(&mut self, to: Address, amount: u128) -> Result<()> {
    let sender = msg::sender();
    let balance = self.balances.get(&sender).unwrap_or(0);
    require!(balance >= amount, "Insufficient balance");
    self.balances.set(&sender, balance - amount);
    let to_balance = self.balances.get(&to).unwrap_or(0);
    self.balances.set(&to, to_balance + amount);
    Ok(())
  }
}

Accounts & Wallets

Gelios uses a unified account model supporting both externally owned accounts (EOAs) and smart contract accounts. Each account has:

TypeScript import { Wallet } from '@gelios/sdk';

// Create a new wallet
const wallet = Wallet.create();
console.log('Address:', wallet.address);
console.log('Public Key:', wallet.publicKey);

// Import existing wallet
const imported = Wallet.fromPrivateKey('0xYOUR_PRIVATE_KEY');

Transactions

Gelios transactions support standard transfers, contract calls, and AI inference calls. All transactions achieve finality in under 400ms.

TypeScript import { GeliosClient } from '@gelios/sdk';

const client = new GeliosClient('https://rpc.gelios.network');

// Send a transaction
const tx = await client.sendTransaction({
  to: '0xRecipientAddress',
  value: parseGOS('10.0'),
  gasLimit: 21000,
});

console.log('TX Hash:', tx.hash);
console.log('Finality:', tx.finalityMs, 'ms');

Smart Contracts

Gelios smart contracts can be written in Rust (recommended) or Solidity (compatibility mode). The Gelios VM extends standard smart contract capabilities with native AI primitives.

Contract Lifecycle

  1. Write — Write contract code in Rust or Solidity
  2. Compilegelios build compiles to Gelios bytecode
  3. Testgelios test runs unit tests locally
  4. Deploygelios deploy deploys to testnet or mainnet
  5. Verifygelios verify publishes source for verification

Gas & Fees

Gelios uses an AI-optimized gas model that dynamically adjusts prices based on network demand. Average fees are $0.001 per transaction.

OperationGas CostUSD Equivalent
Simple Transfer21,000~$0.0005
Contract Call50,000 - 500,000~$0.001 - $0.01
AI Inference (Small)100,000~$0.01
AI Inference (Large)1,000,000+~$0.10 - $0.50
Contract Deployment500,000 - 5,000,000~$0.05 - $0.50

AI SDK Overview

Gelios AI SDK — Build autonomous AI agents that live on-chain. Available for TypeScript/JavaScript and Python.

The Gelios AI SDK provides everything you need to deploy, manage, and interact with AI agents and models on the Gelios blockchain. Key features:

Installation

Terminal # TypeScript / JavaScript
npm install @gelios/ai-sdk

# Python
pip install gelios-ai

Quick Example

TypeScript import { GeliosAI, Agent } from '@gelios/ai-sdk';

// Initialize the AI SDK
const ai = new GeliosAI({
  network: 'mainnet',
  apiKey: 'YOUR_API_KEY',
});

// Deploy an autonomous trading agent
const agent = await ai.createAgent({
  name: 'TradingBot-001',
  model: 'gelios-7b',
  capabilities: ['trade', 'analyze', 'interact'],
  wallet: 'auto',
  verify: true,
});

// Deploy and start the agent
await agent.deploy({ network: 'mainnet' });
console.log(`Agent live at: ${agent.address}`);

Creating AI Agents

AI Agents on Gelios are autonomous on-chain entities. Each agent has its own wallet, can execute transactions, and runs an ML model for decision-making.

Agent Configuration

ParameterTypeDescription
namestringHuman-readable agent identifier
modelstringAI model to use (gelios-7b, gelios-13b, or custom)
capabilitiesstring[]Allowed actions: trade, analyze, interact, govern
walletstring"auto" for new wallet, or existing address
verifybooleanEnable verifiable inference proofs
maxGasPerActionnumberGas limit per agent action (safety limit)
eventTriggersobject[]On-chain events that wake the agent

Agent Lifecycle

TypeScript // Create an agent that monitors DeFi pools
const defiAgent = await ai.createAgent({
  name: 'DeFi-Monitor',
  model: 'gelios-7b',
  capabilities: ['analyze', 'interact'],
  wallet: 'auto',
  verify: true,
  eventTriggers: [{
    contract: '0xAgentSwapPool',
    event: 'Swap',
    filter: { minAmount: parseGOS('1000') },
  }],
});

// Listen to agent actions
defiAgent.on('action', (action) => {
  console.log('Agent action:', action.type, action.details);
});

// Fund and start the agent
await defiAgent.fund(parseGOS('50'));
await defiAgent.start();

On-Chain Models

Deploy custom ML models to the Gelios Model Registry and use them across smart contracts and agents.

Supported Formats

Python from gelios_ai import ModelRegistry, GeliosClient

client = GeliosClient("https://rpc.gelios.network")
registry = ModelRegistry(client)

# Upload a model
model_id = await registry.upload(
  path="./my_model.onnx",
  name="PricePredictor-v1",
  description="Predicts GOS/USDC price movement",
  access="public", # or "private"
  fee_per_inference=0.01, # GOS per call
)

# Run inference
result = await registry.infer(
  model_id=model_id,
  input_data={"prices": [1.23, 1.25, 1.21, 1.28]},
  verify=True,
)
print(f"Prediction: {result.output}")
print(f"Proof: {result.proof_hash}")

Verifiable Inference

Every AI inference on Gelios can produce a Verifiable Inference Proof (VIP) — a cryptographic attestation that the model output was correctly computed. This is critical for DeFi applications where AI decisions affect user funds.

How It Works

  1. Input Commitment — Input data is hashed and committed on-chain
  2. Execution — The model runs on a validator node with TEE (Trusted Execution Environment)
  3. Proof Generation — A zkML proof is generated alongside the output
  4. Verification — Any node can verify the proof in O(log n) time
TypeScript // Verify an inference result on-chain
const isValid = await client.verifyInference({
  modelId: '0xModelAddress',
  inputHash: result.inputHash,
  output: result.output,
  proof: result.proof,
});

console.log('Inference valid:', isValid); // true

JSON-RPC API

Gelios provides a standard JSON-RPC interface compatible with common tooling. Endpoint: https://rpc.gelios.network

Core Methods

POSTgos_getBalanceGet account balance
POSTgos_sendTransactionSubmit a transaction
POSTgos_getTransactionReceiptGet transaction result
POSTgos_callCall contract (read-only)
POSTgos_estimateGasEstimate gas for transaction
POSTgos_blockNumberGet latest block number

AI-Specific Methods

POSTai_createAgentDeploy new AI agent
POSTai_inferRun model inference
POSTai_verifyProofVerify inference proof
POSTai_getAgentStateGet agent status
POSTai_listModelsList available models
cURL curl -X POST https://rpc.gelios.network \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "gos_getBalance",
    "params": ["0xYourAddress", "latest"],
    "id": 1
  }'

REST API

For convenience, Gelios also provides a RESTful API at https://api.gelios.network/v1

GET/v1/accounts/{address}Account info
GET/v1/transactions/{hash}Transaction details
GET/v1/blocks/{number}Block details
POST/v1/transactionsSubmit transaction
GET/v1/ai/agents/{id}Agent details
POST/v1/ai/inferRun inference
GET/v1/ai/modelsList models

WebSocket API

Subscribe to real-time events via WebSocket at wss://ws.gelios.network

TypeScript import { GeliosWS } from '@gelios/sdk';

const ws = new GeliosWS('wss://ws.gelios.network');

// Subscribe to new blocks
ws.subscribe('newBlocks', (block) => {
  console.log('New block:', block.number);
});

// Subscribe to AI agent events
ws.subscribe('agentActions', {
  agentId: '0xAgentAddress',
}, (action) => {
  console.log('Agent acted:', action);
});

// Subscribe to contract events
ws.subscribe('contractEvents', {
  address: '0xContractAddress',
  event: 'Transfer',
}, (event) => {
  console.log('Transfer:', event.from, '->', event.to, event.amount);
});