LogoLogo
English
English
  • Diarkis Help Center
  • Overview of Diarkis
  • Getting Started
    • Diarkis Server Template
    • Diarkis Client SDK
    • Tutorials
      • 1. Launch Diarkis Server in Local Environment
      • 2. Perform Connectivity Check with Test Client
      • 3. Implement Custom Command
      • Connect to Server from Diarkis Client
    • Samples
  • Diarkis Modules
    • Room Module
      • Set Up Room Module on Server
      • Room Sample
        • room_broadcast
      • Utilizing Room Module from Client
      • Additional Features of Room
    • MatchMaker Module
      • Set Up MatchMaker Module on Server
    • Field Module
      • Set Up Field Module on Server
    • P2P Module
      • Set Up P2P Module on Server
      • P2P Sample
    • DM (Direct Message) Module
      • Set Up DM Module on Server
    • Notifier Module
      • Set Up Notifier Module on Server
    • Session Module
      • Set Up Session Module on Server
    • Group Module
      • Set Up Group Module on Server
  • Diarkis Server
    • Launch Diarkis Server in Cloud Environment
      • AWS
    • Launch Diarkis Server on Windows Environment
    • MARS Server
    • UDP Server
    • TCP Server
    • HTTP Server
    • Metrics API
    • Inter-server Communication - Mesh
  • Diarkis Client
    • Runtime Library
      • Diarkis RUDP
    • Diarkis Module
      • Initialization and Termination of Diarkis Module
      • Customization of Diarkis Module
      • Logging System of Diarkis Module
      • Migration
      • Threads of Diarkis
    • Samples
      • C++
        • room_broadcast
        • directmessage_simple
        • group_sample
        • matching_and_turn
        • matchmaker_ticket
        • p2p_rudp_sample
        • session_simple
      • Unreal Engine Plugin
        • FieldWalker
      • Unity Plugin
        • FieldWalker
          • HowToReplicatePosition.md
  • Diarkis Tools
    • Diarkis CLI
      • Procedures to Switch to Diarkis CLI v3
  • References
    • API Reference
    • Release Notes
      • v1.0
      • v1.0.1
      • v1.0.2
      • v1.0.3
      • v1.0.4
      • v1.0.5
      • v1.0.6
  • Support
    • License and Billing
Powered by GitBook
On this page
  • Introduction
  • Environment Preparation
  • Generating a Project from the Server Template
  • Setup
  • Generating Server Binaries
  • Starting the Server
  • Obtaining Connection Information

Was this helpful?

  1. Getting Started
  2. Tutorials

1. Launch Diarkis Server in Local Environment

PreviousTutorialsNext2. Perform Connectivity Check with Test Client

Last updated 1 month ago

Was this helpful?

Introduction

This page provides a guide on how to start a Diarkis server in your local environment using the Diarkis Server Template. It is recommended to go through these steps before beginning development with Diarkis.

Environment Preparation

To set up the server template, Go 1.22 or later is required.

The installation method varies depending on the platform, so please follow the official documentation:

Server development with Diarkis can be performed on macOS, Linux, and Windows.

If you're starting the server in a Windows environment, please refer to Launch Diarkis Server on Windows Environment.

Generating a Project from the Server Template

  1. First, clone the repository by running git clone https://github.com/Diarkis/diarkis-server-template.git at a desired PATH.

  2. Execute the following command to generate the project. The output destination will be the absolute path specified in output.

make init project_id={project ID} builder_token={builder token} output={absolute path to install}

# Example
make init project_id=00000000000 builder_token=xxxx-yyyy-zzzz output=/tmp/diarkis-dir

The project ID and builder token mentioned here are issued to developers who have an enterprise license for Diarkis. The core of Diarkis itself is closed-source and implemented in Go, requiring you to build it using diarkis-cli.

Setup

Run the following command in the generated project.

cd path/to/project
make init

This will download various resources necessary for development, such as references for code completion.

Generating Server Binaries

To generate binaries for local use, run the following make task.

make build-local

Upon execution, Diarkis binaries will be created under remote_bin.

% ls remote_bin
health-check http         mars         ms           tcp          testcli      udp

Starting the Server

Start each of the MARS, HTTP, and UDP servers.

make server target=mars
make server target=http
make server target=udp
# Although not used in this tutorial, the TCP server can be started with the following command:
# make server target=tcp

# Alternatively, the following commands can be used without the make command
./remote_bin/mars ./configs/mars/main.json
./remote_bin/http
./remote_bin/udp

Obtaining Connection Information

If mars, http, and udp are running, you can obtain connection information with curl as follows. This completes the server startup.

% curl -X POST http://127.0.0.1:7000/endpoint/type/UDP/user/test
{"encryptionMacKey":"xxxxxxxxxx","serverType":"UDP","serverHost":"127.0.0.1","serverPort":7100,"sid":"xxxxxxxxxx","encryptionKey":"xxxxxxxxxx","encryptionIV":"xxxxxxxxxx"}%

The above HTTP endpoint indicates authentication to the UDP server with uid test. The returned information can then be used by various client libraries to facilitate packet exchange.

If previous versions are needed, you can either check out the desired version’s tag or download it from the .

https://go.dev/doc/install
release list