Skip to content

Model Info Data Objects

bradreevmx edited this page Jul 13, 2018 · 1 revision

The ModelInfo contract manages the ModelTable.

The ModelTable is indexed by the ModelId, with each ModeId being managed individually. (See the Manufacturer interface for details.)

The ModelInfo contract does not provide any APIs to generate the ModelID as truly random numbers are difficult to generate in a distributed contract, while local generation and verification of uniqueness can be done without gas fees.
From a Geth prompt, a modelId can be generated and verified with the following steps:

  • loadScript("LoadDeviceInfo.js")
  • personal.newAccount("Passphrase")
  • DeviceInfo.Read(** Account created from newAccount **)

If the values returned are as follows, then the ModelId is unique, and may be used. Otherwise, generate another account number and retry.
["", "0x0000000000000000000000000000000000000000", 0]

Data Table[ModelId]

Name Write Access Type Description
AdminList Admin address[] List of users who have admin rights
MediatorList Admin address[] List of mediators who can recover account ownership
MediatorNewAdminList Mediator[x] address[] List of account owner that each mediator has nominated
MediationState Mediator and Admin uint Current mediation state of the record. See Mediation section for more details. ***TBD ***
Data Admin string JSON description of the device. ***TBD do we need schema in contract **
MfgId Admin address Account ID of the manufacturer. This may be a hash of the public key used by the manufacturer's signing key.
Component Admin address[] List of sub-devices included in the Model. For example, a light bulb may contain a ZigBee and WiFi Module.

Clone this wiki locally