Skip to content

Installation

This guide will walk you through installing and setting up the Hyra Network SDKs for different programming languages.

Before installing Hyra Network SDKs, ensure you have:

  • Python 3.8+ (for Python SDK)
  • Node.js 16+ (for Node.js SDK)
  • A compatible wallet with HYRA tokens
  • Private key for your wallet
Terminal window
pip install hyra-sdk
Terminal window
# Option 1: Environment variable (recommended)
export PRIVATE_KEY=your_private_key_here
# Option 2: .env file
echo "PRIVATE_KEY=your_private_key_here" > .env
# Option 3: Inline environment variable
PRIVATE_KEY=your_private_key_here python your_script.py
from hyra_sdk import HyraClient
# Initialize client
client = HyraClient()
# Check if you can connect
print("Hyra SDK installed successfully!")
Terminal window
npm install @hyra-network/sdk
Terminal window
# Option 1: Environment variable (recommended)
export PRIVATE_KEY=your_private_key_here
# Option 2: .env file
echo "PRIVATE_KEY=your_private_key_here" > .env
const { HyraClient } = require("@hyra-network/sdk");
// Initialize client
const client = new HyraClient();
// Check if you can connect
console.log("Hyra SDK installed successfully!");

Hyra Network uses Zero-Knowledge Proofs for task verification. The ZKP system is automatically handled by the SDKs, but you can also install the standalone ZKP library:

Terminal window
# Install the ZKP Rust client for Python
pip install zkp-rust-client
Terminal window
# Install the ZKP Rust client for Node.js
npm install zkp-rust-client
Terminal window
# For web applications
npm install zkp-rust-client-wasm

The SDKs support multiple environment variable names for your private key:

Terminal window
# Primary options
export PRIVATE_KEY=your_private_key_here
export WALLET_PRIVATE_KEY=your_private_key_here
export HYRA_PRIVATE_KEY=your_private_key_here
# Python SDK
from hyra_sdk import HyraClient
client = HyraClient(rpc_url="https://your-custom-rpc-endpoint.com")
// Node.js SDK
const { HyraClient } = require("@hyra-network/sdk");
const client = new HyraClient({
rpcUrl: "https://your-custom-rpc-endpoint.com",
});
  • RPC URL: https://rpc-testnet.hyra.network
  • Chain ID: TBD
  • Native Token: HYRA (testnet)
  • RPC URL: https://rpc.hyra.network
  • Chain ID: TBD
  • Native Token: HYRA
  • Never commit private keys to version control
  • Use environment variables for production deployments
  • Store keys securely in production environments
  • Use hardware wallets when possible
Terminal window
# Development
export PRIVATE_KEY=your_development_private_key
# Production (use secure key management)
export PRIVATE_KEY=your_production_private_key
from hyra_sdk import HyraClient
# Initialize client
client = HyraClient()
# Claim a task
task = client.claim_task()
print(f"Task ID: {task['task_id']}")
print(f"Model: {task['model_name']}")
print(f"Input: {task['input_data']}")
# Submit the task result
result = "Your AI-generated response here"
submit_hash = client.submit_task(
task['task_id'],
result,
task['pool_address']
)
print(f"Submission hash: {submit_hash}")
const { HyraClient } = require("@hyra-network/sdk");
// Initialize client
const client = new HyraClient();
// Claim a task
const task = await client.claimTask();
console.log(`Task ID: ${task.taskId}`);
console.log(`Model: ${task.modelName}`);
console.log(`Input: ${task.inputData}`);
// Submit the task result
const result = "Your AI-generated response here";
const submitHash = await client.submitTask(
task.taskId,
result,
task.poolAddress
);
console.log(`Submission hash: ${submitHash}`);
  1. “No Available Task” Error

    • Wait for new tasks to be created
    • Check if you have an active task already
  2. “Insufficient Balance” Error

    • Ensure you have HYRA tokens in your wallet
    • Check your wallet balance
  3. “Task Deadline Passed” Error

    • Claim a new task
    • Check task deadlines before processing
  4. Connection Issues

    • Verify your RPC endpoint
    • Check your internet connection
    • Ensure the network is accessible

Once installation is complete, you can start: