1 系統要求node
必須是linux系統
必須有公網ip
建議使用ubuntu 14.04 64位
建議內存1G以上
建議帶寬2Mb以上
2 安裝linux
2.1 下載sql
wget https://www.asch.so/downloads...
tar zxvf asch-linux-0.9.5-testnet.tar.gz
2.2 初始化npm
這一步會自動幫您作如下幾件事情
安裝sqlite3等依賴軟件
安裝和配置ntp服務,保證您的時間與其餘節點同步
這一步只須要運行一次便可
cd asch-linux-0.9.5-testnet
./aschd configure
3 運行json
cd asch-linux-0.9.5-testnetubuntu
./aschd start數組
./aschd stopapp
./aschd status工具
./aschd restart區塊鏈
./aschd upgrade
./aschd rebuild
./aschd reindex
./aschd version
tail -f logs/debug.log
4 受託人配置
4.1 受託人密碼
使用文本編輯工具打開config.json, 找到secret字段,將你的受託人密鑰填進去便可,該字段爲json字符串數組,一臺機器能夠配置多個,但不能重複
受託人密鑰配置
注意 無論是一臺機器仍是多臺機器,不要配置重複的受託人密鑰
4.2 公網IP
默認狀況下,系統會自動檢測公網ip,但在某些雲主機中,公網ip沒法檢測到,這時須要手動在config.json修改或添加以下字段
"publicIp": "此處填寫你的公網ip",
配置完以後須要重啓程序
./aschd restart
5 升級
./aschd upgrade
6 命令行工具
命令行工具能夠完成全部錢包的功能,包括帳戶登陸及查詢、區塊鏈和交易查詢、受託人查詢,還能夠建立、簽署並廣播任意的交易數據
6.1 安裝方法
npm install -g asch-cli
6.2 使用示例
隨機生成新帳戶
asch-cli crypto -g
使用公鑰登陸帳戶
asch-cli openaccountbypublickey 8a601534d1638884e523bc0f4fc29eaa4c0f7d2fdc8ca3a9b03d3fa8e4abd04c
使用密碼登陸帳戶
asch-cli openaccount "your secret"
轉帳
asch-cli sendmoney -e "your secret" -t 9519461517002147305 -a 38.38
有二級密碼後的轉帳
asch-cli sendmoney -e "your secret" -s "your second secret" -t 9519461517002147305 -a 38.38
查看某個區塊信息
asch-cli getblockbyid 16006382490436415348
asch-cli getblockbyheight 1
批量查詢區塊
asch-cli getblocks --offset 10 --limit 3 --sort height:asc
批量查詢交易
asch-cli gettransactions --type 2 --limit 2
投票
asch-cli upvote --secret "your secret" --publicKeys 45cbab2f997766925398e1b6eb7784a0bd3fbeff9bdda74d8da9bc645f974a5e,2cd541cf50a4a8641b9e6e2613aeeaa1614dc43f6756829fb45c990e5b6ff873
更多命令行功能請使用help選項查看
asch-cli --help
Usage: asch-cli [options] [command]
Commands:
getheight get block height getblockstatus get block status openaccount [secret] open your account and get the infomation by secret openaccountbypublickey [publickey] open your account and get the infomation by publickey getbalance [address] get balance by address getaccount [address] get account by address getvoteddelegates [options] [address] get delegates voted by address getdelegatescount get delegates count getdelegates [options] get delegates getvoters [publicKey] get voters of a delegate by public key getdelegatebypublickey [publicKey] get delegate by public key getdelegatebyusername [username] get delegate by username getblocks [options] get blocks getblockbyid [id] get block by id getblockbyheight [height] get block by height getpeers [options] get peers getunconfirmedtransactions [options] get unconfirmed transactions gettransactions [options] get transactions gettransaction [id] get transactions sendmoney [options] send money to some address registerdelegate [options] register delegate upvote [options] vote for delegates downvote [options] cancel vote for delegates setsecondsecret [options] set second secret contract [options] contract operations crypto [options] crypto operations dapps [options] manage your dapps creategenesis create genesis block
Options:
-h, --help output usage information -V, --version output the version number -H, --host <host> Specify the hostname or ip of the node, default: 127.0.0.1 -p, --port <port> Specify the port of the node, default: 4096
子命令幫助查詢asch-cli <sub-command> -h