Truffle Introduction

@filip Hello, I am in need of some assistance.

Atom does not recognize the solidity language. It does not exist as a selectable language and I have tried dowloading languages from atom.io without success. Is it allrigth to continue on for example the javascript language (meaning the language is solely for esthetic purposes)?

thank you.

Screenshot 2020-11-10 103148

You need to install solidity syntax for Atom: https://atom.io/packages/language-solidity

happy coding,
Dani

1 Like

Please send a screenshot of your terminal with the commands you are using.

Hello dan-i,

I followed your link but it was the same one that I have tried downloading the language from. When I click download nothing happens and I have reinstalled atom several times now. Would be glad if you knew a solution to this!

thank you

1 Like

I found the solution, you just had to dig a little deeper on the download site.

Thank you for the help anyway!

1 Like

Being new at programming i am totally lost at the first lesson. The jump from 101 to 201 is very discouraging and I am only stuck because I don’t know how to open files with windows powershell.

I really can’t find the solution, I am still lost I need help with installing Truffle with windows 10. I keep following tutorials and i keep watching the video. I am in a trap of not knowing what to do everybody has a different method and none work.

Hi @dan-i

When I do the “truffle comple”, it returns with an error on solc version.
How can I change this to the correctly version?

I am using Atom, Powershell, Genache and truffle is installed.


solidity2

1 Like

Hey @MichaelB

There is a typo in your contract, truffle 0.5.42 does not exist.
Once fixed that one, in order to change the truffle version used to migrating the project you have to:

  • Open your file truffle-config.js
    Scroll to the bottom of it
  • You will see something like:
  compilers: {
    solc: {
      // version: "0.5.12",    // Fetch exact version from solc-bin (default: truffle's version)
      // docker: true,        // Use "0.5.1" you've installed locally with docker (default: false)
      // settings: {          // See the solidity docs for advice about optimization and evmVersion
      //  optimizer: {
      //    enabled: false,
      //    runs: 200
      //  },
      //  evmVersion: "byzantium"
      // }
    }
  }

Uncomment version: "0.5.12" and change it to your version :slight_smile:

Cheers,
Dani

1 Like

Hey @kryptokrymmenos

Please open Powershell and type truffle -version.
Once done post a screenshot of the result.

No need to worry we are here to help :slight_smile:

Let me know and feel free to dm me if you prefer.

Happy learning,
Dani

1 Like

Thank you Dani, I’ll try to do this asap but will be busy the next couple days.

This is the error I am receiving.

1 Like

@kryptokrymmenos

I would adivse to sudo for mac and linux user, in your case please try to run the Powershell as admin.
Right click on the PowerShell icon > run as administrator.

Then truffle init

let me know

@dan-i finally, I removed truffle, then I installed the version recommended by filip, but ganache 2.1.1 doesnt work for me (the appimage file doesnt work) so im using ganache 2.5.4, and it worked fine.

But I have a doubt. How come that you can pass more arguments that the function setMessage has (because in the setMessage you pass a strirng and a JS object?? is that a javascript thing or a truffle thing? I remember filip mentioning that you can review more in truffle documentation about that. Could you point me in the right direction?

And other thing, the value of the 1.000.000 wei that is passed on to the setMessage function from accounts[0] address, where does it go? its like you need to pay to use the setMessage function? and if this is so, does the 1.000.000 wei goes to the miner who mines the Tx? or does it go to the contract Helloworld? Im a little confused, I finished the Ethereum programming 101 aorund 1.5 months ago

This is the error i am getting now.

1 Like

Hey @kryptokrymmenos, hope you are good.

You are trying to initialize truffle on the wrong folder, you should initialize it on the same folder where you have your contracts.

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

2 Likes

Thanks @dan-i

Can you please advise which version of solidity, truffle and solc I should use?
I have a hard time to find which versions match with other software-versions.

Truffle version: 5.0.42
Solidity version: ?
Solc version: ?

Hi Guys,

I copied the code from @filip github, but when I change the sent value to 1 eth (as shown below), save, and “migrate --reset”, I still get the revert error! Any idea why this is so? The error persists no matter what value I enter in the after the semicolon :sob:

Thanks!

const Helloworld = artifacts.require("Helloworld");

module.exports = function(deployer, network, accounts){
  deployer.deploy(Helloworld).then(function(instance){
      instance.setMessage("Hello Again!", {value: 1 ether, from: accounts[0]}).then(function(){
        console.log("Success");
      }).catch(function(err){
        console.log("error: " + err);
      });
  }).catch(function(err){
    console.log("Deploy failed " + err);
  });
};
1 Like

Hey @calvalini, hope you are good.

If you are getting a revert error, that is a require statement in the function that is being activated because of its condition.

Could you please share the solidity code so we can help you review it?

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!”

}

prefromatted_text-animated

Carlos Z.

Hi @thecil

I appreciate the response. I found out in the later videos that there’s different format for entering amount denoted in eth, specifically “web3.utils.toWei” function needs to used. Now I know not to make this mistake. I appreciate you reaching out! :+1:

3 Likes