Truffle Introduction

Welcome to the forum discussion for this section. Here you can ask questions or post feedback.

I lost a bit the answer about I think a quit basic question about what to bring in the air in a life situation in the end? We are doing things on our local computer now, install truffle to deploy contracts and having a local blockchain with Ganache. Suppose we have something working. Whats the next step to getting a complete DAPP in the air.? Do you need a hosting with a complete Ethereum node or can we make use of the Ethereum blockchain which is running by others and is it possible to just use the web3 modul as interface? What’s the idea in the end?

You will be using both. We will be using the local ethereum blockchain for development purposes. Then I will show you how to deploy code to the ethereum testnet. Which is a real blockchain.

We always want to use a local ethereum blockchain for development. Because a transaction on the real ethereum blockchain costs money + takes a lot of time to get confirmed. So development and testing would take forever.

Follow along in the course and you will get it.

Hello.
I got some issues on a fresh installed windows 10 machine. After windows installation I tried to setup my truffle dev environment like before. VS Code, NodeJS, Truffle, Ganache.

I think it is more a Windows kind of question but maybe @filip or someone else, can help me anyway?
It looks like that my windows does not allow scripts.


With this link I should get more information about the execution policy: https:/go.microsoft.com/fwlink/?LinkID=135170
Here are my settings:
image
The settings are the same like on my second windows machine where I have no issues to run truffle. So it does not look like these settings are the problem.
Nevertheless, truffle is working fine after changing the execution policy to unrestricted, which is not recommended so far I understood.

I would like to avoid to make changes in in the execution policy of windows. :grimacing: Any suggestions?

Hey everyone, ran into a couple of common Truffle issues so I thought I would document them here in case anyone else hits them - these usually occur for me when I leave Ganache running for awhile with no activity and then try a migrate --reset:

  1. “Migrations” – Returned error: ENOENT: no such file or directory
    FIX - rmdir build (delete the build folder in your project), recompile
  2. Something went wrong while attempting to connect to the network. Check your network configuration
    FIX A) Make sure your truffle-config.js has the networks development block uncommented and the port matches your local Ganache port (see Filip’s example in the video).
    FIX B) (COMMON) Ganache errored out, restart Ganache.

cheers

2 Likes

Hi. i had the same problem in Power shell, but it worked fine when I tried to use Cmder instead.
Here is a link to Cmder:
https://cmder.net/

Good luck…
Ivo

2 Likes

The solutions I’ve seen has been to set the execution policy like you did. But maybe there is other software you can use like @ivga80 said. I’m not a windows expert unfortunately.

1 Like

All right thanks you anyway. I finally set it to “remoteSigned”. But it is still a phenomen for my, why scripts are running on my laptop where the settings are set to “restricted”. No matter, it is working now on both machines.

1 Like

Hi everyone
I also had problems with init truffle with “power shell”.
however, it worked when I init it using the CMD prompt.
Filip - is it fine? (as you warned not to do so in the video).

1 Like

Hi Filip,
It is not clear to me what migrate --reset is. Is it for running all the migrations from the beginning?

Thanks

1 Like

Hi @Guy.
I use migrate --reset to recompile the contracts after editing. I also use --reset if i get some errors when i`m building my code or testing… Think of it as a reset button… it resets the contract to a new state so you can start over again. :wink:

From the documentation:

If no new migrations exists, truffle migrate won’t perform any action at all. You can use the –reset option to run all your migrations from the beginning. For local testing make sure to have a test blockchain such as Ganache installed and running before executing migrate .

You can read more about it here.

I hope that helps you, buddy… :grinning:
Ivo

1 Like

The cmd is fine, but the syntax for the commands is a little bit different than on mac and linux. So you might have to lookup commands for navigating between folders or creating folders and so on.

I’ve had great success with Truffle using Windows Subsystem for Linux (WSL) under Ubuntu inside anything North of Windows 10 Creator Edition. That’s become the Windows “native”…um…“un-native”. It doesn’t solve the mountain of data privacy issues that Microsoft Windows is built out of. But it does sidestep having to learn .Net to use PowerShell. Its actually a pretty awesome setup, less than 5 buttons to install, and half-redeems Windows 10 per we olde’-timer graybeards. Microsoft tools like VS Code half-expect to find it. Just be careful to synch up your Windows and Linux user names when you install it. You get nasty permissions problems if you don’t.

And yes, I’m running the Windows-native Ganache executable and a Linux-native nodeJS truffle in the Ubuntu tsch shell simultaneously on the same machine and they hook up just fine with zero extra configuration steps, no VM, no Docker, no emulator, everything at native speeds.

On a tablet, with Thortspace and Brave Browser all going at once.

I don’t understand why anybody would bother with PowerShell. It’s just DOS on meth. It’s so clumsy it drops half the process ID’s I ask it for during filtering. Most the process its grinding up is its stupid security paranoia, just like the rest of Windows 10. 90% of PowerShell’s resource usage is completely off-task of what I ask it for. It’s really is just an artificial meth addict.

#PowerShellSucks #GetARealShell

3 Likes

So I’m slogging through this section and finished scribbling down some notes for Lesson 3:

But then the “Mark as Complete” button…just loops me back to the same screen and won’t engage. I had a quick look at hacking its JS as I was able to do on the old platform. But the new service seems to have some hash key lock on the buttons that looks problematic. Anyone else getting the run-around from Lesson 3? Or is hacking that button the lesson’s test?

I’m on Windows 10 running Brave Browser and disengaging uBlockOrigin does not fix the button.

Obliviously I’m moving on to the next lesson while I wait. But the certificate won’t issue at the end if this box isn’t properly ticked.

Hi Ivo .Thanks. very helpfull. :slight_smile:

More info: the Kajabi ap works fine for ticking these lessons off. But Kajabi does not sync back to the website, which remains unticked. I think in the end I can receive the certificate through Kajabi when I’m done.

I use the same setup :smiley: and love it. It’s really flexible. I use it for many projects and it has become my favorite “editor”. Also had great experience with other plugins for docker, angular and python.

Easy Setup:
Install WSL - https://docs.microsoft.com/en-us/windows/wsl/install-win10
Download VS code - https://code.visualstudio.com/docs/?dv=win
Quick Intro how it works - https://code.visualstudio.com/docs/remote/wsl

PS: i dont work for microsoft :sweat_smile:

2 Likes

So the button doesn’t work? Is that is?

I tried the same thing in brave and it works for me. So that’s weird. We have thousands of people “completing” lectures every day, so it works for most people. Have you tried another browser?

Hello,

Just a basic question. How do you get Solidity syntax highlighting on the Atom text editor?

Found this when I searched for it

Is this the way to do it?

Thanks,

Yeah that should work. There are a few plugins that will give you that in atom. Try it!