# Vapor命令行工具

# vaporcli

vaporcli是用户与vapord进程在命令行下建立通信的RPC客户端,用户能够使用使用vaporcli对vapor侧链发起管理请求。 vaporli的使用分为两种:一种是后面接flags参数,vaporcli [flags],如,vaporcli -h 查看使用帮助;另一种是后面接子命令,vaporcli [command],具体的命令如下:

Commands Description
build-transaction Build one transaction template
check-access-token Check an access token
check-key-password check key password
create-access-token Create a new access token
create-account Create an account
create-account-receiver Create an account receiver
create-asset Create an asset
create-key Create a key
create-transaction-feed Create a transaction feed filter
decode-program decode program to instruction and data
decode-raw-transaction decode the raw transaction
delete-access-token Delete an access token
delete-account Delete the existing account
delete-key Delete a key
delete-transaction-feed Delete a transaction feed filter
estimate-transaction-gas estimate gas for build transaction
gas-rate Print the current gas rate
get-asset get asset by assetID
get-block Get a whole block matching the given hash or height
get-block-count Get the number of most recent block
get-block-hash Get the hash of most recent block
get-block-header Get the header of a block matching the given hash or height
get-difficulty Get the difficulty of most recent block
get-hash-rate Get the nonce of most recent block
get-transaction get the transaction by matching the given transaction hash
get-transaction-feed get a transaction feed by alias
get-unconfirmed-transaction get unconfirmed transaction by matching the given transaction hash
help Help about any command
is-mining If client is actively mining new blocks
list-access-tokens List the existing access tokens
list-accounts List the existing accounts
list-addresses List the account addresses
list-assets List the existing assets
list-balances List the accounts balances
list-keys List the existing keys
list-pubkeys list the account pubkeys
list-transaction-feeds list all of transaction feeds
list-transactions List the transactions
list-unconfirmed-transactions list unconfirmed transactions hashes
list-unspent-outputs List the accounts unspent outputs
net-info Print the summary of network
rescan-wallet Trigger to rescan block information into related wallet
reset-key-password Reset key password
set-mining start or stop mining
sign-message sign message to generate signature
sign-transaction Sign transaction templates with account password
submit-transaction Submit signed transaction
update-account-alias update account alias
update-asset-alias Update the asset alias
update-key-alias Update key alias
update-transaction-feed Update transaction feed
validate-address validate the account addresses
verify-message verify signature for specified message
version Print the version number of vaporcli
wallet-info Print the information of wallet

每个Command具有自己的flag参数,如创建access token

vaporcli create-access-token <tokenID> [flags]
1

使用示例

vaporcli create-access-token token1
1

每个Command均可使用-h参数来查看使用帮助

vaporcli create-access-token -h
1

返回结果如下

Create a new access token

Usage:
  vaporcli create-access-token <tokenID> [flags]

Flags:
  -h, --help   help for create-access-token
1
2
3
4
5
6
7

# Vapor Dashboard

vapor dashboard与vaporcli功能类似,都是发送请求与vapord进程建立通信,dashboard使用了Web方式提供了相比vaporcli更友好的使用体验。

在执行vapord node运行vapor节点后dashboard会默认开启,无需收到部署与开启。你可以也可通过传入--web.closed参数关闭该功能。

首先需要创建access token.

可以通过vaporcli命令行工具或API接口

vaporcli create-access-token
1
curl -X POST http://127.0.0.1:9889/create-access-token -d '{"id":"token1"}'
1

打开dashboard网址

$ open http://127.0.0.1:9889/
1

26.png

在文本框输入access token(以tokenname:xyz...的形式)登录dashboaed

27.png

在初始化页面可以选择创建新的钱包,输入账户别名与钱包后即可创建新的钱包

28.png

如果之前有备份的Keystore文件可选择从keystore文件恢复选项,恢复之前备份的钱包

29.png

新建或恢复钱包后可进入主界面进行账户、交易、钱包、挖矿操作

30.png

SDK

多语言sdk接入

见SDK使用

Last Updated: 3/30/2020, 11:49:24 AM