Truffle Introduction

Ah OK, so I would have learned about “await” and “let instance” and such in the javascript course?

Surething.

let / var are used to declare a variable in Javascript.
Await is for async functions, you learn those in the JS course

Cheers,
Dani

1 Like

OK, understood, thanks.

For some reason I’m not getting the colored text in Atom. Anyone know how to fix this?

Never mind. I didn’t have the language installed in Atom.

1 Like

@FIlip. I cant find my console.log messages in truffle. Im running truffle on a Mac, does this matter?
Does it have something to do with Mocha?

Screen Shot 2020-10-10 at 2.01.36 PM

Is anybody else having problems with Ganache showing a blank window after clicking on a contract?

When this happens, there’s nothing else you can do but close Ganache.

Hello @ajphminer, hope you are great.

Please provide more data, which OS are you using? the code of your contract…

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

Carlos Z.

Hey @Nicksta

you should be able to console.log, can you please send me your code?

Happy learning,
Dani

1 Like

I downgraded my Truffle version and now I’m getting a message. I was working with the latest version and that seems to not work for me.

Hi,

I found the solution with some Google searching to not use the QuickStart of Ganache.

Thanks!

1 Like

Hey guys

My problem is that the Helloworld contract can not be deployed

I´ve done what @filip said and now I am stuck.

deploy

I need your help please.

1 Like

Hey @Altcoinproof

In the migration file, because you are calling the constant Migrations you have then to deployer.deploy(Migrations)

happy coding,
Dani

2 Likes

Hello Ivan on Tech Team!

For me everything seems to work correctly so far, however I was wondering is there (or will there be) some new course with the latest versions of solidity/truffle etc. since for 1 years I assume lots of things have changed?

Hi @filip!
I keep getting an error message after entering “migrate” command from the truffle console (the 4th lesson “Setter Function”). It says:
ExtendableError: Unknown network “ganache”. See your Truffle configuration file for available networks.
at Object.validateNetworkConfig (/usr/lib/node_modules/truffle/build/webpack:/packages/environment/environment.js:110:1)
at Object.detect (/usr/lib/node_modules/truffle/build/webpack:/packages/environment/environment.js:16:1)
at /usr/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:206:1

2 Likes

contract(‘People’, async function(accounts){
let instance;
before(async function(){
instance = await People.deployed();
});
it(‘Owner balance increase’, async function(){
let instance = await People.new();
let balanceBefore = await web3.eth.getBalance(accounts[0]);
await instance.createPerson(‘Luli’, 14, 170, {value: web3.utils.toWei(“1”, “ether”), from: accounts[2]});
let transfer = await instance.withdrawAll();
let balanceAfter = balanceBefore + parseFloat(transfer);
assert(balanceBefore < balanceAfter, ‘not increased’);
})
it(‘Owner only with draw the money’, async function(){
let owner = accounts[0];
await truffleAssert.passes(instance.withdrawAll({from: owner}), truffleAssert.ErrorType.REVERT );
})
it(‘balance reset’, async function(){
let instance = await People.new();
await instance.createPerson(‘Luli’, 14, 170, {value: web3.utils.toWei(“1”, “ether”), from: accounts[2]});
await instance.withdrawAll();
let balance = parseFloat(await instance.balance());
let realBalance = await web3.eth.getBalance(instance.address);
assert(balance == realBalance && balance == 0, ‘Balance is not reseted’)
})
})
}

1 Like

Thank you a lot for your help @dan-i

1 Like

Hey @RKumovski

I cannot tell at the moment if the courses will be updated, but I can tell that Sol 0.5 is perfect to learn, some things have changed in Sol 0.6 and 0.7 but nothing critical.

Happy learning,
Dani

1 Like

Hey @Michael_S1

It seems like you’re not running a local blockchain or your truffle config is not correctly set.
Proceed as follow:

Run your local blockchain: truffle develop
Once done: truffle migrate --reset

Happy learning,
Dani

1 Like

Thanks. But that’s not what was in the video lesson. There Filip works with ganache network. https://i.imgur.com/6HGX6Ix.png
Looks like I’m missing something…

1 Like