Skip to content

akhileshthite/dtube

Repository files navigation

DTube

Decentralized video sharing & social media platform on Ethereum blockchain.

Website: https://dtube-eth.on.fleek.co

visitors GitHub release

Contracts

⚠️ Deprecated chains, learn more:

About

⚠️ Use this DApp for educational purposes only! DTube is not responsible for the harm caused by the content you're uploading.

DTube uploads the video files to IPFS by using web3.storage and stores those IPFS CIDs to the blockchain network. Read the step-by-step tutorial 📝 "Build a Social Media dApp & Deploy it on Polygon" to learn how to BUIDL it from scratch. If you have any queries, then please create a discussion thread.

This DApp is inspired by the Dapp University YouTube channel.

Demo

Development instructions

Installation & setup

Make sure you have truffle installed on your computer.

# Install Truffle globally
npm install -g truffle
  • Ensure you create an .env file in root directory. Then to access the Ethereum network/node, create a project on infura and copy-paste the infura project-id url in .env with a variable name REACT_APP_INFURA_RINKEBY or any network you like.
REACT_APP_INFURA_RINKEBY=https://rinkeby.infura.io/v3/YOUR_PROJECT_ID
  • Paste the 12 word Secret Recovery Phrase of your (preferably newly generated and testnet-only) MetaMask wallet in .env with the variable name REACT_APP_MNEMONIC. This will be loaded by truffle at runtime, and the environment variable can then be accessed with process.env.REACT_APP_MNEMONIC.
REACT_APP_MNEMONIC=for example put your twelve word BIP39 secret recovery phrase here
  • For development and testing, you have to create your own web3.storage API token. To do that, login to web3.storage -> create a new API token -> copy the API token.

Then create a .env file in the root directory.

REACT_APP_API_TOKEN=PASTE_YOUR_API_TOKEN

OR

To develop on ganache blockchain, open ganache and import the accounts by adding your ganache private keys in MetaMask.

$ ganache-cli

Deployment

To deploy the smart contracts on blockchain networks, follow the given truffle command below.

# truffle migrate --network NETWORK_NAME
truffle migrate --network rinkeby

# --reset: Run all migrations from the beginning, instead of running from the last completed migration.

For more information, read truffle docs.

React client

Start react app.

npm start
Starting the development server...

⚠️ If dealing with “JavaScript heap out of memory” error after npm start then use the following command to solve it: export NODE_OPTIONS="--max-old-space-size=8192"

📌 Note: I cannot update this repo (main-branch) with react hooks because the initial educational tutorial was written with react classes. However, if you want to work on this issue, then please fork the main branch and push your changes to react-hooks branch and send a pull request for the same.

License

DTube is licensed under the MIT license.


Hope you've learned something new. Don't forget to leave a 🌟 and twitter