BCLI

一、BCLI工具简述

Bottos BCLI 实现了一组人机交互命令行,主要基于RESTFUL API和链进行交互及实现创建用户,查链,转账,钱包等基于主链的人机交互行功能。

二、BCLI工具安装和使用

在BOTTOS代码的BCLI目录下执行go build,编译成功后将会产生bcli可执行文件。

三、BCLI命令行说明

全局选项说明

全局选项名 参数说明
--servaddr 配置全局restful地址

全局帮助信息

./bcli --help

NAME:
Bottos bcli tool - a tool that makes user communicate with bottos blockchain

USAGE:
bcli [global options] command [command options] [arguments...]

VERSION:
0.0.1

COMMANDS:
    getinfo      get chian info
    getblock     get block info
    gettable     get table info
    account      create or get account
    transfer     for user transfering bto
    transaction  get or push transactions
    contract     get or deploy contract
    p2p          for p2p connection
    delegate     for delegate operations
    wallet       For wallet operations
    genesis      for genesis node operations
    help, h      Shows a list of commands or help for one command

GLOBAL OPTIONS:
--servaddr value  (default: "127.0.0.1:8689")
--help, -h        show help
--version, -v     print the version

命令功能说明

主命令行 参数列表 参数说明
./bcli getinfo 获取块头信息
./bcli getblock 获取指定BLOCK信息
./bcli gettable 获取合约表信息
./bcli account 创建/获取用户信息,质押/解质押/回收质押等
./bcli transfer BTO转账功能
./bcli transaction 查询/发起 transaction
./bcli contract 查询/部署合约和ABI
./bcli p2p P2P命令行暂不支持
./bcli delegate 注册/解注册生产者,生产者投票/取消投票等
./bcli wallet 钱包创建/锁定/解锁/查询等
./bcli genesis 创世节点操作相关,设置初始生产者,移交出块权利,取消节点操作权限等

1. BCLI用户账户功能命令行

用户账户功能命令行主要负责创建新用户,获取指定用户信息,质押和解质押BTO,以及回收质押等。

总体命令行帮助信息

./bcli account --help

NAME:
Bottos bcli tool account - create or get account

USAGE:
Bottos bcli tool account command [command options] [arguments...]

COMMANDS:
    create   create account
    get      get account info
    stake    stake of account
    unstake  unstake of account
    claim    claim of stake

OPTIONS:
--help, -h  show help

命令功能说明

主命令行 参数列表 参数说明
./bcli account create 创建新用户
./bcli account get 获取用户信息
./bcli account stake 质押BTO
./bcli account unstake 解质押BTO
./bcli account claim 回收部分质押BTO
创建用户命令说明

帮助信息

./bcli account create --help

NAME:
Bottos bcli tool account create - create account
USAGE:
Bottos bcli tool account create [command options] [arguments...]

OPTIONS:

--username value acocunt name --pubkey value account public key (default: "0454f1c2223d553aa6ee53ea1ccea8b7bf78b8ca99f3ff622a3bb3e62dedc712089033d6091d77296547bc071022ca2838c9e86dec29667cf740e5c9e654b6127f") --referrer value account referrer

参数说明

主命令行 参数列表 参数说明 必选参数
bcli account create --username 创建的用户名
--pubkey 新建用户的公钥,不填则使用内置缺省pubkey
--referrer 引荐人,不填则使用缺省内置账户进行签名,否则使用引荐人做签名

返回信息

该命令成功后将返回BCLI成功发送的Transaction信息,主要内容包含用户名,公钥,发起者及签名(--referrer信息,缺省为内置bottos用户)等。

示例

./bcli account create --username user1 --pubkey 0454f1c2223d553aa6ee53ea1ccea8b7bf78b8ca99f3ff622a3bb3e62dedc712089033d6091d77296547bc071022ca2838c9e86dec29667cf740e5c9e654b6127f

输出结果

Create account: user1 Succeed
Trx: 
{
    "version": 1,
    "cursor_num": 1093,
    "cursor_label": 3607725829,
    "lifetime": 1536230581,
    "sender": "bottos",
    "contract": "bottos",
    "method": "newaccount",
    "param": {
        "name": "user1",
        "pubkey": "0454f1c2223d553aa6ee53ea1ccea8b7bf78b8ca99f3ff622a3bb3e62dedc712089033d6091d77296547bc071022ca2838c9e86dec29667cf740e5c9e654b6127f"
    },
    "param_bin": "dc0002da00057573657231da008230343534663163323232336435353361613665653533656131636365613862376266373862386361393966336666363232613362623365363264656463373132303839303333643630393164373732393635343762633037313032326361323833386339653836646563323936363763663734306535633965363534623631323766",
    "sig_alg": 1,
    "signature": "90936cc7c453a737ec16a70d4c63d1032b1f3d3419a3b20f428d6c98490d5934553bcf2bb5ee6c21914b1421fcbb41146fe8beafd0f0bc78d8708811769dd6db"
}
TrxHash: fc83e64f1e05fd6a78256250c6e58a782567ead312db711a6549a6675eafb696
获取用户信息命令示例

帮助信息

./bcli account get --help
NAME:
Bottos bcli tool account get - get account info

USAGE:
Bottos bcli tool account get [command options] [arguments...]

OPTIONS:
    --username value  acocunt nam

参数说明

主命令行 参数列表 参数说明 必选参数
bcli account get --username 用户名

返回信息

该命令成功后将返回用户所持有的BTO信息。

示例

./bcli account get --username bottos

输出结果

Account: bottos
Balance: 999710000.00000000 BTO
用户质押BTO命令示例

帮助信息

./bcli account stake --help

NAME:
Bottos bcli tool account stake - stake of account

USAGE:
Bottos bcli tool account stake [command options] [arguments...]

OPTIONS:
    --account value  acocunt name
    --amount value   amount of bto

参数说明

主命令行 参数列表 参数说明 必选参数
bcli account stake --account 用户名
--amount 质押BTO个数

返回信息

该命令成功后将返回BCLI成功发送的Transaction信息。

示例

./bcli account stake --account lyp --amount 2

输出结果

Transfer Succeed:
Trx: 
{
    "version": 1,
    "cursor_num": 3909,
    "cursor_label": 4191535575,
    "lifetime": 1536560467,
    "sender": "bottos",
    "contract": "bottos",
    "method": "stake",
    "param": "dc0001c500200000000000000000000000000000000000000000000000000000000000000002",
    "param_bin": "dc0001c500200000000000000000000000000000000000000000000000000000000000000002",
    "sig_alg": 1,
    "signature": "fcb341de3ada22108107285b511fe35d8777d31150545678eb278ad4457303c8059e1b1ff2fa39fb545a0ea743b45e830c6d1bbf86611087a4807116c5351acd"
}
TrxHash: cbea44984ca17dc640cec7bc5349b6c839229ff86462a24fa0e1196d2b73cedd
用户解质押BTO命令示例

帮助信息

./bcli account unstake --help

NAME:
Bottos bcli tool account unstake - unstake of account

USAGE:
Bottos bcli tool account unstake [command options] [arguments...]

OPTIONS:
    --account value  acocunt name
    --amount value   amount of bto

参数说明

主命令行 参数列表 参数说明 必选参数
bcli account unstake --account 用户名
--amount 解质押BTO个数

返回信息

该命令成功后将返回BCLI成功发送的Transaction信息。

示例

./bcli account unstake --account lyp --amount 2

输出结果

Transfer Succeed:
Trx: 
{
    "version": 1,
    "cursor_num": 4067,
    "cursor_label": 3077673547,
    "lifetime": 1536560941,
    "sender": "bottos",
    "contract": "bottos",
    "method": "unstake",
    "param": "dc0001c500200000000000000000000000000000000000000000000000000000000000000002",
    "param_bin": "dc0001c500200000000000000000000000000000000000000000000000000000000000000002",
    "sig_alg": 1,
    "signature": "9f14f894a5dd68a7ec010e95ae9c0de52bf368964e8a539d4f2a2c68240e1e4164d4e7a0b34943399c821c81c7b5526ff96370f2cd7d175c4dab062a98f354e5"
}
TrxHash: 336b46af3a8eefbc8879cd46e91c42eb122152111c3f61c312422eb41b77e383
用户回收质押BTO命令示例

帮助信息

./bcli account claim --help

NAME:
Bottos bcli tool account claim - claim of stake

USAGE:
Bottos bcli tool account claim [command options] [arguments...]

OPTIONS:
    --account value  acocunt name
    --amount value   amount of bto

参数说明

主命令行 参数列表 参数说明 必选参数
bcli account claim --account 用户名
--amount 回收质押BTO个数

返回信息

该命令成功后将返回BCLI成功发送的Transaction信息。

示例

./bcli account claim --account lyp --amount 2

输出结果

Transfer Succeed:
Trx: 
{
    "version": 1,
    "cursor_num": 4148,
    "cursor_label": 2794796656,
    "lifetime": 1536561184,
    "sender": "bottos",
    "contract": "bottos",
    "method": "claim",
    "param": "dc0001c500200000000000000000000000000000000000000000000000000000000000000002",
    "param_bin": "dc0001c500200000000000000000000000000000000000000000000000000000000000000002",
    "sig_alg": 1,
    "signature": "e05082ecf9028bc9e1e0aa003f6f13cffabba4fc28118ad3d3e9de678525d5b049035818d14c8067b739db34408d8aee1aa50deb99a0fcd9973ad2dcd7fdc627"
}
TrxHash: fe3952e5743db0b35bf669b68e5a3d243c19836e1f5c17b970f524a9d59b8eab

2. BCLI 合约功能命令行

BCLI合约功能命令行主要实现用户主动部署一个合约及ABI文件到主链,以及从主链获取合约code(或文件) 文件和ABI(或文件)功能。

总体帮助信息如下

./bcli contract --help

NAME:
Bottos bcli tool contract - get or deploy contract

USAGE:
Bottos bcli tool contract command [command options] [arguments...]

COMMANDS:
    deploy      contract deploy
    deploycode  contract  deploycode
    deployabi   Contract  deployabi
    get         get contract

OPTIONS:
    --help, -h  show help

命令功能说明

主命令行 参数列表 参数说明
./bcli contract deploy 部署ABI文件以及WASM合约
./bcli contract deploycode 部署合约
./bcli contract deployabi 部署ABI文件
./bcli contract get 获取指定合约和ABI信息并存文件
BCLI 合约部署命令行

帮助信息

./bcli contract deploycode --help
NAME:
Bottos bcli tool contract deploycode - contract  deploycode

USAGE:
    Bottos bcli tool contract deploycode [command options] [arguments...]

OPTIONS:
    --name value  the contract name
    --code value  the contract's wasm file path ( includes wasm file name )
    --user value  the user account

参数说明

主命令行 参数列表 参数说明 必选参数
bcli contract deploycode --name 合约名
--code 合约文件(.WASM)所在路径
--user 发起合约签名的用户名

返回信息

该命令成功后将返回BCLI成功发送的Transaction信息。

示例

./bcli contract deploycode --name nodeclustermng --code nodeclustermng.wasm --user bottos

输出结果

Deploy contract: nodeclustermng Succeed
Trx: 
{
    "version": 1,
    "cursor_num": 4948,
    "cursor_label": 3178968225,
    "lifetime": 1536563584,
    "sender": "nodeclustermng",
    "contract": "bottos",
    "method": "deploycode",
    "param": {
        "name": "nodeclustermng",
        "vm_type": 1,
        "vm_version": 1,
        "contract_code": "0061736d0100000001290760027f7f017f60017f0060027f7f0060067f7f7f7f7f7f017f60037f7f7f017f60000060017f017f02560603656e7608676574506172616d000003656e76066d656d637079000403656e76066d656d736574000403656e7606..."
    },
    "param_bin": "dc0004da000e6e6f6465636c75737465726d6e67cc01cc01c5162f0061736d0100000001290760027f7f017f60017f0060027f7f0060067f7f7f7f7f7f017f60037f7f7f017f60000060017f017f02560603656e7608676574506172616d000003656e76...",
    "sig_alg": 1,
    "signature": "aa80b0d7ab8779f112e38cd9ae6eff759dc3997c2d852c33130baac8cf4c641d549b43d69759c3e2b1c617a7552134be5d68ff11dbb0b2fd70d51a2606b853be"
}
TrxHash: ad45ac9a840642e569f07d0a9ba7fb9331e67bc96576e157b68ee09840d430f7
BCLI ABI部署命令行

帮助信息

./bcli contract deployabi --help
NAME:
Bottos bcli tool contract deployabi - Contract  deployabi

USAGE:
    Bottos bcli tool contract deployabi [command options] [arguments...]

OPTIONS:
    --name value  the contract name
    --abi value   the contract's abi file path ( includes abi file name )
    --user value  the user account

参数说明

主命令行 参数列表 参数说明 必选参数
bcli contract deployabi --name 合约名
--abi abi描述文件(.abi)所在路径
--user 发起合约签名的用户名

返回信息

该命令成功后将返回BCLI成功发送的Transaction信息。

示例

./bcli contract deployabi --name nodeclustermng --abi nodeclustermng.abi --user bottos

输出结果

{
    "errcode": 0,
    "msg": "trx receive succ",
    "result": {
        "trx": {
            "version": 1,
            "cursor_num": 5264,
            "cursor_label": 890555306,
            "lifetime": 1536564532,
            "sender": "nodeclustermng",
            "contract": "bottos",
            "method": "deployabi",
            "param": "dc0002da000e6e6f6465636c75737465726d6e67c504297b0a09227479706573223a205b5d2c0a092273747275637473223a205b0a20202020202020202020202020207b0a202020202020202020202020202009226e616d65223a20224e6f6465436c7573746572526567222c0a2020202020202020202020202020092262617365223a2022222c0a202020202020202020202020202009226669656c6473223a207b0a20202020202020202020202020200909226e6f64654950223a2022737472696e67222c0a2020202020202020202020202020090922636c75737465724950223a2022737472696e67222c0a202020202020202020202020202009092275756964223a2022737472696e67222c0a20202020202020202020202020200909226361706163697479223a2022737472696e67220a20202020202020202020202020202020202020207d0a2020202020202020202020202020097d2c0a20202020202020202020202020207b0a202020202020202020202020202009226e616d65223a20224e6f6465436c7573746572496e666f222c0a2020202020202020202020202020092262617365223a2022222c0a202020202020202020202020202009226669656c6473223a207b0a2020202020202020202020202020090922636c75737465724950223a2022737472696e67222c0a202020202020202020202020202009092275756964223a2022737472696e67222c0a20202020202020202020202020200909226361706163697479223a2022737472696e67220a20202020202020202020202020202020202020207d0a2020202020202020202020202020097d0a202020202020205d2c0a0922616374696f6e73223a205b0a20202020202020202020202020207b0a20202020202020202020202020200922616374696f6e5f6e616d65223a2022726567222c0a2020202020202020202020202020092274797065223a20224e6f6465436c7573746572526567220a20202020202020202020202020207d0a202020202020205d2c0a09227461626c6573223a205b0a20202020202020202020202020207b0a202020202020202020202020202009227461626c655f6e616d65223a20226e6f6465636c7573746572696e666f222c0a20202020202020202020202020200922696e6465785f74797065223a2022737472696e67222c0a202020202020202020202020202009226b65795f6e616d6573223a20205b0a20202020202020202020202020200909226e6f64654950220a202020202020202020202020202009205d2c0a202020202020202020202020202009226b65795f7479706573223a20205b0a2020202020202020202020202020090922737472696e67220a202020202020202020202020202009205d2c0a2020202020202020202020202020092274797065223a20224e6f6465436c7573746572496e666f220a20202020202020202020202020207d0a202020202020205d0a7d0a",
            "sig_alg": 1,
            "signature": "1807799fb6c007dff7a49641f1a84b41c083d346af300bbafa0dd1894a01ab6e51d1885b9ded14a66850b85e5ef4c38cc515bd9934f7ceaf26f2db33cfc6973f"
        },
        "trx_hash": "62472648f88eece3a959d4cc1ff6e5dca11f05b1c6fb214e49ac4a9b3458ed1e"
    }
}

注: BOTTOS ABI 文件是对合约一些方法所需的接口和结构以及参数的信息描述,例如本例中nodeclustermng.abi文件内容如下。

"structs" 代表本合约所有方法需要使用到的所有结构体定义;
"actions" 代表本合约所有合约支持的所有合约方法名以及所需的对应结构名
"tables" 代表查询合约被调用后(生效后)合约信息会写入链上,TABLES代表查询链上的某条信息所需要的入参,包含关键字和所对应的结构信息。

具体示例如下。

{
    "types": [],
    "structs": [
            {
                "name": "NodeClusterReg",
                "base": "",
                "fields": {
                    "nodeIP": "string",
                    "clusterIP": "string",
                    "uuid": "string",
                    "capacity": "string"
                    }
                },
            {
                "name": "NodeClusterInfo",
                "base": "",
                "fields": {
                    "clusterIP": "string",
                    "uuid": "string",
                    "capacity": "string"
                    }
                }
    ],
    "actions": [
            {
                "action_name": "reg",
                "type": "NodeClusterReg"
            }
    ],
    "tables": [
            {
                "table_name": "nodeclusterinfo",
                "index_type": "string",
                "key_names":  [
                    "nodeIP"
                ],
                "key_types":  [
                    "string"
                ],
                "type": "NodeClusterInfo"
            }
    ]
}
BCLI CODE和ABI同时部署命令行

帮助信息

./bcli contract deploy --help
NAME:
Bottos bcli tool contract deploy - contract deploy

USAGE:
    Bottos bcli tool contract deploy [command options] [arguments...]

OPTIONS:
    --name value  the contract name
    --code value  the contract's wasm file path ( includes wasm file name )
    --abi value   the contract's abi file path ( includes abi file name )
    --user value  the user account

参数说明

主命令行 参数列表 参数说明 必选参数
bcli contract deploy --name 合约名
--code 合约名
--abi abi描述文件(.abi)所在路径
--user 发起合约签名的用户名

返回信息

该命令成功后将返回BCLI成功发送的Transaction信息。

示例

./bcli contract deploy --name nodeclustermng --code nodeclustermng.wasm --abi nodeclustermng.wasm --user nodeclustermng

输出结果

Deploy contract: nodeclustermng Succeed
Trx:
{
    "version": 1,
    "cursor_num": 5730,
    "cursor_label": 2562596760,
    "lifetime": 1536565930,
    "sender": "nodeclustermng",
    "contract": "bottos",
    "method": "deploycode",
    "param": {
        "name": "nodeclustermng",
        "vm_type": 1,
        "vm_version": 1,
        "contract_code": "0061736d0100000001290760027f7f017f60017f0060027f7f0060067f7f7f7f7f7f017f60037f7f7f017f60000060017f017f02560603656e7608676574506172616d000003656e76066d656d637079000403656e76066d656d736574000403656e7606..."
    },
    "param_bin": "dc0004da000e6e6f6465636c75737465726d6e67cc01cc01c5162f0061736d0100000001290760027f7f017f60017f0060027f7f0060067f7f7f7f7f7f017f60037f7f7f017f60000060017f017f02560603656e7608676574506172616d000003656e76...",
    "sig_alg": 1,
    "signature": "5611a1ccaa1286616e01e93517c04d4353143b5fe3d831ce9f67c48d7a19f39c505e6bd8e190f65ea74f8ade93a5db528c5299b8314cfa37243a8a66df0d900a"
}
TrxHash: 5be2a59d92486a5b9cdc9ab8197f9640d0276949d08c7f8887374a9cd5b36bdc
{
    "errcode": 0,
    "msg": "trx receive succ",
    "result": {
        "trx": {
            "version": 1,
            "cursor_num": 5730,
            "cursor_label": 2562596760,
            "lifetime": 1536565930,
            "sender": "nodeclustermng",
            "contract": "bottos",
            "method": "deployabi",
            "param": "dc0002da000e6e6f6465636c75737465726d6e67c5162f0061736d0100000001290760027f7f017f60017f0060027f7f0060067f7f7f7f7f7f017f60037f7f7f017f60000060017f017f02560603656e7608676574506172616d000003656e76066d656d637079000403656e76066d656d736574000403656e76067072696e7469000103656e76067072696e7473000203656e760b73657453747256616c75650003030504050506000404017000000503010001073d04066d656d6f7279020004696e697400070573746172740008215f474c4f42414c5f5f7375625f495f6e6f6465636c75737465726d6e672e63707000060ada2804f202004100420037028c4041004200370294404100420037029c40410042003702a440410042003702ac40410041003602b440410041003602b840410041003602bc40410041003602c040410041003602c440410041003602c840410041003602cc40410041003602d040410041003602d440410041003602d840410041003602dc40410041003602e040410041003602e440410041003602e840410041003602ec40410041003602f040410041003602f440410041003602f840410041003602fc404100410036028041410041003602844141004100360288414100410036028c414100410036029041410041003602944141004100360298414100410036029c41410041003602a041410041003602a441410041003602a841410041003602ac41410041003602b041410041003602b441410041003602b841410041003602bc41410041003602c041410041003602c441410041003602c841410041003602cc41410041003602d041410041003602d4410b02000bec1b01087f4100410028020441c0196b22083602040240024002400240024002400240200041f200470d00200841c0096a410041801010021a20084180056a410041ba0410021a200841c0096a41801010002205100302402005450d00200841c0096a210020052107034020002d00001003200041016a21002007417f6a22070d000b0b200841003a00f004200820053602f804200841003602fc042008200841c0096a3602f404200841f0046a200841306a1009450d0420082d00304106470d0120082802384104470d04200841f0046a200841306a1009450d0420082d00304105470d022008280238220641016a410a490d03200841013a00f0040c040b200841c0096a41b0c300412310011a200841c0096a4101722105410021000340200520006a2107200041016a2206210020072d00000d000b200841c0096a200610040c040b200841063a00f0040c020b200841063a00f0040c010b0240024020082802f4042207450d00200841fc046a280200220020066a200841f8046a2802004d0d010b200841043a00f0040c010b02402006450d00200720006a210020084180056a2107200621050340200720002d00003a0000200741016a2107200041016a21002005417f6a22050d000b200841fc046a28020021000b20084180056a20066a41003a0000200841fc046a200020066a360200200841f0046a200841306a1009450d000240024020082d00304105470d002008280238220641016a41c303490d01200841013a00f0040c020b200841063a00f0040c010b0240024020082802f4042207450d00200841fc046a280200220020066a200841f8046a2802004d0d010b200841043a00f0040c010b20084189056a210102402006450d00200720006a210020012107200621050340200720002d00003a0000200741016a2107200041016a21002005417f6a22050d000b200841fc046a28020021000b200841fc046a200020066a36020020084180056a20066a41096a41003a0000200841f0046a200841306a1009450d000240024020082d00304105470d002008280238220641016a41e500490d01200841013a00f0040c020b200841063a00f0040c010b0240024020082802f4042207450d00200841fc046a280200220020066a200841f8046a2802004d0d010b200841043a00f0040c010b200841cb086a210202402006450d00200720006a210020022107200621050340200720002d00003a0000200741016a2107200041016a21002005417f6a22050d000b200841fc046a28020021000b200841fc046a200020066a36020020084180056a20066a41cb036a41003a0000200841f0046a200841306a1009450d000240024020082d00304105470d002008280238220341016a410c490d01200841013a00f0040c020b200841063a00f0040c010b0240024020082802f4042205450d00200841fc046a280200220720036a200841f8046a2802004d0d010b200841043a00f0040c010b200841af096a210002402003450d00200520076a210720002105200321060340200520072d00003a0000200541016a2105200741016a21072006417f6a22060d000b200841fc046a28020021070b200841fc046a200720036a3602004100210720084180056a20036a41af046a41003a0000200841366a41002d0086423a0000200841346a41002f0084423b01002008410028008042360230200841306a41017221060340200620076a2105200741016a2203210720052d00000d000b200841306a200310044100210741002103024020082d008005450d0020084180056a4101722104410021050340200420056a2106200541016a2203210520062d00000d000b0b20084180056a20031004200841386a41002f0098423b01002008410029009042370230200841306a41017221060340200620076a2105200741016a2203210720052d00000d000b200841306a200310044100210741002103024020084189056a2d0000450d002008418a056a2104410021050340200420056a2106200541016a2203210520062d00000d000b0b200120031004200841346a41002d00a4423a0000200841002800a042360230200841306a41017221060340200620076a2105200741016a2203210720052d00000d000b200841306a2003100441002107410021030240200841cb086a2d0000450d00200841cc086a2104410021050340200420056a2106200541016a2203210520062d00000d000b0b200220031004200841386a41002d00b8423a0000200841002900b042370230200841306a41017221060340200620076a2105200741016a2203210720052d00000d000b200841306a20031004410021060240200841af096a2d0000450d00200841b0096a2103410021070340200320076a2105200741016a2206210720052d00000d000b0b200020061004200841306a410041b10410021a200841306a21070340200720012d000022053a0000200741016a2107200141016a210120050d000b200841f2036a21070340200720022d000022053a0000200741016a2107200241016a210220050d000b200841d6046a21070340200720002d000022053a0000200741016a2107200041016a210020050d000b200841f0046a41086a418010360200200841fc046a2201410336020041002105200841003a00f004200841dc013a00c00920084180063b00c1092008200841c0096a3602f404024020082d00302203450d00200841306a4101722106410021000340200620006a2107200041016a2205210020072d00000d000b0b4106210220014106360200200841da013a00c309200820053a00c50920082005410874418080fc07714110763a00c4090240024002400240200541ffff03712206450d0041052100200641066a4180104b0d01200820033a00c609024020064101460d00410120066b2105200841c0096a4107722100200841306a41017221070340200020072d00003a0000200041016a2100200741016a2107200541016a22050d000b0b200841fc046a2200200028020020066a22023602000b02400240200841f2036a2d00002201450d00200841f3036a2106410021000340200620006a2107200041016a2205210020072d00000d000c020b0b410021050b4103210020082802f4042207450d00200241016a200841f0046a41086a2802004b0d00200720026a41da013a0000200841fc046a22002000280200220741016a2206360200024020082802f4042202450d0041082100200741036a200841f0046a41086a2802004b0d01200220066a220020054118742005410874418080fc07717220054108764180fe03712005411876727222074118763a0001200020074110763a0000200841fc046a22002000280200220741026a22023602000240200541ffff03712206450d004105210020082802f4042203450d02200220066a200841f8046a2802004b0d02200320026a20013a0000024020064101460d00410120066b2105200320076a41036a2100200841f3036a21070340200020072d00003a0000200041016a2100200741016a2107200541016a22050d000b0b200841fc046a2200200028020020066a22023602000b02400240200841d6046a2d00002201450d00200841d7046a2106410021000340200620006a2107200041016a2205210020072d00000d000c020b0b410021050b4103210020082802f4042207450d01200241016a200841f0046a41086a2802004b0d01200720026a41da013a0000200841fc046a22002000280200220741016a220636020020082802f4042202450d0041082100200741036a200841f0046a41086a2802004b0d01200220066a220020054118742005410874418080fc07717220054108764180fe03712005411876727222074118763a0001200020074110763a0000200841fc046a22002000280200220741026a22023602000240200541ffff03712206450d004105210020082802f4042203450d02200220066a200841f8046a2802004b0d02200320026a20013a0000024020064101460d00410120066b2105200320076a41036a2100200841d7046a21070340200020072d00003a0000200041016a2100200741016a2107200541016a22050d000b0b200841fc046a2200200028020020066a22023602000b41002100200841002903e842370328200841002903e042370320200841206a41017221050340200520006a2107200041016a2206210020072d00000d000b20082d008005450d0220084180056a4101722101410021000340200120006a2107200041016a2205210020072d00000d000c040b0b410821000b200820003a00f00441002100200841106a41002d00d0423a0000200841002903c842370308200841002903c042370300200841017221050340200520006a2107200041016a2206210020072d00000d000b2008200610040c030b410021050b0240200841206a200620084180056a200520082802f40420021005450d0041002100200841146a41002d00a4433a0000200841106a41002802a04336020020084100290398433703082008410029039043370300200841017221050340200520006a2107200041016a2206210020072d00000d000b200820061004410021000c030b41002100200841146a41002d0084433a0000200841106a410028028043360200200841002903f842370308200841002903f042370300200841017221050340200520006a2107200041016a2206210020072d00000d000b2008200610040c010b41002100200841c4006a41002f01f4413b0100200841c0006a41002802f041360200200841002903e841370338200841002903e041370330200841306a41017221050340200520006a2107200041016a2206210020072d00000d000b200841306a200610040b410121000b4100200841c0196a36020420000bf20902047f017e0240024020002802042202450d00200028020c220341016a220420002802084d0d010b200041023a000041000f0b200220036a2d000021022000410c6a200436020002400240024002400240024002400240024002400240024002400240200241bb7e6a220241174b0d00024020020e18000101010101010203040501010101010101010101060107000b200141003a00000240200041046a2802002202450d002000410c6a2203280200220441026a2205200041086a2802004d0d080b200041073a000041000f0b200041063a000041000f0b200141013a00000240200041046a2802002202450d002000410c6a2203280200220441016a200041086a2802004d0d070b200041043a000041000f0b200141023a00000240200041046a2802002202450d002000410c6a2203280200220441026a200041086a2802004d0d070b200041043a000041000f0b200141033a00000240200041046a2802002202450d002000410c6a2203280200220441046a200041086a2802004d0d070b200041043a000041000f0b200141043a00000240200041046a2802002202450d002000410c6a2203280200220441086a200041086a2802004d0d070b200041043a000041000f0b200141053a00000240200041046a2802002202450d002000410c6a2203280200220441026a2205200041086a2802004d0d070b200041043a000041000f0b200141063a00000240200041046a2802002202450d002000410c6a2203280200220441026a2205200041086a2802004d0d070b200041043a000041000f0b200220046a22002d0000210220002d0001210020032005360200200141086a200220004108747222004118742000410874418080fc07717241107636020041010f0b200141086a200220046a2d00003a00002003200328020041016a36020041010f0b200141086a2200200220046a22022d00003a0000200141096a20022d00013a00002003200328020041026a360200200020002f010022014118742001410874418080fc0771724110763b010041010f0b200141086a2205200220046a22002d00003a0000200141096a20002d00013a00002001410a6a200041026a2d00003a00002001410b6a200041036a2d00003a00002003200328020041046a3602002005200528020022004118742000410874418080fc07717220004108764180fe03712000411876727236020041010f0b200141086a2205200220046a22002d00003a0000200141096a20002d00013a00002001410a6a200041026a2d00003a00002001410b6a200041036a2d00003a00002001410c6a200041046a2d00003a00002001410d6a200041056a2d00003a00002001410e6a200041066a2d00003a00002001410f6a200041076a2d00003a00002003200328020041086a360200200520052903002206423886200642288642808080808080c0ff0083842006421886428080808080e03f8320064208864280808080f01f838484200642088842808080f80f832006421888428080fc07838420064228884280fe0383200642388884848437030041010f0b200220046a22002d0000210220002d0001210020032005360200200141086a200220004108747222004118742000410874418080fc07717241107636020041010f0b200220046a22002d0000210220002d0001210020032005360200200141086a200220004108747222004118742000410874418080fc07717241107636020041010b0bf3010b0041040b04e06100000041e0c1000b166e6f646520636c757374657220726567206661696c00004180c2000b076e6f6465495000004190c2000b0a636c75737465724950000041a0c2000b0575756964000041b0c2000b096361706163697479000041c0c2000b117061636b20696e666f206661696c6564000041e0c2000b106e6f6465636c7573746572696e666f000041f0c2000b15736574207374722076616c7565206661696c656400004190c3000b15726567206e6f646520636c757374657220737563000041b0c3000b23696e76616c6964206d6574686f642066726f6d206e6f6465636c75737465726d6e6700",
            "sig_alg": 1,
            "signature": "fecde87d6c5cd6c53b3a4f7c79e6335c5d229bad22092db918850130163cc1bd688bfbf79b188352129ec6c1240d56f8c7c90ad16f953a8cd41a71e63aa426f2"
        },
        "trx_hash": "f55af648b151466499d19d8de3a62ab304a3ff49616e10fa12f78443ec12c4e4"
    }
}
BCLI获取合约CODE文件和ABI文件

帮助信息

./bcli contract get --help
NAME:
Bottos bcli tool contract get - get contract

USAGE:
Bottos bcli tool contract get [command options] [arguments...]

OPTIONS:
    --name value  the contract name
    --code value  the contract's wasm file path ( includes wasm file name )
    --abi value   the contract's abi file path ( includes abi file name )

参数说明

主命令行 参数列表 参数说明 必选参数
bcli contract deploy --name 合约名
--code 要保存的合约路径名
--abi 要保存的abi描述文件(.abi)路径

返回信息

该命令成功后将返回合约文件码流和ABI文件信息,以及保存对应内容到目的合约文件路径及ABI文件路径。

示例

./bcli contract get --name nodeclustermng --code ~/nodeclustermng.wasm --abi ~/nodeclustermng.abi

输出结果

============CONTRACTCODE===============

"0061736d0100000001290760027f7f017f60017f0060027f7f0060067f7f7f7f7f7f017f60037f7f7f017f60000060017f017f02560603656e7608676574506172616d000003656e76066d656d637079000403656e76066d656d736574000403656e76067072696e7469000103656e76067072696e7473000203656e760b73657453747256616c75650003030504050506000404017000000503010001073d04066d656d6f7279020004696e697400070573746172740008215f474c4f42414c5f5f7375625f495f6e6f6465636c75737465726d6e672e63707000060ada2804f202004100420037028c4041004200370294404100420037029c40410042003702a440410042003702ac40410041003602b440410041003602b840410041003602bc40410041003602c040410041003602c440410041003602c840410041003602cc40410041003602d040410041003602d440410041003602d840410041003602dc40410041003602e040410041003602e440410041003602e840410041003602ec40410041003602f040410041003602f440410041003602f840410041003602fc404100410036028041410041003602844141004100360288414100410036028c414100410036029041410041003602944141004100360298414100410036029c41410041003602a041410041003602a441410041003602a841410041003602ac41410041003602b041410041003602b441410041003602b841410041003602bc41410041003602c041410041003602c441410041003602c841410041003602cc41410041003602d041410041003602d4410b02000bec1b01087f4100410028020441c0196b22083602040240024002400240024002400240200041f200470d00200841c0096a410041801010021a20084180056a410041ba0410021a200841c0096a41801010002205100302402005450d00200841c0096a210020052107034020002d00001003200041016a21002007417f6a22070d000b0b200841003a00f004200820053602f804200841003602fc042008200841c0096a3602f404200841f0046a200841306a1009450d0420082d00304106470d0120082802384104470d04200841f0046a200841306a1009450d0420082d00304105470d022008280238220641016a410a490d03200841013a00f0040c040b200841c0096a41b0c300412310011a200841c0096a4101722105410021000340200520006a2107200041016a2206210020072d00000d000b200841c0096a200610040c040b200841063a00f0040c020b200841063a00f0040c010b0240024020082802f4042207450d00200841fc046a280200220020066a200841f8046a2802004d0d010b200841043a00f0040c010b02402006450d00200720006a210020084180056a2107200621050340200720002d00003a0000200741016a2107200041016a21002005417f6a22050d000b200841fc046a28020021000b20084180056a20066a41003a0000200841fc046a200020066a360200200841f0046a200841306a1009450d000240024020082d00304105470d002008280238220641016a41c303490d01200841013a00f0040c020b200841063a00f0040c010b0240024020082802f4042207450d00200841fc046a280200220020066a200841f8046a2802004d0d010b200841043a00f0040c010b20084189056a210102402006450d00200720006a210020012107200621050340200720002d00003a0000200741016a2107200041016a21002005417f6a22050d000b200841fc046a28020021000b200841fc046a200020066a36020020084180056a20066a41096a41003a0000200841f0046a200841306a1009450d000240024020082d00304105470d002008280238220641016a41e500490d01200841013a00f0040c020b200841063a00f0040c010b0240024020082802f4042207450d00200841fc046a280200220020066a200841f8046a2802004d0d010b200841043a00f0040c010b200841cb086a210202402006450d00200720006a210020022107200621050340200720002d00003a0000200741016a2107200041016a21002005417f6a22050d000b200841fc046a28020021000b200841fc046a200020066a36020020084180056a20066a41cb036a41003a0000200841f0046a200841306a1009450d000240024020082d00304105470d002008280238220341016a410c490d01200841013a00f0040c020b200841063a00f0040c010b0240024020082802f4042205450d00200841fc046a280200220720036a200841f8046a2802004d0d010b200841043a00f0040c010b200841af096a210002402003450d00200520076a210720002105200321060340200520072d00003a0000200541016a2105200741016a21072006417f6a22060d000b200841fc046a28020021070b200841fc046a200720036a3602004100210720084180056a20036a41af046a41003a0000200841366a41002d0086423a0000200841346a41002f0084423b01002008410028008042360230200841306a41017221060340200620076a2105200741016a2203210720052d00000d000b200841306a200310044100210741002103024020082d008005450d0020084180056a4101722104410021050340200420056a2106200541016a2203210520062d00000d000b0b20084180056a20031004200841386a41002f0098423b01002008410029009042370230200841306a41017221060340200620076a2105200741016a2203210720052d00000d000b200841306a200310044100210741002103024020084189056a2d0000450d002008418a056a2104410021050340200420056a2106200541016a2203210520062d00000d000b0b200120031004200841346a41002d00a4423a0000200841002800a042360230200841306a41017221060340200620076a2105200741016a2203210720052d00000d000b200841306a2003100441002107410021030240200841cb086a2d0000450d00200841cc086a2104410021050340200420056a2106200541016a2203210520062d00000d000b0b200220031004200841386a41002d00b8423a0000200841002900b042370230200841306a41017221060340200620076a2105200741016a2203210720052d00000d000b200841306a20031004410021060240200841af096a2d0000450d00200841b0096a2103410021070340200320076a2105200741016a2206210720052d00000d000b0b200020061004200841306a410041b10410021a200841306a21070340200720012d000022053a0000200741016a2107200141016a210120050d000b200841f2036a21070340200720022d000022053a0000200741016a2107200241016a210220050d000b200841d6046a21070340200720002d000022053a0000200741016a2107200041016a210020050d000b200841f0046a41086a418010360200200841fc046a2201410336020041002105200841003a00f004200841dc013a00c00920084180063b00c1092008200841c0096a3602f404024020082d00302203450d00200841306a4101722106410021000340200620006a2107200041016a2205210020072d00000d000b0b4106210220014106360200200841da013a00c309200820053a00c50920082005410874418080fc07714110763a00c4090240024002400240200541ffff03712206450d0041052100200641066a4180104b0d01200820033a00c609024020064101460d00410120066b2105200841c0096a4107722100200841306a41017221070340200020072d00003a0000200041016a2100200741016a2107200541016a22050d000b0b200841fc046a2200200028020020066a22023602000b02400240200841f2036a2d00002201450d00200841f3036a2106410021000340200620006a2107200041016a2205210020072d00000d000c020b0b410021050b4103210020082802f4042207450d00200241016a200841f0046a41086a2802004b0d00200720026a41da013a0000200841fc046a22002000280200220741016a2206360200024020082802f4042202450d0041082100200741036a200841f0046a41086a2802004b0d01200220066a220020054118742005410874418080fc07717220054108764180fe03712005411876727222074118763a0001200020074110763a0000200841fc046a22002000280200220741026a22023602000240200541ffff03712206450d004105210020082802f4042203450d02200220066a200841f8046a2802004b0d02200320026a20013a0000024020064101460d00410120066b2105200320076a41036a2100200841f3036a21070340200020072d00003a0000200041016a2100200741016a2107200541016a22050d000b0b200841fc046a2200200028020020066a22023602000b02400240200841d6046a2d00002201450d00200841d7046a2106410021000340200620006a2107200041016a2205210020072d00000d000c020b0b410021050b4103210020082802f4042207450d01200241016a200841f0046a41086a2802004b0d01200720026a41da013a0000200841fc046a22002000280200220741016a220636020020082802f4042202450d0041082100200741036a200841f0046a41086a2802004b0d01200220066a220020054118742005410874418080fc07717220054108764180fe03712005411876727222074118763a0001200020074110763a0000200841fc046a22002000280200220741026a22023602000240200541ffff03712206450d004105210020082802f4042203450d02200220066a200841f8046a2802004b0d02200320026a20013a0000024020064101460d00410120066b2105200320076a41036a2100200841d7046a21070340200020072d00003a0000200041016a2100200741016a2107200541016a22050d000b0b200841fc046a2200200028020020066a22023602000b41002100200841002903e842370328200841002903e042370320200841206a41017221050340200520006a2107200041016a2206210020072d00000d000b20082d008005450d0220084180056a4101722101410021000340200120006a2107200041016a2205210020072d00000d000c040b0b410821000b200820003a00f00441002100200841106a41002d00d0423a0000200841002903c842370308200841002903c042370300200841017221050340200520006a2107200041016a2206210020072d00000d000b2008200610040c030b410021050b0240200841206a200620084180056a200520082802f40420021005450d0041002100200841146a41002d00a4433a0000200841106a41002802a04336020020084100290398433703082008410029039043370300200841017221050340200520006a2107200041016a2206210020072d00000d000b200820061004410021000c030b41002100200841146a41002d0084433a0000200841106a410028028043360200200841002903f842370308200841002903f042370300200841017221050340200520006a2107200041016a2206210020072d00000d000b2008200610040c010b41002100200841c4006a41002f01f4413b0100200841c0006a41002802f041360200200841002903e841370338200841002903e041370330200841306a41017221050340200520006a2107200041016a2206210020072d00000d000b200841306a200610040b410121000b4100200841c0196a36020420000bf20902047f017e0240024020002802042202450d00200028020c220341016a220420002802084d0d010b200041023a000041000f0b200220036a2d000021022000410c6a200436020002400240024002400240024002400240024002400240024002400240200241bb7e6a220241174b0d00024020020e18000101010101010203040501010101010101010101060107000b200141003a00000240200041046a2802002202450d002000410c6a2203280200220441026a2205200041086a2802004d0d080b200041073a000041000f0b200041063a000041000f0b200141013a00000240200041046a2802002202450d002000410c6a2203280200220441016a200041086a2802004d0d070b200041043a000041000f0b200141023a00000240200041046a2802002202450d002000410c6a2203280200220441026a200041086a2802004d0d070b200041043a000041000f0b200141033a00000240200041046a2802002202450d002000410c6a2203280200220441046a200041086a2802004d0d070b200041043a000041000f0b200141043a00000240200041046a2802002202450d002000410c6a2203280200220441086a200041086a2802004d0d070b200041043a000041000f0b200141053a00000240200041046a2802002202450d002000410c6a2203280200220441026a2205200041086a2802004d0d070b200041043a000041000f0b200141063a00000240200041046a2802002202450d002000410c6a2203280200220441026a2205200041086a2802004d0d070b200041043a000041000f0b200220046a22002d0000210220002d0001210020032005360200200141086a200220004108747222004118742000410874418080fc07717241107636020041010f0b200141086a200220046a2d00003a00002003200328020041016a36020041010f0b200141086a2200200220046a22022d00003a0000200141096a20022d00013a00002003200328020041026a360200200020002f010022014118742001410874418080fc0771724110763b010041010f0b200141086a2205200220046a22002d00003a0000200141096a20002d00013a00002001410a6a200041026a2d00003a00002001410b6a200041036a2d00003a00002003200328020041046a3602002005200528020022004118742000410874418080fc07717220004108764180fe03712000411876727236020041010f0b200141086a2205200220046a22002d00003a0000200141096a20002d00013a00002001410a6a200041026a2d00003a00002001410b6a200041036a2d00003a00002001410c6a200041046a2d00003a00002001410d6a200041056a2d00003a00002001410e6a200041066a2d00003a00002001410f6a200041076a2d00003a00002003200328020041086a360200200520052903002206423886200642288642808080808080c0ff0083842006421886428080808080e03f8320064208864280808080f01f838484200642088842808080f80f832006421888428080fc07838420064228884280fe0383200642388884848437030041010f0b200220046a22002d0000210220002d0001210020032005360200200141086a200220004108747222004118742000410874418080fc07717241107636020041010f0b200220046a22002d0000210220002d0001210020032005360200200141086a200220004108747222004118742000410874418080fc07717241107636020041010b0bf3010b0041040b04e06100000041e0c1000b166e6f646520636c757374657220726567206661696c00004180c2000b076e6f6465495000004190c2000b0a636c75737465724950000041a0c2000b0575756964000041b0c2000b096361706163697479000041c0c2000b117061636b20696e666f206661696c6564000041e0c2000b106e6f6465636c7573746572696e666f000041f0c2000b15736574207374722076616c7565206661696c656400004190c3000b15726567206e6f646520636c757374657220737563000041b0c3000b23696e76616c6964206d6574686f642066726f6d206e6f6465636c75737465726d6e6700"

============ABI===============

{ "types": [], "structs": [ { "name": "NodeClusterReg", "base": "", "fields": { "nodeIP": "string", "clusterIP": "string", "uuid": "string", "capacity": "string" } }, { "name": "NodeClusterInfo", "base": "", "fields": { "clusterIP": "string", "uuid": "string", "capacity": "string" } } ], "actions": [ { "action_name": "reg", "type": "NodeClusterReg" } ], "tables": [ { "table_name": "nodeclusterinfo", "index_type": "string", "key_names": [ "nodeIP" ], "key_types": [ "string" ], "type": "NodeClusterInfo" } ] }

BCLI获取合约TABLE信息

帮助信息

./bcli gettable --help
NAME:
bcli gettable - get table info

USAGE:
    bcli gettable [command options] [arguments...]

OPTIONS:
    --contract value  contract name (default: "usermng")
    --table value     table name
    --key value       Key value

参数说明

主命令行 参数列表 参数说明 必选参数
bcli gettable --contract 合约名
--table 要向链上查询的TABLE名 (参考ABI文件TABLE描述)
--key 要向链上查询的key关键字值(参考ABI文件TABLE描述)

返回信息

该命令成功后将返回BCLI发送的Transaction信息。

示例

(无,合约暂且在调试中)

3. BCLI 候选节点选举功能命令行

BCLI候选节点功能选举命令行主线实现候选节点之:注册节点为生产节点,解注册生产节点,列举所有(部分)生产节点信息,投票(投某节点成为生产节点),取消投票等。

总体帮助信息如下

./bcli delegate --help
NAME:
Bottos bcli tool delegate - for delegate operations

USAGE:
    Bottos bcli tool delegate command [command options] [arguments...]

COMMANDS:
    reg         reg delegate
    unreg       unreg delegate
    list        list delegates
    vote        Vote for producers
    cancelvote  cancel vote for producers

OPTIONS:
    --help, -h  show help

命令功能说明

主命令行 参数列表 参数说明
./bcli delegate reg 注册为生产者
./bcli delegate unreg 解注册生产者
./bcli delegate list 查看生产者列表
./bcli delegate vote 选举生产者
./bcli delegate cancelvote 取消选举
BCLI注册生产节点命令行

帮助信息

./bcli delegate reg --help
NAME:
Bottos bcli tool delegate reg - reg delegate

USAGE:
    Bottos bcli tool delegate reg [command options] [arguments...]

OPTIONS:
    --account value      account name
    --signkey value      public sign key (default: "0454f1c2223d553aa6ee53ea1ccea8b7bf78b8ca99f3ff622a3bb3e62dedc712089033d6091d77296547bc071022ca2838c9e86dec29667cf740e5c9e654b6127f")
    --location value     location
    --description value  description

参数说明

主命令行 参数列表 参数说明 必选参数
bcli delegate reg --account 用户名
--signkey 用户自定义公钥(缺省为内置缺省值)
--location 投票地理城市名
--description 用户自定义描述

返回信息

该命令成功后将返回BCLI发送的Transaction信息。

示例

./bcli delegate reg --account lyp --location "SHANGHAI" --description "Reg lyp as a producer"

输出结果

Transfer Succeed:
Trx:
{
    "version": 1,
    "cursor_num": 6115,
    "cursor_label": 789697330,
    "lifetime": 1536567085,
    "sender": "bottos",
    "contract": "bottos",
    "method": "regdelegate",
    "param": "dc0004da00036c7970da008230343534663163323232336435353361613665653533656131636365613862376266373862386361393966336666363232613362623365363264656463373132303839303333643630393164373732393635343762633037313032326361323833386339653836646563323936363763663734306535633965363534623631323766da00085348414e47484149da0015526567206c797020617320612070726f6475636572",
    "param_bin": "dc0004da00036c7970da008230343534663163323232336435353361613665653533656131636365613862376266373862386361393966336666363232613362623365363264656463373132303839303333643630393164373732393635343762633037313032326361323833386339653836646563323936363763663734306535633965363534623631323766da00085348414e47484149da0015526567206c797020617320612070726f6475636572",
    "sig_alg": 1,
    "signature": "eb0f741d4466c8d650c867dd3da988d2b81fc7c035018a461c01b9adab0767177239a041c9e6835e0952d2a95ab48900255a97ef8145a61115b286f1bbbfd3bb"
}
TrxHash: 816dc08c5cb3c4e059d04ac4842ceb583b34c58c865311c889d2d9d9acf9658b

注: 此命令执行前提:创世节点必须成功移交出块权利。 参考命令./bcli genesis blkprodtrans --sender lyp --actblknum 10

BCLI解注册生产节点命令行

帮助信息

./bcli  delegate unreg  --help

NAME:
Bottos bcli tool delegate unreg - unreg delegate

USAGE:
    Bottos bcli tool delegate unreg [command options] [arguments...]

OPTIONS:
    --account value  account

参数说明

主命令行 参数列表 参数说明 必选参数
bcli delegate unreg --account 用户名

返回信息

该命令成功后将返回BCLI发送的Transaction信息。

示例

./bcli delegate unreg --account lyp

输出结果 Transfer Succeed: Trx: { "version": 1, "cursor_num": 6237, "cursor_label": 2162498930, "lifetime": 1536567466, "sender": "bottos", "contract": "bottos", "method": "unregdelegate", "param": "dc0001da00036c7970", "param_bin": "dc0001da00036c7970", "sig_alg": 1, "signature": "48e3f949527851c13e9a82e5eb5bd605548ca4491ea05f3afed8405cab6985c037b6d59175d7880658da9bad33ab61e14da77b846305913d1b9326afd0b326dd" } TrxHash: 8eacc1d64d722565b0033ca7afbd090ab73ae56f6ab2bf10fe934a3d305ffd6f

BCLI列举当前生产节点列表

帮助信息

./bcli delegate list --help
NAME:
Bottos bcli tool delegate list - list delegates

USAGE:
    Bottos bcli tool delegate list [command options] [arguments...]

OPTIONS:
    --limit value  (default: 100)
    --start value  (default: 0)

参数说明

主命令行 参数列表 参数说明 必选参数
bcli delegate list --limit 输出前N条记录
--limit 从第几条开始输出和统计条数

返回信息

该命令成功后将返回BCLI发送的Transaction信息。

示例

./bcli delegate list

输出结果

[
    {
        "account_name": "adhil",
        "active": false,
        "desc": "",
        "last_confirmed_block_num": 6358,
        "last_slot": 1147647,
        "location": "",
        "report_key": "0454f1c2223d553aa6ee53ea1ccea8b7bf78b8ca99f3ff622a3bb3e62dedc712089033d6091d77296547bc071022ca2838c9e86dec29667cf740e5c9e654b6127f",
        "total_missed": 0
    },
    {
        "account_name": "albireo",
        "active": false,
        "desc": "",
        "last_confirmed_block_num": 6377,
        "last_slot": 1147667,
        "location": "",
        "report_key": "0454f1c2223d553aa6ee53ea1ccea8b7bf78b8ca99f3ff622a3bb3e62dedc712089033d6091d77296547bc071022ca2838c9e86dec29667cf740e5c9e654b6127f",
        "total_missed": 0
    },
    .....
    ....
    .... (略)
BCLI生产者投票命令行

帮助信息

./bcli delegate vote --help
NAME:
Bottos bcli tool delegate vote - Vote for producers

USAGE:
    Bottos bcli tool delegate vote [command options] [arguments...]

OPTIONS:
    --voter value     voter account
    --delegate value  delegate account

参数说明

主命令行 参数列表 参数说明 必选参数
bcli delegate vote --voter 投票者
--delegate 要投给哪个生产节点(必须投给已注册为生产节点的节点)

返回信息

该命令成功后将返回BCLI发送的Transaction信息。

示例

./bcli delegate vote --voter bottos --delegate lyp

输出结果

Transfer Succeed:
Trx: 
{
    "version": 1,
    "cursor_num": 6616,
    "cursor_label": 1568844234,
    "lifetime": 1536568645,
    "sender": "bottos",
    "contract": "bottos",
    "method": "votedelegate",
    "param": "dc0003cc01da0006626f74746f73da00036c7970",
    "param_bin": "dc0003cc01da0006626f74746f73da00036c7970",
    "sig_alg": 1,
    "signature": "86968717552104084b995c8ac46aca0f20fde5535daaf6f634af3cef9ecef804508577ee0c4c5c41f33e10feec45c22fccb5569e712fa62149f38d816d76ce35"
}
BCLI生产者取消投票命令行

帮助信息

./bcli delegate cancelvote --help
NAME:
Bottos bcli tool delegate cancelvote - cancel vote for producers

USAGE:
    Bottos bcli tool delegate cancelvote [command options] [arguments...]

OPTIONS:
    --voter value     voter account
    --delegate value  delegate account

参数说明

主命令行 参数列表 参数说明 必选参数
bcli delegate cancelvote --voter 投票者
--delegate 要取消投给哪个生产节点(必须填写注册为生产节点的节点)

返回信息

该命令成功后将返回BCLI发送的Transaction信息。

示例

./bcli delegate cancelvote --voter bottos --delegate lyp

输出结果

Transfer Succeed:
Trx:
{
    "version": 1,
    "cursor_num": 6690,
    "cursor_label": 482796464,
    "lifetime": 1536568876,
    "sender": "bottos",
    "contract": "bottos",
    "method": "votedelegate",
    "param": "dc0003cc00da0006626f74746f73da00036c7970",
    "param_bin": "dc0003cc00da0006626f74746f73da00036c7970",
    "sig_alg": 1,
    "signature": "946291c599105d2906d004b73fbec002e4ae2d8e113a4d71bbc17fa7129affb324ee6b6e1a101f9da217eee14ff1bac697f55bb29e634cdd4eda20b33801d116"
}
TrxHash: f90e5cb5c6e5990c6bceb6e0fd7ec5a2f629760dd809b7fbd9c2832f916319ee

4. BCLI 块信息获取命令行

BCLI块信息获取主要包括: 获取当前块信息,块头信息。

BCLI块头信息获取命令行

帮助信息

./bcli getinfo --help
NAME:
    bcli getinfo - get chian info

USAGE:
    bcli getinfo [arguments...]

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli getinfo (无) (无) (无)
(无) (无) (无)

返回信息

该命令成功后将返回实时最新块头信息。

示例

./bcli getinfo

输出结果

==Chain Info==

{
    "head_block_num": 7047,
    "head_block_hash": "34460313889fc988137e42394009df8880e5e82118fcae4579fc0e33d913309e",
    "head_block_time": 1536569883,
    "head_block_delegate": "sulafat",
    "cursor_label": 3641913502,
    "last_consensus_block_num": 7026,
    "chain_id": "5c7c2ea85df042747b38b183c84c8313b499177ed4abbf29d0947f4908934941"
}
BCLI最新块信息获取命令行

帮助信息

./bcli getblock --help
NAME:
    bcli getblock - get block info

USAGE:
    bcli getblock [command options] [arguments...]

OPTIONS:
    --num value   get block by number (default: 100)
    --hash value  get block by hash

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli getblock (无) (无) (无)
(无) (无) (无)

返回信息

该命令成功后将返回实时最新块信息。

示例

./bcli getblock

输出结果

==Block Info==

{
    "prev_block_hash": "6de5f9fb40511d307a55f5838e936a4d8c211177a0750287010bc7e67935954f",
    "block_num": 100,
    "block_hash": "e97df19ae9b73ba46b5f5681b159f87a56a4aa8426dc0407f6ea4ed12fb1857d",
    "cursor_block_label": 800163197,
    "block_time": 1536548940,
    "trx_merkle_root": "0000000000000000000000000000000000000000000000000000000000000000",
    "delegate": "vega",
    "delegate_sign": "fa3504d657168fb9b16ae9ee3d281ead80adb43fbb3859213198f856732b12c33459b2ff820af6fdf15c9dce7dde9a29fe0446a09568b1a34a3909cd64a73815",
    "trxs": null
}

5. BCLI 创世节点功能命令行

BCLI创世节点功能命令行主要包括: 添加初始生产者, 移交出块权利,撤销创世节点特权操作权限。

总体帮助信息如下

./bcli genesis --help

NAME:
Bottos bcli tool genesis - for genesis node operations

USAGE:
    Bottos bcli tool genesis command [command options] [arguments...]

COMMANDS:
    setdelegate      set delegate
    blkprodtrans     for genesis node transfering the permission of producing blocks
    cancelprevilige  cancel genesis node permission

OPTIONS:
    --help, -h  show help

命令功能说明

主命令行 参数列表 参数说明
./bcli genesis setdelegate 创世节点上指定初始生产者
./bcli genesis blkprodtrans 创世节点移交出块权利
./bcli genesis cancelprevilige 创世节点取消操作权限
BCLI创世节点添加初始生产者功能命令行

帮助信息

./bcli genesis setdelegate --help
NAME:
Bottos bcli tool genesis setdelegate - set delegate

USAGE:
    Bottos bcli tool genesis setdelegate [command options] [arguments...]

OPTIONS:
    --sender value       sender account
    --account value      account name
    --signkey value      public sign key (default: "0454f1c2223d553aa6ee53ea1ccea8b7bf78b8ca99f3ff622a3bb3e62dedc712089033d6091d77296547bc071022ca2838c9e86dec29667cf740e5c9e654b6127f")
    --location value     location
    --description value  description

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli genesis setdelegate --sender 发起签名者(必须为已注册用户名,缺省为内置bottos用户)
--account 要被添加的初始生产者用户名
--signkey 用户的公钥
--location 用户指定的城市名
--description 用户指定的描述

返回信息

该命令成功后将返回BCLI提交的Transaction信息。

示例

./bcli genesis setdelegate --sender bottos --account lyp

输出结果

Transfer Succeed:
Trx: 
{
    "version": 1,
    "cursor_num": 7356,
    "cursor_label": 2458267119,
    "lifetime": 1536570943,
    "sender": "bottos",
    "contract": "bottos",
    "method": "setdelegate",
    "param": "",
    "param_bin": "",
    "sig_alg": 1,
    "signature": "fe901957f6b55a41aef893ec6c285bd8f3c6624a1a0950d96cea4dab5896fe3d4476f602b910cdd7d51e9f74ee69af9c17b126ca37a85c040d6aee0827e33e3d"
}
TrxHash: ec4654e3edb61c661ed63cf6b02d44cd255ca7a604c463074fb1307f70025181
BCLI创世节点移交出块权利功能命令行

帮助信息

./bcli genesis blkprodtrans --help
NAME:
Bottos bcli tool genesis blkprodtrans - for genesis node transfering the permission of producing blocks

USAGE:
    Bottos bcli tool genesis blkprodtrans [command options] [arguments...]

OPTIONS:
    --sender value     sender account
    --actblknum value  the threshold number of active block for which genesis node transfering the permission of producing blocks after exceeding it (default: 0)

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli genesis blkprodtrans --sender 发起签名者(必须为已注册用户名,缺省为内置bottos用户)

返回信息

该命令成功后将返回BCLI提交的Transaction信息。

示例

 ./bcli genesis blkprodtrans --sender lyp

输出结果

Transfer Succeed:
Trx: 
{
    "version": 1,
    "cursor_num": 7431,
    "cursor_label": 974139076,
    "lifetime": 1536571174,
    "sender": "lyp",
    "contract": "bottos",
    "method": "blkprodtrans",
    "param": "",
    "param_bin": "",
    "sig_alg": 1,
    "signature": "393abd00bc0c7bb2da1bec6fb03d755e553e17cddfd7b4e40daecdf372d188854517d099a5d166057e6e85e7b4edae98d5e75d48ec09f891d1f6eca3c94b979f"
}
TrxHash: 2e25dd5f8bc7c598a3c6b81f245b6413143973ab9c9bc46f695a9ef6b33b4507
BCLI撤销创世节点特权操作权限功能命令行

帮助信息

./bcli genesis cancelprevilige --help
NAME:
Bottos bcli tool genesis cancelprevilige - cancel genesis node permission

USAGE:
    Bottos bcli tool genesis cancelprevilige [command options] [arguments...]

OPTIONS:
    --sender value  sender account

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli genesis cancelprevilige --sender 发起签名者(必须为已注册用户名,缺省为内置bottos用户)

返回信息

该命令成功后将返回BCLI提交的Transaction信息。

示例

 ./bcli genesis cancelprevilige --sender lyp

输出结果

Transfer Succeed:
Trx: 
{
    "version": 1,
    "cursor_num": 7479,
    "cursor_label": 4050849039,
    "lifetime": 1536571324,
    "sender": "lyp",
    "contract": "bottos",
    "method": "cancelprevilige",
    "param": "",
    "param_bin": "",
    "sig_alg": 1,
    "signature": "bb88393a4d1b526c079f2c3d0d38bbbc90f46084fb0c3e21cde9a5eaed5e0ce140a7a5dd30192ae63df489b46fa54d0ad4ff077c5f7286e559221e64c5d1ee9f"
}
TrxHash: 794fb7f03c8d9ae0545660d66394f45e5cc261966fc66342dab72a70a6bbd2ea

6. BCLI 转账功能命令行

BCLI转账功能负责由FROM用户向TO用户进行BTO转账。

BCLI转账命令行

帮助信息

./bcli transfer --help
NAME:
bcli transfer - for user transfering bto

USAGE:
    bcli transfer [command options] [arguments...]

OPTIONS:
    --from value    the from user account (default: "bottos")
    --to value      the [to] user account (default: "bottos")
    --amount value  the amount of bto (default: "0")

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli transfer --from 转账者
--to 转账目的人
--amount 转账BTO个数
--sign 用户自定义公钥(缺省为内置缺省值)

返回信息

该命令成功后将返回BCLI提交的Transaction信息。

示例

./bcli transfer --from bottos --to lyp --amount 2

输出结果

Transfer Succeed
    From: bottos
    To: lyp
    Amount: 200000000
Trx: 
{
    "version": 1,
    "cursor_num": 7762,
    "cursor_label": 117036287,
    "lifetime": 1536572206,
    "sender": "bottos",
    "contract": "bottos",
    "method": "transfer",
    "param": {
        "from": "bottos",
        "to": "lyp",
        "value": 2
    },
    "param_bin": "dc0003da0006626f74746f73da00036c7970c50020000000000000000000000000000000000000000000000000000000000bebc200",
    "sig_alg": 1,
    "signature": "3aa45652b368827fd5480721de1588ed08c2289de2cfa97ce352d65c8f1acc6e4f04b2c8492caacedb61097dea2728019d4c40c932d763ed7e26d051ca27a188"
}
TrxHash: 86cbc8bd54d85fc817f3675103e62c5693fe7ef1520f2218f57c6406be05b46b

7. BCLI Transaction 提交和查询命令行

BCLI Transaction 提交和查询命令行负责提交一个用户自定义的Transaction到链上,或根据TrxHash值查询一个已存在的合约信息。

总体帮助信息如下

./bcli transaction --help

NAME:
Bottos bcli tool transaction - get or push transactions

USAGE:
Bottos bcli tool transaction command [command options] [arguments...]

COMMANDS:
    get   get tx details
    push  push transaction

OPTIONS:
--help, -h  show help

命令功能说明

主命令行 参数列表 参数说明
./bcli transaction get 获取指定TRXHASH对应的transaction信息
./bcli transaction push 提交一个Transaction
BCLI Transaction查询命令行

帮助信息

./bcli transaction get --help

NAME:
    Bottos bcli tool transaction get - get tx details

USAGE:
    Bottos bcli tool transaction get [command options] [arguments...]

OPTIONS:
    --trxhash value 

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli transaction get --trxhash Transaction hash索引值

返回信息

该命令成功后将返回指定Trxhash对应的Transaction信息。

示例

./bcli transaction get --trxhash 86cbc8bd54d85fc817f3675103e62c5693fe7ef1520f2218f57c6406be05b46b

输出结果

{
    "contract": "bottos",
    "cursor_label": 117036287,
    "cursor_num": 7762,
    "lifetime": 1536572206,
    "method": "transfer",
    "param": null,
    "sender": "bottos",
    "sig_alg": 1,
    "signature": "3aa45652b368827fd5480721de1588ed08c2289de2cfa97ce352d65c8f1acc6e4f04b2c8492caacedb61097dea2728019d4c40c932d763ed7e26d051ca27a188",
    "version": 1
}
BCLI Transaction提交命令行

帮助信息

./bcli transaction push --help
NAME:
    Bottos bcli tool transaction push - push transaction

USAGE:
    Bottos bcli tool transaction push [command options] [arguments...]

OPTIONS:
    --sender value    acocunt name
    --contract value  contract name
    --method value    method name
    --param value     param value
    --sign value      sign value

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli transaction push --sender 签名发起者(缺省为内置bottos用户)
./bcli transaction push --contract 合约名
./bcli transaction push --method 合约方法名
./bcli transaction push --param 参数键值对
./bcli transaction push --sign 用户自定义公钥(缺省为内置缺省值)

返回信息

该命令成功后将返回指定Trxhash对应的Transaction信息。

示例

(略)

8. BCLI钱包命令行

钱包功能主要为用户提交Transaction提供钱包创建,绑定用户,解锁钱包,锁定钱包,查询钱包等功能。

帮助信息

./bcli wallet --help

NAME:
Bottos bcli tool wallet - For wallet operations

USAGE:
Bottos bcli tool wallet command [command options] [arguments...]

COMMANDS:
    generatekey  generate key pairs
    create       create wallet
    lock         lock wallet
    unlock       unlock wallet
    list         list wallet
    listkey      listkey of wallet

OPTIONS:
--help, -h  show help

命令功能说明

主命令行 参数列表 参数说明
./bcli wallet generatekey 创建一对新公私钥对
./bcli wallet create 创建钱包
./bcli wallet lock 锁定钱包
./bcli wallet unlock 解锁钱包
./bcli wallet list 列出所有钱包
./bcli wallet listkey 列出钱包对应公私钥对(必须钱包解锁后使用)
BCLI 创建钱包公私钥命令行

帮助信息 ./bcli wallet generatekey --help

NAME:
    Bottos bcli tool wallet generatekey - generate key pairs

USAGE:
    Bottos bcli tool wallet generatekey [arguments...]

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli wallet generatekey (无) (无) (无)

返回信息

该命令成功后将返回一对新生成的公私钥对。

示例

 ./bcli wallet generatekey

输出结果 { "private_key": "b8b890ebc315a8e1c3a6f7b78977d68ca1e9274c986314ccbe967b964cf68b66", "public_key": "0485fccecf8c8e6260d8558e1a61adca3a888127e34ba0d052dfeb1c31d419bf0494482e7e8a447d63394cff713fc00aa8e64c24b73a8173661a91884b71407bce" }

BCLI 创建钱包命令行

帮助信息

./bcli wallet create --help

NAME:
Bottos bcli tool wallet create - create wallet

USAGE:
Bottos bcli tool wallet create [command options] [arguments...]

OPTIONS:
--account value  account name

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli wallet create --account 钱包绑定的用户名

返回信息

该命令成功后将返回用户的钱包文件keystore信息,路径位于/home/bottos/bot下, 文件格式为 用户.keystore 文件。

示例

 ./bcli wallet create --account lyp

输出结果

Please input your password for your wallet:

Please input your private key for your wallet:

{ "wallet_name": "lyp.keystore" }

注: 本例中需要用户手工输入钱包密码和使用的私钥。

BCLI 锁定钱包命令行

帮助信息

./bcli wallet lock --help

NAME:
Bottos bcli tool wallet lock - lock wallet

USAGE:
Bottos bcli tool wallet lock [command options] [arguments...]

OPTIONS:
--account value  account name

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli wallet lock --account 钱包绑定的用户名

返回信息

该命令成功后将返回钱包锁定状态标志。

示例

./bcli wallet lock --account lyp

输出结果

./bcli wallet lock --account lyp { "lock": true }

BCLI 解锁钱包命令行

帮助信息

./bcli wallet unlock --help

NAME:
Bottos bcli tool wallet unlock - unlock wallet

USAGE:
Bottos bcli tool wallet unlock [command options] [arguments...]

OPTIONS:
--account value  account name

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli wallet unlock --account 钱包绑定的用户名

返回信息

该命令成功后将返回钱包锁定状态标志。

示例

 ./bcli wallet unlock --account lyp

输出结果

Please input your password for your wallet: 

{
    "unlock": true
}

注: 本例要求用户输入当时创建钱包时的密码。

BCLI 查看所有钱包命令行

帮助信息

./bcli wallet list --help

NAME:
Bottos bcli tool wallet list - list wallet

USAGE:
Bottos bcli tool wallet list [arguments...]

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli wallet list (无) (无) (无)

返回信息

该命令成功后将返回钱包锁定状态标志。

示例

 ./bcli wallet list

输出结果

[
    {
        "account_name": "lyp",
        "public_key": "0454f1c2223d553aa6ee53ea1ccea8b7bf78b8ca99f3ff622a3bb3e62dedc712089033d6091d77296547bc071022ca2838c9e86dec29667cf740e5c9e654b6127f",
        "wallet_path": "/home/bottos/bot/lyp.keystore"
    }
]
BCLI 查看所有钱包公私钥命令行

注: 本命令必须在钱包unlock状态前提下执行。

帮助信息

./bcli wallet listkey --help

NAME:
Bottos bcli tool wallet listkey - listkey of wallet

USAGE:
    Bottos bcli tool wallet listkey [command options] [arguments...]

OPTIONS:
    --account value  account name

参数说明

主命令行 参数列表 参数说明 必选参数
./bcli wallet listkey --account 钱包绑定的用户 (无)

返回信息

该命令成功后将返回钱包account对应公私钥对。

示例

./bcli wallet listkey --account lyp

输出结果

{ "account_name": "lyp", "private_key": "b799ef616830cd7b8599ae7958fbee56d4c8168ffd5421a16025a398b8a4be45", "public_key": "0454f1c2223d553aa6ee53ea1ccea8b7bf78b8ca99f3ff622a3bb3e62dedc712089033d6091d77296547bc071022ca2838c9e86dec29667cf740e5c9e654b6127f" }

results matching ""

    No results matching ""