Skip to content

Installation Instructions (Coding Exercises)

Nils-Erik Frantzell edited this page Mar 28, 2018 · 3 revisions

Running the tests requires NodeJS, Truffle (version 3.4.7), and TestRPC(included with Truffle).

Tool Installation

  1. Install NodeJS
  2. Install Truffle 3.4.7 (which includes TestRPC):
    npm install -g truffle@3.4.7
    Note: The course recommends v3.4.7 since v4.0 was still fairly new when the course was created and had some issues

Truffle Initialization and Configuration

  1. Create a new local directory and run the following command to create a new Truffle project:
    truffle init
  2. (If on Windows) Rename truffle.js -> truffle-config.js
  3. Copy the smart contracts to the contracts directory
  4. Copy the test files to the test directory
  5. Copy the Truffle deployment file to the migrations directory
  6. Run TestRPC (Ethereum test RPC client) by executing the testrpc command in a console
  7. Compile the smart contracts and run a specific set of tests:
    Truffle test test/<test file name>
    For example:
    Truffle test test/MultiNumberBettingV5.js