Skip to content
5. Hardware Registration

5. Hardware Registration

This tutorial covers registering hardware resources in the dAIEDGE Middleware, including computational devices for AI model training, inference, and benchmarking.

Overview

Hardware registration allows you to:

  • Publish computational resources to the blockchain
  • Define hardware specifications and capabilities via structured JSON
  • Register supported ML runtimes and formats
  • Enable benchmarking on your hardware
  • Control access to your resources

What Gets Registered

The hardware registration uses a target specification JSON object that includes:

  • Hardware Specifications: CPUs, GPUs/accelerators, memory, storage, power requirements
  • Software Specifications: OS, ML engines/frameworks, supported benchmarking types
  • Cost Information: Pricing details for resource usage
  • Metadata: Unique identifiers, descriptions, implementation status

Prerequisites


Required Roles

Hardware Owner Role

To register and manage hardware, you need the HARDWARE_OWNER_ROLE:

RolePurposeRequired For
HARDWARE_OWNER_ROLERegister and manage hardware resourcesCreating new hardware registrations
HARDWARE_MANAGER_ROLEList and view hardware resourcesBrowsing hardware on the platform
HARDWARE_OPERATOR_ROLEUpdate hardware (if delegated)Updating hardware you don’t own but are delegated to manage

Authorization

You can register hardware if:

  • Your identity has HARDWARE_OWNER_ROLE (granted by ADMIN_ROLE)

You can list/view hardware if:

  • Your identity has HARDWARE_MANAGER_ROLE (granted by ADMIN_ROLE)

You can update hardware if:

  • You own the hardware (registered it), OR
  • You have HARDWARE_OPERATOR_ROLE AND are a valid delegate of the hardware owner (via Identity Management)

See the Role Management tutorial to obtain these roles.


Step 1: Register Hardware

Register a new hardware resource on the blockchain using a structured target specification.

Endpoint

POST /api/v1/hardware

Request

curl -X POST https://middleware-daiedge.bisite.usal.es/api/v1/hardware \
  -H "Content-Type: application/json" \
  -H "x-session-id: {SESSION_ID}" \
  -d '{
    "walletId": "0000019a95f732ce0adb8f69ccc7d362",
    "password": "WalletPass123!",
    "did": "did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7",
    "is_implemented": true,
    "description": "Raspberry Pi 4B with 4GB RAM",
    "family": "rpi4b",
    "hardware_spec": {
        "cost": {
            "value": 0.02,
            "currency": "EUR",
            "unit": "hour"
        },
        "cpus":[
            {
                "id" : "cpu_001",
                "arch": "arm64",
                "model": "cortex-a72",
                "specs": {
                    "rate": { "value": 1500, "unit": "MHz", "kind": "frequency"},
                    "cores": { "value": 4, "unit": "cores"},
                    "computing_power": { "value": 2.0, "unit": "GFLOPS" }
                }
            }
        ],
        "accelerators": [
            {
                "id" : "accel_001",
                "type": "gpu",
                "model": "broadcom-videocore",
                "specs": {
                    "rate": { "value": 500, "unit": "MHz", "kind": "frequency" },
                    "cores": { "value": 1, "unit": "core" },
                    "computing_power": { "value": 12.0, "unit": "GFLOPS"}
                }
            }
        ],
        "memory": {
            "type": "LPDDR4",
            "kind": "UNIFIED",
            "specs": {
                "size": { "value": 4096, "unit": "MB" },
                "rate": { "value": 3200, "unit": "MHz", "kind": "frequency" }
            }
        },
        "storage": {
            "type": "SD",
            "specs": {
                "size": { "value": 32, "unit": "GB" },
                "rate": { "value": 90, "unit": "MB/s", "kind": "read_speed" }
            }
        },
        "power":{
            "min": { "value": 7.0, "unit": "W" },
            "max": { "value": 15.0, "unit": "W"}
        }
    },
    "software_spec": {
        "OS": "Raspberry Pi OS",
        "version": "11 (Bullseye)",
        "engines":[
            {
                "id": "ort_001",
                "name": "Onnx Runtime",
                "family": "ort",
                "version": "1.14.1",
                "computing_backends": [
                    "cpu_001",
                    "accel_001"
                ],
                "supported_applications": [
                    {
                        "type": "BENCHMARKING",
                        "details":{
                            "supported_types": [
                                "TYPE1",
                                "TYPE2",
                                "TYPE3"
                            ]
                        }
                    }
                ]
            },
            {
                "id": "tf_002",
                "name": "TensorFlow Lite",
                "family": "tflite",
                "version": "2.7.0",
                "computing_backends": [
                    "cpu_001"
                ],
                "supported_applications": [
                    {
                        "type": "BENCHMARKING",
                        "details":{
                            "supported_types": [
                                "TYPE1",
                                "TYPE2"
                            ]
                        }
                    }
                ]
            }
        ]
    }
  }'

Request Body

FieldTypeRequiredDescription
walletIdstringYesYour wallet ID
passwordstringYesWallet password
didstringYesYour identity DID (format: did:ethr:{network}:0x...) with HARDWARE_OWNER_ROLE
is_implementedbooleanYesWhether the hardware is physically deployed
descriptionstringYesHuman-readable description
familystringNoHardware family/architecture (e.g., nvidia-ada, arm-cortex)
hardware_specobjectYesHardware specifications object
software_specobjectYesSoftware specifications object

Response (200 OK)

{
  "id": "0x4b864cf8dc2de08557697526cc59c2cbfc3416c7f922b12ef59d0c747724f194"
}

Returns the hardware ID (bytes32 hash).

Error Responses

CodeErrorCause
404WALLET_NOT_FOUNDWallet doesn’t exist
400WRONG_PASSWORDWallet password incorrect
400INVALID_DIDIdentity DID format invalid
400INVALID_TARGETTarget missing or not a valid JSON object
403NOT_DID_OWNERThe DID does not belong to you
403INVALID_WALLETWallet doesn’t belong to you
403HARDWARE_OWNER_ROLE_REQUIREDYour identity lacks HARDWARE_OWNER_ROLE
500TRANSACTION_ERRORBlockchain transaction failed

Step 2: View Registered Hardware

List All Hardware

Browse all hardware registered on the platform.

Endpoint

GET /api/v1/hardware?did={did}&page={page}

Request

curl -X GET "https://middleware-daiedge.bisite.usal.es/api/v1/hardware?did=did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7&page=1" \
  -H "x-session-id: {SESSION_ID}"

Response (200 OK)

{
  "hardware": [
    {
      "id": "0x4b864cf8dc2de08557697526cc59c2cbfc3416c7f922b12ef59d0c747724f194",
      "owner": "did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7",
      "created": 1697000000000
    }
  ],
  "page": 1,
  "totalPages": 10,
  "total": 245
}

Note: The list endpoint returns only basic information (ID, owner DID, creation timestamp). Use the detail endpoint below to get full hardware specifications.

Get Hardware Details

Retrieve specific hardware information.

Endpoint

GET /api/v1/hardware/{id}?did={did}

Request

curl -X GET "https://middleware-daiedge.bisite.usal.es/api/v1/hardware/{HARDWARE_ID}?did=did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7" \
  -H "x-session-id: {SESSION_ID}"

Response (200 OK)

{
  "hash": "0x4b864cf8dc2de08557697526cc59c2cbfc3416c7f922b12ef59d0c747724f194",
  "owner": "did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7",
  "created": 1697000000000,
  "is_implemented": true,
  "description": "NVIDIA RTX 4090 with 24GB VRAM",
  "family": "nvidia-ada",
  "hardware_spec": {
    "cost": { "value": 0.50, "currency": "EUR", "unit": "hour" },
    "cpus": [],
    "accelerators": [ ... ],
    "memory": { ... },
    "storage": { ... },
    "power": { ... }
  },
  "software_spec": {
    "OS": "Ubuntu",
    "version": "22.04 LTS",
    "engines": [ ... ]
  }
}

Response Fields:

  • hash: Keccak256 hash of the target JSON (stored on blockchain)
  • owner: DID of the hardware owner
  • created: Registration timestamp
  • target: Complete hardware and software specification object

Step 3: Update Hardware

Modify hardware specifications by updating the target JSON.

Endpoint

POST /api/v1/hardware/{id}

Request

curl -X POST https://middleware-daiedge.bisite.usal.es/api/v1/hardware/{HARDWARE_ID} \
  -H "Content-Type: application/json" \
  -H "x-session-id: {SESSION_ID}" \
  -d '{
    "walletId": "0000019a95f732ce0adb8f69ccc7d362",
    "password": "WalletPass123!",
    "did": "did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7",
    "is_implemented": true,
    "description": "NVIDIA RTX 4090 with 24GB VRAM (Updated with Triton)",
    "family": "nvidia-ada",
    "hardware_spec": {
        "cost": { "value": 0.50, "currency": "EUR", "unit": "hour" },
        "cpus": [],
        "accelerators": [
          {
            "id": "gpu_001",
            "type": "gpu",
            "model": "rtx-4090",
            "specs": {
              "rate": { "value": 2520, "unit": "MHz", "kind": "frequency" },
              "cores": { "value": 16384, "unit": "cores" },
              "computing_power": { "value": 82580, "unit": "GFLOPS" }
            }
          }
        ],
        "memory": {
          "type": "GDDR6X",
          "kind": "DEDICATED",
          "specs": {
            "size": { "value": 24576, "unit": "MB" },
            "rate": { "value": 21000, "unit": "MHz", "kind": "frequency" }
          }
        },
        "storage": {
          "type": "NVMe",
          "specs": {
            "size": { "value": 1000, "unit": "GB" },
            "rate": { "value": 7000, "unit": "MB/s", "kind": "read_speed" }
          }
        },
        "power": {
          "min": { "value": 100, "unit": "W" },
          "max": { "value": 450, "unit": "W" }
        }
      },
      "software_spec": {
        "OS": "Ubuntu",
        "version": "22.04 LTS",
        "engines": [
          {
            "id": "trt_001",
            "name": "TensorRT",
            "family": "tensorrt",
            "version": "8.6",
            "computing_backends": ["gpu_001"],
            "supported_applications": [
              {
                "type": "BENCHMARKING",
                "details": { "supported_types": ["TYPE1", "TYPE2", "TYPE3"] }
              }
            ]
          },
          {
            "id": "triton_001",
            "name": "Triton Inference Server",
            "family": "triton",
            "version": "2.0",
            "computing_backends": ["gpu_001"],
            "supported_applications": [
              {
                "type": "BENCHMARKING",
                "details": { "supported_types": ["TYPE1", "TYPE2", "TYPE3"] }
              }
            ]
          }
        ]
      }
    }
  }'

Request Body

FieldTypeRequiredDescription
walletIdstringYesYour wallet ID
passwordstringYesWallet password
didstringYesYour identity DID (format: did:ethr:{network}:0x...)
is_implementedbooleanYesWhether the hardware is physically deployed
descriptionstringYesUpdated description
familystringNoHardware family/architecture
hardware_specobjectYesUpdated hardware specifications
software_specobjectYesUpdated software specifications

Response (200 OK)

{}

Authorization

You can update hardware if:

  • You are the hardware owner, OR
  • You have HARDWARE_OPERATOR_ROLE AND are a valid delegate of the owner

Step 4: Delete Hardware

Remove a hardware registration from the platform.

Endpoint

DELETE /api/v1/hardware/{id}

Request

curl -X DELETE https://middleware-daiedge.bisite.usal.es/api/v1/hardware/{HARDWARE_ID} \
  -H "Content-Type: application/json" \
  -H "x-session-id: {SESSION_ID}" \
  -d '{
    "walletId": "0000019a95f732ce0adb8f69ccc7d362",
    "password": "WalletPass123!",
    "did": "did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7"
  }'

Request Body

FieldTypeRequiredDescription
walletIdstringYesYour wallet ID
passwordstringYesWallet password
didstringYesYour identity DID (format: did:ethr:{network}:0x...)

Response (200 OK)

{}

Authorization

You can delete hardware if:

  • You are the hardware owner, OR
  • You have HARDWARE_OPERATOR_ROLE AND are a valid delegate of the owner

Error Responses

CodeErrorCause
404WALLET_NOT_FOUNDWallet doesn’t exist
404HARDWARE_NOT_FOUNDHardware ID not found
400WRONG_PASSWORDWallet password incorrect
400INVALID_DIDIdentity DID format invalid
403INVALID_WALLETWallet doesn’t belong to you
403HARDWARE_OWNER_ROLE_OR_HARDWARE_OPERATOR_ROLE_REQUIREDMissing required role

Next Steps

Now that your hardware is registered, you can:

Related Topics