Devfolio's ETHIndia Online: Chain Runner
- Kahan Majmudar
- Harshil Darji
- Nisarg Sheth
- Kairav Pithadia
The purpose of the project is to make a decentralized resource sharing platform aimed for college ๐ซ /students ๐งโ๐ who can share/use those resources ๐ for acedamic purposes. The users need to register an account to use the services and can upload/view/download the resources. The resouces are stored on IPFS and are accessible to everyone based on the post's CID ๐ฎ. The users need to follow other users in order to view the content(to get post CIDs). The users can search other users by entering the users' addresses and follow them. Various metadata such as user data and CIDs are stored in smart contract and the main data is stored in mongodb. ๐
-
Install Node
-
Install MongoDB
-
Install truffle
npm i truffle -g
-
Install MetaMask Plugin ๐ฆ for your Browser/Device.
- Notice
.env.example
file in the repo.- Make a new file using
touch .env
(Linux implementation). Your implementation may vary based on OS ๐. - Fill up the Details as present in the
.env.example
in the newly created.env
file.
- Make a new file using
-
Go to the cloned Repository and execute below mentioned steps.
truffle develop
- Copy the Localhost Address from the output after executing above command. Eg.
http://127.0.0.1:9545
- Open your Metamask Plugin ๐ฆ -> Top Right circle -> Settings -> Networks -> Add Network
- Mention
Name
of the network. Eg.localhost
and Mention your Localhost address copied in Step ii inNew RPC URL
- Goto Metamask Plugin ๐ฆ -> Top Right Circle -> Import Account -> Paste your Private Key which is present in the output of the Step i.
-
Open New Terminal and execute below mentioned steps.
truffle migrate
- Scroll down to the bottom of the output.
- Notice 2_deploy_migration.js
- Copy your
contract address
to this file named contract_controller.js and paste your address in place of a HASH value present in the linked line.
-
Install dependencies
npm i
- It will take some time to install dependencies โฒ๏ธ. Have patience ๐.
-
Start the server
npm start
. -
Voila! the server's up and running. Check the status of the server by going to the port mentioned in the
.env
file via localhost. Eg.http://127.0.0.1:3000
๐.
This backend server is made using Node.js and provides the connectivity to our Frontend Repo. The details to connect them are mentioned in the README.md of our frontend repository.
We're using Smart Contract to save the Post data corresponding to each User.
Contract Attributes
- CID (Content-Address Identifiers)
- Type (of file)
- Title (of Post)
- Tag (of Post)
- creation_time
The server uses MongoDB at the server side to keep track of the users and their corresponding Transactions which can be seen by going in the View Transactions
Tab in our Frontend.
The server is capable of authorising a user using their email address and provide them a verification link.