For the complete documentation index, see llms.txt. This page is also available as Markdown.

trac-peer RPC API v1

Health check

get

Basic liveness probe.

Responses
200

OK

application/json
okbooleanRequired
get/v1/health
GET /v1/health HTTP/1.1
Host: 127.0.0.1:5001
Accept: */*
200

OK

{
  "ok": true
}

Peer + MSB status summary

get

Status summary for the running peer and its embedded MSB client view.

Useful for UIs to display:

  • peer identity (pubKeyHex, writerKeyHex, msbAddress)

  • subnet info (bootstrap/channel, signed/unsigned lengths)

  • MSB view (bootstrapHex, networkId, signedLength)

Responses
200

OK

application/json
get/v1/status
GET /v1/status HTTP/1.1
Host: 127.0.0.1:5001
Accept: */*
{
  "peer": {
    "pubKeyHex": "text",
    "writerKeyHex": "text",
    "msbAddress": "text",
    "baseWritable": true,
    "isIndexer": true,
    "isWriter": true,
    "subnetBootstrapHex": "text",
    "subnetChannelUtf8": "text",
    "subnetSignedLength": 1,
    "subnetUnsignedLength": 1,
    "admin": "text",
    "chatStatus": "on",
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "msb": {
    "ready": true,
    "bootstrapHex": "text",
    "networkId": 1,
    "signedLength": 1,
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Contract schema (ABI-like discovery)

get

ABI-like discovery document for wallets/dApps.

Includes:

  • supported contract transaction types (contract.txTypes)

  • per-op input schema hints (contract.ops)

  • protocol API method schema (api.methods)

Responses
200

OK

application/json
schemaVersionnumberRequired
schemaFormatstring · enumRequiredPossible values:
get/v1/contract/schema
GET /v1/contract/schema HTTP/1.1
Host: 127.0.0.1:5001
Accept: */*
{
  "schemaVersion": 1,
  "schemaFormat": "json-schema",
  "contract": {
    "contractClass": "text",
    "protocolClass": "text",
    "txTypes": [
      "text"
    ],
    "ops": {
      "ANY_ADDITIONAL_PROPERTY": {
        "key": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        },
        "value": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        },
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    },
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "api": {
    "methods": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Generate a nonce for contract tx signing

get

Generates a nonce used in the wallet signing payload.

Responses
200

OK

application/json
noncestringRequired

32-byte hex string (64 hex chars)

Pattern: ^[0-9a-fA-F]{64}$
get/v1/contract/nonce
GET /v1/contract/nonce HTTP/1.1
Host: 127.0.0.1:5001
Accept: */*
{
  "nonce": "text"
}

Get tx signing context (MSB context)

get

Returns the MSB tx context required for wallets to compute the contract tx hash.

The wallet typically signs a payload derived from:

  • { prepared_command, nonce, context }

Responses
200

OK

application/json
get/v1/contract/tx/context
GET /v1/contract/tx/context HTTP/1.1
Host: 127.0.0.1:5001
Accept: */*
{
  "msb": {
    "networkId": 1,
    "txv": "text",
    "iw": "text",
    "bs": "text",
    "mbs": "text",
    "operationType": 1
  }
}

Simulate or broadcast a wallet-signed contract transaction

post

Submits a wallet-signed contract transaction.

Notes:

  • Tx submission is opt-in; operators must start the peer with --api-tx-exposed.

  • Use sim=true first (preflight) and only broadcast (sim=false) if simulation succeeds.

Body
txstringRequired

32-byte hex string (64 hex chars)

Pattern: ^[0-9a-fA-F]{64}$
addressstringRequired

32-byte hex string (64 hex chars)

Pattern: ^[0-9a-fA-F]{64}$
signaturestringRequired

64-byte hex string (128 hex chars)

Pattern: ^[0-9a-fA-F]{128}$
noncestringRequired

32-byte hex string (64 hex chars)

Pattern: ^[0-9a-fA-F]{64}$
simbooleanOptionalDefault: false
Responses
200

OK

application/json
resultanyRequired
Other propertiesanyOptional
post/v1/contract/tx
POST /v1/contract/tx HTTP/1.1
Host: 127.0.0.1:5001
Content-Type: application/json
Accept: */*
Content-Length: 161

{
  "tx": "text",
  "prepared_command": {
    "type": "text",
    "value": null,
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "address": "text",
  "signature": "text",
  "nonce": "text",
  "sim": false
}
{
  "result": null,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Read a single key from subnet state

get

Reads one key from subnet state.

  • confirmed=true reads from the subnet signed view (final snapshots).

  • confirmed=false reads from the latest local view (fast UI updates).

Query parameters
keystring · min: 1 · max: 4096Required

Exact Hyperbee key

confirmedbooleanOptional

If true, reads from signed view; if false, reads from latest (unsigned) view

Default: true
Responses
200

OK

application/json
keystringRequired
confirmedbooleanRequired
valueanyRequired
get/v1/state
GET /v1/state?key=text HTTP/1.1
Host: 127.0.0.1:5001
Accept: */*
{
  "key": "text",
  "confirmed": true,
  "value": null
}

Last updated