1

While using the push transaction I am getting the below error, Kindly help

{ "code": 500, "message": "Internal Service Error", "error": { "code": 3090003, "name": "unsatisfied_authorization", "what": "Provided keys, permissions, and delays do not satisfy declared authorizations", "details": [] } }

This is my smart contract code

#include <eosiolib/eosio.hpp> 
#include <eosiolib/print.hpp> 

using namespace eosio; 

class hello : public contract { 

public: 
    using contract::contract; 
    [[eosio::action]] void hi( name user ) {
        print( "Hello, ", name{user});
    }
};

EOSIO_DISPATCH( hello, (hi))
  • It depends on what auth you have set in the smart contract code... can you provide the code? and the command you provide to push the action? – damianodamiano Nov 12 '18 at 12:37
  • This is my smart contract code #include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace eosio; class hello : public contract { public: using contract::contract; [[eosio::action]] void hi( name user ) { print( "Hello, ", name{user}); } }; EOSIO_DISPATCH( hello, (hi)) I am sending body to the push transaction API – Danish Nov 12 '18 at 12:53
0

Import eosio keys to wallet and then try to push transaction

0

Before doing push_transaction, there are few more steps to do

  1. abi_json_to_bin- Convert the transaction into binary form(transaction packing)
  2. get_info- To get the current block number
  3. get_block- To get information about the latest block
  4. unlock_wallet - Unlock your wallet(Make sure wallet is imported with required keys)
  5. get_required_keys- Get the required keys from the wallet for signing the transaction
  6. sign_transaction- Sign the transaction using data obtained from previous steps
  7. push_transaction- Finally, push the signed transaction into blockchain

Make sure the wallet is imported with required keys. For detailed tutorial go to EOS-Tutorials

0

Just import genesis account (eosio) keys in the wallet. - Make sure wallet is unlocked

cleos wallet unlock

Now import the keys which are fixed

eosio public key: EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
eosio private key: 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDe

So your command of importing key will be

cleos wallet import --private-key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDe

All should be find after that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.