您正在查看: EOS-新手问答 分类下的文章

Error 3010004: Invalid authority

当设置一个账户的权限为多个账户时

cleos set account permission bcskillsurou active  '{"threshold":1,"keys":[{"key":"EOS5bu13CujrEUdKB57LnvihUAqkdUycwSz2p7vPuac7vNBvfh7M7","weight":1}],"accounts":[{"permission":{"actor":"222222222222","permission":"eosio.code"},"weight":1},{"permission":{"actor":"111111111111","permission":"eosio.code"},"weight":1}],"waits":[{"wat_sec":1,"weight":1}]}'  owner -p bcskillsurou

报错如下

Error 3010004: Invalid authority
Ensure that your authority JSON is valid follows the following format!
{
  "threshold":      <INTEGER [1-2^32): the threshold that must be met to satisfy this authority>,
  "keys": [         <keys must be alpha-numerically sorted by their string representations and unique>
    ...
    {
      "key":        <STRING: EOS.IO compatible Public Key>,
      "weight":     <INTEGER [1-2^16): a signature from this key contributes this to satisfying the threshold>
    }
    ...
  ],
  "accounts": [     <accounts must be alpha-numerically sorted by their permission (actor, then permission) and unique>
    ...
    {
      "permission": {
        "actor":      <STRING: account name of the delegated signer>,
        "permission": <STRING: permission level on the account that must be satisfied>,
      },
      "weight":     <INTEGER [1-2^16): satisfying the delegation contributes this to satisfying the threshold>
    }
    ...
  ],
  "waits": [        <waits must be sorted by wait_sec, largest first, and be unique>
    ...
    {
      "wait_sec":   <INTEGER [1-2^32): seconds of delay which qualifies as passing this wait>
      "weight":     <INTEGER [1-2^16): satisfying the delay contributes this to satisfying the threshold>
    }
    ...
  ]
}

Error Details:
Authority failed validation! ensure that keys, accounts, and waits are sorted and that the threshold is valid and satisfiable!

解决问题

将添加的accounts按照ascii顺序添加
例如上面的例子,先添加 111111111111 再添加 222222222222

cleos set account permission bcskillsurou active  '{"threshold":1,"keys":[{"key":"EOS5bu13CujrEUdKB57LnvihUAqkdUycwSz2p7vPuac7vNBvfh7M7","weight":1}],"accounts":[{"permission":{"actor":"111111111111","permission":"eosio.code"},"weight":1},{"permission":{"actor":"222222222222","permission":"eosio.code"},"weight":1}],"waits":[{"wat_sec":1,"weight":1}]}'  owner -p bcskillsurou

参考

https://github.com/EOSIO/eos/issues/4433

EOS 编译 llvmWARshim error

编译EOS2.x版本时,由于使用WSL,或者Windows git 操作过,很容易把软连接丢了,所以报错如下

/eos/libraries/chain/webassembly/eos-vm-oc/llvmWARshim.llvmwar:1:1: error: ‘llvmWARshim’ does not name a type
 llvmWARshim.cpp
 ^~~~~~~~~~~
libraries/chain/CMa

手动修复软连接

cd /eos/libraries/chain/webassembly/eos-vm-oc
rm llvmWARshim.llvmwar
ln -s llvmWARshim.cpp llvmWARshim.llvmwar

修复后ll查看如下

llvmWARshim.llvmwar -> llvmWARshim.cpp*

ubuntu 编译 EOS 缺少libtinfo.so.5解决办法

sudo apt-get install libncurses5

EOS 内联操作后,立即查询数据未更新

问题

老同事今天问我,A合约inline调用B合约的action(B合约的action中的逻辑会修改B合约的某个Table),A合约中执行完inline后,立刻查B合约中的Table数据,数据未更新,怎么处理。

解决方案

A合约inline调用B合约的action后,B再内联调用A合约的另一个新加的action(在这个action中再查B合约的Table数据)

先暂时记录下,等下再跟下链代码,详细分析下为什么合约是同步执行的,然而inline action 出现了“异步的效果”

cleos get table name,无法精准定位

当get table索引是name 时,无法精准查询
因为cleos 传入的参数默认是字符串,需要对应的转换参数
--key-type name

例如

cleos -u https://api.eosnewyork.io:443 get table eosio eosio voters --key-type name -L 111111111122 -l 1

参考

https://github.com/EOSIO/eos/issues/5019