eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

transaction create unsatisfied_authorization

Open fantasthu opened this issue 8 years ago • 1 comments

** eos config **

const Eos = require('eosjs')

// Optional configuration..
config = {
  keyProvider: ['5JhHEAzxGN5UVt8TbCWDD4r2cF1q9RCFMboEYDLrVyJj3FidjHQ'], // 配置私钥字符串
  // httpEndpoint: 'http://192.168.1.52:8896', //DEV开发链url与端口
  httpEndpoint: 'http://jungle.cryptolions.io:18888', //DEV开发链url与端口
  chainId: "038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca", // 通过cleos get info可以获取chainId
  // mockTransactions: () => null, // 如果要广播,需要设为null
  // transactionHeaders: (expireInSeconds, callback) => {
  //   callback(null /*error*/ , headers) //手动设置交易记录头,该方法中的callback回调函数每次交易都会被调用
  // },
  expireInSeconds: 60,
  broadcast: true,
  debug: false,
  sign: true,
  authorization: 'huwenzhi1234@permission' // 该参数用于在多签名情况下,识别签名帐号与权限,格式如:account@permission
}

module.exports = Eos(config)

** call transition **

eos.transaction({
      // ...headers,
      actions: [{
          account: 'eosio.token', //合约
          name: 'create', //方法
          authorization: [{
            actor: 'eosio.token',
            permission: 'active'
          }],
          data: {
            issuer: 'huwenzhi1234',
            maximum_supply: '10000.0000 GAT',
            can_freeze: 0,
            can_recall: 0,
            can_whitelist: 0
          }
        },
        {
          account: 'eosio.token', //合约
          name: 'issue', //方法
          authorization: [{
            actor: 'huwenzhi1234',
            permission: 'active'
          }],
          data: {
            to: 'huwenzhi1111',
            quantity: '1000.0000 GAT',
            memo: "huwenzhi1234 issue 1000 GAT to huwenzhi1111"
          }
        }
      ]
    }

** error message ** {"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"Provided keys, permissions, and delays do not satisfy declared authorizations","details":[{"message":"transaction declares authority '{"actor":"eosio.token","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [], provided keys ["EOS6UPrDfYLz26RdjbhyK5cJdmTdHjWseNTeTdZAJFt3P3DRCar32"], and a delay max limit of 3888000000 ms","file":"authorization_manager.cpp","line_number":517,"method":"check_authorization"}]}}

fantasthu avatar Oct 26 '18 11:10 fantasthu

解决了么?

bytehi avatar Nov 08 '18 03:11 bytehi