check_authorization Error
eos : dawn-v4.0.0 eosjs : 10.0.0
In cleos, the account is created well, but in eosjs, the following problem occurs when creating account.
http://localhost:3330/v1/chain/push_transaction {"compression":"none","transaction":{"expiration":"2018-05-14T00:41:47","region":0,"ref_block_num":8406,"ref_block_prefix":3983766411,"max_net_usage_words":0,"max_kcpu_usage":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"newaccount","authorization":[{"actor":"eosio","permission":"active"}],"data":"0000000000ea3055000000012103b89a01000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf01000001000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf0100000100000000010000000000ea305500000000a8ed32320100"}]},"signatures":["SIG_K1_Kb8rBwQepJth2tQ4r86o1ZB1UWMbnKCdhXSjuGFiWHAD9YujH6betfQtLaWeqXhQ1WpFL7n7aH7kU2ntg29HDTXb392hjz"]}
api error => { message: 'transaction declares authority '{"actor":"eosio","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms',
file: 'authorization_manager.cpp',
line_number: 405,
method: 'check_authorization' } http://localhost:3330/v1/chain/push_transaction {"compression":"none","transaction":{"expiration":"2018-05-14T00:41:47","region":0,"ref_block_num":8406,"ref_block_prefix":3983766411,"max_net_usage_words":0,"max_kcpu_usage":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"newaccount","authorization":[{"actor":"eosio","permission":"active"}],"data":"0000000000ea3055000000012103b89a01000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf01000001000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf0100000100000000010000000000ea305500000000a8ed32320100"}]},"signatures":["SIG_K1_Kb8rBwQepJth2tQ4r86o1ZB1UWMbnKCdhXSjuGFiWHAD9YujH6betfQtLaWeqXhQ1WpFL7n7aH7kU2ntg29HDTXb392hjz"]}
{ Error: {"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","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms","file":"authorization_manager.cpp","line_number":405,"method":"check_authorization"}]}}
at /Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/apigen.js:102:23
at
Received same kind of error when invoking contract action (even after merging pending pull request)
{"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":"chmbifyslhqs","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms","file":"authorization_manager.cpp","line_number":405,"method":"check_authorization"}]}}
Same issue here
So right now eosjs is still on dawn3, but there is a dawn4 ( slim ) branch which is being worked on. I've run some tests on it yesterday and it seems to be working as expected, I think we might just be waiting for it to be merged.
Received above error in slim branch only. For example, tried below transaction
eos.transaction({
actions: [
{
account: 'hello',
name: 'hi',
authorization: [{
actor: 'nrisxgbvijwz',
permission: 'active'
}],
data: {
user: 'test'
}
}
]
})
I just merged slim into master .. It is getting a lot better but there are still errors..
eosjs master depends on fcbuffer [master], and eosjs-api [master] .. There is still an error with the asset. Once I fix that I can update npmjs..
overwrite the newly changed code in 10.0.0, delete the deposit, and test it, the account created.
In case of eos.newaccount, the following error occurs.
Error: Abi 'eosio.token' is not cached, call abiAsync('eosio.token') action.data transaction.actions
at Object.abi (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs/lib/abi-cache.js:38:13)
at structLookup (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs/lib/structs.js:36:31)
at actionDataFromObject (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs/lib/structs.js:560:52)
at Object.fromObject (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/fcbuffer/lib/struct.js:148:15)
at Object.fromObject (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/fcbuffer/lib/types.js:239:26)
at Object.fromObject (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/fcbuffer/lib/struct.js:151:34)
at rawTx (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs/lib/write-api.js:392:36)
at /Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs/lib/write-api.js:551:5
at api.getBlock.block (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/exported-helpers.js:60:7)
at /Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/exported-helpers.js:69:5
at callback (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/process-args.js:70:9)
at callback (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/apigen.js:86:9)
at /Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/apigen.js:113:9
at
but my newAccount function is ok
function newAccount(account, endpoint) {
if (_.isEmpty(endpoint)) {
endpoint = http://${eosNodeConfig.host}:${eosNodeConfig.httpPort};
}
const options = getConfig(endpoint);
const eos = api.Localnet(options);
return eos.contract('eosio')
.then((contract) => {
return contract.newaccount(account, {authorization: ${eosNodeConfig.systemAccount}});
})
.catch(function(err) {
console.log(err);
if (typeof err === 'string') {
throw JSON.parse(err);
}
throw err;
});
}
// eosio_contract_abi.cpp "newaccount": { "base": "", "type": "action", "fields": { "creator": "account_name", "name": "account_name", "owner": "authority", "active": "authority", "recovery": "authority" } },
https://github.com/EOSIO/eosjs/blob/a0b29aff1feda39ed862a2e2cacd5baff498d72b/src/schema/chain_types.json#L134
I published npm eosjs@dawn4 (version 11) .. This version is compatible with eosio/eos:dawn-v4.0.0 .. There are many changes. Please let me know if you have questions or find other bugs..
@jcalfee When I create new account
const eos = eosjs.Localnet({
keyProvider: ['5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'],
binaryen
});
return eos.newaccount({
creator: 'eosio',
name,
owner: 'EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV',
active: 'EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV',
});
It is still error same above !
I use "eosjs": "^11.0.0", 🙇
Maybe you have another eosjs-* package installed in your package.json? Or the nodeosd your using is not the version you think it is. Your example works for me.
@jcalfee Sorry, this is my confusion! It works. Thank you very much.
The most common issue is the chainId .. Look at the chainId in get_info under http://193.93.219.219:8888/v1/chain/get_info then include that hex string in config.chainId ..