EOS Nodeos & Cleos Setup

Welcome to the discussion thread about this lecture section. Here you can feel free to discuss the topic at hand and ask questions.

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ā€¦

Do you have any idea?

System info : running on Ubuntu 19.04

1 Like

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.

5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

Then you should be able to create an account

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.
  • FOR VM can use: virtual box, VM Workstation.
  • Download ubuntu ISO file here.
  • 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 ubuntu terminal, 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).

5 Likes

Thanks for sharing! Good advice indeed :slight_smile:

@filip How can I correct this: zsh: command not found: eosios-cpp :upside_down_face:

Hi @cherrybluemoon.
Can you share a screenshot or copy&paste the code in this post?

The error mean just what it says. The command was not found in your code. Maybe there is a misspelling some where in your contact?
Ivo

#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;
  };

Hi. Iā€™ll try to take a look at this tonight I hope. :hugs:
Ivo

Hi Cherrybluemoon.

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))

Hi,
I am in this course
EOS Programming 201

/

Categories

/

Inline Actions

/

Deploying and Testing.

The error happens when I am deploying the code for hello table.cpp. I cannot move further until a solution

presents itself.

I have double and triple checked the path upon deploying, and each time I received: Error 3160009: No wasm file found

Error Details:no wasm file found /Users/cherrybluemoon/Documents/hellotable/hellotable.wasm/hellotable.wasm.wasm

**Using this command:**cleos set contract hellotable Documents/hellotable/hellotable.wasm --abi hellotable.abi -p hellotable@active

Hello @filip,

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.ā€

It is useful, it works on MAC as well.
Thank you,
Regards,

1 Like

is your nodeos running?
the command i use is:

cleos create account eosio [accountNameHere] [ownerKey] [activeKey]

your command looks correct, there must be a problem with the nodeos i thinkā€¦please be sure its runningā€¦

1 Like

wich command are you using to deploy the contract?
command syntax for deploying is:

eosio-cpp -abigen -o <OUTPUT> <SOURCE FILE>

After deploying it, set the contract to account with

cleos set contract <ACCOUNT> <CONTRACT-DIR> <WASM-FILE> --abi <ABI-FILE> -p <ACCOUNT>@<PERMISSION>

please remember, you must have the nodeos running in order to run this commandsā€¦

2 Likes

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.

Regards,

3 Likes

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?

3 Likes

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).

3 Likes

Thanks for all the help! :pray:
Ivo

2 Likes