## 4 Case Study Implementation Using Hyperledger Fabric
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Name** & **Property** & **Type** \\ \hline \multirow{6}{*}{Notebook} & old & String \\  & notebook status (instore, available, in use, callback) & Enum \\  & Provider & Object \\  & user (active) & Object \\  & Remark & String \\ \hline \multirow{6}{*}{Login password} & old & String \\  & user (active) & Object \\  & Notebook & Object \\  & Password & String \\ \hline \multirow{6}{*}{Service issue} & old & String \\  & User & Object \\  & Provider & Object \\  & issue status (submitted, in progress, solved, unsolved) & Enum \\  & issue note & String \\ \hline \multirow{6}{*}{Service level agreement (SLA)} & old & String \\  & Provider & Object \\  & service level (basic, standard, premium) & Enum \\ \cline{1-1}  & service type (operation, storage, connection bandwidth) & Concept \\ \cline{1-1}  & service level monitoring (TAT, MTTR, gathering cycle) & Concept \\ \cline{1-1}  & Pricing & Double \\ \cline{1-1}  & unit (hour) & Double \\ \cline{1-1}  & SLA status (invalid, available, subscribed) & Enum \\ \cline{1-1}  & violation (default: false) & Boolean \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Asset definition in the smart contract. The transaction process function is the logical operation of a transaction defined in the smart contract as shown in Figure 9. The structure of this function includes decorators and metadata followed by a JavaScript function, both parts are required for a transaction to work. As shown in Algorithm 1, the pseudo code for the transaction processor function relating to the \"Subscribe SLA\" transaction is to modify the status of both the SLA asset and the current consumer. This transaction will execute only when the status of the SLA is available. Then, it updates the status of the SLA asset, adds the associations between the SLA asset and the current participant, and emits an event. ```
/** * ProcessorfunctionforSubscribeSlaTransaction *@param{org.notebooksharing.biznet.SubscribeSlaTransaction}tx *@transaction */ asyncfunctionprocessSubscribeSlaTransaction(tx){ letcurParticipant=getCurrentParticipant(); if(tx.sla.status!==SlStatus.AVAILABLE){ thrownewError('Youcannotsubscribe a SLAwhichisnot\"AVAIALABLE\"); } //ChangeSAstatusandactiveuseraccordinally tx.sla.status=SlactStatus.SUBSCRIBED; tx.sla.activeUser=curParticipant; tx.sla.subscriptionTime=tx.subscriptionTime; //AddSAttouser'sactiveslIdlist if(curParticipant.activeSLAIGs==undefined){ currParticipant.activeSLAIGs=[]; } currParticipant.activeSLAIGs.push(tx.sla.getFullyQualifiedIdentifier());
```  
```
/*AddSAttouser'sactiveslIdlist if(curParticipant.activeSLAIGs==undefined){ currParticipant.activeSLAIGs=[]; currParticipant.activeSLAIGs=[]; currParticipant.activeSLAIGs.push(tx.sla.getFullyQualifiedIdentifier());
```  
``` /*AddSAttouser'sactiveslIdlist if(curParticipant.activeSLAIGs==undefined){ currParticipant.activeSLAIGs=[]; currParticipant.activeSLAIGs=[]; currParticipant. lake. Transactions are sorted into blocks in time order, and these blocks are cryptographically linked to each other to form a sequence of the chain, which enables the user to know the historical changes that took place in the off-chain data lake. In the real product environment, the real-time data from assets are needed to determine whether the violation happened over the life of the SLA contract. In this paper, the monitoring of the assets is not considered to simplify the case study. Figure 11 illustrates the simplified workflow of the notebook sharing case study. In the permissioned network, every participant of the system is required to obtain a certificate that contains the identity information and the connection file before connecting to the system. This certificate is issued through the register and enrollment processes that can be performed only by the system admin. The provider can register the basic information of the notebook, including the model name, manufacturer, and some other specifications. However, in this stage, the notebook is not visible to consumers unless the provider releases it.