*5.2. Deploying the Blockchain*

To run the experimental setup, firstly, the *Ganache* blockchain was deployed in the *BCS* machine. By default, *Ganache* generates some public keys for users, and all the users receive 100 *Ether* transactions. Each member VM (EV1,2, HCS1,2) got a public key and used that as its public identity. Then, the members joined the blockchain by using the *Metamask* wallet.

During development, we kept the amount of charge open to receive manual entry so that it could receive user input rather than automatic calculation by the charging agent. After deploying the blockchain, we requested different amounts of charging in KWs manually. After receiving the entry from the members, the SBS module generated the amount to be paid and requested a blockchain transaction. Due to the simplification, the proposed system can generate the block almost instantly after the request and broadcast it to all the members. During the block generation process, the amount of cryptocurrency, i.e., *Ether*, is deducted from the EV's account and credited to the HCS's account. Additionally, the service receiver EV can provide a rating score (out of 5), and the server will calculate the mean of all the reputation scores received by each HCS. The rating score will be available publicly. By using the web interface, all the members can check the global (and also own) transaction histories, financial statements, and rating points (provided or received).

Multiple transactions were performed to analyze the system. After running the simulated system, data were prepared manually, and by using smart contracts, information was added to the *transaction()* function according to the message structure (presented in Figure 4). After inserting those data, a transaction was performed in the blockchain. Details of some of the performed transactions can be found in Figure 6.


**Figure 6.** Transactions in the *Ganache* blockchain.
