This is an examle DApp (Decentralized Application) that shows how easy it is to create a decentralized marketplace on the ethereum blockchain. It showcases the power of origin.js. Using only javascript commands, you can search listings, create listings, purchase listings, and more.
Documentation for origin.js is located here: http://docs.originprotocol.com/
To learn more about this project, please visit the Origin website and download our whitepaper.
NOTE: This project is under rapid development.
This demo is currently running on the Rinkeby testnet. (Note that this demo is slightly behind the current state of this repo.)
Make sure you have node
version 8.5.0 or greater
node --version
In a new tab:
git clone https://github.com/OriginProtocol/demo-dapp origin-demo-dapp && cd origin-demo-dapp
npm install
npm run start
A browser will open to http://localhost:3000. You're not quite done though! You'll need metamask if you don't already have it. See next step.
-
Install Metamask Chrome Browser Extension.
-
Follow the instructions to set up your wallet.
-
Click where it says "Ethereum Main Network" and select "Rinkeby". This takes us off of the real ETH blockchain and onto the Rinkeby test net.
Be careful not to mix up your test wallet with your real one on the Main Network.
- To get some Rinkeby ETH for creating or purchasing listings, visit the this faucet.
Create a listing and post it to IPFS and Ethereum.
By default, this demo will connect to the global test networks of Rinkeby or Ropsten. For development, you may wish to connect to a local blockchain running on your local machine.
Follow these instructions to setup and run origin.js. Origin.js is needed to run a local blockchain and make it accessible to your dapp.
In a separate tab:
git clone https://github.com/OriginProtocol/demo-dapp origin-demo-dapp && cd origin-demo-dapp
npm run install:dev
npm run start
The install:dev
script performs the regular install and then links to your local origin.js.
-
Install Metamask Chrome Browser Extension.
-
Click the Metamask icon in the toolbar, accept terms, and then click
Import Existing DEN
-
Enter the seed phrase (Mnemonic):
candy maple cake sugar pudding cream honey rich smooth crumble sweet treat
This is the default seed phrase for truffle development.
- Click where it says "Ethereum Main Network" and select "Localhost 8545". Click the back arrow to return to your account.
Be careful not to mix up your test wallet with your real one on the Main Network.
- You should see your first test account now has 100 ETH. (Address of
0x627306090abaB3A6e1400e9345bC60c78a8BEf57
) Additional generated accounts will also have this amount.
If you want to host the demo dapp on web server such as EC2 you will need to configure things differently. Browsers can not connect to a test chain on the EC2 server, so you will need to connect to our existing contracts on the test networks or deploy your own.
To use the contracts deployed by Origin, modify the file build/contracts/Listing.json
and add lines to the networks
entry so it begins like this:
"networks": {
"3": {
"events": {},
"links": {},
"address": "0xe66c9c6168d14be4c3c145f91890740cbdf9ec8b"
},
"4": {
"events": {},
"links": {},
"address": "0x94de52186b535cb06ca31deb1fbd4541a824ac6d"
},
<...Possibly other networks for local test chains>
(Ropsten test network is id 3, and Rinkeby test netork is id 4)
We'd love to have you join us on this project. We're still in the super early stages, but join our Discord channel or email us to get started.