Skip to content

API Reference

Base URL: https://pot.rpc.gateway.tribewarez.com

Endpoints

GET /health

Liveness check.

Response:

json
{ "status": "ok", "service": "pot-o-validator", "version": "0.7.3" }

GET /status

Mining stats, difficulty, network peers.

Response:

json
{
  "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:

json
{ "slot": 12345, "slot_hash": "abcdef...", "device_type": "native" }

POST /submit

Submit a proof.

Body:

json
{
  "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:

json
{
  "amount": "1000",
  "lock_period_days": 30,
  "pubkey": "..."
}

Response:

json
{
  "stake_id": "...",
  "amount": "1000",
  "lock_expiry": 1719878400,
  "yield_rate": 0.10
}

POST /unstake

Withdraw staked tokens (penalty if before lock expiry).

Body:

json
{
  "stake_id": "...",
  "pubkey": "..."
}

POST /claim

Harvest accumulated staking yield.

Body:

json
{
  "stake_id": "...",
  "pubkey": "..."
}

GET /stake/:pubkey

Query staking positions for a miner.

Response:

json
{
  "stakes": [
    {
      "stake_id": "...",
      "amount": "1000",
      "yield_earned": "50",
      "lock_expiry": 1719878400
    }
  ]
}

POST /swap/quote

Get a swap quote between two tokens.

Body:

json
{
  "from_token": "PTtC",
  "to_token": "NMTC",
  "amount": "100"
}

Response:

json
{
  "from_amount": "100",
  "to_amount": "95.5",
  "price": 0.955,
  "slippage": 0.005
}

POST /swap/execute

Execute a token swap.

Body:

json
{
  "from_token": "PTtC",
  "to_token": "NMTC",
  "amount": "100",
  "min_received": "94.5",
  "pubkey": "..."
}

GET /swap/pools

List active liquidity pools.

Response:

json
{
  "pools": [
    {
      "pair": "PTtC/NMTC",
      "liquidity": "50000",
      "volume_24h": "1200"
    }
  ]
}

POST /vault/deposit

Deposit tokens into a time-locked vault.

Body:

json
{
  "token": "NMTC",
  "amount": "500",
  "unlock_at": 1722470400,
  "pubkey": "..."
}

POST /vault/withdraw

Withdraw from a vault after unlock time.

Body:

json
{
  "vault_id": "...",
  "pubkey": "..."
}

GET /vault/:pubkey

List vaults for a user.

Response:

json
{
  "vaults": [
    {
      "vault_id": "...",
      "token": "NMTC",
      "amount": "500",
      "unlock_at": 1722470400,
      "withdrawn": false
    }
  ]
}

GET /marketplace/orders

List open marketplace orders.

Response:

json
{
  "orders": [
    {
      "id": "...",
      "type": "buy",
      "token": "PTtC",
      "amount": "100",
      "price": "0.5"
    }
  ]
}

POST /marketplace/order

Create a marketplace order.

Body:

json
{
  "type": "sell",
  "token": "NMTC",
  "amount": "50",
  "price": "2.0",
  "pubkey": "..."
}

GET /ledger/entries

Fetch recent ledger entries (mining rewards, transfers).

Response:

json
{
  "entries": [
    {
      "type": "mining_reward",
      "amount": "10",
      "token": "PTtC",
      "timestamp": 1719792000
    }
  ]
}

GET /pool/status

Get pool status and statistics.

Response:

json
{
  "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:

json
{
  "pubkey": "...",
  "stake_amount": "1000"
}

POST /pool/leave

Leave the mining pool.

Body:

json
{
  "pubkey": "..."
}

GET /admin/metrics

Get validator performance metrics.

Response:

json
{
  "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:

json
{
  "difficulty": 3,
  "max_tensor_dim": 128,
  "pool_strategy": "solo"
}

TribeWarez Blockchain Ecosystem