So you want to code a blockchain, but you're using Windows and don’t have a Mac or Linux System? No problem, you've come to the right place.
The following is a simple guide to installing Ignite on Windows subsystem for Linux.
To use Ignite, you'll need 1. Ubuntu (Linux), 2. Golang Version +19, and 3. Several Dependencies. Let's get started:
Locate the App Store and type "Ubuntu" in the search bar. Any of the LTS versions should work fine, but for this tutorial we'll be using version 22.04.3 LTS as pictured below, click "Get."
Once the app has finished downloading, go ahead and launch it.
It will automatically open a terminal command prompt and begin the installation.
For "Username," I simply put "ubuntu."
For "Password," make sure to write it down in a safe spot as it's hard to reset the password.
After logging in, you should see a command prompt with your username and the name of your desktop machine. Note: this is a user account and not "root." Root is the default admin for linux/ubuntu systems, but you can access its powers with the sudo command, short for "super user do."
Let's go ahead and update our installation with these dependencies below. In my experience, all of these become necessary at one point or another, so I recommend installing them all now.
sudo apt update -y
sudo apt install build-essential -y
sudo apt install gcc -y
sudo apt install wget -y
sudo apt install curl -y
Great! Now we have an updated version of Linux called Ubuntu installed. We're now ready to install Golang, which is required to run Ignite.
You can download and install Golang on your WSL subsystem with these commands:
#On Linux
sudo wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz
#unpack it
sudo tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz
We need to update our environment variables so our system knows where to find our Golang installation.
From your home directory:
ls -a
You should see a file called .bashrc. Open it with this command:
nano .bashrc
Then copy and paste these lines of code below. Close the file with Control+X and press Y to save it.
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
export PATH=$PATH:~/go/bin
source ~/.bashrc
go version
You can download and install Ignite with this command:
curl https://get.ignite.com/cli | bash
If Ignite is not automatically placed in your /usr/local/bin folder, you can move it there with this command:
sudo mv ignite /usr/local/bin
We can check to see if Ignite was installed properly with this command:
ignite version
This will show you an available list of commands for Ignite.
ignite --help
Now that we have Ignite installed, let's go ahead and build a simple testchain.
ignite scaffold chain testchain
To launch our testchain, we change our current working directory to the testchain folder, then we can launch the chain with one Ignite command as follows:
cd testchain
ignite chain serve
There you have it; you have sucessfully installed Linux/Ubuntu on your Windows Machine, installed Ingite on your system, and used it to create a blockchain!
Please check out our socials and reach out to us on Discord to let us know what you want to build. We're here to help!
Our Official Discord Server:
https://discord.com/invite/ignite
Ignite CLI Docs:
https://docs.ignite.com/
Official Ignite GitHub:
https://github.com/ignite/cli
Twitter/X:
https://twitter.com/ignite_com