How to ICON ($ICX) on a Windows PC
Users / developers may wish to utilise T-Bears on Windows for any number of reasons, however there is no direct support for this. In addition, some steps are missing in the current documentation on icondev.io. Here, we introduce a work-around solution.
Steps:
- Install Windows Subsystem Linux 2 (WSL2) & Windows Terminal (optional)
- Install Visual Studio (VS) Code
- Get extensions in VS code (Remote — WSL)
- Get python (v3.7 preferred)
- Install dependencies (details below)
- Create and activate virtual environment
- Install rewardcalculator & golang
- Install T-Bears
1. Install WSL2
A complete guide to installing WSL2 can be found here. GUI installation is optional.
- Open PowerShell as administrator
- Enable WSL
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- Enable Virtual Machine Platform
Windows 10 (2004)
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Windows 10 (1903, 1909)
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
- Restart your PC (this will show that Windows is updating)
- Set WSL2 as default
wsl — set-default-version 2
- Troubleshoot if not working (refer to)
- https://docs.microsoft.com/en-us/windows/wsl/install-win10
- https://docs.microsoft.com/en-us/windows/wsl/troubleshooting
- Personal experience
- Install a Linux distro from the Microsoft Store
- Ubuntu 20.04 LTS
https://www.microsoft.com/en-gb/p/ubuntu-2004-lts/9n6svws3rx71?activetab=pivot:overviewtab
2. Windows Terminal (optional)
https://www.microsoft.com/en-gb/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab
2. Install Visual Studio (VS) Code
This is a straightforward step. Go to https://code.visualstudio.com/download and install.
3. Get extensions in VS code (Remote — WSL)
Run VS code, and it may pop-up installation suggestions for Remote — WSL. Otherwise, press ctrl + shift + x (extensions search), type in “Remote — WSL” and install. You can also click on the settings button to get access to extensions search.
Press F1 and type “Remote-WSL: New Window”.
A new VS code window will pop up, with bottom left showing “WSL: Ubuntu-20.04”
4. Get python (v3.7 preferred)
In your terminal, type:
sudo apt updatesudo apt upgradewget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgztar xf Python-3.7.9.tgz
5. Install dependencies
We need some prerequisites. In your terminal, type:
sudo apt install build-essential zlib1g-dev \
libncurses5-dev libgdbm-dev libnss3-dev \
libssl-dev libreadline-dev libffi-dev curl
In the python directory, type:
./configuresudo make install
Close and open your terminal again. In your terminal, type:
python3 — version
It should show something like this:
6. Create and activate virtual environment
In your home directory, create a directory — cd into it then type:
python3 -m venv .venv
Activate the venv by typing:
source .venv/bin/activate
7. Install rewardcalculator & golang
In your terminal, type:
git clone --depth 1 --branch 1.2.2 https://github.com/icon-project/rewardcalculator.gitsudo apt-get install golang
In the rewardcalculator folder, type “make”
Now to get the missing binaries, type:
sudo cp -R bin/icon_rc /usr/local/binsudo cp -R bin/rctool /usr/local/bin
8. Install levelDB, RabbitMQ and T-Bears
Install levelDB:
sudo apt-get install libleveldb-dev
Install libSecp256k:
sudo apt-get install libsecp256k1-dev
Install RabbitMQ and start service:
sudo apt-get install rabbitmq-serversudo service rabbitmq-server start
Install tbears:
pip install tbears
Start tbears:
tbears genconftbears start
Try typing this to see if it works:
tbears balance hxe7af5fcfd8dfc67530a01a0e403882687528dfcb
It should show:
And that is all. You are a professional dev now! :)