Getting started with Storj Testnet on Windows
If you want to try it on Linux, you can read this article: https://github.com/storj/storj/wiki/Test-network
In addition, we have an article for freeBSD: Getting started with Storj Testnet on FreeNAS (freeBSD)
See also our docker-compose based setup: https://github.com/storj/up
Install the necessary dependencies
It is recommended to install Notepad++ for easy config file editing.
- Install the latest Go (version 1.22.x or later), the executable can be found here. Documentation for the installation can be found here.
- Install
Msys2
, which can be found here. Please, select thex86_64
package.
Run the MSYS2 MinGW 64-bit program from the Start menu and execute:
Now close the MinGW terminal.
Install NodeJS LTS (Optional)
You can do this in several different ways:
Check the installation
Install VisualStudio 2017 build tools for C++
Install using a Chocolatey:
Install Python
Install using a Chocolatey:
Disable the app execution alias for python installer, because otherwise you will get this error:
Finish setup by restarting the terminal.
Now check the installation:
Confirm dependencies were installed correctly
Start a PowerShell or cmd terminal and execute:
Please restart your terminal to apply the changes.
You should now be able to execute the following commands, please note that for each command a version number should be returned:
Storj installation and setup instructions
Compile Storj from Source
To compile Storj from main, please execute the following commands:
If you want to have access to the storagenodes' web dashboards and to the satellite's web dashboard, you need NodeJS LTS, VisualStudio BuildTools C++ and Python installed (see optional steps above) and compile the web UIs (PowerShell):
Install the REDIS binaries
We should have the redis server set up locally.
Download the pre-build redis binary with libraries or build your own: https://github.com/meiry/redis5_compiled_for_windows10 or https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip
Unpack the archive and copy the binary and needed libraries to %USERPROFILE%\go\bin
Run PostgreSQL
We can install PostgreSQL either locally, in the WSL, or in a Docker container. In this example, we will create a teststorj
DB and will use the database user postgres
.
Run PostgreSQL in a Docker container
The easiest way is to run it in a Docker container, but it requires Docker installed.
In a new terminal, create the teststorj database:
To run your own queries in the PostgreSQL, you can use the following command to open an interactive terminal:
Install PostgreSQL in the WSL
If you have a WSL enabled, then you can install PostgreSQL in the Ubuntu shell.
To create the teststorj
database for the satellite:
You should get a prompt postgres=#
, execute this SQL command:
Then exit from the postgres shell by executing the command \q
.
To run your own queries in PostgreSQL you can use these command to open an interactive terminal:
Enable access for postgres user by host
Edit /etc/postgresql/12/main/pg_hba.conf
:
Add this line above all lines that start with host:
Save the configuration file and restart the PostgreSQL:
Install the native PostgreSQL locally
https://www.postgresql.org/download/
https://www.postgresql.org/docs/current/tutorial-install.html
Setup a local Storj Network
First we have to make sure we are able to call the compiled Storj binaries. To do so, please execute the following on the command line in cmd.exe
:
Now restart the terminal and execute the following:
At the moment it's assigning ports as follows:
- Gateways start from port
11000
- Version control is at port
12000
- Bootstrap server is at port
13000
- Satellites start from port
10000
- Satellite Console starts on port
10002
- Storage Nodes public ports start from port
14000
- Storage Nodes private ports start from port
14001
- Storage Nodes web dashboard start from port
13002
,13012
,13022
, ...,13092
Getting environment variables for the Local test network
Setup the uplink
In Powershell:
If the command throws an error such as
Then stop storj-sim (Ctrl-C) and run it back (storj-sim network run
). After that, the configuration of uplink should work.
More info you can read at https://github.com/storj/storj/wiki/Test-network
Up- and Download Files
You can read more about Uplink CLI.
S3 Gateway
The S3 gateway, which also is being run by storj-sim
, allows users to quickly and easily upload files to the Storj network through a S3 gateway (Minio). Furthermore, this gateway is accessible via localhost in the browser.
Copy your S3 keys from the Getting environment variables for the Local test network of storj-sim
and configure the AWS CLI:
Here are the commands to make a bucket, upload the file, make an external link for sharing:
You can configure your AWS CLI to include an endpoint URL to the config: Define an endpoint with AWS CLI.
S3 gateway video streaming
Video streaming is possible with the S3 endpoint by executing the following command:
After the last command you will get an URL to your video file, which you can open in your browser or VLC player.
You can read more about S3 Gateway.
Relevant directories on Windows
To revert the entire installation, deleting the directories above will do the trick.