/prometheus

Primary LanguageJavaScript

Prometheus

dApp for collecting IoT Data.

Prerequites

  1. Install NodeJS and NPM
  2. Install truffle, ganache-cli and angular-cli global ```npm install -g ganache-cli truffle @angular/cli

Setup

  1. Execute npm install in Project directory
  2. Run ng serve to start a local webserver which serves the webpage
  3. Run node server.js to sign and send a Testtransaction

Compile and Migrate Contracts (already deployed, see build directory)

  1. Run truffle compile to compile Contracts
  2. Run truffle migrate --reset --network="rinkeby to deploy on Rinkeby Network"
  3. Run truffle migrate --reset to deploy on localhost:8545 (First, start Local Node e.g. ganache-cli)
  4. Run truffle develop or truffle test to execute Truffle Tests

Project Structure

  • ./build contains Artifacts with ABI, Bytecode, Deployed Addresses and more generated by Truffle
  • ./contracts contains the Solidity Smart Contracts
  • ./e2e contains End-to-End Tests for Angular Frontend Application
  • ./migrations contains Scripts for Deploying Smart Contracts
  • ./src contains Source Code from Angular Frontend Application
  • ./test contains Tests for Smart Contracts

Running unit tests

  1. Run ng test to execute the unit tests via Karma.
  2. Run truffle test to run tests associated with your solidity smart contracts. The test folder for this can be found in the test directory at the root level of this project

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor. Before running the tests make sure you are serving the app via ng serve.

Technologies & Languages Used

  1. Angular4 (Typescript/Javascript)
  2. Truffle (Solidity)