aptos move run 命令使用感受

xiang
发布于 阅读 550

aptos move run 命令你用了吗?

可以用它在命令行发送交易。基本使用方法:

aptos move run \
--function-id '0x9fecf7c6ad1fc0e5337c6d64443cda47b41f61b556a698193646ce0b8917cbe1::red_packet::create' \
--args 'u64:2' 'u64:10000'

未指定 private-keyurl 时候,会使用当前目录下 .aptos/config.yml 下的配置。

aptos init # 在目录下初始化 .aptos/config.yml 配置文件

你也可以在命令后面跟上参数 --private-key <PRIVATE_KEY> 指定私钥,--url <URL> 指定网络 rpc url

args 目前支持的类型有 [u8, u64, u128, bool, hex, string, address]。也支持使用 --type-args <TYPE_ARGS>... 传入 type-args

测试合约时直接用命令行发交易,省去了写脚本的时间。

标签: Aptos #Aptos
1条评论
greyireland
greyireland
点赞,希望能有更多干货
点赞
评论