Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

luongdn/eth-ppu

Repository files navigation

Requirements

Running

Set up Ganache

The fisrt thing you need to do is create a new workspace in Ganache. Open Ganache app and click New Workspace button, add the truffle-config.js file to the Workspace. After click Save Workspace you'll be taken to the the screen of the workspace just created

ganache-config-workspace

Configure IPFS API CORS headers

After installing IPFS, run the following command to configure your IPFS API at http://127.0.0.1:5001 to allow cross-origin request from http://localhost:3000 which is where the app will be running

ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://localhost:3000"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'

Import accounts into Metamask

After installing metamask, open it, follow the steps and create an account. Click the Main Ethereum Network on top of the window to change the network. We'll be running Ganache on http://127.0.0.1:7545 so click Custom RPC and fill up:

metamask-custom-rpc

Next, import couple of accounts into metamask to test our app. Click the button with the key icon, copy the private key and paste it into metamask

ganache-private-key

Click the import account button to import account from private key

metamask-import-account

Install dependencies

# npm
npm install
# yarn
yarn install

Running on local

In order to run the app on local, you need to run the 3 commands. The command to deploy all the contracts in contracts folder

truffle migrate

(or truffle migrate --reset if you want to modify the contract and deploy it again)

This command to run IPFS daemon in your computer

ipfs daemon

And finally, to run the client app with react

# npm
npm run start

or with yarn

# yarn
yarn start

result

About

Simple Ethereum Dapp

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published