Coder Social home page Coder Social logo

ip5's Introduction

IP5: Book Licensing and Publishing on the Blockchain

This Project demonstrates the basic foundations of a blockchain application that facilitates the trading of book licenses. Within this repository are smart contract files which, when included in an ethereum based blockchain, can be interacted with using either the Remix and solidity online IDE or by using the developed frontend application developed by our team.

The front end was developed using React and connects directly to the Reverse Oracle contract "userapp.sol" in order to send and recieve data from the blockchain. Alongside the Cloud Firebase database, this application demonstrates the typical usage of the contracts without the need for a fully fledged application.

Below are relevant instructions to use the application.

NOTE: Because this application uses a cloud database, errors may occur if attempting to use several different instances of the same Oracle contract.

This is because the data on the database does not automatically clear when a new contract is created.

If there needs to be more than one contract made, please contact someone from the team so the database can be cleared.


Requirements / Installations

First of all a few things are required.

  1. Remix needs to be used to deploy relevant contracts which may require the "remixd" application installed on the local machine too.
  2. A Ganache test chain is needed, in particular it needs to be hosted on the local host on port 8545. (All contracts should be deployed to this chain)
  3. Using npm or otherwise, install all of the requirements in the package.json file located in the "front" folder. If for some reason this doesnt work, the dependencies are below: "dependencies": { "bootstrap": "^4.3.1", "firebase": "^9.9.1", "react": "^18.1.0", "react-bootstrap": "^1.0.0-beta.5", "react-dom": "^18.1.0", "react-scripts": "2.1.5", "web3": "^1.0.0-beta.46" }

Setting Up

  1. Granted the above requirements are fulfilled, simply launch the ganache test chain and make sure to use one of the given accounts on the chain by default.

  2. Copy the private key from ganache to eth_accounts/accounts.json

  3. Once this is done, run

    npx tsc && node build/index.js deploy

    it will deploy the contracts

    image-20220807105351905

  4. This allows for the oracle to be deployed with the addresses of the transfer and bookFactory. Keep note of this address too.

  5. From here return to the ./front folder and then go to ./front/src/config.js

    image-frontfolder
  6. Modify the corresponding environment variables for the BookFactory and userApp addresses.

    image-configjs

Run

Simply use npm start from the ./front folder to start the frontend. Which should automatically connect to the testchain ready to be run.

ip5's People

Contributors

forever6 avatar itslame avatar eliciaauduong avatar

Watchers

 avatar  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.