Setting up your Environment
Written by Thomas Tumiel
Why is this Important:Setting up the tools to effectively code can take some time. Here we look at some of the best tools available and recommend you to choose one and get proficient at it. Don't get caught in this stage.
Time to read: 15 minutes
Code development is as simple as opening a plain text editing program and writing code. There doesn’t have to be anything fancy to it. However, often the use of additional tools improves workflow, code readability and code correctness. In this section we explore some of the tools commonly used in blockchain and machine learning development.
If you’d rather just read one of the sections, you can jump to it here:
As mentioned before, writing code is as simple as opening up a plain text editor and beginning. But it can be easier. Here, we’ll recommend some tools to try out to get you started programming.
There is a lot of competition amongst code editors. And I won’t say that any one of them is the best. The main thing, however, is to pick one and get good at it. Know the shortcuts, know the tricks. And then it doesn’t really matter which one you end up using. If you’re not sure or don’t feel like really investigating all of them, download VS Code and move on.
If you went through our previous Git tutorial you’ll see that we don’t even mention that there are other version control software. It’s recommended to stick with Git for now.
There is a small hitch though - Git doesn’t always play nice with Windows so if you are on Windows, try use Git Bash which you can choose to install when you install Git.
This section will focus on developing on the Ethereum platform.
Developing on Ethereum
The blockchain development landscape is rapidly evolving and new tools are constantly coming out and old ones are being updated. However, this is often not nearly as fast as Ethereum is being updated and changed. A common choice to develop smart contracts, is to use the in-browser IDE, Remix, developed by the Ethereum team. It is probably the most useful and up to date development environment you’ll find. And fairly easy when you get the hang of it.
NodeJS and NPM
Testing on Ethereum would be very expensive if you had to pay every time you had to update your code. To avoid this problem (and many others introduced by an asynchronous, global database) developers created local blockchains which you can spend all the Eth you want. The recommended choice is Ganache, a GUI based Ethereum emulator.
Machine Learning Tools
Most cutting edge machine learning is done using Python. Python is an easy to use but powerful programming language that has a large community and many Stack Overflow answers. In this section we will focus on how to use Python for ML.
The best way to get Python for machine learning is actually not to download it from their site. Rather use a Python package manager called Anaconda that does a lot of the hard work and nitty gritty of getting things to work. It also comes preinstalled with a lot of the packages that you will need, saving you a lot of time.
After installing Anaconda, you can use a beautiful interactive “notebook” that can run code and hold notes. From your terminal run
jupyter notebook to launch Jupyter. This is where you can rapidly prototype ideas using Python. For a longer tutorial on Jupyter, see a general tutorial or an intro to Python with Jupyter.
Install Tensorflow and PyTorch
The most commonly used frameworks for machine learning are PyTorch and Tensorflow. We won’t get into how to use them in this tutorial or even what they do but you can get a taste by following their tutorials: