|
Algorithm 3. Device trust insertion and update rules for smart contract
|
Require: Trust Value (), Node Identification (), System Identification (), Fog Address ()
-
1:
Parameters:
block_chain: Blockchain
System: Object
Gateway: Object
Fog: Object
-
2:
if (fog_system_mapping(sys.id) = fog_address) then
-
3:
if (fog_verifier(fog_address,block_chain) = true) then
-
4:
if (Node_exist(node.id) = true) then
-
5:
if (system_node_mapping(sys.id) = node.id) then
-
6:
update_trust(node.ID, , block_chain)
-
7:
node_trust_mapping(node.id, )
-
8:
else
-
9:
return error()
-
10:
end if
-
11:
else
-
12:
return error()
-
13:
end if
-
14:
else
-
15:
return error()
-
16:
end if
-
17:
else
-
18:
return error()
-
19:
end if
|