Corlink API Server

This is the server that handles all the requests and responses. Want to see the docs for the API? Click here.

Setup

There are 6 ways of setting up the Corlink API server:

Docker

This is one of the easiest ways to get the Corlink API server up and running.

Prerequisites

Steps

  1. Pull the image.
docker pull ghcr.io/ruby-network/corlink-server:latest
  1. Run the image.
docker run -d -p 8080:8080 -e ADMIN_KEY=your_admin_key -e DB_HOST=your_db_host -e DB_USER=your_db_user -e DB_PASS=your_db_password -e DB_NAME=your_db_name -e DB_PORT=your_db_port ghcr.io/ruby-network/corlink-server:latest

This is the recommended way of setting up the Corlink API server. It is the easiest and fastest way to get the Corlink API server up and running.

Prerequisites

Steps

  1. Acquire the docker-compose.yml file from the Corlink repository.
    • You can find the file here.
  2. Setup the folders for the database and other volumes where your docker-compose.yml file is located.
mkdir -p db/
  1. Edit the docker-compose.yml files environment variables.
When changing the POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB variables, you will also need to change the DB_USER, DB_PASSWORD, and DB_NAME variables in the corlink-server service.
Make sure to change the ADMIN_KEY to a secure key. Below is a command to generate a secure key.
openssl rand -base64 32
VariableDescriptionService
POSTGRES_USERThe user of the database. (Default is fine)postgres
POSTGRES_PASSWORDThe password of the database. (Default is fine)postgres
POSTGRES_DBThe name of the database. (Default is fine)postgres
ADMIN_KEYThe admin key for the Corlink API.corlink-server
DB_HOSTThe host of the database. LEAVE DEFAULTcorlink-server
DB_USERThe user of the database. (default value is fine)corlink-server
DB_PASSWORDThe password of the database. (default value is fine)corlink-server
DB_NAMEThe name of the database. (default value is fine)corlink-server
DB_PORTThe port of the database. (default value is fine)corlink-server
  1. Run the docker-compose.yml file.
docker-compose up -d
  1. You should now have a Corlink API server running.

AUR

This is another easy way to get the Corlink API server up and running.

Prerequisites

  • Arch Linux
  • Yay (or any other AUR helper, or manual installation (figure that out yourself nerd))
  • A PostgreSQL database. (See setup here)

Steps

  1. Install the package.
yay -S corlink-server
  1. Create a .env file in the directory you would like to run the server in.
ADMIN_KEY=your_admin_key
DB_HOST=your_db_host
DB_USER=your_db_user
DB_PASS=your_db_password
DB_NAME=your_db_name
DB_PORT=your_db_port
  1. Run the package.
corlink-server start
You can also use a SQLite database (not recommended for prod) by adding the -s or --sqlite flag to the corlink-server start command.
  1. You should now have a Corlink API server running.
  • For more information on the CLI see here

Go Install

This is another easy way to get the Corlink API server up and running.

Prerequisites

  • Go
  • A PostgreSQL database. (See setup here)

Steps

  1. Install the package.
go install github.com/ruby-network/corlink/licensing@latest
  1. Create a .env file in the directory you would like to run the server in.
ADMIN_KEY=your_admin_key
DB_HOST=your_db_host
DB_USER=your_db_user
DB_PASS=your_db_password
DB_NAME=your_db_name
DB_PORT=your_db_port
  1. Run the package.
corlink-server start
You can also use a SQLite database (not recommended for prod) by adding the -s or --sqlite flag to the corlink-server start command.
  1. You should now have a Corlink API server running.
  • For more information on the CLI see here.

Manual

This is the hardest way to get the Corlink API server up and running.

Prerequisites

  • Go
  • A PostgreSQL database. (See setup here)
  • Git

Steps

  1. Clone the repository.
git clone https://github.com/ruby-network/corlink.git
  1. Run the make command.
cd licensing/ && make
  1. Edit the .env file.
ADMIN_KEY=your_admin_key
DB_HOST=your_db_host
DB_USER=your_db_user
DB_PASS=your_db_password
DB_NAME=your_db_name
DB_PORT=your_db_port
  1. Run the server.
./bin/corlink-server start
You can also use a SQLite database (not recommended for prod) by adding the -s or --sqlite flag to the corlink-server start command.
  1. You should now have a Corlink API server running.
  • For more information on the CLI see here.