博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
eos cleos set account permission 创建或修改权限
阅读量:6868 次
发布时间:2019-06-26

本文共 2055 字,大约阅读时间需要 6 分钟。

hot3.png

创建或修改权限

命令格式:$ cleos set account permission ${permission} ${account} ${permission_json} ${account_authority}

要修改帐户的权限,你必须拥有该帐户的权限和你正在修改的权限。设置帐户权限命令可能会更改,因此它关联的类没有完整记录。

$ cleos set account permission test active '{"threshold" : 1, "keys" : [{"permission":{"key":"EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB","permission":"active"},"weight":1}], "accounts" : [{"permission":{"actor":"acc2","permission":"active"},"weight":50}]}' owner

第二个示例修改相同的帐户权限,但删除上一个示例中的密钥集,并将@test帐户的活动权限授予另一个帐户。

$ cleos set account permission test active '{"threshold" : 1, "keys" : [], "accounts" : [{"permission":{"actor":"sandwich","permission":"active"},"weight":1},{"permission":{"actor":"acc1","permission":"active"},"weight":50}]}' owner

第三个示例演示如何设置multisig的权限

$ cleos set account permission test active '{"threshold" : 100, "keys" : [{"permission":{"key":"EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB","permission":"active"},"weight":25}], "accounts" : [{"permission":{"actor":"@sandwich","permission":"active"},"weight":75}]}' owner

此命令中使用的JSON对象实际上由两种不同类型的对象组成 权限JSON对象...

{  "threshold"       : 100,    /*An integer that defines cumulative signature weight required for authorization*/  "keys"            : [],     /*An array made up of individual permissions defined with an EOS PUBLIC KEY*/  "accounts"        : []      /*An array made up of individual permissions defined with an EOS ACCOUNT*/}

...其中包括一个或多个权限对象

/*Set Permission with Key*/{  "permission" : {    "key"           : "EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB",    "permission"    : "active"  },  weight            : 25      /*Set the weight of a signature from this permission*/}/*Set Permission with Account*/{  "permission" : {    "actor"       : "sandwich",    "permission"  : "active"  },  weight            : 75      /*Set the weight of a signature from this permission*/}

分享个《EOS智能合约与DApp开发入门教程》,欢迎大家来学习互动:

本教程帮助你快速入门EOS区块链去中心化应用的开发,内容涵盖EOS工具链、账户与钱包、发行代币、智能合约开发与部署、使用代码与智能合约交互等核心知识点,最后综合运用React和EOS的各知识点完成一个便签DApp的开发。

转载于:https://my.oschina.net/u/3837977/blog/1915826

你可能感兴趣的文章
别伤了虚拟桌面管理员的"心"
查看>>
Windows系统使用IntelliJ IDEA 搭建Hadoop的开发调试环境(一)
查看>>
yum安装lamp
查看>>
Web.Config文件中数据库连接配置
查看>>
[Unity 3D] Unity 3D 性能优化 (一)
查看>>
spring Quartz定时任务调度 时间设置
查看>>
SymmetricDS: 数据库数据同步Database synchronization
查看>>
Disabling OOM killer on Ubuntu 14.04
查看>>
VBS备份脚本
查看>>
CentOS 6.5 自动安装镜像
查看>>
Storm与Spark Streaming比较
查看>>
我的友情链接
查看>>
Exchange Server 运维管理01:Exchange中Active Directory 有什么用?
查看>>
dhcp服务在企业中的应用
查看>>
linux系统管理之四:服务状态
查看>>
VMware View FAQ[一]
查看>>
【原创翻译】布尔值(boolean)
查看>>
三元运算式、lambda表达式、内置函数map、reduce、filter以及yield生成器
查看>>
MySQL分库分表分表后数据的查询(5th)
查看>>
iOS-点击图片放大,再次点击返回原视图 类似查看相册的功能
查看>>