homework project - software engineering
- npm & nodejs
- truffle
- mongodb
The basic environment is nodejs, along with database and browser plugin. Theoretically windows and linux both works...Let's use linux.
- Install node first (recommend to install using latest version deb package rather than apt)
- Install npm (
apt-get install npm
is fine. A toolkit to manage nodejs packages. Other packages can be installed easily by npm) - Install Truffle (ethereum contract framework)
npm install -g truffle
(See truffle website for more info) - Install mongodb (search "mongodb" on browser directly)
- Install browser plugin Metamask (chrome or firefox)
Now you are ready to go!
- compile contract and setup ethereum testnet
cd contract/contracts
truffle develop # enter console, default to listen port 9545
>> compile
>> migrate
- start database
mongod --dbpath={your path}
mongo # interact with db in another terminal
- install nodejs packages
npm install
- run browser server
npm run bro
listen to port 3000
- run client
npm run cli
listen to port 3001
- If you want to install other nodejs packages, install them locally.
npm install {package name} --save
- Our client may use Metamask plugin which is available in Chrome or Firefox. See Truffle Tutorial
- We mainly use web3 package to implement ethereum contract Apps. Also there is python implementation of web3.
webtorrent
has been included in package.json. see WebTorrent doc