In this article we cover how to install Nodemon on Windows. Please note there are a few requirements:
You must have Python 3 installed.
You should have git installed (https://git-scm.com/download/win)
You must have a node running locally in order to get layer data (for now)
If you run into issues please join my Discord, post a comment here, or DM me on Discord. Or try ChatGPT or a bit of Googling. I will help as much as I can but I’m not always available.
The first thing you want to do is create a folder where you want to install Nodemon. I’m a Windows noob so I usually just create the folder in the GUI and then open a terminal in that location. To do this, simply create a folder where you want Nodemon to be installed. The right click, and then click ‘open in terminal’.
You should now see something like this:
Now you can clone the git repo located here: https://github.com/hakehardware/nodemon using the following command to clone it to your current folder:
git clone https://github.com/hakehardware/nodemon.git .
Don’t forget the dot at the end, that allows it to clone to the current directory. Once it’s done cloning, the next thing we will do is create the config file. An example is provided, but you will need to add your own data inside it. First lets copy the example to a new file called ‘config.json’
cp .\example.config.json config.json
Now you can open up the config file by either opening up the folder in your file browser, or simply type the following into your terminal:
.\config.json
This should bring up notepad. When editing the config you need to be very careful to ensure it’s in JSON format. JSON is very picky about commas, quotation marks, and brackets. Try and make sure you follow the format exactly. I’ve highlighted some common error points in the image below:
Make sure after each node (except the last one) there is a comma.
As mentioned above, the last node does not have a trailing comma.
Make sure the last bracket doesn’t get left off or deleted
Always make sure there is a starting and ending quotation mark.
As in the example above, you can add more nodes by simply copy and pasting a section under “nodes”. Make sure that you are using the correct ports and IP address. If your nodes are not on your localhost, you will need to make sure you put in the correct IP address. For more complex network setups things can be a bit more difficult, but for most setups as long as your IP and port is correct it will work fine. Then update the ‘name’ field to whatever you want to call your node.
Finally, after the nodes goes your state file. This is the path to your state file. You should really only need to update the “Example” part to reflect your own username. However the goal here is to just point the script to a state.sql file. It only needs one state.sql file, so if you have multiple nodes, just adding in a single state file works.
The last thing we need to do is set up a virtual environment. There are a load of reasons why you would want to do this, I’m not going to go over them here. Either create one or don’t :) But if you choose correctly here is how to do it:
You should just be able to run
python -m pip install --user virtualenv
Then to create a virtual environment all you have to do is run:
python -m venv env
What this does is create a virtual environment at the location ‘.venv’ which will be a hidden folder in your directory. But don’t worry it’s there even if you cant see it.
To activate your virtual environment, run:
.\env\Scripts\activate
At this point you should see something like this:
Now its time for dependencies. We can install the requirements with pip using the following command:
pip install -r .\requirements.txt
When I tried to run this I got an error saying I needed to download Microsoft Visual 14.0 or greater and that the following packages failed to build: aiohttp frozenlist grpcio multidict yarl. Honestly it was a huge mess. I couldn’t figure it out so what I did was install everything manually, for the following packages run the command below and replace <package> with the package name:
pip install <package>
These are packages:
requests, protobuf, grpcio, bech32, python-dateutil, textual
Alright with those installed we can FINALLY run the application
python app.py
The most common issues people have are with the IP addresses and ports, as well as with properly formatting the JSON file. Please make sure to double check everything. If you want some help either DM me on Discord, leave a message here, or join my Discord: Hake Hardware