API Reference
Base URL: https://pot.rpc.gateway.tribewarez.com
Endpoints
GET /health
Liveness check.
Response:
{ "status": "ok", "service": "pot-o-validator", "version": "0.7.3" }GET /status
Mining stats, difficulty, network peers.
Response:
{
"node_id": "...",
"difficulty": 2,
"max_tensor_dim": 64,
"peer_network_mode": "local_only",
"pool_strategy": "solo",
"stats": { "total_challenges_issued": 10, "total_proofs_valid": 5 },
"engine": { "tasks_processed": 10, "successful": 8, "failed": 2 },
"network": { "peers": [], "total_nodes": 1, "synced": true }
}POST /challenge
Get a mining challenge.
Body:
{ "slot": 12345, "slot_hash": "abcdef...", "device_type": "native" }POST /submit
Submit a proof.
Body:
{
"proof": { "challenge_id": "...", "mml_score": 0.72, "..." : "..." },
"signature": [0, 1, 2]
}GET /miners/:pubkey
Query miner account (proxied from on-chain).
GET /pool
Pool info (type, miners, stake, minimum_stake).
POST /devices/register
Register an ESP or external mining device.
GET /network/peers
List known peers (empty in local_only mode).
POST /stake
Lock PTtC tokens and start earning yield.
Body:
{
"amount": "1000",
"lock_period_days": 30,
"pubkey": "..."
}Response:
{
"stake_id": "...",
"amount": "1000",
"lock_expiry": 1719878400,
"yield_rate": 0.10
}POST /unstake
Withdraw staked tokens (penalty if before lock expiry).
Body:
{
"stake_id": "...",
"pubkey": "..."
}POST /claim
Harvest accumulated staking yield.
Body:
{
"stake_id": "...",
"pubkey": "..."
}GET /stake/:pubkey
Query staking positions for a miner.
Response:
{
"stakes": [
{
"stake_id": "...",
"amount": "1000",
"yield_earned": "50",
"lock_expiry": 1719878400
}
]
}POST /swap/quote
Get a swap quote between two tokens.
Body:
{
"from_token": "PTtC",
"to_token": "NMTC",
"amount": "100"
}Response:
{
"from_amount": "100",
"to_amount": "95.5",
"price": 0.955,
"slippage": 0.005
}POST /swap/execute
Execute a token swap.
Body:
{
"from_token": "PTtC",
"to_token": "NMTC",
"amount": "100",
"min_received": "94.5",
"pubkey": "..."
}GET /swap/pools
List active liquidity pools.
Response:
{
"pools": [
{
"pair": "PTtC/NMTC",
"liquidity": "50000",
"volume_24h": "1200"
}
]
}POST /vault/deposit
Deposit tokens into a time-locked vault.
Body:
{
"token": "NMTC",
"amount": "500",
"unlock_at": 1722470400,
"pubkey": "..."
}POST /vault/withdraw
Withdraw from a vault after unlock time.
Body:
{
"vault_id": "...",
"pubkey": "..."
}GET /vault/:pubkey
List vaults for a user.
Response:
{
"vaults": [
{
"vault_id": "...",
"token": "NMTC",
"amount": "500",
"unlock_at": 1722470400,
"withdrawn": false
}
]
}GET /marketplace/orders
List open marketplace orders.
Response:
{
"orders": [
{
"id": "...",
"type": "buy",
"token": "PTtC",
"amount": "100",
"price": "0.5"
}
]
}POST /marketplace/order
Create a marketplace order.
Body:
{
"type": "sell",
"token": "NMTC",
"amount": "50",
"price": "2.0",
"pubkey": "..."
}GET /ledger/entries
Fetch recent ledger entries (mining rewards, transfers).
Response:
{
"entries": [
{
"type": "mining_reward",
"amount": "10",
"token": "PTtC",
"timestamp": 1719792000
}
]
}GET /pool/status
Get pool status and statistics.
Response:
{
"type": "pplns",
"miners_online": 42,
"total_stake": "100000",
"round_duration": 3600,
"fee": 0.02
}POST /pool/join
Join the mining pool with a stake.
Body:
{
"pubkey": "...",
"stake_amount": "1000"
}POST /pool/leave
Leave the mining pool.
Body:
{
"pubkey": "..."
}GET /admin/metrics
Get validator performance metrics.
Response:
{
"challenges_issued": 5000,
"proofs_valid": 3200,
"proofs_rejected": 80,
"avg_response_time_ms": 450,
"uptime_pct": 99.8
}POST /admin/config
Update validator configuration at runtime.
Body:
{
"difficulty": 3,
"max_tensor_dim": 128,
"pool_strategy": "solo"
}