<?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-05-29T21:34:27Z</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=132&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=132&amp;oldid=prev"/>
		<updated>2026-05-27T19:43:54Z</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 with three top-level sections: &amp;lt;code&amp;gt;data_store&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;server&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;. 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;
data_store:&lt;br /&gt;
  # The address of the MySQL server.&lt;br /&gt;
  address: &amp;quot;127.0.0.1:3306&amp;quot;&lt;br /&gt;
  # The username used to authenticate with MySQL.&lt;br /&gt;
  username: spireadmin&lt;br /&gt;
  # The password for the MySQL user.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
  # The name of the database schema where data is stored.&lt;br /&gt;
  schema: spire&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;
  # 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;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;127.0.0.1:20000&amp;quot;&lt;br /&gt;
  # The account username used to authenticate with the Service Locator.&lt;br /&gt;
  username: uid_server&lt;br /&gt;
  # The password for the Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&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;
  --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;
The script:&lt;br /&gt;
* Generates &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template.&lt;br /&gt;
* Requires only the &amp;lt;code&amp;gt;--password&amp;lt;/code&amp;gt; argument by default.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Log files are generated as &amp;lt;code&amp;gt;srv_[YYYY][MM][DD]_[HH]_[MM]_[SS].log&amp;lt;/code&amp;gt; in the runtime directory. Upon termination, non-empty log files are moved into the &amp;lt;code&amp;gt;log/&amp;lt;/code&amp;gt; subfolder, while empty log files are deleted.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Uid Server is managed through three core scripts:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt; - Starts the Uid Server. Does nothing if the server is already running.&lt;br /&gt;
* &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt; - Stops an existing server instance and waits for the server to terminate.&lt;br /&gt;
* &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; - Verifies that the server is running and reports its status.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
</feed>