RustChain API Postman Collection

May 27, 2026 · View on GitHub

Issue #1617 - Complete Postman collection for RustChain Node API

Overview

This directory contains a complete Postman collection and environment configuration for testing and documenting the RustChain Node API. The collection is organized by functionality with example responses for each endpoint.

Files

FileDescription
RustChain_API.postman_collection.jsonComplete Postman collection with all endpoints
RustChain_Environment.postman_environment.jsonEnvironment variables configuration
validate_postman_collection.pyValidation script and checklist
README.mdThis documentation file

Quick Start

1. Import Collection into Postman

  1. Open Postman (v10.0 or later recommended)
  2. Click FileImport
  3. Select RustChain_API.postman_collection.json
  4. Collection will appear in the sidebar

2. Import Environment

  1. Click FileImport
  2. Select RustChain_Environment.postman_environment.json
  3. Click the environment dropdown (top right)
  4. Select RustChain API Environment

3. Configure Variables

Update the following environment variables:

VariableDescriptionExample
base_urlRustChain node URLhttps://rustchain.org
miner_idYour miner ID/walleteafc6f14eab6d5c5362fe651e5e6c23581892a37RTC
admin_keyAdmin API key (secret)your-admin-key
wallet_addressYour wallet addressyour-walletRTC
recipient_addressRecipient wallet for transfersrecipient-walletRTC

Collection Structure

The collection is organized into logical folders:

RustChain API - Complete Collection
├── 01_Health_Status
│   ├── Health Check
│   └── Readiness Probe
├── 02_Epoch_Network
│   ├── Current Epoch
│   ├── Network Statistics
│   ├── Active Miners
│   └── Hall of Fame
├── 03_Fee_Pool
│   └── Fee Pool Statistics
├── 04_Wallet_Balance
│   ├── Miner Balance
│   └── Lottery Eligibility
├── 05_Explorer
│   └── Block Explorer
├── 06_Attestation
│   └── Submit Attestation
├── 07_Wallet_Transfers
│   ├── Admin Transfer
│   └── Signed Transfer
└── 08_Withdrawals
    └── Withdrawal Request

Endpoints Reference

Public Endpoints (No Authentication)

MethodEndpointDescription
GET/healthNode health check
GET/readyReadiness probe
GET/epochCurrent epoch, slot, enrolled miners
GET/api/statsNetwork statistics
GET/api/minersActive miners with attestation data
GET/api/hall_of_fame/leaderboardHall of Fame leaderboard
GET/api/fee_poolRIP-301 fee pool statistics
GET/wallet/balance?miner_id=XMiner balance lookup
GET/lottery/eligibility?miner_id=XEpoch eligibility check
GET/explorerBlock explorer HTML page

Authenticated Endpoints (X-Admin-Key Header)

MethodEndpointDescription
POST/attest/submitSubmit hardware attestation
POST/wallet/transferAdmin transfer
POST/wallet/transfer/signedEd25519 signed transfer
POST/withdraw/requestWithdrawal request

Example Usage

Test Health Endpoint

curl -sk https://rustchain.org/health | jq .

Expected response:

{
  "ok": true,
  "uptime_s": 58480,
  "version": "2.2.1-rip200",
  "backup_age_hours": 13.65,
  "db_rw": true,
  "tip_age_slots": 0
}

Test Epoch Endpoint

curl -sk https://rustchain.org/epoch | jq .

Expected response:

{
  "epoch": 91,
  "slot": 13227,
  "enrolled_miners": 20,
  "blocks_per_epoch": 144,
  "epoch_pot": 1.5,
  "total_supply_rtc": 8388608
}

Test Miner Balance

curl -sk "https://rustchain.org/wallet/balance?miner_id=eafc6f14eab6d5c5362fe651e5e6c23581892a37RTC" | jq .

Expected response:

{
  "amount_i64": 150500000,
  "amount_rtc": 150.5,
  "miner_id": "eafc6f14eab6d5c5362fe651e5e6c23581892a37RTC"
}

Submit Attestation (Authenticated)

curl -sk -X POST https://rustchain.org/attest/submit \
  -H "Content-Type: application/json" \
  -H "X-Admin-Key: YOUR_ADMIN_KEY" \
  -d '{
    "miner_id": "your_miner_id",
    "proof": {
      "clock_skew": {"mean_ppm": 15.2, "std_ppm": 3.1},
      "cache_timing": {"l1_latency_ns": 4.2, "l2_latency_ns": 12.5},
      "simd_identity": {"has_avx2": false, "has_altivec": true},
      "thermal_entropy": {"jitter_score": 0.85},
      "instruction_jitter": {"fpu_jitter": 0.023, "int_jitter": 0.018},
      "behavioral_heuristics": {"vm_detected": false, "hypervisor": null, "cpu_vendor": "Freescale"}
    },
    "signature": "base64_signature"
  }' | jq .

Validation Script

Run the validation script to verify the collection structure:

# Make executable
chmod +x validate_postman_collection.py

# Run validation
python3 validate_postman_collection.py

# Run with live API tests (optional)
python3 validate_postman_collection.py --live-test

The script will:

  • Validate JSON syntax
  • Check collection structure
  • Verify environment variables
  • Generate endpoint checklist
  • Optionally test live endpoints

Validation Checklist

Use this checklist to verify all endpoints:

Health & Status

  • GET /health - Returns node health status
  • GET /ready - Returns readiness status

Epoch & Network

  • GET /epoch - Returns current epoch info
  • GET /api/stats - Returns network statistics
  • GET /api/miners - Returns active miners list
  • GET /api/hall_of_fame/leaderboard - Returns leaderboard

Fee Pool

  • GET /api/fee_pool - Returns fee pool statistics

Wallet

  • GET /wallet/balance?miner_id=X - Returns miner balance
  • GET /lottery/eligibility?miner_id=X - Returns eligibility status

Explorer

  • GET /explorer - Returns HTML explorer page

Attestation (Admin)

  • POST /attest/submit - Submits hardware attestation

Transfers (Admin)

  • POST /wallet/transfer - Executes admin transfer
  • POST /wallet/transfer/signed - Executes signed transfer

Withdrawals (Admin)

  • POST /withdraw/request - Creates withdrawal request

Environment Variables Reference

Required Variables

VariableTypeDescription
base_urldefaultRustChain node base URL
miner_iddefaultYour miner identifier
admin_keysecretAdmin API key for authenticated endpoints

Optional Variables

VariableTypeDescription
wallet_addressdefaultYour wallet address
recipient_addressdefaultRecipient for transfers
tx_payloaddefaultBase64-encoded transaction payload
signaturesecretEd25519 signature
attestation_proofdefaultHardware attestation proof JSON
environmentdefaultEnvironment name (production/staging)
api_versiondefaultAPI version string

Testing Tips

1. Start with Public Endpoints

Test public endpoints first to verify connectivity:

  • Health Check
  • Readiness Probe
  • Epoch Info

2. Use Pre-request Scripts

For authenticated endpoints, add a pre-request script to generate timestamps:

// Generate timestamp for nonce
pm.environment.set("timestamp", Math.floor(Date.now() / 1000));

3. Use Collection Variables

Store responses in variables for use in subsequent requests:

// Save miner_id from response
const jsonData = pm.response.json();
pm.environment.set("miner_id", jsonData.miner_id);

4. Add Tests

Add test scripts to validate responses:

// Test status code
pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});

// Test response body
pm.test("Node is healthy", function () {
    const jsonData = pm.response.json();
    pm.expect(jsonData.ok).to.be.true;
});

Error Handling

Common Error Codes

CodeMeaningResolution
400Bad RequestCheck request body format
401UnauthorizedVerify X-Admin-Key header
404Not FoundCheck miner_id or endpoint URL
429Rate LimitedWait and retry
500Server ErrorContact node operator

Error Response Format

{
  "error": "ERROR_CODE",
  "message": "Human-readable error description",
  "detail": "Additional error details (optional)"
}

API Rate Limits

Endpoint TypeLimit
Public endpoints100 requests/minute
Attestation1 per 10 minutes per miner
Transfers10 per minute per wallet

Security Notes

  • Never commit admin keys or signatures to version control
  • Use Postman's secret type for sensitive variables
  • Consider using Postman vault for team sharing
  • Rotate admin keys periodically

Troubleshooting

Collection Import Fails

  1. Ensure Postman v10.0 or later
  2. Verify JSON syntax: python3 -m json.tool RustChain_API.postman_collection.json
  3. Re-download the collection file

Environment Variables Not Working

  1. Ensure environment is selected (top-right dropdown)
  2. Check variable names match exactly (case-sensitive)
  3. Verify variable values don't have extra whitespace

Authenticated Endpoints Return 401

  1. Verify admin key is correct
  2. Check X-Admin-Key header is being sent
  3. Ensure environment is active

SSL Certificate Warnings

The RustChain node uses self-signed certificates. In Postman:

  1. Go to Settings → General
  2. Disable "SSL certificate verification"
  3. Or use curl -sk for CLI testing

Contributing

To add new endpoints:

  1. Add request to appropriate folder (or create new folder)
  2. Include example responses (success and error cases)
  3. Update this README with endpoint details
  4. Run validation script to verify structure

Version History

VersionDateChanges
1.0.02026-03-11Initial complete collection (Issue #1617)

Resources

License

This Postman collection is part of the RustChain project documentation.


Issue: rustchain-bounties #1617
Status: Complete
Validated: Yes