This repository is part of GNS ecosystem.
It provides infrastructure component for the providers, that allows NAT traversing [todo: add link to specs] for some categories of mobile users.
- Public IPv4 address (IPv6 is also planned) if you plan to provide world-wide available service;
- Redis server or redis cluster, if you plan to deploy multiple instances;
- python 3.6+ (see requirements.txt)
cd <target directory>
git clone https://github.com/GEO-Protocol/gns_provider_centrifuge.git ./
virtualenv -p /usr/bin/python3.5 venv
source venv/bin/activate
- [optional]
pip install pip --upgrade
pip install -r requirements.txt
- Edit
conf.json
according to your environment. (nano conf.json
) - Run centrifuge
python server.py
{
"asserts": true,
"debug": false,
"host": "0.0.0.0",
"port": 9000,
"redis": {
"host": "127.0.0.1",
"port": 6379,
"db": 0
},
"use_centrifuge": true
}
It is recommended to run the server as a systemd
service to automatically reload it in case of any failure.
[Unit]
Description=GNS Centrifuge Instance
After=network.target
StartLimitBurst=5
StartLimitIntervalSec=10
[Service]
Type=simple
Restart=always
RestartSec=5
User=<user>
ExecStart=/<___destination dir___>/venv/bin/python /<___destination dir___>/server.py
WorkingDirectory=/<___destination dir___>/