Skip to main content
. 2022 Jul 7;22(14):5119. doi: 10.3390/s22145119
Algorithm 6: Simulating the Framework
whilesimulationdo
//Initialization
fori in r∗, r∗∈R∀∗ = 1, 2, 3, …, n do
   Algorithm 5← call
  forj in ido
   xi∗[j].node← compile contract
   xi∗[j].node← deploy
for i in v∗, v∈V= 1, 2, 3, …, n do
  Algorithm 5← call
//Network Update
for i in x*, x*∈(v*, r*) do
   for j in adj.m, m*ϵN∀∗=1, …, n do
   if Algorithm 1(new_v)== truethen
     Algorithm 5← call
     contract ← sendMessage() ← v*[i].node
    r[j].node← contract ← v*[i].node
    while msgrequest(v*[i].node)==1 do
     for k in v∗, v∗∈V ∀∗=1, 2, 3, …, n do
      if v∗[k].cert == true then
       v∗[k].cert← Permission
       generate v∗[k].ID
       for m in kdo
        vi∗[m].node← compile contract
        vi∗[m].node← deploy
            vi∗[m].predecessor = null
            vi∗[m].node.successor = reg_veh.find_suc(v)
        sp = { vk∗[m].predecessor, vk∗[m].node.successor}
        ifsp∈ (v, vk∗[m].node.successor)then
          sp = vk∗[m].node.successor
        if ((vk∗[m].predecessor == null)or vi∗[j].predecessor ∈ (v, vi∗[j].predecessor)then
          vk∗[m].predecessor = reg_veh
         name[t++] = Algorithm 4(v + 2t−1)
      else ifv∗[k].reg ==1 then
        whilemsgrequest(v*[k].node)==1 do
        if PUFCRP(v∗[k]) ==1 then
         v∗[k].cert ← Issue
         Set v∗[k].cert = 1
        else
         v∗[k].cert ← Reject
         Set v∗[k].cert = 0
      else
       v∗[k].cert ← Reject
       Set v∗[k].cert = 0
  //Update LocalBC
  for i in r*, r*ϵL∗=1, …, n do
   Algorithm 2← call
  for j in adj.m, m*ϵN∗=1, …, n do
   while MIN(Texii,Texjj)do
     contract ← sendMessage() ← r*[i].node
    r[j].node← contract ← r*[i].node
   Algorithm 3(MinerNode, ControllerNode)← call
  Clear Block from bB-1 to bB-N
  //Update GlobalBC
  for i in r∗, r∈G∗=1, 2, 3, …, n do
   Algorithm 2← call
  for j in adj.m, m*ϵN∗=1, …, n do
   while MIN(Texii,Texjj)do
     contract ← sendMessage() ← r*[i].node
    r[j].node← contract ← r*[i].node
   Algorithm 3(ControllerNode, CloudServer)← call
  Update GlobalBC
  Replicate and filter data from GlobalBC to Cloud_Server