EOS Tables Discussion

Yes, a completely new and updated EOS course is released the 1st of September. So stay tuned, I think you will like it! It will be a great upgrade to the academy.

Hi, filip.
Iā€™m not sure I could ask this question on this discussion, but I really want answer.
I recently installed eosio, and eosio.cdt on my ubuntu system and was going to compile my first helloworld contract. But it stuck for several hours after showing some warnings. I felt confused after trying to do anything I could.

Plz help me, bro.
This is the snapshot of my ubuntu.

<hello.cpp>
#include <eosio/eosio.hpp>

using namespace eosio;

class [[eosio::contract]] hello : public contract {
public:
using contract::contract;

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

};

Donā€™t worry about those warnings. They donā€™t have anything to do with the code itself.

You can read more about ricardian contracts here: https://medium.com/eosio/eosio-software-release-ricardian-contract-specifications-and-the-ricardian-template-toolkit-a0db787429d1

The next eos course will cover this as well. Basically you donā€™t have to worry about that unless you are actually deploying a contract on mainnet that people are going to use.

hello guys, @filip teacher, im still researching about the multi_index tables, i have been reading a lot of other dapps contracts and have seen they are coded different than actual EOS programming course, so i see now they change most of the syntax for contracts and should be coded with the new syntax on the course.

Now, i have seen most dapps contracts have a folder called tables and inside a lot of ā€œ.hppā€ with only the table struct they plan to include for something into the main ā€œ.cppā€ contract right? now, since they have the old syntax, would like to know if this example from eosio.cdt is up to date with how tables should be coded from now on (i mean this is the best practice and design for contracts?).
eosio.cdt github multi_index_table example

if true, means that i can create an .hpp file with all the table logic, including the actions and use the action wrapper to call those actions from other source?

thanks for everything.

i will use the dog contract to practice this, when i have it completly functional, would lovely share it with the academy.

Yeah you can choose to put those definitions in header files. Itā€™s a good general practice in c++, especially when you want to re-use definitions un multiple source files. You can google for general tutorials if you want to learn more about header files, because they are not exclusive for eos.

Yeah unfortunately eos has a habit of changing the syntax all the time. They canā€™t seem to decide on one syntax. We will update the course in due time, but I donā€™t think there are any huge changes in syntax. They seem to be quite small still.

I would love to see the end result! :heart_eyes:

Hi Guys,
Iā€™m trying to create some tables as per EOS Programming 101 - Tabled Programming - Part 1. I have done everything correctly but once I have built everything as per the instructions, I then go to helloworld.abi to check out the table that have been constructed there are none thereā€¦I have attached screen shots of the relevant code. I have checked everything and all look fine. Not sure what I have missed here that has prevented the tabled from being built? If someone can point out what Iā€™ve done wrong that would be great.
Cheers
Aaron

1 Like

Hello sir, yes, everything in your code looks great, now the issue with the ABI not showing the table that you create could be a little bug on the EOS Studio, you can try to continue to the next lesson when you are going to add some data to the table, if you still are having some issues please let me know.

Remember you can use the ā€œPreformatted Textā€ Button to encapsulate any kind of code you want to show.


function formatText(){

let words = ā€œIā€™m a preformatted Text box, Please use me wisely!ā€

}

Carlos Z.

1 Like

Hi Carlos,

Thanks for your reply. Iā€™ll see if I can move forward on this one. If not Iā€™ll let you know.

Have a good day dude.

Aaron

1 Like