Skip to main content

Realnet server

Project description

realnet-server

How to run on linux using pip (deployed version)

  • Create a folder and go to it.
mkdir realnet-server
cd realnet-server
  • The realnet-server will need a database to connect to. Instructions for how to create a local db will be included at the end.
  • In the repo root folder create an .env file with the following content:
REALNET_SERVER_HOST='0.0.0.0'
REALNET_SERVER_PORT='8080'
REALNET_DB_USER='realnet'
REALNET_DB_HOST='localhost'
REALNET_DB_PASS='Q1w35rr!423421345fdsfgs'
REALNET_DB_PORT='5432'
REALNET_DB_NAME='realnet'
REALNET_STORAGE_TYPE='s3'
REALNET_STORAGE_PATH='\realnet-server\storage'
REALNET_STORAGE_S3_BUCKET='realnet-dev'
REALNET_STORAGE_S3_KEY='ddd'
REALNET_STORAGE_S3_SECRET='ggg'
REALNET_STORAGE_S3_REGION='us-east-1'
REALNET_NAME='public'
REALNET_USERNAME='admin'
REALNET_EMAIL='joe.blog@gmail.com'
REALNET_REDIRECT_URI='http://localhost:4200/callback'
  • run command
chmod 700 .env
  • run the following commands:
python3 -m venv venv
. ./venv/bin/activate
pip install realnet-server
  • finally to start realnet server run the following command:
realnet-server serve

Choose from 'serve', 'upgrade', 'initialize', 'migrate'.

How to run on linux from source:

  • Clone out the repo
git clone https://github.com/virtual-space/realnet-server/realnet-server.git
  • Go to the repo root folder
cd realnet-server
  • The realnet-server will need a database to connect to. Instructions for how to create a local db will be included at the end.
  • In the repo root folder create an .env file with the following content:
REALNET_SERVER_HOST='0.0.0.0'
REALNET_SERVER_PORT='8080'
REALNET_DB_USER='realnet'
REALNET_DB_HOST='localhost'
REALNET_DB_PASS='Q1w35rr!423421345fdsfgs'
REALNET_DB_PORT='5432'
REALNET_DB_NAME='realnet'
REALNET_STORAGE_TYPE='s3'
REALNET_STORAGE_PATH='\realnet-server\storage'
REALNET_STORAGE_S3_BUCKET='realnet-dev'
REALNET_STORAGE_S3_KEY='ddd'
REALNET_STORAGE_S3_SECRET='ggg'
REALNET_STORAGE_S3_REGION='us-east-1'
REALNET_NAME='public'
REALNET_USERNAME='admin'
REALNET_EMAIL='joe.blog@gmail.com'
REALNET_REDIRECT_URI='http://localhost:4200/callback'
  • run command
chmod 700 .env
  • run the following commands:
python3 -m venv venv
. ./venv/bin/activate
python setup.py install
  • finally to start realnet server run the following command:
realnet-server serve

Choose from 'serve', 'upgrade', 'initialize', 'migrate'.

Running as a local development server

Run the following command before realnet-server serve. This disables the https requirement.

export AUTHLIB_INSECURE_TRANSPORT=1

If you have your own database, you should also run the following to initialize the database.

realnet-server initialize

python setup.py install notes

You may need to manually install some dependencies. python setup.py install should tell you what is missing.

The Cryptography module takes a long time to compile.

Below is an incomplete list of installation instructions for dependencies. If you're not doing this on a fresh installation, you should run python setup.py install to see what you need first.

Inside VENV

  • Cryptography dependencies
pip install --upgrade pip
pip install setuptools-rust

Outside VENV

  • postgreSQL (pg_config is missing)
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql
  • c/c++ compilers (gcc/g++ is missing)
sudo apt update
sudo apt install build-essential

Optional Man pages

sudo apt-get install manpages-dev

To test the C & C++ compiler installations run these commands:

gcc --version
g++ --version

Creating a database for realnet-server

The following section should be done on your windows terminal if you are using WSL2.

Install Docker: https://docs.docker.com/desktop/windows/install/ Install Kubernetes: Go to settings in docker -> kubernetes -> enable kubernetes.

Get helm 3.1.0 or above. Create a postgresql container in docker using the bitnami distribution: https://github.com/bitnami/charts/tree/master/bitnami/postgresql Run the following after installing helm.

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install realnet -f values.yaml bitnami/postgresql

This requires a values.yaml file to be in directory you use this command: You can get one from the bitnami github. You probably want to change from the default password and use a port that won't interfere with other databases on the system.

Replace password and port in the .env file with the password and port you used in values.yaml

Run kubectl port-forward --namespace default svc/realnet-postgresql [port]:[port] in a linux terminal. This allows connections from outside the container to reach the database.

Run in linux:

sudo docker ps -a

This will list the containers available in docker. Note the CONTAINER ID of the database you just created. Run the following commands:

docker exec -u root -it [CONTAINER ID] bash
install_packages postgis
psql -U postgres
CREATE EXTENSION postgis;

Check version:

SELECT postgis_version();

This should produce the following.

---------------------------------------
 2.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
(1 row)

Once the .env details have been updated to point at your local database, use realnet-server initialize to create the default database in your venv. This will also complain that there is no REALNET_PASSWORD. You will need to include one in the .env file, or add it to the initialize command via --password.

Notes for MacOS

Build from sources:

  1. brew install libyaml
  2. pip install pyyaml
  3. pip install cython
  4. brew install shapely
  5. pip install geos
  6. pip install cryptography
  7. If you are having trouble installing psycopg2 by pointing it to where your openssl library is, ie: env LDFLAGS="-I/opt/homebrew/Cellar/openssl@1.1/1.1.1m/include -L/opt/homebrew/Cellar/openssl@1.1/1.1.1m/lib" python setup.py install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

realnet-server-0.0.5.tar.gz (30.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

realnet_server-0.0.5-py3.7.egg (90.6 kB view details)

Uploaded Egg

realnet_server-0.0.5-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

Details for the file realnet-server-0.0.5.tar.gz.

File metadata

  • Download URL: realnet-server-0.0.5.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for realnet-server-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0d83dd8ec283ce935b26a72a80680499f203afcf7f9060e63588ccd1b2a5edbf
MD5 248e9a493866cd54d691b32093dbbfbb
BLAKE2b-256 a6912f3c30641a455d842a3642baa4ac067f8bdd358f483f3679a04a4af9e9ea

See more details on using hashes here.

File details

Details for the file realnet_server-0.0.5-py3.7.egg.

File metadata

  • Download URL: realnet_server-0.0.5-py3.7.egg
  • Upload date:
  • Size: 90.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for realnet_server-0.0.5-py3.7.egg
Algorithm Hash digest
SHA256 942b07af17f2c19b5e90109f093b9581d804cafe8969e9206d9cc62ba46582b4
MD5 62c69a62d5eb6336f6a6fbf2a0cccd9b
BLAKE2b-256 9e5a3244b4b9c995216388891fdee3234264a78eee2b9ecbc1dc5d3a9cfa7735

See more details on using hashes here.

File details

Details for the file realnet_server-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: realnet_server-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 40.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for realnet_server-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 889680a8fda4767407f826d7763f7c641467afb4028e20859fc9f1d7b56bce14
MD5 913f517d64e3f48e2831a19bf67b4f4b
BLAKE2b-256 2171632211cab3e8e92e3eac9e5b437a917247da3648914912c51f534941a75d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page