1. 每日区块链首页
  2. 学院
  3. 技术文档

Asch使用文档

Asch使用文档

环境及工具

  • nodejs v6.3 +
  • npm 3.10+(不是cnpm)
  • node-gyp v3.6.2 +(建议)
  • sqlite v3.8.2 +
  • G++
  • libssl

安装Ubuntu 14.04.x或以上的版本

# Install dependency package
sudo apt-get install curl sqlite3 ntp wget git libssl-dev openssl make gcc g++ autoconf automake python build-essential -y
# libsodium for ubuntu 14.04
sudo apt-get install libtool -y
# libsodium for ubuntu 16.04
sudo apt-get install libtool libtool-bin -y

# Install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
# This loads nvm
export NVM_DIR=”$HOME/.nvm”
[ -s “$NVM_DIR/nvm.sh” ] && \. “$NVM_DIR/nvm.sh”
[ -s “$NVM_DIR/bash_completion” ] && \. “$NVM_DIR/bash_completion” # This loads nvm bash_completion

# Install node and npm for current user.
nvm install node 8
# check node version and it should be v8.x.x
node –version

# git clone sourece code
git clone https://github.com/AschPlatform/asch && cd asch && chmod u+x aschd

# Install node packages
npm install

前端制作

cd public/

npm install bower -g
npm install browserify -g
npm install gulp -g

npm install
# angular chose “angular#~1.5.3 which resolved to 1.5.11 and is required by ASCH”
bower install

npm run build
gulp build-test #This make the dist directory.

安装

# pull asch code docker image
docker pull aschplatform/asch:v1.3.0
# run docker and asch
docker run -i -t –name asch1.3.0 -p 4096:4096 aschplatform/asch:v1.3.0 /bin/bash
root@e149b6732a48:/# cd /data/asch && ./aschd start
Asch server started as daemon …

你可以在浏览器中打开    localhost:4096

用法

node app.js –help

Usage: app [options]

Options:

-h, –help output usage information
-V, –version output the version number
-c, –config <path> Config file path
-p, –port <port> Listening port number
-a, –address <ip> Listening host name or ip
-b, –blockchain <path> Blockchain db path
-g, –genesisblock <path> Genesisblock path
-x, –peers [peers…] Peers list
-l, –log <level> Log level
-d, –daemon Run asch node as daemon
–reindex Reindex blockchain
–base <dir> Base directory

设置为本地网络帐户

{
“keypair”: {
“publicKey”: “8065a105c785a08757727fded3a06f8f312e73ad40f1f3502e0232ea42e67efd”,
“privateKey”: “a64af28537545301f66579604628b55c7a7a102752bbd8f0b0d152f9754e78d58065a105c785a08757727fded3a06f8f312e73ad40f1f3502e0232ea42e67efd”
},
“address”: “14762548536863074694”,
“secret”: “someone manual strong movie roof episode eight spatial brown soldier soup motor”
}

查看英文原文请转到:http://www.dayqkl.com/4679.html

原创文章,作者:fenrir,如若转载,请注明出处:http://www.dayqkl.com/4687.html

发表评论

登录后才能评论
QR code