Tekkaman

导航

 

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

posted on 2018-11-21 22:45  Tekkaman  阅读(493)  评论(0编辑  收藏  举报