首页 > 其他 > 详细

EOS 权限

时间:2018-11-22 01:35:25      阅读:189      评论:0      收藏:0      [点我收藏+]

EOS权限

1、查看权限 

cleos get account $(Account_Name)

  技术分享图片

2、使用 cleos set account permission 命令来修改权限

  技术分享图片

  可以看到,owner、active 这种东西叫做 permission,这其中具体的内容叫做 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
View Code

 3、权限规则实际如下:

{
  "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*/
}

  keys、accounts下结构相同,都拥有permission、weight字段

/*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*/
}

 

参考:

1、https://my.oschina.net/u/3837977/blog/1915826

EOS 权限

原文:https://www.cnblogs.com/tekkaman/p/9998411.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!