axionax Core API Reference

Version: 1.5.0-testnet

Overview

axionax Core provides JSON-RPC API compatible with Ethereum clients + custom extensions for compute, consensus, worker, and network status.

Standard Ethereum Methods

eth_chainId

Returns the current chain ID.

{
  "jsonrpc": "2.0",
  "method": "eth_chainId",
  "params": [],
  "id": 1
}

Example result:

{
  "jsonrpc": "2.0",
  "result": "0x7a69",
  "id": 1
}

eth_getBalance

{
  "jsonrpc": "2.0",
  "method": "eth_getBalance",
  "params": ["0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", "latest"],
  "id": 1
}

axionax Custom Methods

axn_submitJob

{
  "jsonrpc": "2.0",
  "method": "axn_submitJob",
  "params": [{
    "specs": {"gpu": "NVIDIA RTX 4090", "vram": 24, "framework": "PyTorch", "region": "us-west"},
    "sla": {...},
    "data": "0x..."
  }],
  "id": 1
}

axn_getJobStatus

{
  "jsonrpc": "2.0", "method": "axn_getJobStatus", "params": ["job_abc123"], "id": 1
}

axn_registerWorker

{"jsonrpc":"2.0","method":"axn_registerWorker","params":[{...} ],"id":1}

axn_getWorkerStatus

{"jsonrpc":"2.0","method":"axn_getWorkerStatus","params":["0x..."],"id":1}

axn_getPricingInfo

{"jsonrpc":"2.0","method":"axn_getPricingInfo","params":[],"id":1}

axn_getValidatorInfo

WebSocket Subscriptions

Error Codes

CodeMessageDescription
-32700Parse errorInvalid JSON
-32600Invalid requestNot valid JSON-RPC
-32601Method not foundMethod does not exist
-32602Invalid paramsInvalid method parameters
-32603Internal errorInternal JSON-RPC error
-32000Job not foundJob ID does not exist
-32001Worker not foundWorker address not registered
-32002Insufficient stakeNot enough staked AXX
-32003Invalid specsHardware specs don't meet reqs
-32004Quota exceededWorker exceeded epoch quota
-32005Validation failedPoPC validation failed

Rate Limits

Authentication/Security

{
  "from": "0x...",
  "signature": "0x...",
  "nonce": 123
}

Example Usage

Using curl

# Get chain ID
curl -X POST http://localhost:8545 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
# Get pricing info
curl -X POST http://localhost:8545 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","method":"axn_getPricingInfo","params":[],"id":1}'

Using TypeScript (Web3.js)

import Web3 from 'web3';
const web3 = new Web3('http://localhost:8545');
// Standard
gp const chainId = await web3.eth.getChainId();
// Custom
gp const pricing = await web3.currentProvider.send('axn_getPricingInfo', []);

Using Python (web3.py)

from web3 import Web3
w3 = Web3(Web3.HTTPProvider('http://localhost:8545'))
# Standard method
chain_id = w3.eth.chain_id
# Custom axionax method
pricing = w3.provider.make_request('axn_getPricingInfo', [])

Additional Resources