DTube
Decentralized video sharing & social media platform on Ethereum blockchain.
Website: https://dtube-eth.on.fleek.co
Contracts
- https://goerli.etherscan.io/address/0x678af4458950d0aefbc427e663050f50ebdab52a
- https://mumbai.polygonscan.com/address/0xffded6c68ccf4ed30d2b9c85ba21a926cccc8e0e
⚠️ Deprecated chains, learn more:
- https://rinkeby.etherscan.io/address/0xcda87299367d6b29fef13ca08448bfaaf2e4a175
- https://ropsten.etherscan.io/address/0xc6eb38be0949a63f7c3ac36a053de209970fa19b
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
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 inroot
directory. Then to access the Ethereum network/node, create a project on infura and copy-paste theinfura project-id url
in.env
with a variable nameREACT_APP_INFURA_RINKEBY
orany 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 nameREACT_APP_MNEMONIC
. This will be loaded by truffle at runtime, and the environment variable can then be accessed withprocess.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 afternpm 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 pleasefork
the main branch and push your changes toreact-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