区块链侧链运用开辟平台Asch节点装置及区块临盆教程

1 体系请求

必需是linux体系
必需有公网ip
发起运用ubuntu 14.04 64位
发起内存1G以上
发起带宽2Mb以上
2 装置

2.1 下载

wget https://www.asch.so/downloads…
tar zxvf asch-linux-0.9.5-testnet.tar.gz
2.2 初始化

这一步会自动帮您做以下几件事变
装置sqlite3等依靠软件
装置和设置ntp效劳,保证您的时候与其他节点同步
这一步只须要运转一次即可
cd asch-linux-0.9.5-testnet
./aschd configure
3 运转

cd asch-linux-0.9.5-testnet

启动

./aschd start

住手

./aschd stop

检察运转状况

./aschd status

重启

./aschd restart

晋级

./aschd upgrade

从新同步区块

./aschd rebuild

重修索引

./aschd reindex

检察版本

./aschd version

检察log

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

    原文作者:ASCH
    原文地址: https://segmentfault.com/a/1190000007934382
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞