Skip to content

0Alic/COBrA_DApp

Repository files navigation

COBrA_DApp

Client side application of https://github.com/0Alic/COBrA-Smart-Contract. The backend, i.e. the smart contracts are extended (as explained in the report).

A simple content sharing platform backend / frontend on Ethereum blockchain. Final project of the Peer To Peer and Blockchains course at the university of Pisa, academic year 2017/2018.

The goal of this project concerns to learn how to write a client application (in this case a web app) interacting with Solidity smart contracts. This application has no practical use, and the contents have no real "content" to display (sorry if in the other page I have promised that the DApp would store the actual contents 🐑).

In any case, I would like to thank DApp univeristy with this great tutorial who helped me a lot at the beginning.

🚧 Warining 🚧 : contracts need to be updated for the new Solidity compiler V 0.5 and Truffle V 5.0.1

Tools used

NodeJS to download Truffle and other useful packages. Truffle basically helps you to compile your smart contracts, provides you abstractions to interact with them in your client side application and helps you to deploy your contracts on a local blockchain or on real one.

  • To create a local blockchain and get some fake accounts to interact with I have used Ganache;
  • to deploy on a real blockchain (in my case, the test chain called Ropsten) I have exploited an Infura node running an Ethereum client (instead of using Geth, since I would need to sync with Ropsten (download it) in order to interact with it) following this tutorial.

Finally Metamask. In any case, the tutorial linked above exaplains everything way better than I do here.

Install and run

  • Install NodeJS;
  • Install Truffle npm install truffle -g
  • git clone this repository;
  • npm install;
  • Install Metamask.

Local blockchain

  • Install Ganache;
  • Run Ganache (my case, port 8545);
  • Open Metamask, import account from Ganache (by copying the private key);
  • truffle migrate --reset (it also compiles the contracts);
  • new tab and npm run dev to run a local server to enable ajax calls (to retrieve JSON contracts);

Ropsten


Latex code for code highligthing:

Releases

No releases published

Packages

No packages published