resound

所属分类:加密货币
开发工具:JavaScript
文件大小:235KB
下载次数:0
上传日期:2018-04-28 21:09:34
上 传 者sh-1993
说明:  音乐市场DApp,具有基于以太坊IPFS的去中心化无服务器架构来处理后端。
(a music marketplace DApp with a Ethereum IPFS based decentralized serverless architecture handling the backend.)

文件列表:
build (0, 2018-04-29)
build\contracts (0, 2018-04-29)
build\contracts\Migrations.json (51126, 2018-04-29)
build\contracts\Releases.json (386016, 2018-04-29)
contracts (0, 2018-04-29)
contracts\Migrations.sol (515, 2018-04-29)
contracts\Releases.sol (2634, 2018-04-29)
migrations (0, 2018-04-29)
migrations\1_initial_migration.js (129, 2018-04-29)
migrations\2_deploy_contracts.js (134, 2018-04-29)
package.json (636, 2018-04-29)
public (0, 2018-04-29)
public\favicon.ico (3518, 2018-04-29)
public\index.html (1629, 2018-04-29)
public\manifest.json (317, 2018-04-29)
src (0, 2018-04-29)
src\App.css (883, 2018-04-29)
src\App.js (7074, 2018-04-29)
src\EthereumDiagram.jpg (111668, 2018-04-29)
src\actions (0, 2018-04-29)
src\actions\siteActions.js (1737, 2018-04-29)
src\actions\userActions.js (514, 2018-04-29)
src\actions\web3actions.js (168, 2018-04-29)
src\build (8, 2018-04-29)
src\components (0, 2018-04-29)
src\components\About (0, 2018-04-29)
src\components\About\AboutPage.js (485, 2018-04-29)
src\components\Account (0, 2018-04-29)
src\components\Account\AccountPage.js (4764, 2018-04-29)
src\components\Account\UserReleasesManager.js (795, 2018-04-29)
src\components\Account\Withdraw.js (447, 2018-04-29)
src\components\Collection (0, 2018-04-29)
src\components\Collection\CollectionPage.js (2143, 2018-04-29)
src\components\Collection\CollectionTable.js (1049, 2018-04-29)
src\components\Header (0, 2018-04-29)
src\components\Header\Header.js (840, 2018-04-29)
src\components\Header\Navbar.js (629, 2018-04-29)
... ...

# resound Resound is a decentralized music marketplace for independent artists and labels. The goal here was to develop a front end using React/Redux, and develop an 'always on' decentralized, serverless backend. In doing so, people could choose to use the website without this frontend due to the nature of such a backend. This ultimately enables unlimited access despite any efforts to remove it. **This code needs to be refactored!** ## To Run It For this version, I currently run it on [Truffle's Ganache](http://truffleframework.com/ganache/). However, it points to whatever you have locally listening on port 8545 (edited through `truffle.js`), so you could easily use a Geth node or similar. Additionally, MetaMask must point to the same network as the port in `truffle.js`. You also need to be running a local node of IPFS on the same system, and ensure that the HTTP API is available. `yarn` to install dependencies. Run `truffle migrate` (add `--network [network name or id]` if you have multiple networks configured and want to pick one). This will compile the contracts into the ABI. It'll also deploy the contract to the given network. Now, you should be able to run `yarn start` and start working with the app. ## Flow ![resound Flow Chart](https://i.imgur.com/9n8dgoo.jpg) In developing this decentralized serverless architecture for my backend, I leveraged two services: * The Ethereum Virtual Machine (EVM) as a database for primitive data types and transaction logic. * I was limited to using the EVM solely for transaction logic here due to cost of **gas** when writing to the blockchain. Storing large files in here was not an option, since the goal is for this website to be accessible; large files on here would be cost prohibitive for the average artist. Instead, I prioritized the information that was warranted the security of being stored on the blockchain. * IPFS (InterPlanetary File System) as a location for blob storage. * Since there needed to be a place to store the primary contents of the site - the audio files * One caveat here is that while the IPFS is *designed* to be decentralized, that is contingent on other people 'pinning' your data on their server. As such, it's not *inherently* decentralized. Currently, this web app is designed to be running on a server that is expected to have an IPFS daemon running in the background in order to connect it to the network. While it is yet to be implemented, a solution around this would likely be requiring artists to pin data to their own servers / computers, and the server 're-pinning' it locally for a fee to speed up transmission to the artist's fans. Alternatively, in lieu of a fee, artists could re-pin a certain amount of other artists data. This would force more artists to join the network, and as such, hosting the data, speeding up the network overall. This is the ideal solution, but also the tougher option to convince the masses of. It also unfairly leaves out artists who don't necessarily have access to internet in this way, so that would have to be worked out. ## Concerns and Issues * In its current iteration, the files hashes are exposed to the public. This clearly isn't secure for artists avoiding piracy. A solution is to encrypt the location of those hashes * In terms of scalability, I can't expect to host all files on my own IPFS local node. Not only is this not truly decentralized, but it will bottleneck the network and not be able to keep speeds up to speed (pun very much intended.) * I also don't provide nearly enough security on the user verification front. I just pull from MetaMask's injected web3 instance. In the future, I should implement something like Consensys' uPort to verify the user. * Intellectual property. How do we protect artists? What if something is released somewhere else first, where someone takes it and tries to sell it here? * I handle Wei / Ether conversion pretty messily. I only stored up to a complexity of 0.0000 decimal places, but it would have been far easier to just force the user to work in Wei. However, I thought this might be confusing to the average user. May explore this again later with a live conversion below. * Lots of refactoring and optimization. There's a lot of async work in here that needs to be corralled a bit as far as triggering rerenders etc.

近期下载者

相关文件


收藏者