## 6 System Architecture
Similarly, the list is updated during regular operations if there are any deviations in metrics like packet loss, end-to-end delay, message overhead, or energy consumption. Below is an elaborate description of the functionality of the blockchain ledger updater module as a smart contract. * Smart contract deployment: The fog server deploys the smart contract in the selected blockchain network. The smart contract's code contains the logic for managing the global trust list and processing trust-related data. The deployment process involves uploading the compiled smart contract code to the blockchain platform through relevant APIs or tools. * Receiving trust parameters: The blockchain ledger updater module receives trust parameters from multiple sources, including the device discoverer module, which keeps a record of all nodes entering and leaving the CPS network. Trust parameters from various nodes, such as packet loss, end-to-end delay, message overhead, and energy consumption, are gathered and sent to the blockchain ledger updater for further processing. * Global trust list update: Based on the trust evaluation results, the blockchain ledger updater module updates the global trust list (BRGTL) in the blockchain. The list contains entries for each node, reflecting their trust values and other relevant information. New nodes requesting to join the network have their entries added to the BRGTL. * Immutability and consensus: The smart contract ensures that the global trust list on the blockchain is immutable and tamper-resistant. Once trust data are recorded, they cannot be altered or deleted, ensuring the integrity and reliability of the trust registry. * Decentralization and transparency: As a smart contract in the fog layer, the blockchain ledger updater operates in a decentralized manner, thus removing the need for a central authority figure. * Logging and event handling: The module logs and handles events related to trust parameter updates and BRGTL modifications. By efficiently updating the BRGTL in the blockchain, this module ensures a secure and decentralized trust-management system for the CPS network. * Trust Disseminator: The trust disseminator is responsible for distributing the BRGTL from the fog layer to the device layer of the CPS network. The revised list is sent to the disseminator module after the trust has been determined and the blockchain has been updated. The disseminator module transmits the updated list to the device layer through the sink node, which is the third function of the fog server. This module is just in charge of trust distribution to the device layer and does not perform any calculations. A thorough explanation of the trust disseminator module's working is outlined below:  
* Receiving BRGTL: After trust calculations are completed and the blockchain is updated with the latest trust values for each node, the blockchain ledger updater forwards the BRGTL to the trust disseminator module. * Sending BRGTL to device layer: When the data have been prepared, the sink node allows the trust disseminator to send the BRGTL to the device layer. Because it acts as an intermediary between the fog and device layers, the sink node is the most appropriate option for sharing trust data. * BRGTL distribution: The primary function of the trust disseminator is to use the root node to transmit the trust data to each node in the device layer. It guarantees that each node in the network is aware of the reliability of its nearby peers and other nodes. * Synchronizing trust update: To guarantee that each node has access to the most recent trust values, the trust disseminator module regulates the trust changes in all nodes in the device layer through the root node. * Trust-based decision making: Nodes can decide how to interact with other nodes based on trust when trust information is quickly disseminated. During the RPL process, nodes are able to employ this information to assess the reliability of prospective parents or children.