Algorithm 1 Registering a device with the service registry. |
Require: |
B: Global state of the blockchain. |
P: Service registry smart contract caller. |
: Device’s digital identity. Must be unique within an organization. |
: ID of the organization to which the device belongs. |
: Nickname of the device. |
: A short summary of the device’s function and usage. |
: The date and time when the last update is made to the device information. |
Ensure: |
Device information is saved or updated in the blockchain. |
1: if
GetCallerPermissions
then
|
2: return error ▹ Abort if caller is not allowed to update the blockchain |
3: end if
|
4:
GenerateDeviceId
▹ Generate device ID from its digital identity |
5: if
GetContractCallerId
then
|
6: return error ▹ Abort if caller impersonates another device |
7: end if
|
8: if
GetContractCallerOrgId
then
|
9: return error ▹ Abort if caller impersonates another organization |
10: end if
|
11:
Serialize
|
12:
|
13: return
|