kopanitsa / web3-arduino

an Arduino (or ESP32) library to use web3 on Ethereum platform.
MIT License
105 stars 45 forks source link

error: no matching function for call to 'Web3::Web3(const char [18], const char [36])' #16

Open Alenius opened 5 years ago

Alenius commented 5 years ago

Hello.

I am interested in getting this library up and running for my nodemcu. I however fall short pretty much immediately. When I use the example code I get an error code at:

Web3 web3(INFURA_HOST, INFURA_PATH);

and my defines are:

#define INFURA_HOST "rinkeby.infura.io"
#define INFURA_PATH "/mypath"

Where of course the path is really my infura path.

The error is:

SMART-:14:35: error: no matching function for call to 'Web3::Web3(const char [18], const char [36])'
 Web3 web3(INFURA_HOST, INFURA_PATH);
                                   ^

/Users/project.ino:14:35: note: candidates are:
In file included from /Users/project.ino:3:0:
/Users/mypath/Documents/Arduino/libraries/web3-arduino-master/src/Web3.h:15:5: note: Web3::Web3(const string*, const string*)
     Web3(const string* _host, const string* _path);

It feels weird since I've copy pasted the example code from the repo.

hikaman commented 5 years ago

Hey,

you must generate your own path on on infura. Create an account on https://infura.io/ and you will get your path/key via email.

Please note that there are flaws in the main repo. If you want to call smart contracts or send ERC20 Token check the PRs or the repo from https://github.com/TbLtzk/web3-arduino

Alenius commented 5 years ago

Yes, I have already done that. I just substituted my address above.

swapnilbaad commented 5 years ago

I am also getting same error. Did you solve the problem??

Alenius commented 5 years ago

Sorry I do not remember exactly but I think I solved this some other way and did not get this to work.

swapnilbaad commented 5 years ago

Did you come up with another solution on how to call functions of smart contract through arduino ??

Yago-Caetano commented 4 years ago

For solve this problem, You need to put this code, on PlatformIO

Web3 web3((string)INFURA_HOST, (string)INFURA_PATH);

toutou8148 commented 3 years ago

Sorry I do not remember exactly but I think I solved this some other way and did not get this to work.

Did you successfully connect to infura using nodeMCU esp32?

uskhalil commented 1 year ago

@Yago-Caetano: It doesn't work either. Web3 web3((string)INFURA_HOST, (string)INFURA_PATH); OR Web3 web3(new string(INFURA_HOST), new string(INFURA_PATH));

Since the library is not maintained a long ago, and there are broken links to the related libraries, I tried to figure out the issues however I am still getting the instantiation issue with the Web3 class in the main.cpp

Please share if anyone managed to deploy it on ESP32

CaioTurnes commented 1 year ago

Hello, did you figure out how to make it work?

CaioTurnes commented 1 year ago

@uskhalil