Skip to content
nathan-liu-ventureum edited this page Apr 26, 2018 · 10 revisions

Installation

sudo npm install
cp ./react-scripts/config/* ./node_modules/react-scripts/config/
npm start

Generate contract JSON files(read VTCR) and copy into public/contracts/.

Build

npm run build

Notice: since addresses are changed, each time you run truffle migrate, remember to copy all JSON files again and clear browser cache.

Testing locally

  1. Clone VTCR
git clone https://github.com/ventureum/VTCR.git
  1. Clone VUI
git clone https://github.com/ventureum/VUI.git
  1. Start Ganache GUI, disable auto-mining, set block time to 2 seconds

  2. Migrate contracts and copy build artifacts to VUI

cd VTCR
[edit truffle.js] to use 127.0.0.1
truffle migrate --reset
cp -r ./build/contracts ../VUI/public
  1. Install VUI dependencies

Follow Jenkinsfile

exec steps in 'Install Dependencies'

  1. Start VUI
cd VUI
npm start

Components in progress

Application

Apply a new project(tested)

URL: http://localhost:3000/apply

Steps:

  1. input project name
  2. click Submit button
  3. confirm the metamask transaction

Notice:

  1. vth param of registry.apply() is hard-coded to 500000 in JS

Request Voting Rights(tested)

URL: http://localhost:3000/account

Steps:

  1. input vote rights amount
  2. click Request Voting Rights button
  3. confirm the metamask transaction

Withdraw Voting Rights(tested)

URL: http://localhost:3000/account

Steps:

  1. click Withdraw VTH button
  2. confirm the metamask transaction

Project List(tested)

URL: http://localhost:3000/projects

Steps:

  1. click Next and Prev buttons

Notice:

  1. pagination control params are setted in state

Project Challenge(tested)

URL: http://localhost:3000/projects

Steps:

  1. submit a project application at http://localhost:3000/apply
  2. goto http://localhost:3000/projects
  3. click challenge button
  4. confirm the metamask transaction

Project Challenge Commit(tested)

URL: http://localhost:3000/projects

Steps:

  1. challenge a project
  2. click commit button
  3. input token amount, choose option and click Download Commit button
  4. click VOTE TO button
  5. confirm the metamask transaction

VTH faucet(tested)

URL: Any

Steps:

  1. click VTH Faucet link at top bar
  2. input amount of ETH you want to transfer to VTH
  3. click Transfer ETH to VTH button
  4. confirm the metamask transaction
  5. refresh the page

Notice:

  1. I have added event listeners to all contracts, but currently there is no event after transferring

Workaround to deal with Metamask bug

Description of the bug: Metamask hangs indefinitely after Ganache is restarted. https://github.com/MetaMask/metamask-extension/issues/3881

Steps:

  1. Disable Metamask Chrome extension, then re-enable it.
  2. In Metamask Chrome extension -> Settings, click "Reset Account".
  3. Clear browser cache.

Clone this wiki locally