Basic EOS Programming - Discussion

When you create a new project on EOS Studio, it create a new folder for that project inside the EOS Studio folder, if you do not set any folder when creating the project, try to delete the project and create a new one on the default folder that EOS Studio suggest, then try to compile and deploy the contract, to test those methods.

image

Carlos Z

ok, I deleted everything from the old project and created a new ā€˜helloworldā€™ project. This time when I tried to deploy, I got the same error as shown below. But this time, there is no helloworld.wasm at all anywhere as far as I can tell. Below is all there is. In ā€˜srcā€™ is the .cpp and in ā€˜includeā€™ is the .hpp. Thatā€™s all thatā€™s there. I should also mention I got this message when I did a build:

docker run --rm --name eosio.cdt_v1.6.2 --volume /home/ted/EOSStudio:/project -w /project eostudio/eosio.cdt:v1.6.2 /bin/bash -c ā€œeosio-cpp -abigen -I include -R resource -contract helloworld -o helloworld.wasm src/helloworld.cppā€
docker: Error response from daemon: Conflict. The container name ā€œ/eosio.cdt_v1.6.2ā€ is already in use by container ā€œaf1fb28662db30103a03c35b6f0e89b4df0fba930659a03bfff99741edc79355ā€. You have to remove (or rename) that container to be able to reuse that name.
See ā€˜docker run --helpā€™.
eos deploy failed
eos folder

1 Like

Ok, this problems happens when your contract syntax have some error and when you compile it (hammer button on EOS Studio) the compiler just get stuck compiling forever.

Thats why you have the error from docker saying there is another instance already running.

Would be great if you can share the code so i can debug it on my PC and check what is missing. :face_with_monocle:

Carlos Z

1 Like

I managed to get docker to stop the previous instance, but when I went to compile, it never finished again.

Hereā€™s the code:
helloworld.hpp:

#ifndef HELLOWORLD
#define HELLOWORLD

#include <eosio/eosio.hpp>

CONTRACT helloworld : public eosio::contract
{
public:
using eosio::contract::contract;
ACTION hi(eosio::name const & nm);
};
#endif

hellowold.cpp:

#include <helloworld.hpp>

void helloworld::hi(eosio::name const & nm)
{
eosio::print("Hello ",nm);
}

It also added .tmp60bcf7a to helloworld.wasm and helloworld.abi is missing

1 Like

Hey @tbaker, hope you are ok.

I have tested your contract and I facing the same issue with EOS Studio, I was not able to solve it, every time i want to compile, it takes forever, never finish to do it.

What i try also was to delete all my EOS Studio projects, restart the entire program, and just create the basic ā€œhelloworldā€ contract that they deploy at the start.

It does not compile even their own contract, so for me its basically a problem with EOS Studio (is not working properly). I can advice you to not loose more time with it and move on with Nodeos & Cleos, which are the same that EOS Studio use but on command line.

You can check how to use Nodeos & Cleos in the course EOS 201. At least try to learn how to use those tools so you can compile/deploy/test your contracts properly.

Carlos Z

1 Like

Hi guys, can anyone help. I keep getting the following error when trying to build the contract in the ā€œhello world - compile and deploy videoā€, thanks in advance

840s - It took longer than we expected, you may keep waiting or stop it and build it again.
<h2>Internal Server Error, real status: 500</h2>

Me again guys, also having issues when trying to install systems contracts v1.9.2 with the following error message:

git : The term 'git' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included,    
verify that the path is correct and try again.
At line:1 char:1
+ git clone --branch v1.9.2 --single-branch https://github.com/EOSIO/eo ...
+ ~~~
    + CategoryInfo          : ObjectNotFound: (git:String) [], CommandNotFoundExcepti    
   on
    + FullyQualifiedErrorId : CommandNotFoundException

Thanks again

1 Like

i am trying to deploy my instance and am getting a transaction authority declared (actor helloworld permission active) does not have signature any help please and how can i delete and start over ?
thanks

1 Like

Already replied on another topic :nerd_face:

Could you please provide an screenshot of the error? Might be helpful to read what the error is being show to you directly from the console, probably you have not selected the correct account.

Carlos Z

image
can i get help please cant get this to build

1 Like

Please provide the code in the following way to check if there any error in our code :face_with_monocle:

FAQ - How to post code in the forum

Carlos Z

#ifndef HELLOWORLD
#define HELLOWORLD

#include <eosio/eosio.hpp>

CONTRACT helloworld : public eosio::contract
{
public:
using eosio::contract::contract;
ACTION hi(eosio::name const & nm);
};
#endif
#include <helloworld.hpp>

void helloworld::(eosio::name const & nm)

{

eosio::print("Hello ",nm);

}

1 Like

Hey @John_Nutter, hope you are well.

There are too many syntax issues in your contract. I suggest to rewatch the EOS 101 videos if you are confuse with the syntax for each file.

You are declaring CONTRACT helloworld : public eosio::contract but this one is already declared in helloworld.hpp.

Also that #include <helloworld.hpp> should be on top of the file, not after.

#endif should be at the end of the proper declaration.

Carlos Z

Canā€™t figure out why my program wonā€™t compile. Iā€™m using the 1.6.2 version of CDT. Below is a paste of the error message:

/project/src/helloworld.cpp:3:19: error: out-of-line definition of ā€˜hiā€™ does not match any declaration in ā€˜helloworldā€™

void helloworld:: hi(eosio::name & nm)

              ^~

include/helloworld.hpp:9:13: note: type of 1st parameter of member declaration does not match definition (ā€˜const eosio::name &ā€™ vs ā€˜eosio::name &ā€™)

ACTION hi(eosio::name const & nm);

        ^

1 error generated.

Error while processing /project/src/helloworld.cpp.

abigen error

Warning, empty ricardian clause file

Warning, empty ricardian clause file

Warning, action does not have a ricardian contract

@filip @thecil

1 Like

Donā€™t worry! Managed to realise my issue. Was missing a public declaration so the cpp file couldnā€™t get access to the hpp fileā€™s CONTRACT template!

1 Like

Hey guys,

Iā€™m having a issue with EOS Studio. I did the contract ā€œhelloworldā€ like Philips did, however my .abi file is completely empty and the .wasm file has this error written.

"Error: readWasm failed:
0000000: error: unable to read uint32_t: magic"

Iā€™m running the EOS Studio Online (iā€™m using windows), and when I try to use the cloud network (I donā€™t have the local option), says that itā€™s down (maybe the error is related to this). But I canā€™t do any contracts compile. So iā€™m kinda stuck in this course.

Does anyone knows what is happening? :anguished:

Hey @Nuno_Silva, hope you are great!

Iā€™ll be honest with you, our EOS courses are quite old, we have not updated them because the EOS Studio Online is giving a lot of issues over time, some times, the tool does not work correctly, therefore all the process to program or learn EOS is quite a pain.

If you really want to keep going into the course, i might advice to skip using EOS Studio, at the EOS 201 course, we will teach you how to use CLEOS which is the sdk for program smart contract on a local eos blockchain, then you can just use that sdk to program any smart contract.

Here are some old guidelines that i made to execute properly all CLEOS commands, all this commands are mentioned in the EOS 201 course, i just made this to save me time on learning each command and step to deploy an smart contract properly: https://github.com/thecil/EOSCoding

Sorry for the inconveniences :nerd_face:

Carlos Z

Dear @thecil I just started taking EOS 101, ran into trouble installing EOS Studio, started looking for an answer here and saw many posts from you where you say that your EOS courses are quite old. Please tell me, is there any point in (option 1) taking this course further by trying to solve the problems somehow, or is it way behind the times, problems will arise at every step and (option 2) itā€™s better to find some other resource to learn EOS programming?

If still option 1, then please tell me the best way to take EOS courses. From the answer above I see that I can learn about local setup in EOS 201, did I understand correctly that after that I should go back to the EOS 101 course?

Hey Nikolay, indeed, you could learn how to setup you local node with CLEOS (using the EOS 201 lessons) and then go back to EOS 101 to continue the course, since the EOS Studio is not working properly for the course anymore, but using CLEOS for it is still possible, just that will require to know how to use the local node (cleos).

Carlos Z