Truffle Introduction

@dan-i. kindly see above and revert. Thanks and awaiting. I am really looking forward to completing this course soon, and then the Smart contract Risk assessment/ management course.

regards

Suveett kalra

1 Like

Hey @Su.kal.Crypto

If you get ‘command not found: truffle’ means that Truffle is not installed globally.
Open your terminal and run sudo npm install -g [email protected].

Once done navigate into an (empty) project folder and run truffle init.

Should work fine.

Let me know

Dear @dan-i

Now its showing the below message :slight_smile:
Last login: Thu Dec 10 19:51:22 on ttys000

aadyakalra@Aadyas-MacBook-Air ~ % cd /Users/aadyakalra/Documents

aadyakalra@Aadyas-MacBook-Air Documents % sudo npm install -g [email protected].

Password:

npm ERR! code ETARGET

npm ERR! notarget No matching version found for [email protected]

npm ERR! notarget In most cases you or one of your dependencies are requesting

npm ERR! notarget a package version that doesn’t exist.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/aadyakalra/.npm/_logs/2020-12-10T14_22_54_253Z-debug.log

aadyakalra@Aadyas-MacBook-Air Documents % sudo npm install -g [email protected]

npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module ‘is-npm’

npm ERR! Require stack:

npm ERR! - /usr/local/lib/node_modules/npm/node_modules/update-notifier/index.js

npm ERR! - /usr/local/lib/node_modules/npm/bin/npm-cli.js

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/aadyakalra/.npm/_logs/2020-12-10T14_23_27_411Z-debug.log

aadyakalra@Aadyas-MacBook-Air Documents %

aadyakalra@Aadyas-MacBook-Air Documents %

kindly revert whats to be done next?

thanks and regards

suveett Kalra

@Su.kal.Crypto

pm ERR! notarget No matching version found for [email protected] this message is strange as I am able install that version. Just to double check make sure that you have not wrote a dot (.) after the number 12

sudo npm install -g [email protected]

If you are sure that the command is correct and still does not work, run sudo npm install -g truffle

Notice that you will receive warnings during the installation, that’s ok.

Once done run truffle -v you should see something like:

Cheers,
Dani

as you can see i tried in the documents folder - both
sudo npm install -g [email protected] (that you suggested)

and sudo npm install -g [email protected](that Fillip suggested)

but its still not working.

Then i tried again the below :

You don’t have access to this file.

at Object.openSync (fs.js:476:3)
at Object.readFileSync (fs.js:377:35)
at Configstore.get all [as all] (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/~/configstore/index.js:31:1)
at new Configstore (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/~/configstore/index.js:25:31)
at Function.getUserConfig (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:151:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/mnemonics/mnemonic.js:11:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/develop.js:2:22)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/index.js:9:12)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/cli.js:33:29)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:65:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js:71:10)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47

Error: Error while attempting to download and cache solc 0.5.8: Command failed: node ./build/cli.bundled.js obtain --solc=0.5.8
Error: EACCES: permission denied, open ‘/Users/aadyakalra/.config/truffle/config.json’
You don’t have access to this file.

at Object.openSync (fs.js:476:3)
at Object.readFileSync (fs.js:377:35)
at Configstore.get all [as all] (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/~/configstore/index.js:31:1)
at new Configstore (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/~/configstore/index.js:25:31)
at Function.getUserConfig (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:151:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/mnemonics/mnemonic.js:11:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/develop.js:2:22)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/index.js:9:12)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/cli.js:33:29)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:65:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js:71:10)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47

at postinstallObtain (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/scripts/postinstall.js:13:11)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/scripts/postinstall.js:20:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
  • [email protected]
    updated 1 package in 7.486s
    aadyakalra@Aadyas-MacBook-Air Documents % cd /Users/aadyakalra/Documents/ethereum-course-advanced/Helloworld
    aadyakalra@Aadyas-MacBook-Air Helloworld % truffle init
    zsh: command not found: truffle

SO ITS STILL NOT WORKING

*PLEASE SUGGEST WHAT TO DO NEXT *

thanks and regards

Suveett Kalra

From what you shared truffle is installed.

[email protected]
updated 1 package in 7.486s

Try the following:

  • Reboot your pc, then try to run truffle init once again (do not skip this step).
    If that does not work:

  • Run sudo npm uninstall truffle -g

  • then follow this: FAQ - How to downgrade Node.Js

  • Reboot your pc.

  • Run sudo npm install -g truffle

  • Reboot

Try to use truffle again

Hello @dan-i

I did exactly as per the above instructions

Now its showing the following message:

Last login: Thu Dec 10 21:01:46 on ttys000

aadyakalra@Aadyas-MacBook-Air ~ % truffle init

zsh: command not found: truffle

aadyakalra@Aadyas-MacBook-Air ~ % cd /Users/aadyakalra/Documents/ethereum-course-advanced/Helloworld

aadyakalra@Aadyas-MacBook-Air Helloworld % truffle init

zsh: command not found: truffle

aadyakalra@Aadyas-MacBook-Air Helloworld % node -v

v10.21.0

aadyakalra@Aadyas-MacBook-Air Helloworld % nvm -v

zsh: command not found: nvm

aadyakalra@Aadyas-MacBook-Air Helloworld % npm -v

6.14.4

aadyakalra@Aadyas-MacBook-Air Helloworld %

Please let me know whats to be done now, as its still showing zsh: command not found : truffle

regards

suveett Kalra

Dear @dan-i

I tried to download the nvm through the links given on Forum, but my Mac doesn’t allow me to run/ install it :slight_smile:it shows the following message :slight_smile:
This download is from a developer we cannot verify as safe on running on this Mac

what could this be possibly ? I have absolutely no idea now how to navigate further …

i have literally tried everything now whats mentioned on the forum (and even read on google), but its still not working and i am literally tired now.
i am even following the exact instructions you gave me

thanks and regards

Suveett kalra

  • Reboot your pc, then try to run truffle init once again (do not skip this step).
    If that does not work:
  • Run sudo npm uninstall truffle -g
  • then follow this: FAQ - How to downgrade Node.Js
  • Reboot your pc.
  • Run sudo npm install -g truffle
  • Reboot

Try to use truffle again.

This below happened when i ran sudo install npm -g truffle

Last login: Thu Dec 10 21:15:39 on console
aadyakalra@Aadyas-MacBook-Air ~ % sudo npm install -g truffle
Password:
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
/Users/aadyakalra/.npm-global/bin/truffle -> /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js

[email protected] postinstall /Users/aadyakalra/.npm-global/lib/node_modules/truffle
node ./scripts/postinstall.js

Error: EACCES: permission denied, open ‘/Users/aadyakalra/.config/truffle/config.json’
You don’t have access to this file.

at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Configstore.get all [as all] (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/node_modules/configstore/index.js:31:1)
at new Configstore (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/node_modules/configstore/index.js:25:31)
at Function.getUserConfig (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:171:1)
at Object.__awaiter (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/mnemonics/mnemonic.js:11:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/develop.js:2:22)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.defineProperty.value (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/index.js:9:12)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:83:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/commands.bundled.js:89:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.module.exports (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/external "./commands.bundled.js":1:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.module.exports (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/cli.js:37:19)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:83:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js:89:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

Error: Error while attempting to download and cache solc 0.5.16: Command failed: node ./build/cli.bundled.js obtain --solc=0.5.16
Error: EACCES: permission denied, open ‘/Users/aadyakalra/.config/truffle/config.json’
You don’t have access to this file.

at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Configstore.get all [as all] (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/node_modules/configstore/index.js:31:1)
at new Configstore (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/node_modules/configstore/index.js:25:31)
at Function.getUserConfig (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:171:1)
at Object.__awaiter (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/mnemonics/mnemonic.js:11:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/develop.js:2:22)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.defineProperty.value (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/index.js:9:12)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:83:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/commands.bundled.js:89:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.module.exports (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/external "./commands.bundled.js":1:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.module.exports (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/cli.js:37:19)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:83:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js:89:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

at postinstallObtain (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/scripts/postinstall.js:13:11)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/scripts/postinstall.js:20:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
  • [email protected]
    added 144 packages from 66 contributors in 18.866s
    aadyakalra@Aadyas-MacBook-Air ~ %

Then i rebooted and ran truffle init again :

as per the below :slight_smile:

I did exactly as per the above instructions

Now its showing the following message:

Last login: Thu Dec 10 21:01:46 on ttys000

aadyakalra@Aadyas-MacBook-Air ~ % truffle init

zsh: command not found: truffle

aadyakalra@Aadyas-MacBook-Air ~ % cd /Users/aadyakalra/Documents/ethereum-course-advanced/Helloworld

aadyakalra@Aadyas-MacBook-Air Helloworld % truffle init

zsh: command not found: truffle

so you see i am doing exactly as you advised me, but its not working

Please suggest

Also,

Hello @dan-i, @gabba, @filip

Please see the trailing messages. I really need to resolve this as today is the third day and i am unable to continue with my Course because of this Rare Technical issue.

I have been waiting since yesterday for a response.

If you will see from the above message at Terminal after running all commands exactly as per the Instructions of @dan-i , that i am still not able to initiate Truffle.
it gives the below message:

npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
/Users/aadyakalra/.npm-global/bin/truffle -> /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js

so when i click on this link (https://github.com/visionmedia/debug/issues/797)
i am directed to the below page. Unfortunately i am not so technical to really understand what exactly are the next steps to be taken now.

Kindly see below : :point_down: and Help

Hello. You’re probably here from the deprecation notice.

tl;dr This is a low-severity regression that was fixed but later re-introduced a while back. You are only affected if you pass un-sanitized, long user input to debug(ns)(...) - specifically, by way of the %o formatter - in Node.js. All other cases are unaffected.

Affected version selector: debug@>=3.2.0 <3.2.7 || >=4 <4.3.1

If you’re still pulling old versions of the package, please nuke your node_modules/npm cache. If you’re still pulling old versions of the package, bring it up with npm - I’ve confirmed everything is released and tagged correctly.

If the latest versions have introduced a bug for you (they shouldn’t), and you’ve confirmed you’ve not accidentally pulled a major version change based on your package.json version selector (e.g. don’t be using debug@* as I won’t support you), then please open a ticket on this repository.

Any questions or comments about the vulnerability itself can be left in this issue . Spam comments will be deleted as I expect this issue to see a lot of traffic.

Several years ago we were alerted to a ReDos vulnerable regex expression that was fixed in f53962e but was accidentally re-introduced in 7116906. The original CVE was assigned identifier CVE-2017-16137. There will not be a formal update nor will there be a second CVE identifier assigned to the regression. Maintainers of advisory databases are free to update the recommended versions to 3.2.7 or 4.3.1 and link to this issue as a regression advisory.

The regression was responsibly disclosed to me by Yaniv Nizry from the CxSCA AppSec team at Checkmarx via email. A fix was issued appx. 1 week ago and the public disclosure was set to go out no sooner than 7 days after that.

NPM has been notified but has not yet responded.

I realize this is a low-severity issue that doesn’t affect many people, but given that debug has >86 million weekly downloads and used (publicly) by >9 million repositories, I wanted to treat this as equally as any other security vulnerability. Apologies if the response seems a bit overdone, but I have learned not to assume how people are using this package because people continually surprise me throughout the years.

Thank you to Yaniv, and thank you, reader, for your patience.

  • Josh

thanks and regards

suveett kalra

I went to youtube to see if I can get a better understanding of truffle and the first video I click on is by @filip :smile:

1 Like

Hello, I am on Windows. I installed Truffle and Ganache then restarted my pc but when I run truffle init I get the following error (image below).

I tried the following which solved the error

1 Like

Check your DM, I want to troubleshoot this one in chat with you :slight_smile:

Have a nice day

su.kal crypto #5233

This is my Username on Discord.

I have sent you a Request on discord, Kindly accept and let’s take it over after 5 minutes … I will have my laptop ready. Also, let me know if you need some App like Teamviewer installed so you can have access to my Mac.
Cheers

Suveett Kalra

Hey @dan-i, Kindly lets make it now because i have a meeting plugged at 4 pm Indian standard time (thats 45 minutes from now), so it will be great to resolve it right now.

Thanks and Regards

Suveett kalra

In the console when I call getMessage() I get the message but when I call setMessage() I get this error. How to solve this ?

Also I get this error. What’s this error about?

For the community, that was a bug with Truffle.

Fixed with these steps:

  1. run npm init and make a new npm project
  2. run npm i truffle
  3. run ./node_modules/.bin/truffle init and it should work!

Source: https://stackoverflow.com/questions/38148521/truffle-command-not-found-after-installation

Hey @oneworldcoder

From your screenshot it seems like you don’t have a function setMessage.

Screenshot 2020-12-14 at 11.39.30

Can you share your contract?

1 Like

Hi @dan-i

pragma solidity 0.5.12;

contract Helloworld {
  string message = "Hello World!";

  function getMessage() public view returns (string memory) {
    return message;
  }
  function setMessage(string memory newMessage) public {
    message = newMessage;
  }
}                                                       

In the console type:

let i = await HelloWorld.deployed()

then

i.setMessage("new message")

If that does not work

console.log(i)

and send me the screenshot

1 Like

Hi @dan-i

It worked! Please can you tell me what went wrong the first time?

Thank you

1 Like