DESIGN AND DISCUSSION

System Architecture

The TAG is managed by Ethereum blockchain. The smart contracts execution is the real motivation by which Ethereum drives out DAO. Three distinct languages such as Solidity, Serpent, and LLL are used to formulate smart contracts. Once coded, it is compiled and deployed in Ethereum blockchain. Solidity is a Java-based language that was created and upheld by the Ethereum people group. Serpent and LLL are Python-like execution and Lisp-like usage, respectively. Mostly, Solidity 0.4.8

Waste management system architecture

FIGURE 12.5 Waste management system architecture.

is used to create smart contracts for TAG. The applications on Ethereum are manufactured using Truffle and Embark systems. TAG collaborates with three smart contracts and it is deployed using Truffle v2.1.2. The overall architecture of a smart waste management system is shown in Figure 12.5.

Bank

The bank DAO is the portrayal of any certifiable association over blockchain. One of its significant aspects is the functional code of the blockchain cannot be altered after deployment. Hence it is difficult for the intruder to tamper the data. Individuals can change the principles or goals utilizing the voting mechanism. Such bank serves as smart contracts in real-world blockchain applications. The bank has the registries that hold addresses and balances of different parities. Each address has a unique account number to access the users. The addresses can be a record number of clients or different DAOs. This bank can be comprehended as a central bank that regulates the economy of DAOs. However, common currency “PercCoin” is used across different DAOs. Such currency is created using two techniques, and it can be easily implemented by accessing the codes from Github.

External Transfer

Trade rates can be characterized for various monetary standards used in the bank. Whenever users transfer a certain amount to bank, sender account information are updated in the registry and with appropriate measure of PercCoin with a conversion scale 1 Wei = 1 PercCoin is updated to the existing account balance of the user.

Minting

Ethereum creates the Ether tokens to create the blockchain where it can be transferred between the accounts to compensate the processing time of mining nodes. Mining the Ether requires more computational resources and it is highly expensive. Moreover, it also increase the network complexity. The bank can mint a comparable measure of equivalent currency to add it to the client’s record.

Community DAO

Community DAO can be comprehended as an association running to manage the waste in efficient way. All the proposals of members in community DAO is elected based on voting. All the voting rules are set during initialization and voting rules can also be updated based on new proposal request. Ethereum gives distinct layouts for different organization. A Congress format given in the Ethereum site is utilized here. The owning address can include and evacuate members based on the voting capabilities.

minimumQuorum

Quorum is one of the primary significant aspects toward normal adoption of block- chain among monetary ventures. Moreover, it is enterprise-centered, permissioned blockchain framework intended for financial transactions. These permissioned blockchains creates trust and operates between approved nodes [62]. minimum quorum represents the least number of members required to approve the new proposal from the member of Ethereum.

debatingPeriodlnMinutes

It is the maximum time limit set for users to vote for particular proposal. Suppose, if debatingPeriodlnMinutes is set as 5, all the members in communityDAO need to vote within 5 minutes.

majorityMargin

A new proposal requires sum of 50% of the vote and majority margin number of members to pass through communityDAO [63]. Suppose if there are 10 members in the community and if the majorityMargin is set to 1, then the total number of votes required to pass through the proposal is 6. However, for absolute majority, the margin is set to -1 or it simply left to 0.

SGB Factory

SGB Factory holds a record for SGB makers. It tends to be comprehended as a commercial center point and communityDAO can also support by raising funds. The individuals can choose their own investment amount for SGB and pass a proposal to transact fund amount to this SGB Factory. Once SGB producers receive funds, they transfer the same to SGB, which is one of the key features of blockchain. The blockchain transactions are used for exchanging goods and services.

SWM Server

Despite the fact that, blockchain has intense potential, were its advancement need to be acknowledged. The implementation of blockchain is highly complex where it requires more processing time and hence it undermined for high-speed applications. Due to this drawback, design of TAG is made hybrid, where a centralized server, smart waste management server or SWM handles parts that need quick read compose and blockchain innovation to deal with the user transactions. The SWM has the parts that are discussed in the following sections.

Telegram Bot

TelegramBot is a bot application that collaborates with both user and bots by sending command requests. User can connect with bot to determine balance or to produce QR-code that is expected to open the SGB. In the event that the clients have enough balance in their record, this bot creates a QR code and requests clients area. When the area is given, it is considered as the focus of the circle and the nearest SGB is identified and returned back to the client. The geoJSON and GIS queries in Firebase database are used to fetch geographical data.

Users have the option to go to the SGB to search the QR-code that had already been generated. When a generated QR-code is not reused, then the Telegram bot automatically opens up the new SGB connectivity.

API

A smart waste management application offers different API to communicate with user and bots with various data endpoints. The fundamental APIs used to retrieve the waste collection details are /api/info/:sgb_id and /api/filled_bins/:percent/:radi us/:lat/:lon, where it returns current location, waste amount, rate for given SGB id.

SCB Simulation

The simulation environment is set up using SGB simulator and QR code scanner. MQTT subscribe and publish queuing technique is used to connect to the server. The simulator examines the QR code produced by the Telegram Bot in client’s Telegram application and speaks with the server utilizing MQTT convention. Lids of SGB are opened with decoded QR code sent by SGB.

FireBase

Firebase is a cloud-based real-time database and data from each user is constructed in JSON format and stored in it. Rather than common HTTP demands, Firebase real-time database also provides data synchronization for each time data changes, and it will be updated in inside milliseconds in the devices. It supports both online and offline mode, in case of latter, when network is restored, the customer gadgets are synchronized with the present server state.

The SGB information like user account, waste-related information, geographical information, etc., is stored in the Firebase database. The geoJSON and GIS queries in the Firebase database are used to fetch geographical data, data related to geographical details can be easily fetched with location value and its radius. Whenever the user selects the option to throw the waste, all these geographical information are requested by Telegram Bot.

User sends his location information to NodeJs server through Telegram application. The latitude and longitude values are interpreted by the server and create the object for data access. The object and distance metrics are passed to query Firebase database to fetch all the SGBs available in nearby working zone. The circular working zone is characterized with constant radius of 3 km with center point as the latitude and longitude value sent from Telegram application. The radian value is obtained by dividing distance metric with radius value.

Similar to geographical information, transaction details is also stored as separate collection in Firebase database, where it holds details like user name, account number, amount of waste disposed, SGB details, rate for waste, transfer of perCoin rom user account to the SGB account.

The Firebase real-time database is not required for an application server. Security and data endorsement are open through the Firebase real-time database security rules, and rules are composed and executed at the time of data retrieval.

Tw'o information models are used to represent SGB and user transaction details in Firebase database. SGB model stores information related to location and waste. Similarly, the transactions model stores the information about exchanges made in the framework utilizing various traits like client account, weight of waste, cost of transaction, and so on.

Database schemas used in waste management system is detailed in the following sections.

 
Source
< Prev   CONTENTS   Source   Next >