In this section the schematic of different modules of implemented Peer to Peer energy trading framework using IOTA blockchain in accordance with the present invention. A user connected to solar panel is an energy producer who sells its energy to consumer devices. A single channel low cost INA219 current/voltage/power sensor that comes in the form of a breakout board and is connected to the Raspberry PI controller pins. A potentionmeter is a variable resistor placed in the circuit to simulate variable power usage. At interval of 1 hour (callback function of MAM) we calculated the average power usage for that period and multiply with the time (one hour) and the energy price in IOTA’s network they both agree upon through smart contract. Finally, after interval of 1 hr, the PI automatically creates a new IOTA transaction and transfers the calculated IOTA light wallet 2.5.4 wallet tokens from the consumer to the producer address before starting a new period. The WiFi module and device controller are used to interface with the IOTA NW.
Setting up an IOTA node and seed generation
The IOTA node has been installed on a local machine. The IOTA node has integrated with the energy trading application. Although IOTA supports many languages, we considered Java. The Openjdk version 10.0.2 has installed in an Ubuntu 18.04.4 machine for the proposed application. Then we run the IOTA node after installing the iri java file. IOTA node is configured by setting the parameters in the iri.ini and a script for starting the IOTA network. The complete requirements with their specification are shown in Table 1 Finally when the node is running, we found the db and logs of that node has created. It provides two basic implementation specification one is iri and another is IOTA wallet. To execute the java archive we created a script file named as start.sh. we used the screen command to create node in console mode in the background. The basic configuration in iri.ini is set by setting the IRI port number to 14265, UDP_RECEIVER_PORT=14700, neighbors, ixi_dir, headless, debug, testnet and db_path. IRI port is configured so that the node is going to expose all its interfaces. The UDP receiver port is used to receive the connection from its peers to sync up its Tangle node. The neighbor’s configuration has the address of neighbor of peers that node needs to create a synced up database called tangle. The IXI directory is the directory of extensions like messaging that IOTA provides. The HEADLESS flag indicates that we are not running the nodes to be connecting to a ledger wallet. Listing 1, 2, 3 shows how the neighbours are added, attached to Tangle, and broadcast-ed to all node. Figure 4 shows a sample of IOTA transaction bundle structure. Similarly Fig. 5 refers to designing Masked Payload Energy Data of Consumer. To interact with IOTA network these commands are executed. We found the log files by tailing them.
Deployment of nodes and address generation
Table 2 indicates scenario of energy trading between two communities has been simulated. The participant in the producer group has to broadcast or request their amount of energy to sell. Although they produces a sum of 66.5KW, but they have to sell only 50kw to consumers on the specified date and time. The IOTA Tip selection strategy is will consider the highest value (KW) first. As you can see, we have only considered 20KW of P102, 19KW of P103 and 11KW of P105 for selling. Figure 6 shows Tangle structure of our proposed model, where node C9 and C7 are the Tips before the arrival of new transaction C10. The shown DAG for the proposed framework can generate cumulative weight of 50. Consider each of the participant in producer group have 0 tokens as a balance except P107. After energy trading is completed the energy transaction and payment of IOTA tokens are updated in the Table 2. Similarly, Table 3 indicates energy trading within the same community. Although P107 is producer and produces very less amount of energy and need 10KW more amount of energy. It is observed from the Table 2 that the rest amount i.e., 11.5 KW is available to trade among themselves in producer community. Participants 107 of the producer wants to buy 20KW with the same condition. After 50KW trading is over the participants P101, P104, P105, P106 have balance of 5 KW, 2.5 KW, 1.5 KW, 1.5 KW. So, the energy transaction of 10 KW against 100 token takes place. Finally, the values are updated in the Table 3.
Setting up energy trading application by Java client (API)
We run IOTA nodes on Raspberry Pi 3 as a light node along with current and voltage sensor (INA219) for publishing to and fetching data from the Tangle. IOTA provides IOTA java which is a client API that is a thin wrapper over the JSON RPC calls. To interact with the energy trading IOTA application the API was run. Eclipse is used to setup the java IOTA client (JOTA) and ran the API through some test cases. Iota java is installed which is a repository of IOTA ledger. To interact with IOTA, we build an address through Trinty wallet which generates seeds. Further, we supplied the protocol i.e., https, host name and the port, as it is running locally. Provided the local PoW through Perl driver which is an engine that generates POW locally. Created the client separately where introducing the SSL certificate. To generate an address an IOTA needs a seed. Seed is like a password or a private key that maps to an address. We received the hashes for the tips. It is found out the effect of transaction by submitting to the API. From the Tangle explorer, we collected an address for which there is a transaction. To retrieve the transaction details like hash, address, timestamp, index values, transaction bundle, branch and trunk transaction, nonce, has been added with a list of addresses. getInputs function returns the combined balance of all the addresses available for our seed. It also transfers IOTA from one seed to the other. Passed the tips to find the milestone transaction hash. Attach to Tangle is an API that is needed to execute PoW and submitted.
Setting and integrating IOTA network
IOTA private network is designed, which is a collection of interconnected nodes, and each node stores a copy of the Tangle through a Hornet plugins. The energy trading private network essential means any access to the Tangle requires permission. Testing of our energy trading application conducted in a local environment. Retrieval of data at any time in future and confirming the signed transaction has been done. The timestamp is attached at which this transaction was sent.
This news is republished from another source. You can check the original article here.