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