Skip to main content
. 2020 Dec 22;21(1):23. doi: 10.3390/s21010023
Algorithm 4. Node trust verification rules for smart contract
Require: Node Identification (node.id), System Identification (sys.id), Gateway Identification (gt.id)
  • 1:

    Parameters:

    block_chain: Blockchain

    System: Object

    Gateway: Object

    Fog: Object

  • 2:

    if (fog_system_mapping(sys.id) = fog_address) then

  • 3:

    if (Node_exist(node.id) = true) then

  • 4:

      if (gateway_exist(gt.id) = true) then

  • 5:

       if (concerned_gateway(gt.id) = sys.id) then

  • 6:

        return node_trust(node.id)

  • 7:

       else

  • 8:

        return error()

  • 9:

       end if

  • 10:

      else

  • 11:

       return error()

  • 12:

      end if

  • 13:

    else

  • 14:

      return error()

  • 15:

    end if

  • 16:

    else

  • 17:

     return error()

  • 18:

    end if