Skip to main content
. 2020 Dec 22;21(1):23. doi: 10.3390/s21010023
Algorithm 2. Sensor node registration rules for smart contract
Require: Node Identification (node.id)
  • 1:

    Parameters:

    block_chain: Blockchain

    System: Object

    Gateway: Object

  • 2:

    if(System_exists(sys.id, block_chain) =true)then

  • 3:

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

  • 4:

      register_device(node.id, block_chain)

  • 5:

      system_node_mapping(sys.id, node.id)

  • 6:

      node_trust(node.id, “50”)

  • 7:

    else

  • 8:

      return error())

  • 9:

    end if

  • 10:

    else

  • 11:

    return error())

  • 12:

    end if