Partner API
Developers can set up and run the OpenG2P Registry Partner API on their local machines. This guide outlines the steps to install it on a Linux-based laptop or desktop.
Prerequisites
Python3
Git
PostgreSQL
Installation of Partner API
1. Update system packages
Log in to your Linux server using SSH and update the package list and upgrade the existing packages:
sudo apt update
sudo apt upgrade -y2. Install dependencies
sudo apt install -y python3-pip python3-dev python3-venv build-essential libpq-dev3. Install and configure PostgreSQL
The Registry uses PostgreSQL as the database engine. Install PostgreSQL (if not already installed) and create a new database user and database.
sudo apt install -y postgresql
sudo su - postgres
psql
CREATE ROLE registryuser WITH LOGIN NOSUPERUSER CREATEDB CREATEROLE INHERIT REPLICATION CONNECTION LIMIT -1 PASSWORD 'password';
CREATE DATABASE registrydb WITH OWNER = registryuser CONNECTION LIMIT = -1;
exit
exit4. Clone the Registry APIs Repository
5. Install Python Libraries and Run the API
Create a new Python virtual environment:
Activate the virtual environment:
Install required Python packages:
Create a
.envfile:
Run the API server:
Verifying the Installation
Open the OpenAPI docs in your browser at http://127.0.0.1:8001/docs.
Last updated
Was this helpful?