<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.spiretrading.com/index.php?action=history&amp;feed=atom&amp;title=Uid_Server</id>
	<title>Uid Server - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.spiretrading.com/index.php?action=history&amp;feed=atom&amp;title=Uid_Server"/>
	<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Uid_Server&amp;action=history"/>
	<updated>2026-04-07T13:01:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Uid_Server&amp;diff=232&amp;oldid=prev</id>
		<title>Kamal: Created page with &quot;The Uid Server is a centralized service responsible for generating batches of unique integers that can be used to identify items, such as database entries. The Uid Server regi...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Uid_Server&amp;diff=232&amp;oldid=prev"/>
		<updated>2025-02-05T00:20:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The Uid Server is a centralized service responsible for generating batches of unique integers that can be used to identify items, such as database entries. The Uid Server regi...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The Uid Server is a centralized service responsible for generating batches of unique integers that can be used to identify items, such as database entries. The Uid Server registers itself with the Service Locator as a &amp;lt;code&amp;gt;uid_server&amp;lt;/code&amp;gt; and ensures uniqueness by tracking allocated identifiers in a MySQL database.&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
The Uid Server is configured via a YAML file that defines its network interface, data store settings, and Service Locator integration. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---&lt;br /&gt;
server:&lt;br /&gt;
  # The network interface and port the Uid Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:20900&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  # List of addresses the server advertises for client connections.&lt;br /&gt;
  addresses: [&amp;quot;192.168.1.100:20900&amp;quot;, &amp;quot;0.0.0.0:20900&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
data_store:&lt;br /&gt;
  # MySQL server address (host:port).&lt;br /&gt;
  address: &amp;quot;127.0.0.1:3306&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  # MySQL credentials.&lt;br /&gt;
  username: uid_server&lt;br /&gt;
  password: securepassword123&lt;br /&gt;
  schema: uid_db&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # Service Locator address for registration.&lt;br /&gt;
  address: &amp;quot;127.0.0.1:20000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  # Uid Server credentials for Service Locator.&lt;br /&gt;
  username: uid_service&lt;br /&gt;
  password: adminpassword123&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation &amp;amp; Setup==&lt;br /&gt;
&lt;br /&gt;
A Python script automates configuration file generation. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python setup.py&lt;br /&gt;
  --local 0.0.0.0                   # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 192.168.1.100             # Global interface (default: same as local)&lt;br /&gt;
  --address 127.0.0.1:20000         # Service Locator address&lt;br /&gt;
  --password [REQUIRED]             # Admin password for Service Locator&lt;br /&gt;
  --mysql_address 127.0.0.1:3306    # MySQL server address&lt;br /&gt;
  --mysql_username admin            # MySQL username (default: spireadmin)&lt;br /&gt;
  --mysql_password [OPTIONAL]       # MySQL password (default: same as admin password)&lt;br /&gt;
  --mysql_schema uid_db             # Database schema (default: spire)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
&lt;br /&gt;
* Generates config.yml from config.default.yml template.&lt;br /&gt;
* Requires only the --password argument by default.&lt;br /&gt;
* Auto-detects local IP if --local is omitted.&lt;br /&gt;
&lt;br /&gt;
==Operations==&lt;br /&gt;
&lt;br /&gt;
Log files are generated as srv_[YYYY][MM][DD]_[HH]_[MM]_[SS].log in the runtime directory, upon termination, non-empty log files are moved into the log/ subfolder, while empty log files are deleted.&lt;br /&gt;
&lt;br /&gt;
The Uid Server is managed through three core scripts:&lt;br /&gt;
&lt;br /&gt;
start.sh&lt;br /&gt;
Starts the Uid server, does nothing if the server is already running.&lt;br /&gt;
&lt;br /&gt;
stop.sh&lt;br /&gt;
Stops an existing server instance and waits for the server to terminate.&lt;br /&gt;
&lt;br /&gt;
check.sh&lt;br /&gt;
Verifies that the server is running.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
</feed>