Skip to content

Vjais/Blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Blockchain

An Ethereum Blockchain to store and add CS Courses to the blocks using a web application. An Ethereum Blockchain to store and add CS Courses to the blocks using a web application.

Steps to migrate and deploy the Dapps Make sure you have npm and node installed.

Open terminal and navigate to the project directory

Type "truffle migrate -f 2 --network rinkeby --reset" to migrate the contract to the rinkeby test-net

Now your blockchain is live in the test-net.

To deoloy the fron-end files navigate to the downloaded go-ipfs software in your terminal and type "ipfs init" and then "ipfs daemon"

Let the daemon run in that terminal. Open up another terminal and make a directory named 'dist' in the go-ipfs directory and put all the build files and the 'src' directory files in the 'dist' directory.

To serve the files in the ipfs system type "ipfs swarm peers" and then type "ipfs add -r dist/".

You will get a cryptographic hash which is used to access the files after deployment.

Publish the files using "ipfs name publish COPY DIST HASH HERE"

To access the dapp in your browser type the url "https://gateway.ipfs.io/ipfs/COPY YOUR PEERID HERE"

Make sure your daemon is running and "Ipfs companion" is added as an extension to your browser.

You now have access to your dapp and can be interacted with the blockchain.

Steps to use the DApp: Firstly, install the go-ipfs from the website using the given link and install the pre-built package called go-ipfs. (https://docs.ipfs.io/introduction/install/)

Extract the zip file and open your terminal and navigate to the directory of the go-ipfs and follow the installation instructions given in the above link depending on the OS version.

Run the following commands to have ipfs up and running:

-> ipfs init

-> ipfs daemon

Make sure you have the extension ?IPFS Companion? added to your chrome browser which can be found on the chrome web store.

Use the URL shared by us with the cryptographic hash to access the DApp.

Make sure you are connected to MetaMask and ?Rinkeby test network? is selected.

You are now set to use our DApp and test its functionality. But you only have access to the ?Get Course? functionality.

To get course details just type in the Rubric of the course and click on ?Get Course? button to get all the details of that course.

Anyone with access to the link and a MetaMask account on Rinkeby test-net can view the course details with the Course rubric if it already exists in the blockchain.

In order for you to have ?Add Course? functionality make sure you give your Rinkeby address to us so that we can grant you access to ?Add Course? functionality.

Also, you need to get some fake ethers for your address. For that go to https://www.rinkeby.io/#faucet and tweet your address on twitter. Then use the tweet?s URL to request for 3 ethers. The ethers should be added in 30 seconds.

You now have access to add course functionality.

Now you can give course details and confirm the transaction to add the course onto the blockchain using the ?Add Course? button on the Dapps. Only privileged users have access to ?Add Course? i.e. only few addresses have been added to the contract who will have access to ?Add Course?.

Code Locations The contract should be in ATSE V2/Contracts/Course.sol The Web3.js code should be in ATSE V2/src/js/app.js The HTML page should be in ATSE V2/src/index.html

About

An Ethereum Blockchain to store and add CS Courses to the blocks using a web application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published