EOS 權限

EOS權限ide

一、查看權限 ui

cleos get account $(Account_Name)

  

二、使用 cleos set account permission 命令來修改權限this

  

  能夠看到,owner、active 這種東西叫作 permission,這其中具體的內容叫作 authority。以下例:spa

$ 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

 三、權限規則實際以下:.net

{
  "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字段code

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

 

參考:blog

一、http://www.javashuo.com/article/p-mneqetax-bq.htmlget

相關文章
相關標籤/搜索