Problems with EOS Studio

you have download the centOS package, which is not the correct one for ubuntu.

Your can check my quick guide to install nodeos on ubuntu properly.
https://github.com/thecil/EOSCoding/blob/master/nodeos_Setup.md

Carlos Z

1 Like

As I mentioned, I did install the Ubuntu package. My mistake was going further and attempting to install the centOS package. Your instructions there are identical to the course except the version. I tried both versions and everything is fine until tail -f nodeos.log which is the last step in the sequence in my post above. The image shows the result:tail nodeos log

1 Like

Does the nodeos.log exists in the contracts folder or its on another one? you should initialize that command where the nodeos.log file is located.

Carlos Z

Yes, that file is in the contracts folder.

And I executed from there

1 Like

Are you sure your nodeos is properly up and running? once its running it will create the nodeos.log file.

Command to start nodeos:

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 & 

Carlos Z

Yes. I was able to use that command to start it, or at least I didn’t get any errors.

1 Like

So, @thecil, what do you think? Again, below is where the problem occurs:

ted@ted-VirtualBox:~/contracts$ tail -f nodeos.log

Command ‘nodeos’ not found, did you mean:

command ‘nodejs’ from deb nodejs
command ‘nodefs’ from deb noweb

Try: sudo apt install

1 Like

Its very weird, tail is used to print the last 10 command lines from a file, this case is nodeos.log which is the log file for the operations of nodeos.

Try to check all files in the folder with the command ls.

Carlos Z

Here it is:
eosio.cdt_1.6.1-1_amd64.deb eosio.cdt-1.6.1-1.centos-x86_64.rpm nodeos.log

1 Like

Maybe you do not have installed tail (which could be weird), but this is not a real issue, aslong as your nodeos is running, tail is just used to verify the data that is being processed, you can do the same with cat. (only that is not going to be show in the same fashion way than tail)

Carlos Z

1 Like

After trying cat, I tried tail --help and got a response, no errors. Then I tried tail -f nodeos.log and it worked. Same folder - contracts. VERY strange.

But now it’s looking like I’ll definitely need the code in pet.hpp from the helloworld contract (this video - https://academy.ivanontech.com/products/eos-programming-101/categories/1672209/posts/5619989) because we’ll be calling the actions in that contract with nodeos.

If you go to 0:48 in this video https://academy.ivanontech.com/products/eos-programming-201/categories/1681110/posts/5646944, you’ll see that the compile command is calling dogcontract.wasm which I don’t think I have the ability to generate except with EOS Studio. It’s not clear how Filip generated it because the first video does not show him compiling and he doesn’t appear to be using EOS Studio or anything I’ve seen before. In the first video, Phillip was in EOS Studio, but the second video with Filip is showing something else entirely. Same code, different application. In my case, if you remember, helloworld.wasm is helloworld.wasm.tmpb60bcf7aand has garbage characters in it due to a failure to deploy (or maybe compile, I’m not sure). So I don’t see any way to proceed with EOS 201 at this point.

1 Like

I suggest you to check my quick guide against the video lessons, all the commands that filip use i just put it there to have an step by step on how to compile/deploy contracts with nodeos.

https://github.com/thecil/EOSCoding/blob/master/EOSIO%20CLI%20commands.md#compilation

You need to compile your contract in order to create the .wasm file.

Also to add the pet.hpp you must create a new file and paste all its logic there, this pet.hpp file should be in the same folder than the main contract, then you just need to #include the pet file into the main contract.

Carlos Z

1 Like

OK, here’s the issue. It appeared to me initially that the helloworld code from the 101 course was being used in 201. I now realize that although the code in 201 is very similar, it’s for dogs rather than pets and is not the same. But nowhere in the 201 course is this mentioned. And although you provided me with the 201 code from GitHub, it’s only the dogcontract.cpp file and this is an entirely new contract. So I need to know how to set up this contract, presumably in EOS Studio Isn’t there at least a dogcontract.hpp file as well? I’m also not sure whether I should be using the dogcontractTOKEN.cpp code or the dogcontractNOTOKEN.cpp at this point.

1 Like

The cpp file is your main file for the contract, you could type all the functions on that one or use header files hpp that contain some of the logic that cpp will use.

I have made a more advance contract to show some functionalities outsite of the course scope, you can look at it as an example on how to use hpp files.
https://github.com/thecil/public/tree/master/EOS

But at the moment of compiling the contract with eosio you just need to specify the cpp.

Let me know if you have any question, i know it can be confusing moving from 101 to 201 for this course.

Carlos Z

1 Like

In the lower section here, you can see exactly what I did and what came back. I still have a blinking cursor after 30 minutes. A dogcontract.wasm.tmp... file was created again with the extra .tmp…, like when I tried to compile within EOS Studio, but instead of one line of garbage, I have many pages.

I verified using a spreadsheet that what is in the .cpp file is exactly what you have in GitHub.

I killed the process and attempted one more time with the same result.

Then at the bottom it’s more coherent and it references some of the actions in the contract. I’ll leave this here just in case it means anything:

action_data_sizeread_action_dataeosio_assert_codeeosio_assertrequire_authdb_find_i64
db_get_i64
db_update_i64current_receiverdb_store_i64db_lowerbound_i64
db_end_i64db_previous_i64db_idx64_storedb_next_i64
db_remove_i64db_idx64_find_primarydb_idx64_removedb_idx64_updatedb_idx64_lowerbound
db_idx64_next
ted@ted-VirtualBox:~/EOSStudio/src$ ls
dogcontract.cpp  helloworld.cpp
ted@ted-VirtualBox:~/EOSStudio/src$ cd ..
ted@ted-VirtualBox:~/EOSStudio$ eosio-cpp -abigen -o dogcontract.wasm src/dogcontract.cpp
Warning, empty ricardian clause file
Warning, empty ricardian clause file
Warning, action <insert> does not have a ricardian contract
Warning, action <erase> does not have a ricardian contract
Warning, action <modify> does not have a ricardian contract
Warning, action <removeall> does not have a ricardian contract
1 Like

All looks good, at the end of the console, it said warning, action <actionName> ... which is a sign that the contract compile successfully, thats only a suggestion that your actions should also fulfill the ricardian contract requirements, but nothing to worry about.

In fact, every time you compile and you receive that suggestion, it means your contract is OK.

Carlos Z

1 Like

Was able to go a step further and get the dogcontract code to compile with the additional code with send_summary wtih the notify action, but the code in the video appears to be wrong. When it didn’t compile, I realized that instead of what Filip had there where he put owner as the first argument of send_summary, that doesn’t work for the erase, modify, or removeall functions because owner is not passed into the code. For erase and modify, I used dog.owner and for removeall, that wasn’t an option, so I used user.

But beyond that, I wasn’t able to start nodeos correctly because “database dirty flag set (likely due to unclean shutdown)” And if I add --hard-replay-blockchain to the start command, it says it doesn’t recognize the command.

Also, how do I shut down the database gracefully next time?

1 Like

Hey man, hope you are ok.

That error message shows up when you have not close properly the nodeos process. You interrupt it in the middle of the process so the database got corrupted.

I have solve this issue in the past and create a quick guide for it, you can check it here:

Carlos Z

1 Like

OK, next problem. I had the same problem with my default wallet as below, but here’s what I did when I created a new wallet called ted. At the account creation, it says I don’t have the proper keys or permissions.

ted@ted-VirtualBox:~/contracts$ cleos wallet open -n ted
Opened: ted

ted@ted-VirtualBox:~/contracts$ cleos create key --to-console
Private key: 5K2p2NNymTXktutmMfymekYHk594ZCKVEpDtuStW4dP7qE8ZRiw
Public key: EOS6BTBSifV3jtXo4TRrtSTMQJRdcMnsjZZuErc4wjDYRrB6r4LQY

ted@ted-VirtualBox:~/contracts$ cleos wallet unlock -n ted
password: Unlocked: ted

ted@ted-VirtualBox:~/contracts$ cleos wallet import -n ted
private key: imported private key for: EOS6BTBSifV3jtXo4TRrtSTMQJRdcMnsjZZuErc4wjDYRrB6r4LQY

ted@ted-VirtualBox:~/contracts$ cleos create account eosio ted EOS6BTBSifV3jtXo4TRrtSTMQJRdcMnsjZZuErc4wjDYRrB6r4LQY EOS6BTBSifV3jtXo4TRrtSTMQJRdcMnsjZZuErc4wjDYRrB6r4LQY
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.

1 Like