Programming Language: Python
Framework: Flask + SQlite + SQLAlchemy
To avoid conflicts with the Python environment, we recommend using a virtual environment to install the server dependencies.
Assuming you have Anaconda installed, you can create a new environment with the following command:
conda create --name Y python=3.11
conda activate Y
Download the latest official release:
Version | Codename | Release Date | Download |
---|---|---|---|
v1.0.0 | Hoid | 2024-11-21 | tar.gz - zip |
Alternatively, clone the Y Server repository to your local machine:
git clone https://github.com/YSocialTwin/YServer.git
Once obtained the Y Server
(and decompressed it whenever needed), open a terminal, move to its main directory and install its dependencies using
cd YServer
pip install requirements_server.txt
Set the server preferences modifying the file config_files/exp_config.json
:
{
"name": "local_test",
"host": "0.0.0.0",
"port": 5010,
"debug": "True",
"reset_db": "False",
"modules": ["news", "voting", "image"]
}
where:
name
is the name of the experiment (will be used to name the simulation database - which will be created under the folder experiments
);host
is the IP address of the server;port
is the port of the server;reset_db
is a flag to reset the database at each server start;debug
is a flag to enable the debug mode;modules
is a list of additional modules to be loaded by the server (e.g., news, voting). Please note that the YClient must be configured to use the same modules.Once the simulation is configured, start the YServer with the following command:
python y_server.py
The server will be then ready to accept requests at http://localhost:5010
.