Author Topic: ubuntu1404 编译 bitshares_client及运行web_wallet的步骤  (Read 8366 times)

0 Members and 1 Guest are viewing this topic.

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
tks
ubuntu基本0基础
新建文件用touch node.sh
然后sudo chmod 777 node.sh
再sudo gpedit node.sh
vi用不惯

nodejs搞定了
npm似乎还是不行啊

 sudo npm install lineman
sudo: npm: command not found



jerry@jerry-VirtualBox64bit:~$ npm -v
1.4.9
jerry@jerry-VirtualBox64bit:~$ node -v
v0.10.28
是我想当然了。应该sudo -i 变为root后再运行
Code: [Select]
sudo -i
npm install lineman
« Last Edit: June 05, 2014, 03:31:15 pm by alt »

Offline Harvey

  • Sr. Member
  • ****
  • Posts: 244
    • View Profile
BTS       Witness:harvey-xts Seed:128.199.143.47:2015 API:wss://128.199.143.47:2016 
MUSE   Witness:harvey-xts Seed:128.199.143.47:2017 API:ws://128.199.143.47:2018

Offline sudo

  • Hero Member
  • *****
  • Posts: 2255
    • View Profile
  • BitShares: ags
这种安装包一般解开就能用的。
Code: [Select]
sudo tar -zxvf node-v0.10.28-linux-x64.tar.gz -C /opt
然后新建一个文件  /etc/profile.d/node.sh,内容为:
Code: [Select]
export PATH=/opt/node-v0.10.28-linux-x64/bin:$PATH
重新登录让环境变量生效后,就可以运行node命令了

 tks
ubuntu基本0基础
新建文件用touch node.sh
然后sudo chmod 777 node.sh
再sudo gpedit node.sh
vi用不惯

nodejs搞定了
npm似乎还是不行啊

 sudo npm install lineman
sudo: npm: command not found



jerry@jerry-VirtualBox64bit:~$ npm -v
1.4.9
jerry@jerry-VirtualBox64bit:~$ node -v
v0.10.28
« Last Edit: June 05, 2014, 02:41:15 pm by sudo »

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
这种安装包一般解开就能用的。
Code: [Select]
sudo tar -zxvf node-v0.10.28-linux-x64.tar.gz -C /opt
然后新建一个文件  /etc/profile.d/node.sh,内容为:
Code: [Select]
export PATH=/opt/node-v0.10.28-linux-x64/bin:$PATH
重新登录让环境变量生效后,就可以运行node命令了
« Last Edit: June 05, 2014, 01:48:14 pm by alt »

Offline sudo

  • Hero Member
  • *****
  • Posts: 2255
    • View Profile
  • BitShares: ags
http://nodejs.org/dist/v0.10.28/node-v0.10.28-linux-x64.tar.gz
下载这个么? 解压开不知道怎满装 囧
apt-get 能搞定就好了 诶
有个 README.md
Code: [Select]
Evented I/O for V8 javascript. [![Build Status](https://secure.travis-ci.org/joyent/node.png)](http://travis-ci.org/joyent/node)
===

### To build:

Prerequisites (Unix only):

    * GCC 4.2 or newer
    * Python 2.6 or 2.7
    * GNU Make 3.81 or newer
    * libexecinfo (FreeBSD and OpenBSD only)

Unix/Macintosh:

    ./configure
    make
    make install

If your python binary is in a non-standard location or has a
non-standard name, run the following instead:

    export PYTHON=/path/to/python
    $PYTHON ./configure
    make
    make install

Windows:

    vcbuild.bat

You can download pre-built binaries for various operating systems from
[http://nodejs.org/download/](http://nodejs.org/download/).  The Windows
and OS X installers will prompt you for the location to install to.
The tarballs are self-contained; you can extract them to a local directory
with:

    tar xzf /path/to/node-<version>-<platform>-<arch>.tar.gz

Or system-wide with:

    cd /usr/local && tar --strip-components 1 -xzf \
                         /path/to/node-<version>-<platform>-<arch>.tar.gz

### To run the tests:

Unix/Macintosh:

    make test

Windows:

    vcbuild.bat test

### To build the documentation:

    make doc

### To read the documentation:

    man doc/node.1

Resources for Newcomers
---
  - [The Wiki](https://github.com/joyent/node/wiki)
  - [nodejs.org](http://nodejs.org/)
  - [how to install node.js and npm (node package manager)](http://www.joyent.com/blog/installing-node-and-npm/)
  - [list of modules](https://github.com/joyent/node/wiki/modules)
  - [searching the npm registry](http://npmjs.org/)
  - [list of companies and projects using node](https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node)
  - [node.js mailing list](http://groups.google.com/group/nodejs)
  - irc chatroom, [#node.js on freenode.net](http://webchat.freenode.net?channels=node.js&uio=d4)
  - [community](https://github.com/joyent/node/wiki/Community)
  - [contributing](https://github.com/joyent/node/wiki/Contributing)
  - [big list of all the helpful wiki pages](https://github.com/joyent/node/wiki/_pages)

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
是的,第一次运行是为了生成那个 config.json,有提示先不用管它,后面改了 config.json 就好了。

Offline sudo

  • Hero Member
  • *****
  • Posts: 2255
    • View Profile
  • BitShares: ags
web钱包我之前没搞定
这下有教程了 太好了

会提示这个哦
Code: [Select]
jerry@jerry-VirtualBox64bit:~/bitshares_toolkit/programs/client$ ./bitshares_client --server --httpport 9989
================================================================
=                                                              =
=             Welcome to BitShares XTS                         =
=                                                              =
=  This software is in alpha testing and is not suitable for   =
=  real monetary transactions or trading.  Use at your own     =
=  risk.                                                       =
=                                                              =
=  Type 'help' for usage information.                          =
================================================================
Logging to file "/home/jerry/.BitSharesXTS/default.log"
Logging RPC to file "/home/jerry/.BitSharesXTS/rpc.log"
Loading config "/home/jerry/.BitSharesXTS/config.json"
{
  "rpc": {
    "rpc_user": "",
    "rpc_password": "",
    "rpc_endpoint": "127.0.0.1:0",
    "httpd_endpoint": "127.0.0.1:0",
    "htdocs": "./htdocs"
  },
  "default_peers": [
    "107.170.30.182:8764"
  ],
  "ignore_console": false
}
Loading blockchain from "/home/jerry/.BitSharesXTS/chain"
Using genesis block from file "/home/jerry/bitshares_toolkit/programs/client/genesis.json"
Error starting RPC server
You specified --server on the command line,
but did not provide a username or password to authenticate RPC connections.
You can provide these by using --rpcuser=username and --rpcpassword=password on the
command line, or by setting the "rpc_user" and "rpc_password" properties in the
config file
« Last Edit: June 05, 2014, 01:27:27 pm by sudo »


Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
1. 安装 ubuntu1404,注意现在只支持64位版本
2. 安装以下依赖包
Code: [Select]
aptitude install git cmake g++ zlib1g-dev libreadline6-dev libdb++-dev libboost-all-dev libssl-dev uuid-dev
3. git 迁出 bitshares_toolkit 代码,并编译
Code: [Select]
    git submodule init
    git submodule update
    mkdir build && cd build
    cmake ..
    make
运行
Code: [Select]
cd programs/client
  cp ../../../tests/genesis.json ./
 ./bitshares_client --server --httpport 9989
4. git 迁出 web_wallet 代码
5. 下载 node , 地址 http://www.nodejs.org/download/ ,下载 linux 下 64位版本并安装
6. 使用超级用户安装 lineman
Code: [Select]
sudo -i
npm install lineman
exit
7. 安装其它依赖包,注意要在 web_wallet 目录下运行
Code: [Select]
cd web_wallet
npm install protractor jasmine-given coffee-script lineman-angular lineman-less
8. 然后编辑 ~/.BitsharesXTS/config.json,注意要配置用户名、密码及htdocs这三项
Code: [Select]
{
  "rpc": {
    "rpc_user": "alt",
    "rpc_password": "alt",
    "rpc_endpoint": "127.0.0.1:0",
    "httpd_endpoint": "0.0.0.0:0",
    "htdocs": "/home/alt/workspace/web_wallet/generated/"
  },
  "default_peers": [
    "107.170.30.182:8764"
  ],
  "ignore_console": false
}
9. 启动 web 钱包服务器
Code: [Select]
lineman run
10. 重新运行 bitshares_client
11. 浏览器内输入 http://localhost:9989 就可以访问 web 钱包了。
如果想在手机上访问,需要把 config.json 中的httpd_endpoint 改为0.0.0.0:0
« Last Edit: June 05, 2014, 11:49:32 pm by alt »