Basic EOS Programming - Discussion

What’s the issue you’re having?

Strange that it worked on yours and @ivga80 's systems. Maybe it’s something to do with the Eos cloud network that I’m having to use. Please test that as well when making any Eos update tuts. The closest Ive got to deploying the contract was with the CryptoKylin option (got an insufficient ram message(in bytes)). My system has roughly 4 - 5gb ram freely available, but I would have thought that the Eos cloud network used a ‘virtual’ ram!?

Thanks for replying & trying to help guys, but I am now working on a practice project in order to get a better developer grounding, so to speak, and shall return when the new material come available. :+1:

I cannot get pass the firsts steps:
I am still troubleshooting the issue eosio-cpp -abigen -I include -R resource -contract hellotable -o hellotable.wasm src/hellotable.cpp I cannot get passed this. Each time there is a error msg. Also I cannot compile wiith eosio-cpp
There seems to be bugs.

It is the first of the 3 (three) lessons under Basic EOS Programming .

I have included a SCREEN SHOT from the lesson below ::

It’s weird, because right now when I’m testing I’m using the cloud network as well. So frustrating…

What’s the error message? is it in eos studio?

eos studio, I can build and deploy hellotable.cpp
But now that I am using the terminal I continue to get this error when compiling and deploying.
error: error reading ‘/Users/cherrybluemoon/src/hellotable.cpp’
1 error generated.
Error while processing /Users/cherrybluemoon/src/hellotable.cpp.
abigen error

Hello @filip ! I have seen this expression in the code: name{user}
It was explained that this is used to cast the user to a string.
As I have not seen this kind of construct in C++ (an identifier followed by {}), I would like to know what kind of construct / expression is that.
Best regards,
Jefferson

I keep getting this error
"
docker: Error response from daemon: Conflict. The container name “/eosio.cdt_v1.6.2” is already in use by container “7e2648be969ce323336795a03b8f6f46e1fca499cdb2a5f29a509051929af7be”. You have to remove (or rename) that container to be able to reuse that name.
See ‘docker run --help’. "

this happened when I hit Stop while building took too long trying to build the code, so when I tried to create a new contract and copied and paste the same code , then everytime i click build it gives me this error !!
Please help

Hi Sam,
it seems like the docker container running your CDT got stuck and EOS Studio is trying to create a new container with the same name. Have you tried to remove and add your EOSIO.CDT again?
Inside the EOS Studio, you can click on EOS.CDT v1.6.2 (Local) (bottom-right of the UI) and then on Manage Local EOSIO.CDT. From there you can try to remove the current CDT and install it again. Let me know if that helps.
Best regards,
Jefferson

1 Like

totally agree , I know both @filip and @Ivan are busy , but at least if they can give us a guide with how to proceed with the new updates, I thought I was the only one having problem :slight_smile:

@filip or another friend here :
please could you run this code and let me know if I have anything wrong ! ;
thanks in advanced

#include <eosio/eosio.hpp>

#include <eosio/print.hpp>

using namespace eosio;

CONTRACT dogggss : public contract {

public:

using contract::contract;

dogggss(name receiver, name code, datastream<const char*> ds):contract(receiver, code, ds) {}

ACTION insert(name owner, std::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;

});

}

private:

TABLE dog{

int id;

std::string dog_name;

int age;

name owner;

uint64_t primary_key() const {return id;}

};

typedef multi_index<“dogs”_n,dog> dog_index;

};

thanks that helped , but Im not sure if there is a bug in my code or its a version issue ! Im able to build and deploy successfully but the contract doesn’t have action (insert), I appreciate your help
this is my code :

#include <eosio/eosio.hpp>

#include <eosio/print.hpp>

using namespace eosio;

CONTRACT dogggss : public contract {

public:

using contract::contract;

    dogggss(name receiver, name code, datastream<const char*> ds):contract(receiver, code, ds) {}

ACTION insert(name owner, std::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;

  });

}

private:

TABLE dog{

int id;

  std::string dog_name;

int age;

name owner;

uint64_t primary_key() const {return id;}

};

typedef multi_index<"dogs"_n,dog> dog_index;

};

Hi, thanks for helping out, there are not enough hours in the day to be able to help everyone, so we appreciate all can help. Thanx :+1:

Ivo

Hi.
The EOS course is being updated, but it may take some time to finish.

I took this course myself and I didn’t have any issues following the course with the guidelines provided by Filip. Luckily most of the issues we encounter are often discussed before in this forum, so you will often find the solution by doing a simple search here or online.
The EOS docs are always the best resource for the EOS platform. :slight_smile:

All the courses are built up in the way so most of the questions we students have are actually answered by Ivan and Filip in the next video in that chapter. So If you feel like you are stuck and you don’t get an answer fast enough, feel free to continue to the next video and see if that helps. That’s not cheating. :wink:

We always try to respond within 24 hours, help us help you by trying to debug and search the resources for a solution to the issues you have.

Good luck, my friend.

Ivo

1 Like

Hello,
I am using windows 10 for the helloworld project with the correct CDT version 1.6.2.
When I create my helloworld project it does not look like the one in the video (mine looks like those mentioned above having 37 lines of code vs the 6 lines in the video).
When I build it, it states that it is “successful”, but the wasm and abi files are different from those in the video.
When I deploy the project, it deploys but there are no parameters (so I cannot put a name in there) and no scope.
Any helpful suggestions?
I have tried to download a local node, but as you said, that did not work.

Hi @Sam_Asad I have tried your code locally in EOS Studio and it worked fine for me.
Maybe your environment is not configured properly or there is something corrupted there.
I suggest you to stop your current node instance, delete it and create a new one.
Then create a new account and try to build and deploy the contract again.
Best regards,
Jefferson

2 Likes

Hi @ivga80, are you the responsible for answering the forum questions?
Are you replacing @filip?

thanks @jmsofarelli for your reply , I tried that before and it didn’t work , I know something is missed up in the environment which I can figure out , I have Mac ,and I tried even to delete the EOS studio app and docker then re install them and used new account to deploy to, but still no luck ,
that’s why I was hoping the online EOS studio would work but there didn’t work either , I don’t know why Im having a bad luck !

@Sam_Asad Are you getting some error? If you just delete the EOS Studio app, it still keeps some stuff in the folder ~/Library/Application Support/eos-studio, this content should be deleted too. Also, if I am not wrong, deleting the app will not delete the node instance (and blockchain data???), but I am not sure about that. You can try to delete manually the instance inside EOS Studio before deleting the app itself. Good luck and don’t give up! Developers should be prepared to deal with the unpredictable :slight_smile: It’s a shame that we get almost no support from the academy team :frowning: You can also try to use EOS running a local node from the command line and use cleos to deploy and interact with the contracts. It’s a bit more advanced but it’s covered in the second EOS Programming course, that I am doing right now. EOS Studio is a bit buggy.

2 Likes