Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢昇
test
Commits
9196897f
Commit
9196897f
authored
Mar 20, 2020
by
谢昇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update cli独立模块命令-3(privacy、para).md
parent
aefe549e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
457 deletions
+1
-457
cli-privacy.md
cli-privacy.md
+1
-457
No files found.
cli
独立模块命令-3(privacy、para)
.md
→
cli
-privacy
.md
View file @
9196897f
**版本:V6.3.2**
**版本:V6.3.2**
...
...
@@ -436,462 +436,6 @@ Total Privacy spend amount is 132.0000
***
## para 跨链合约
使用para合约时,需先搭建一条平行链。参考平行链搭建文档完成搭建。以下以搭建的game链完成示例。
`cli para -h`
```
Available Commands:
asset_transfer Create a asset transfer to para-chain transaction
asset_txinfo Get para chain cross asset transfer info
asset_withdraw Create a asset withdraw to para-chain transaction
blocks Get blocks with main chain hash map between [start, end], the same in main
buffer_block Get para download-level block info
config parachain config cmd
consens_done Get para chain done height consensus info
consens_status Get para chain heights' consensus status
cross_transfer Create a cross asset transfer transaction
height query consensus height
is_sync query parachain is sync
nodegroup super node group manage cmd
para_list Get para chain info list by titles
super_node super node manage cmd
transfer Create a transfer transaction
transfer_exec Create a transfer to exec transaction
withdraw Create a withdraw transaction
```
***
## asset_transfer 资产转移
进行para资产转移前需在paracross合约中存有足额的资产。
`cli para asset_transfer --paraName user.p.game. -a 10 -n test -t 12HKLEn6g4FH39yUbHh4EVJWcFo5CXg22d`
签名并完成发送。
paraName为目标平行链的标题,注意格式为最后有一点。-s后为资产标志,缺省为bty。
通过调用平行链的余额查询,查询余额。
`cli asset balance -a 12HKLEn6g4FH39yUbHh4EVJWcFo5CXg22d --asset_exec paracross --asset_symbol coins.bty -e paracross --rpc_laddr="http://114.55.11.139:1195"`
```
{
"balance": "10.0000",
"frozen": "0.0000",
"addr": "12HKLEn6g4FH39yUbHh4EVJWcFo5CXg22d"
}
```
若未编译指定平行链专用的cli,因cli默认调用8801端口,需在调用时指定具体的调用端口,由--rpc_laddr= 指定。
跨链转入的bty存在paracross合约中,名称更改为了coins.bty的格式。若转移的是主链token,则名称相应的为token.xxx
## asset_txinfo 根据哈希查询资产转移交易
`cli para asset_txinfo -s 0x82eebee5ad865f42c71794b7842d5cab777f4f01267e4be3d40f3859dfae6f23`
```
{
"from": "19kCYYJnvdsXLUxY5DqKL3yCiweNMzeMxE",
"to": "1B1qDTmQYF48aARKeGY7PNsQtg8nznPp6B",
"txHash": "0x82eebee5ad865f42c71794b7842d5cab777f4f01267e4be3d40f3859dfae6f23",
"amount": 100000000,
"exec": "coins",
"symbol": "BTY",
"height": 4753337,
"commitDoneHeight": 4753339,
"paraHeight": 3506,
"success": true
}
```
## asset_withdraw 取回资产
进行平行链资产取回前,需在平行链的paracross合约中有足额的备转移资产。
`cli para asset_withdraw -a 1 --ptitle user.p.game. -t 1xUdxvnZoBpnWwnUSuNQN9ts3mWi1MZrc`
签名并发送。
从平行链取回一样需要输入指定的ptitle。取回后的资产存放于paracross合约中。
执行平行链资产取回,需要对应的平行链开启共识。未开启共识的平行链无法取回。
## blocks 根据高度返回获取平行链和对应主链区块哈希
`cli para blocks -e 10000 -s 9999 --rpc_laddr="http://114.55.11.139:1195"`
```
{
"items": [
{
"height": 9999,
"blockHash": "0x69d1fe567f5f72397bc85f9547697f358e4c499a24b4aa86ceed0b59f03a1a0a",
"mainHeight": 3847377,
"mainHash": "0x882086a3324a2046755b53d6c0426c7087aa8c58728947e7cdd6846f1baf0e9d"
},
{
"height": 10000,
"blockHash": "0x9559671bdfbbc876eba722449f5a64d457b9f462db9af2a16d9d55da51201211",
"mainHeight": 3847577,
"mainHash": "0x7ef088ccb85b775f5482f47ee35e37ec93a99c766c4f325258b097cccb81db0a"
}
]
}
```
调用时需调用对应平行链端口。返回信息中返回平行链及主链的对应高度和区块哈希。
## buffer_block 根据高度获取指定平行链区块的信息
`cli para buffer_block -t -1 --rpc_laddr="http://114.55.11.139:1195"`
```
{
"height": 11472,
"mainHash": "0x9a990c48aaf76409dd0f8c9eb6b6bf4356eb32494906f80e6d8521d4c055a88a",
"mainHeight": 3981201,
"parentMainHash": "0x567d344f3be247c13c70d8212459f53b5f8d8356189a6092cdccd366913a1898",
"blockTime": 1574306182,
"txs": [
"0xccfa6a51a8d29beb27c24e1b533ee6e82f179f3aa594ca0d22e263ec4478ab51",
"0x8f80fe47b42039339fe5d43cb275f303053095edf6449e62a515e741f3f4f7c8",
"0x3b6695b7189f907ef63877b5e6736898ca16748db1e835c601810f9302a213b1",
"0x9c63c65c912a8e05d9945ab87182d6e76231b45366416ae090989fadeea012f7",
"0x5ef453dfd914c7f1b5341b4fe4bc8841cddf50fc809f03e57b98c6c01061f810",
"0xeafb4b6aa67e3915383d4a017ed65020850f19082561ccda3da644569c447215",
"0x89e4825d05aa72160b054ee98905d8a8b58cfb7749f9371bebb41266a18f1311",
"0xc3dcb74d9bb3c4c473134e65b46654f33233fcfb09d082170055e624dc195188",
"0x557ee0e9a461e1354fc5a2aff5cd2bc34fc1301f42aad5cbd76789546b67f67b",
"0xac48f9c5c8ef047f39b197f075e9c39dda3f5c1bea19392d7ee0995d93b14f51",
"0x314d3e212c403de04eb5374df1dbe0cdd7bb500c59d04f8899f8ac4a3072bac0",
"0xec73cc9e128101bc2c0c8a44311906c25c61cc6df4090fef7d894e7f3dec56c9"
]
}
```
-t为指定平行链高度,-1代表最新高度。
## config 配置
平行链配置项,目前只支持自共识配置。
`cli para config stages -h `
```
Available Commands:
all Get para chain self consensus stages
cancel cancel for config cmd
new apply for para chain's self consensus stages cmd
one query para chain one self consensus stage
query show self consensus stage apply info
vote vote for config cmd
```
需在平行链已配置超级节点后可使用。
## height 查询当前平行链的链高度及共识高度
`cli para height --rpc_laddr="http://114.55.11.139:1195"`
```
{
"title": "user.p.game.",
"chainHeight": 11497,
"consensHeight": 11495,
"consensBlockHash": "0x1e6e2099752d9f80d8295542aef6404711324198ed2988f29687af0d06830c0a"
}
```
## consens_status 根据高度查询平行链共识状态
`cli para consens_status -g 10000 --paraName user.p.game.`
```
{
"status": 1,
"title": "user.p.game.",
"height": 10000,
"mainHeight": 3847577,
"mainHash": "0x7ef088ccb85b775f5482f47ee35e37ec93a99c766c4f325258b097cccb81db0a",
"commitAddrs": [
"1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR",
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4",
"1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
],
"commitBlockHash": [
"0x9559671bdfbbc876eba722449f5a64d457b9f462db9af2a16d9d55da51201211",
"0x9559671bdfbbc876eba722449f5a64d457b9f462db9af2a16d9d55da51201211",
"0x9559671bdfbbc876eba722449f5a64d457b9f462db9af2a16d9d55da51201211"
]
}
```
注意这里需要输入的是paraName这个参数。
## is_sync 查询当前平行链是否同步至最高
`cli para is_sync --rpc_laddr="http://114.55.11.139:1195"`
返回true or false。
## nodegroup 平行链超级节点相关配置
后面详述超级节点相关操作及配置。
## para_list 查询当前主链下所有开启共识的平行链相关信息
`cli para para_list`
```
{
"titles": [
{
"totalNodes": 4,
"totalCommit": 3,
"mostSameCommit": 3,
"title": "user.p.game.",
"height": 11498
},
{
"totalNodes": 1,
"totalCommit": 1,
"mostSameCommit": 1,
"title": "user.p.issuance.",
"height": 6063
},
{
"totalNodes": 5,
"totalCommit": 4,
"mostSameCommit": 4,
"title": "user.p.magic.",
"height": 1802,
"txResult": "3166"
},
{
"totalNodes": 4,
"totalCommit": 3,
"mostSameCommit": 3,
"title": "user.p.para.",
"height": 89778
},
{
"totalNodes": 1,
"totalCommit": 1,
"mostSameCommit": 1,
"title": "user.p.testuwallet.",
"height": 11572
}
]
}
```
## super_node 超级节点相关配置
后面详述超级节点相关配置。
## transfer 转账
para转账是将平行链paracross中的资产转移到其他地址。
`cli para transfer -a 1.1 -s coins.bty -t 1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj --rpc_laddr="http://114.55.11.139:1195"`
可通过资产查询接口查看余额。
`cli asset balance -a 1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj --asset_exec paracross --asset_symbol coins.bty -e paracross --rpc_laddr="http://114.55.11.139:1195"`
```
{
"balance": "1.1000",
"frozen": "0.0000",
"addr": "1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj"
}
```
## transfer_exec 向执行器转账
同主链一样,向具体的执行器转账。
`cli send para transfer_exec -a 0.2 -e trade -s coins.bty --rpc_laddr="http://114.55.11.139:1195"`
查询余额
`cli asset balance -a 12HKLEn6g4FH39yUbHh4EVJWcFo5CXg22d --asset_exec paracross --asset_symbol coins.bty -e trade --rpc_laddr="http://114.55.11.139:1195"`
```
{
"balance": "0.2000",
"frozen": "0.0000",
"addr": "12HKLEn6g4FH39yUbHh4EVJWcFo5CXg22d"
}
```
## withdraw 取回资产
同主链一样,从具体的执行器取回资产到paracross合约。
`cli para withdraw -a 0.1 -s coins.bty -e trade --rpc_laddr="http://114.55.11.139:1195"`
***
## node 平行链超级节点相关
配置平行链超级节点,需要在配置文件中配置挖矿地址:
#验证账户,验证节点需要配置自己的账户,并且钱包导入对应种子,非验证节点留空
authAccount="1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
超级节点组申请:
nodegroup相关命令:
`cli para nodegroup -h`
```
Available Commands:
addrs Query super node group's current addrs by title
apply apply for para chain's super node group
approve approve for para chain's super node group application
list query super node group apply list by status
modify modify for para chain's super node group parameters
quit quit for para chain's super node group application
status query super node group apply status by title
```
## apply 申请超级节点账户组
平行链开链后,需要申请第一批超级节点账户组。
`cli para nodegroup apply -a 13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn -c 0 --paraName user.p.tank. --rpc_laddr="http://localhost:8901"`
-c为申请超级节点抵押的主链币数量,需大于等于后续审批阶段要求的数量。目前可以设置为0。
-a后为申请的账户组地址,多个时用,分隔。
## list 查询超级节点账户组申请状态
`cli para nodegroup list -s 1`
```
{
"ids": [
{
"id": "0xefdb14372362d382592d7e1ea0ee3460d0a9122301dda171c26a9128747bd334",
"status": 1,
"title": "user.p.tank.",
"targetAddrs": "13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn",
"fromAddr": "13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn",
"height": 4140014
}
]
}
```
-s后为申请状态,status:1:apply,2:approve,3:quit,根据状态查询
## quit 取消超级节点账户组申请
`clip para nodegroup quit -i 0xefdb14372362d382592d7e1ea0ee3460d0a9122301dda171c26a9128747bd334 --rpc_laddr="http://localhost:8901" --paraName user.p.tank.`
根据查询得到的申请id来取消申请。
## modify 修改超级节点账户组申请的抵押金额
`cli para nodegroup modify -c 1 --rpc_laddr="http://localhost:8901" --paraName user.p.super.`
## approve 审批超级节点账户组申请
`cli para nodegroup approve -c 0 --id 0x937e04945863ebf6241bef20e19e4d1ceb014a7235ce97725b3abf1137535786 --rpc_laddr="http://localhost:8901" --paraName user.p.tank.`
针对id进行审批。-c为抵押的主链币数量,申请者不能低于该数量。签名需由管理员签名完成。因为该交易需在主链和平行链都执行成功,所以该管理员需在主链和平行链都配置。
查询完成申请的超级节点状态:
`cli para nodegroup list -s 2`
```
{
"ids": [
{
"id": "0x215d2184e8709caf6a2a11aa4d1de55337e1eef83297a60259dbe627ddb312af",
"status": 2,
"title": "user.p.magic.",
"targetAddrs": "1Prx7vUMqqhWN6iaE4iijdxKZbAwLzfweC,1KpZCQqZF1mNAghWUmC3Y7FR9Uoa8gj3XK",
"coinsFrozen": 1000000000,
"fromAddr": "1Prx7vUMqqhWN6iaE4iijdxKZbAwLzfweC",
"height": 1850156
},
{
"id": "0x886a5c040e99fd3783f7ca2b38367809a50b33d0c8a52970ce56001fed2cb144",
"status": 2,
"title": "user.p.super.",
"targetAddrs": "13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn",
"fromAddr": "13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn",
"height": 4141281
},
{
"id": "0x937e04945863ebf6241bef20e19e4d1ceb014a7235ce97725b3abf1137535786",
"status": 2,
"title": "user.p.tank.",
"targetAddrs": "13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn",
"fromAddr": "13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn",
"height": 4140879
}
]
}
```
## addrs 根据平行链名称查询超级节点账户组
`cli para nodegroup addrs --paraName user.p.super.`
```
{
"key": "mavl-paracross-nodes-title-user.p.super.",
"value": "[13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn]"
}
```
## status 根据平行链名称查询超级节点账户组状态
`cli para nodegroup status --paraName user.p.super.`
```
{
"id": "0x886a5c040e99fd3783f7ca2b38367809a50b33d0c8a52970ce56001fed2cb144",
"status": 2,
"title": "user.p.super.",
"targetAddrs": "13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn",
"fromAddr": "13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn",
"height": 4141281
}
```
超级节点操作:
`cli para super_node -h`
```
Available Commands:
addr_status Get node current status:10:joined,11:quited from nodegroup
cancel super node cancel join or quit action by id cmd
id_list Get node apply id list info by status
id_status Get node id current vote status:1:joining,2:quiting,3:closed,4:canceled
join super node apply for join nodegroup cmd
quit super node apply for quit nodegroup cmd
vote nodegroup nodes vote for new join node cmd
```
## addr_status 根据地址查询地址在超级节点组的状态
`cli para super_node addr_status -a 13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn --paraName user.p.super.`
```
{
"addr": "13H84ZwW36bHqvxTrSENmFaa5zqsfBL8Fn",
"proposalId": "0x886a5c040e99fd3783f7ca2b38367809a50b33d0c8a52970ce56001fed2cb144-0",
"status": 10,
"title": "user.p.super."
}
```
其中:
status:10:joined,11:quited
## join 申请加入超级节点组
`cli para super_node join -a 1EKWC81hrPFPK3rfGiD4g9cQ1o9ohR62Sa -c 0 --rpc_laddr="http://localhost:8901" --paraName user.p.super.`
-c同上,为超级节点抵押的主链币,可设为0。
## id_list 根据状态查询超级节点申请信息
`cli para super_node id_list -s 1 --paraName user.p.super.`
```
{
"ids": [
{
"id": "0x1eafc50600d4dab5e941f6761b1a685c2991bc1ba63471ecb7a34397b9c31405",
"status": 1,
"title": "user.p.super.",
"targetAddr": "1EKWC81hrPFPK3rfGiD4g9cQ1o9ohR62Sa",
"votes": {},
"fromAddr": "1EKWC81hrPFPK3rfGiD4g9cQ1o9ohR62Sa",
"height": 4153693
}
]
}
```
-s为指定的status:0:all,1:joining,2:quiting,3:closed,4:canceled
## id_status 根据id查询超级节点申请信息
`cli para super_node id_status --id 0x1eafc50600d4dab5e941f6761b1a685c2991bc1ba63471ecb7a34397b9c31405 --paraName user.p.super.`
```
{
"id": "0x1eafc50600d4dab5e941f6761b1a685c2991bc1ba63471ecb7a34397b9c31405",
"status": 1,
"title": "user.p.super.",
"targetAddr": "1EKWC81hrPFPK3rfGiD4g9cQ1o9ohR62Sa",
"votes": {},
"fromAddr": "1EKWC81hrPFPK3rfGiD4g9cQ1o9ohR62Sa",
"height": 4153693
}
```
## cancel 取消申请加入或退出
`cli para super_node cancel -i 0x1eafc50600d4dab5e941f6761b1a685c2991bc1ba63471ecb7a34397b9c31405 --rpc_laddr="http://localhost:8901" --paraName user.p.super.`
可以取消join加入和quit退出的申请。
## vote 对申请加入的账号投票
`cli para super_node vote -v 1 -i 0xa64bb366b1bea81814e844b149379b339a743cc01d0074545dfc98e5d2d8ec63 --rpc_laddr="http://localhost:8901" --paraName user.p.super.`
-v为投票的值,1位赞成,2为反对。
投票需由超级节点账户组内地址完成。
## quit 退出超级节点账户组申请
`cli para super_node quit -a 1EKWC81hrPFPK3rfGiD4g9cQ1o9ohR62Sa --rpc_laddr="http://localhost:8901" --paraName user.p.super.`
可以由任何地址提出,由超级节点账户组进行投票。
***
配置相关
## config
`cli para config stages -h`
```
Available Commands:
all Get para chain self consensus stages
cancel cancel for config cmd
new apply for para chain's self consensus stages cmd
one query para chain one self consensus stage
query show self consensus stage apply info
vote vote for config cmd
```
目前支持自共识查询
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment