Coder Social home page Coder Social logo

iot-rbac's Introduction

DECENTRALIZED ACCESS CONTROL WITH IOTA

INSTALLATION GUIDE

Requirements

  • Node.js and NPM
  • An Apache server (XAMPP for windows)
  • Ganache
  • Metamask browser extension
  • Truffle (globally installed from npm) Tip: install it by running the command npm i -g truffle

Move your application to a directory that can be used with your Apache server

For windows move your application to C:\xampp\htdocs for windows. And update the $base variable in /views/components/header.php to /your_folder_name and /routes.php to /your_folder_name/ notice the forward slashes in both.,

For linux move to /var/www . A config file should be created on in /etc/apache2/sites-available to serve the application folder. Dont forget to enable the config.

Start Ganache and create a new workspace.

While creating a workspace, you can add a project by clicking the "add projects" button and navigate to your application folder, and select the truffle.config.js file. This step is not important but can help you keep logs on Ganache.

Click "save workspace".

You will be taken to a page with a list of 10 eth accounts. Copy your network id and rpc server details located at the top of the ganache application. Update your truffle.config.js file with the details you copied (the host is the number before the colon (:) usually 127.0.0.1 and the port is the number after the colon. And set http_host to your rpc server in /js/web3.js line 5.

Install the metamask extension for your browser and follow the following tutorial https://dapp-world.com/blogs/01/how-to-connect-ganache-with-metamask-and-deploy-smart-contracts-on-remix-without-1619847868947, to add ganache to metamask.

Now run the command npm install to install dependencies, npm run build to compile and generate the required css, and truffle migrate โ€“-reset to compile and deploy smart contract. And navigate to the url of your project. You can run `npm run watch

` to use tailwindcss.

FUNCTIONALITY

  1. Manage My Devices:

The "Manage My Devices" / home page lists all the devices that are owned by the connected account. You can click on any of the devices to manage the device (toggle between functions and edit device name or function count).

Clicking any of the device takes you to a manage device page which will be discussed later.

  1. Register Devices:

The register device page allows you to register new device. It takes the following parameters:

  • Device Name - Name of the device. This can be anything, use a name that you can easily remember.
  • Min Function Count - The minimum number when the device is on e.g 1 for fan, 16 for air conditioner. Must be greater than 0 since 0 indicates off.
  • Max function Count - Should be greater than or equal to Min function count. It is the maximum number a device can be set to. Some fans have a max of 3, so the max will be 3.

Once a device is created the function is set to 0. That is the device is set to off after registration.

  1. Manage Device:

This page allows you to edit device name, minimum function and maximum function count. It

also allows you to toggle between functions and transfer ownership of the device.`

  1. Simulate device:

This page shows the simulation of created devices. By default the system maps the first 4

created devices to a simulation of Fan, Bulb, Ac and Smart Door Respectively. It is

recommended to follow this pattern when registering your devices. Every device coming

after this will be considered an unconfigured device.

iot-rbac's People

Contributors

xenonwellz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.