Hi,
Concerning the account creation process - Iām getting stuck!
When running the ācleos create account eosio ā¦ā command, ensuring that everything else is on order, I get the following:
Error 3090003: Provided keys, permissions, and delays do not satisfy declared authorizations
Ensure that you have the related private keys inside your wallet and your wallet is unlocked.
Error Details:
transaction declares authority ā${auth}ā, but does not have signatures for it.
Wallet is opened and unlocked. Key exists as it was generated using ācleos create key --to-consoleā.
Answers on the web does not seem to help, as their case have the ${auth} replaced by something elseā¦
Thatās my bad. So sorry. I forgot to add an important step in the video. I have edited the lecture now and added that. What you need to do is to add the key for the eosio account. Which is a standard key that exists within EOS that everyone needs to have in their wallet in order to be able to do stuff on behalf of the āadminā account (eosio).
This is what you need to do. Run: cleos wallet import. It will query you for a key, enter the following key.
Tips for Windows users, has fillip says, no windows clients are ready, so VM or dual boot is an option.
BUT, if u dont have a IT background or computer knowledge skills, lets keep it simple.
FOR WINDOWS, better use a VM (Virtual-Machine), dual boot its more complicate to configure than a VM.
Go to youtube and search videos on how to install ubuntu on a VM (depending on what software ur going to use), tons of video tutorials on how to install and get ubuntu running properly on a VM in windows.
Would be nice if you do some kind of simple instructions on this chapter in the academy website for tech newbies teacher!.
Little trick to deal with big line command to start Nodeos.
in ubuntuterminal, after properly apt-get update and upgrade.
Install nano if dont have it.
sudo apt-get install nano
Navigate to your contract folder.
Run command:
sudo nano nodeos_start
inside black interface of nano, copy/paste this:
nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --plugin eosio::history_plugin --plugin eosio::history_api_plugin --access-control-allow-origin='*' --contracts-console --http-validate-host=false >> nodeos.log 2>&1 &
echo "Nodeos started, check status on 'tail -f nodeos.log'"
echo " "
echo "IMPORTANT: Remember to close proprely with command 'pkill nodeos'"
Ctrl+S to save on nano.
Ctrl+X to leave nano editor.
Run Command to make nodeos_start file executable:
sudo chmod +x nodeos_start
Start command by:
./nodeos_start
PD: you must be inside contracts folder to run the start file.
WHY THIS?: im not going to re run that big nodeos command everytime i need to boot itā¦ now i just use my ānodeos_startā script file to made easy that boot process.
Hope it works for someone. (i know can be improved, fillip you can take what ever i post here if u like an idea or something).
#include <eosio/eosio.hpp>
#include <eosio/print.hpp>
//using namespace std;
using namespace eosio;
CONTRACT hellotable : public contract {
public:
using contract::contract;
hellotable(name receiver, name code, datastream<const char*>ds):contract
(receiver, code, ds) {}
//to substansiate Table in Action
ACTION insert(name owner, std::string dog_name,int age){
require_auth(owner);
dog_index dogs(get_self(), get_self().value);
//now to insert all this data:
dogs.emplace(owner, [&](auto& row){
row.id = dogs.available_primary_key();
row.dog_name = dog_name;
row.owner = owner;
row.age = age;
});
send_summary(owner, "inserted dog");
}
ACTION erase(int dog_id){
dog_index dogs(get_self(), get_self().value);
auto dog = dogs.get(dog_id, "Unable to fetch dog");
require_auth(dog.owner);
auto iterator = dogs.find(dog_id);
dogs.erase(iterator);
send_summary(dog.owner, "erase dog");
}
ACTION modify(int dog_id, std::string dog_name, int age){
dog_index dogs(get_self(), get_self().value);
auto dog = dogs.get(dog_id, "Unable to modify dog");
require_auth(dog.owner);
auto iterator = dogs.find(dog_id);
dogs.modify(iterator, dog.owner, [&](auto& row){
row.dog_name = dog_name;
row.age = age;
});
//send_summary(owner, "modify dog");
}
ACTION removall(name user){
dog_index dogs(get_self(), get_self().value);
auto owner_index = dogs.get_index<"byowner"_n>();
auto iterator = owner_index.find(user.value);
while(iterator != owner_index.end()){
owner_index.erase(iterator);
iterator = owner_index.find(user.value);
}
}
//inline action
ACTION notify(name owner, std::string msg){
require_auth(get_self());
//security measure that sends a recipt to user
require_recipient(owner);
}
//structure of table /struct
private:
TABLE dog{
//primary key is good identifier int id;
int id;
std::string dog_name;
int age;
name owner;
//defining primary key
uint64_t primary_key() const {return id;}
//only have integers that return numbers
uint64_t by_owner() const {return owner.value;}
};
//how to write inline action with four arguments
void send_summary(name owner, std::string message){
action(
permission_level{get_self(), "active"_n},
get_self(),
"notify"_n,
std::make_tuple(owner, message)
).send();
}
//define type of table it is going to be
/*typedef is type definition
eos use multi arguement and name of index is dogs
convert into eos name by adding n
last arguement of structure is adding name which is dog
dog is the struct defining each row
standard name is adding indexes to substansiate of this type
*/
//these are the arguments inside <name,struct, where this argument can be found>
//const is the function that wraps around line 63
typedef multi_index<"dogs"_n, dog, indexed_by<"byowner"_n, const_mem_fun<dog, uint64_t, &dog::by_owner>>>
dog_index;
};
Iām not sure what creates the error you got, but when I look at your code there are a couple of things that iām not sure ofā¦ I see you commented out the line 4 in your code, but I think this is on purpose because you have used the std: manually in your code, so that should be ok, I hope. But you also use :
And iām not sure about this, maybe you can explain what itās for? I see that I didnāt use it in my Dogtable.cpp code below.
Also your typedef, in the end, is a little more complex than mine, but you also have a lot more actions in your contract.
Have it worked earlier? Can you tell me what you have done to debug it? When do you get the error?
All I know is this:
This is the code I had in my contract. I hope this helps you.
#include <eosio/eosio.hpp>
#include <eosio/print.hpp>
using namespace std;
using namespace eosio;
CONTRACT dogtable : public contract {
public:
using contract::contract;
ACTION insert(name owner, string dog_name, int age) {
require_auth(owner);
dog_index dogs(get_self(), get_self().value);
dogs.emplace(owner, [&](auto& row) {
row.id = dogs.available_primary_key();
row.dog_name = dog_name;
row.age = age;
row.owner = owner;
});
}
ACTION erase(int dog_id) {
dog_index dogs(get_self(), get_self().value);
auto dog = dogs.get(dog_id, "Unable to fetch dog.");
require_auth(dog.owner);
auto iterator = dogs.find(dog_id);
dogs.erase(iterator);
}
ACTION modify(int dog_id, name new_owner, string new_dog_name) {
dog_index dogs(get_self(), get_self().value);
auto dog = dogs.get(dog_id, "Unable to fetch dog.");
require_auth(dog.owner);
auto iterator = dogs.find(dog.id);
dogs.modify(iterator, dog.owner, [&](auto& row) {
row.owner = new_owner;
row.dog_name = new_dog_name;
});
}
private:
TABLE dog {
int id;
string dog_name;
int age;
name owner;
auto primary_key() const { return id; }
};
typedef multi_index<name("dogs"), dog> dog_index;
};
EOSIO_DISPATCH(dogtable, (insert)(erase)(modify))
I have repeated the process three times and still getting same error as mentioned below.
Regards,
Iām having same issue on MAC.
Wallet is created and unlocked.
Private key is imported: 5K1x33C12ZETcHiAc7BzdJRQxSCV1RCXVky5LgYa2xw6mAn2HgM
After command: cleos create account eosio doujaiji EOS85A3gF64oh2YPQvzERX1uDC2X4VqrmmYNQuntCP4f1TMfSDJ1P EOS85A3gF64oh2YPQvzERX1uDC2X4VqrmmYNQuntCP4f1TMfSDJ1P
While creating account, it is giving this error: āError 3090003: Provided keys, permissions, and delays do not satisfy declared authorizations.ā
Finally it worked after a lot of trial and errors.
The problem was as @filip said we need to get the private key of āeosioā and add it to the wallet.
Thanks, I had the wrong path. After I ran the command the following respond is:
cherrybluemoon@Markandrews-MacBook-Pro ~ % eosio-cpp -abigen -o hellotable.wasm src/hellotable.cpp
Warning, empty ricardian clause file
Warning, empty ricardian clause file
Warning, action does not have a ricardian contract
Warning, action does not have a ricardian contract
Warning, action does not have a ricardian contract
Warning, action does not have a ricardian contract
Warning, action does not have a ricardian contract Is that correct?
yes, no error shows up, that warning will appear for every action you have in the contract without ricardian rules on them (nothing to worry about right now).
I am using Windows on my main computer, but I have an old laptop where I installed Ubuntu as @thecil encouraged me to get started with Linux!
So I installed Ubuntu on my old laptop, but I installed Ubuntu 20.04 not knowing it was a very recent release.
Installing the Ubuntu 18.04 Debian Package from the link provided in the course (EOSIO v. 1.8.1) did not work, I got an HTTP request sent, awaiting response... 404 Not Found error in my terminal, I guess because this package is not fit for the Ubuntu 20.04 version. I tried to install the package for EOSIO v. 2.0.5 found on EOS Github page, but I got the same error message.
I would need now to wait for a new release by EOS for Ubuntu 20.04. It seems that it is coming soon, because an EOS dev commented two weeks ago on Github: āA new LTS release is about to be available, so it will be great to have deb packages for it.ā
Of course I could uninstall Ubuntu 20.04 and install the 18.04 version, but I will wait for a while, I hope the package will be available soon for 20.04.
Another option for me would be to install a VM on Windows and use Ubuntu on my main computer with the VM. Does this solution work well and does it take not too much memory?