> For the complete documentation index, see [llms.txt](https://help.diarkis.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.diarkis.io/en/diarkis-server/mars.md).

# MARS Server

## Overview

The MARS (Mesh network Announcement Relay Storage) server is a unique server possessed by Diarkis and is an essential component for any Diarkis cluster.

The MARS server is characterized by its ability to function without the need for scaling or redundancy, and it does not become a single point of failure. Even if a short downtime occurs, it does not impact the overall Diarkis cluster. In the event of an issue, the integrity of the Diarkis cluster can be maintained by simply restarting the server.

## Setting Up the MARS Server

```go
package main

import (
	"github.com/Diarkis/diarkis"
	"github.com/Diarkis/diarkis/mars"
)

func main() {
	mars.Setup()
	diarkis.Start()
}
```

## Configuring the MARS Server

Configuration is specified in JSON format.

```json
{
  "address": "127.0.0.1",
  "port": "6779",
  "fullSyncRoles": ["HTTP"],
  "enableMetricsLogging": false
}
```

<table><thead><tr><th width="230">Key</th><th width="119">Default</th><th>Description</th></tr></thead><tbody><tr><td>address</td><td>"127.0.0.1"</td><td>The address to which the UDP server binds</td></tr><tr><td>port</td><td>"6779"</td><td>The port for binding the MARS server. The UDP server will automatically search for an available port starting from the specified port.</td></tr><tr><td>fullSyncRoles</td><td>["HTTP"]</td><td>An array of server roles that synchronize all mesh data</td></tr><tr><td>enableMetricsLogging</td><td>false</td><td>If set to <code>true</code>, the MARS server will output JSON data for metrics to standard output every second.</td></tr></tbody></table>

### When Launching Different Versions of Diarkis

The MARS server segregates and manages data based on the Diarkis server version. This prevents user data from being mixed across applications with different versions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.diarkis.io/en/diarkis-server/mars.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
