Hosting guide
This tutorial will guide you through the process of self-hosting Polygon
Before starting
Make sure you have the following tools installed on your local machine.
Important: This guide will fail if any of these tools is missing
- Git - For cloning the source code
- Python - For running Python scripts
- Docker - For containerizing Redis and PostgreSQL
- Node.js and Yarn - For building, executing and running Polygon
- Make for Linux or Make for Windows - For executing complex tasks with a single command
After you are done installing all of these, make sure that everything is installed correctly by executing this command in your terminal
make check-tools
After making sure that all the versions display correctly, we can proceed further.
Building Polygon from the source
To build Polygon from the source you will need to run the following command from your terminal
make
Firstly, the script will start to concurrently clone the front-end and core repositories to your machine from GitHub.
Secondly, it will start installing the dependencies and building the source. Then a script will try to spawn 2 Docker containers(Redis and PostgreSQL).
Finally, you will be prompted to enter the values for the required environment variables of both projects. The script will write a .env
file to each folder(core/
and fronteend/
) automatically.