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

    Parameters:

    block_chain: Blockchain

    System: Object

    Gateway: Object

  • 2:

    if (system_exists(sys.id, block_chain) = false) then

  • 3:

    if (gateway_exists(gt.id, block_chain) =  false) then

  • 4:

      register_SID(sys.id, block_chain)

  • 5:

      concerned_gateway(gt.id, sys.id)

  • 6:

      fog_system_mapping(sys.id, fog_address)

  • 7:

    else

  • 8:

      return error()

  • 9:

    end if

  • 10:

    else

  • 11:

    return error()

  • 12:

    end if