In this tutorial, you will learn how to install a local EOS node on Windows using the Windows Subsytem for Linux

Prerequisite:

Optional Prerequisite:

Level of Difficulty: Intermediate

Estimate Time to Complete Tutorial: 180 mins

Environmental Setup

  1. Create you workspace
    1. You can create your workspace in Windows Explorer: C:\Workspace\EOSIO
    2. Or directly in WSL bash: mkdir /mnt/c/Workspaces/EOSIO
  2. Start you WSL bash (either via the icon or directly from powershell)
  3. Navigate to you workspace
    1. cd /mnt/c/Workspaces/EOSIO
  4. Export your environmental variables
    1. export WORKSPACE_DIR=/mnt/c/Workspaces/EOSIO
    2. export EOSIO_INSTALL_DIR=${WORKSPACE_DIR}/eos
    3. export EOS_PROGRAMS=${EOSIO_INSTALL_DIR}/build/programs
    4. export TEMP_DIR=/tmp
  5. Save system variables to ~/bashrc for later use
    1. echo "export WORKSPACE_DIR=${WORKSPACE_DIR}" >> ~/.bashrc
    2. echo "export EOSIO_INSTALL_DIR=${EOSIO_INSTALL_DIR}" >> ~/.bashrc
    3. echo "export EOS_PROGRAMS=${EOS_PROGRAMS}" >> ~/.bashrc
      1. sudo apt install cmake
      2. sudo apt install gitInstall cmake and git
        1. *Note: it is most likely that git is already installed on you distro by default. If you are unsure then run the command anyways

Clone Repo

  1. Navigate to your workspace
    1. cd ${WORKSPACE_DIR}
  2. Clone the repo
    1. git clone https://github.com/EOSIO/eos --recursive

 

Build and Test EOS

  1. Navigate to the EOS Install Dir:
    1. cd ${EOSIO_INSTALL_DIR}
  2. Build EOS
    1. ./eosio_build.sh
  3. Test EOS build
    1. export PATH=${HOME}/opt/mongodb/bin:$PATH
    2. /home/mmoetia/opt/mongodb/bin/mongod -f /home/mmoetia/opt/mongodb/mongod.conf &
    3. cd /mnt/c/Workspaces/EOSIO/eos/build; make test

 

Install EOS

  1. Navigate to the EOS Install Dir:
    1. cd ${EOSIO_INSTALL_DIR}
  2. Install EOS
    1. sudo ./eosio_install.sh

 

Run a Node

  1. *Optional: If you want eos node to keep running even after you close the console the bash window, open a linux screen by typing the following command:
    1. screen –S eos
  2. Navigate to the EOS nodeos Dir
    1. cd ${EOS_PROGRAMS}/nodeos
  3. Start nodeos default
    1. ./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --http-server-address 192.168.1.99:8888
  4. Advance nodeos start
    1. Modfiy the config.ini file
      1. %localappdata%\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\home\mmoetia\.local\share\eosio\nodeos\config\config.ini.
      2. Update/Add the following settings:
        1. # Enable production on a stale chain, since a single-node test chain is pretty much always stale
          enable-stale-production = true
          # Enable block production with the testnet producers
          producer-name = eosio
          # Load the block producer plugin, so you can produce blocks
          plugin = eosio::producer_plugin
          # As well as API and HTTP plugins
          plugin = eosio::chain_api_plugin
          plugin = eosio::http_plugin
          # This will be used by the validation step below, to view history
          plugin = eosio::history_api_plugin
    2. Start nodeos:
      1. ./nodeos

Test HTTP Connection

  1. Once your local test node is up and running you can connect to it via a web browser to test the HTTP connection:
    1. http://127.0.0.1:8888/v1/chain/get_info
      1. *Note: Replace the IP with your HTTP binding IP

 

Conclusion

You should now have a local EOS node running on your windows machine via WSL bash.

Next steps is to start writing smart contracts and deploying them to your test node