【EOS权限】
1、查看权限
cleos get account $(Account_Name)
2、使用 cleos set account permission 命令来修改权限
可以看到,owner、active 这种东西叫做 permission,这其中具体的内容叫做 authority。如下例:
$ cleos set account permission test active
'{
"threshold" : ,
"keys" : [
{
"permission":{
"key":"EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB",
"permission":"active"
},
"weight":
}
],
"accounts" : [
{
"permission":{
"actor":"acc2",
"permission":"active"
},
"weight":
}
]
}' owner
3、权限规则实际如下:
{
"threshold" : , /*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 : /*Set the weight of a signature from this permission*/
}
/*Set Permission with Account*/
{
"permission" : {
"actor" : "sandwich",
"permission" : "active"
},
weight : /*Set the weight of a signature from this permission*/
}
参考: