Giter Site home page Giter Site logo

blockchain-iot / motoro Goto Github PK

View Code? Open in Web Editor NEW
105.0 21.0 39.0 1.08 MB

Smart contracts for decentralized rentals of vehicles.

Home Page: https://www.toptal.com/ethereum/motoro-iot-in-transportation

License: MIT License

JavaScript 83.39% HTML 1.49% CSS 2.36% Solidity 12.76%
iot blockchain dapp ethereum blockchain-iot truffle solidity workshop platform infrastructure

motoro's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

motoro's Issues

similar IoT projects

As the IoT is wide perspective there are some other projects developing in this space already. Maybe we can learn something by looking at their work. I have found 4 so far:

#1. IOTA
This one is using Tangle instead of blockchain. There is no need of PoS or PoW because when you are sending transaction you automatatically confirm 2 another transactions on the Tangle network.

github
IOTA Dev hub
whitepapre

#2. Waltonchain (just translate it in chrome + they have got English version of the whitepaper).
They are using Blockchain + RFID so basically you can attach their chips to everything you want (not only electronic devices).

whitepapre

#3. Vechain
They are pretty similar to Walton. They want to create whole ecosystem where eveything is labeled by their chips.

whitepaper

#4. Modum
Similar to Walton and Ve. They are targeting logistics

whitepaper

#5 Request Network
This project has had it's ICO recently and looks like they are planing to do something with IoT as well. But couldn't find any more information so far.

#6 Universa
This project also claims to be useable for IoT
whitepaper

Setup a CI system

It will be nice to have a CI system like travis to be sure that project always compile
And maybe check in the future linter and tests

How to communicate with ECUs?

The purpose of this discussion is to find the optimal, generic interface to ECUs.

Reading into ECU tuning, I could not find any generic ECU open-source hardware or software, until I stumbled on this awesome piece of software http://www.tuneecu.com/ (don’t be tricked by the funny looking website, the community states it's legit.)

That software is not compatible with KTM dirtbikes though. A user on another forum noted, that official KTM software for ECU tuning, can be downloaded for free, but they charge $500 for the cable. The OBD connector is CAN-bus, while the tuneECU supports the KTM Duke 690 and 990 motorcycles, which use K-Line OBD. Here is the link to the forum: http://ecuhacking.activeboard.com/t49773328/interfacing-to-ktm-keihin-ecu-canbus/

Obviously, it would be terrific for us to be able to connect an IoT device directly to the ECU. There are cables for that, e.g. https://www.powercellperformance.com/shop/tuneecu-programing-cables/
IMHO if we could skip the piggyback hardware in favor of software, it will get us much closer to our goal. One way to do this, would be to install tuneECU on a Raspberry Pi, solutions for that were found after a quick google.

Questions:

  1. any chance of creating a DIY CAN-bus connector?
  2. how do we interact with tuneECU running on the Raspberry Pi, connected to the motorcycle?
  3. any other thoughts?

UIKit doesn't render spinners in React

Expected behavior (user story)

I want to use uk-spinner inside JSX so that it renders properly.

Actual behavior

uk-spinner is placed inside DOM with decorated element (i.e. span or div) but remains invisible (has 0px width).

Steps to reproduce

Reproduced using either [email protected] or [email protected]
In JSX template, placing:
<div className="uk-spinner"></div>,
<div data-uk-spinner></div>, or
<span data-uk-spinner={''} />
will not result in proper rendering.

This issue mimics:
uikit/uikit#2663

Is falling back to [email protected] an option?

Refactor repository structure

As a lead developer,
I want the code structure to be simple,
have a single dependencies installation process,
and reflect the purpose for the project,
which is creating a set of smart contracts for vehicle rentals,

Functional testing

Feature request

As a CTO
I want to be able to test our smart contracts under real environment
then I expect to publish all contracts in TestNet
Where I can test all business requirements

Decentralized vehicle rental protocol

Feature request

As a product owner
to deliver appropriate contracts for vehicle rentals
I need to invent a trustless decentralized protocol
which involves only the motorcycle owner and renter
and involves storing cryptographic proof of the process
and does not involve any relay business
or other central authority

suggestion
try to depict the algorithm like a flow diagram

Versioning

Feature request

As a CTO
I want to be able to upload different versions of the smart contracts
then I expect to have an additional smart contract
Where I can redirect all requests from the old version of contract to a new one

Jest has incorrect test search path

Expected behavior (user story)

I want to run and complete tests using Jest with npm test

Actual behavior

Jest fails tests

Steps to reproduce

Run npm test

npm test

> [email protected] test /home/spoon/WebstormProjects/blockchain-IoT-core
> node scripts/test.js --env=jsdom

Error: Unknown config option "testMatch" with value "<rootDir>/src/**/__tests__/**/*.js?(x),<rootDir>/src/**/?(*.)(spec|test).js?(x)". This is either a typing error or a user mistake and fixing it will remove this message.
 PASS  src/App.test.js
 FAIL  scripts/test.js
  ● Test suite failed to run

    SyntaxError: Identifier 'jest' has already been declared
      
      at Runtime._execModule (node_modules/jest-runtime/build/index.js:442:13)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:118:7)

Test Suites: 1 failed, 1 passed, 2 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.36s
Ran all test suites.
npm ERR! Test failed.  See above for more details.

Looking at SyntaxError: Identifier 'jest' has already been declared we can tell that Jest tries to run scripts/test.js, treating it as test. This is because "testMatch" with value "<rootDir>/src/**/__tests__/**/*.js?(x),<rootDir>/src/**/?(*.)(spec|test).js?(x)" filter doesn't work in current Jest version (19.0.0+)

Related:
facebook/create-react-app#1319
https://facebook.github.io/jest/docs/en/configuration.html#testmatch-array-string

Update README

As product owner,
I want the README file to be up-to-date,
so that onboarding comes easy-breezy

IoT Platform choice

Let's choose the base platform for the project

Take a moment to read through this whitepaper, and hopefully also some of the articles, listed in the references in README.md

We need to pick our platform :) this is actually good fun, but the decision will be critical to our project.

A few key points to keep in mind here:

  • we should be able to develop at a fast rate
  • performance in terms of inter-device communication – looking at http://codeandlife.com/2012/07/03/benchmarking-raspberry-pi-gpio-speed/ we should srsly consider the programming language that the platform supports. I am not sure if C is the only option, there are alternatives, like C++ or Rust, but let's not take this lightly :)

Questions

  1. what frameworks should we take into consideration?
  2. which one seems to be the best option for us?
  3. for what reasons?

Apply style corrections from #23

As lead developer
to reduce tech-debt and have style consistency across the project
I want to have the suggested changes from PR #23 committed into the repo
So please check out the comments under that link

Communication design

The project needs some kind of visual communication (industrial?) design. In particular, we should discuss:

  • the names for the project, and the repos
  • the logo
  • the visual language we will use throughout the app (I would suggest Material Design)

All suggestions welcome!

Create dapp to register new vehicle

Feature request

As a motorcycle owner
to register and rent out motorcycles
then I expect to have a web interface
to access the smart contracts
and create a representation on blockchain

Required fields:
// check with ABI or the source code
utilise the react truffle dapp found in src/notary
use ui-kit https://github.com/uikit/uikit

Decentralized vehicle registration protocol

Feature request

As a product owner
to deliver appropriate contracts for vehicle registration
I need to invent a trustless decentralized protocol
which involves only the motorcycle owner
and involves storing cryptographic proof of the process
and does not involve any relay business
or other central authority

Suggestion

  1. Try to depict the algorithm like a flow diagram
  2. We can assume that the vehicle's registration documents and insurance are proofs that the motorcycle owner has the right vehicle disposal

Decentralized vehicle rental protocol – assumptiont for smart contracts

As a product owner
to deliver appropriate contracts for vehicle rentals
I need to invent a trustless decentralized protocol
which involves only the motorcycle owner and renter
and involves storing cryptographic proof of the process
and does not involve any relay business
or other central authority

Suggestion

  1. Try to depict the algorithm like a flow diagram

Smart Contract for user

As the product owner,
When new users join the system,
Then I expect there is a Smart Contract for them,
So that they can add new machines,
And so they are represented on the blockchain

Error when getting the container up

I am using docker compose to define my multi-container application and when use docker-compose up to start the services I get the following error regarding couchbase server

"couchbase_server_1 | standard_init_linux.go:190: exec user process caused "no such file or directory"

Following is the console o/p and I'm using docker toolbox in windows 10 machine. What could be a possible reason for this? Please advice.

$ docker-compose up
Starting getmcrew2services_couchbase_server_1 ... done
Starting getmcrew2services_tpm_1 ... done
Starting getmcrew2services_sync_gateway_1 ... done
Starting getmcrew2services_tp1_1 ... done
Starting getmcrew2services_tmsdm_1 ... done
Starting getmcrew2services_auth_service_1 ... done
Starting getmcrew2services_auth_proxy_1 ... done
Starting getmcrew2services_nginx_1 ... done
Attaching to getmcrew2services_tpm_1, getmcrew2services_couchbase_server_1, getmcrew2services_sync_gateway_1, getmcrew2services_tp1_1, getmcrew2services_tmsdm_1, getmcrew2services_auth_proxy_1, getmcrew2services_auth_service_1, getmcrew2services_nginx_1
couchbase_server_1 | standard_init_linux.go:190: exec user process caused "no such file or directory"

Initial tool set

We need to pick our initial set of tools, to start working on the first prototype, or Pilot – Alpha.

IoT Platform

This piece will most likely be the biggest one. With regard to the requirements for the end products, described in README.md and in the Wiki, let us discuss and choose the base IoT platform, or another set of open-source software, serving as modules for our future tool set.

To clarify: we can either choose a large platform, and use the visualization apps etc., which come bundled, or choose a library which only cares for visualization, and integrate that into our project.

Blockchain

Here we need to decide which Ethereum client we want to use; or decide if perhaps an all together different ledger, would be better suited.

Ethereum clients

http://ethdocs.org/en/latest/ethereum-clients/choosing-a-client.html

Ledgers

Notable projects

IoT devices

What kind of devices are we going to use to connect the machines? The initial thoughts would go to Raspberry Pi 3, because it is very popular and can support multiple use cases. Perhaps Arduino would be the better choice, due to its low complexity? Or maybe a totally different product? Cast your votes :) and please explain the reasons behind them.

State is undefined

Expected behavior (user story)

Clicking the register button on the main page (Create new instance of MachineOwner contract) should create new instance of MachineOwner contract and give access to register new machine.

Actual behavior

After clicking the register button on the main page application throws App.js:132 Uncaught TypeError: Cannot read property 'state' of undefined
It is for sure related to App:144 where we put callback without binding it.
The same is with App.js:L148-L149

Steps to reproduce

  1. Click the register button on the bottom of the page
  2. Check console for undefined state error

Design the process of Ownership Aproval

As a product owner
to deliver appropriate contracts for vehicle registration
I need an algorithm of bike owner authorization
which involves a list of well know documents
and a list of other documents
which are a proof of bike ownership
and the process of their validation

Actual behavior

Steps to reproduce

Smart Contract for representing machines

As a user,
When I want to add a new machine to the blockchain,
Then I expect there is a Smart Contract to represent it,
So that I can interact with it,
And perform actions, on it, such as rent it out to other users,
And so it is publicly available on the blockchain

Cleanup repository from build artifacts

Expected behavior (user story)

As a developer,
I want the repository to be clean of build artifacts

Actual behavior

Contract jsons are versioned in the repository in build/contracts

Unit test coverage

As the product owner,
I want the code in the repo to be bulletproof
And have the business logic covered by unit tests
So that other people can actually use it

Create dapp to register new owner

Feature request

As a user
to register as a motorcycle owner
then I expect to have a web interface
to access the smart contracts
and create a representation on blockchain


Required fields:
// check with ABI or the source code
utilise the react truffle dapp found in src/notary
use ui-kit https://github.com/uikit/uikit

Dockerize + handle docker image

Is your feature request related to a problem? Please describe.
We need the project to run in a Docker container, so that hosting is easily manageble

Describe the solution you'd like
Please

  1. add a Dockerfile,
  2. make sure that the docker image is built on Travis CI builds

Describe alternatives you've considered
We thought initially about relying just on package-lock.json, but we cannot deploy node.js apps with the same ease as Docker images

Additional context
The blockchain node used by the dapp should be external, provided via env variables.

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.