Installation

Get up and running with Altruist in minutes.

Altruist is distributed as a set of .NET libraries. You include them as project references in your .NET 9 application.

Prerequisites

  • .NET 9 SDK or later
  • A code editor (Visual Studio, Rider, or VS Code)
  • (Optional) PostgreSQL if using database persistence

Project Setup

1. Create a new .NET project

dotnet new console -n MyGameServer
cd MyGameServer

2. Add Altruist as a dependency

Altruist is currently included as a library reference. Add the Altruist projects to your solution:

# Core framework (required)
dotnet add reference path/to/Altruist/Core/Core.csproj
dotnet add reference path/to/Altruist/Boot/Boot.csproj

# WebSocket transport
dotnet add reference path/to/Altruist/Web/Web.csproj

# TCP/UDP transport
dotnet add reference path/to/Altruist/Socket/Socket.csproj

# Game engine (optional — for game servers)
dotnet add reference path/to/Altruist/Gaming/Main/Gaming.csproj

# Postgres database (optional)
dotnet add reference path/to/Altruist/Postgres/Postgres.csproj

# Physics engine (optional)
dotnet add reference path/to/Altruist/Physx/Physx.csproj

3. Create your entry point

using Altruist;

await AltruistApplication.Run(args);

4. Create your configuration

altruist:
  server:
    http:
      host: "0.0.0.0"
      port: 8080
      path: "/"
    transport:
      codec:
        provider: json
      websocket:
        enabled: true
        path: /ws

Note:

Make sure config.yml is copied to the output directory. In your .csproj file add:

<ItemGroup>
  <None Update="config.yml">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </None>
</ItemGroup>

5. Run

dotnet run

You should see the Altruist startup banner with your configured endpoints.

What's Next?

Head to the Quick Start Guide to build your first portal and start handling real-time connections.