1. 配置系统环境
Ubuntu 14.04 ~ 16.10 (LTS) - x86_64
安装必要的依赖包(命令行操作):
$ sudo apt-get update
$ sudo apt-get install curl build-essential python
安装SQLite3 (version 3.8.2)数据库:
$ sudo apt-get install -y sqlite3
安装 Node.js (版本4.6.2) 和 npm:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
nvm install 4.6.2
2. 配置工程
全局安装 grunt-cli:
$ npm install grunt-cli -g
全局安装 bower:
$ npm install bower -g
克隆代码:
$ git clone https://github.com/Ebookcoin/ebookcoin.git
安装 node.js 模块:
$ npm install
加载 git 子模块 (client 和 ebookcoin-js):
$ git submodule init
$ git submodule update
构建前端:
$ cd public
$ npm install
$ bower install
$ grunt release
3. 运行
运行亿书:
$ cd ..
$ node app.js
4. 测试
运行测试前,请确保代码是运行在本地测试链上的(这是默认行为),而不是主链。
全局安装 mocha:
$ npm install mocha -g
运行测试套件:
$ npm test
运行独立测试:
$ mocha test/lib/accounts.js
$ mocha test/lib/transactions.js