My Blockchain Decentralized application for Music Industry

  1. Familiarize yourself with blockchain and learn the basics
  2. Build a simple smart-contract on the problem
  3. Assess the workings and limitations of the application

1. Technologies involved

We will be using ethereum for the blockchain and ipfs for storing the songs on a p2p network. If you don’t have previous knowldge about writing a basic smart-contract, or with truffle framework, you should first go through these part1, part2, part3 tutorials for initial set up, installing the dependencies and deploying a basic smart-contract, as we won’t be discussing them here. After that, we will learn how to install and play with ipfs.

Ethereum

2. IPFS

In those tutorials I mentioned, ipfs was not used. We are going to set up ipfs which is required for out dApp.

$ cd ipfs    // go to ipfs directory
$ sudo install.sh // installs ipfs
$ ipfs init // initialises ipfs
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT" , "GET" , "POST" , "OPTIONS"]'
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
$ ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8082
$ ipfs config Addresses.API /ip4/127.0.0.1/tcp/5002
$ ipfs daemon // starts ipfs daemon
IPFS

3. The Application

Phew! That’s a lot of work huh? Anyway, we have just learned how to build a basic smart-contract from those tutorials and set up our system for the coming application. We have just started :P

$ clone https://github.com/srirambandi/mediaStore.git
smart-contract for the application
JavaScript logic for the application
$ cd mediaStore    // enter the directory
$ node_modules/.bin/testrpc // start ethereum with 10 test accounts
(in another terminal window)
$ truffle migrate --reset // compile the smart-contract
$ npm run dev // start the node js server
(in another terminal window)
$ ipfs daemon // start ipfs daemon

4. Summary

To summarize, we have learnt on how to set up environment, write a basic smart-contract from some good tutorials. We then explored a simple smart-contract focussing on the problem of publishing in music industry. You did some awesome learning there, rejoice!

5. Conclusion

We have only made a basic dApp just to demonstrate how a smart-contract might look like for this scenario. This has many limitations, it hasn’t included licenses. Even though ipfs denies duplicates, one can tamper the media data little bit and get away with a new hash. For implementing a real production ready dApp, one has to fight these challenges. There are various technologies available for identifying the similarities in media. Integrating them, and designing smart-contracts to handle licenses and payment splits adds value to your application.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store