Standard
Prerequisites
- Go 1.26 (opens in a new tab) (RotomNG requires 1.26.3 or newer)
- Node 22 (opens in a new tab) (v20.8 minimum, v24+ recommended)
- Bun 1.3 (opens in a new tab) (used to build the RotomNG web UI)
- Git (opens in a new tab) (
gitmight be pre-installed) - PM2 (opens in a new tab)
npm install -g pm2oryarn global add pm2 - jq (opens in a new tab)
sudo apt-get install jq - Compatible Database - See Database Setup
Install Dragonite
This setup guide is written for Linux. All referenced Dragonite binary files will have
the -linux-amd64 suffix. Using a different platform like macOS (darwin) will
change the suffix. Windows builds are currently not available and we recommend
Windows users use Windows Subsystem for Linux (WSL) or docker.
-
Clone repo
git clone https://github.com/UnownHash/Dragonite-Public.git Dragonite -
Change into cloned repo
cd Dragonite -
Download latest release binaries
./run.sh -
Create your
config.tomlfiles from the two included example filescp admin/config.toml.example admin/config.toml cp dragonite/config.toml.example dragonite/config.toml -
Modify your
dragonite/config.tomlfile. Minimum requirement:-
db.dragonitesettings -
golbat_*settings
Additionally, we highly recommend setting a the
raw_bearer,api_secretandbearer_tokenkeys if this service is accessible from the public internet. -
-
Modify your
admin/config.tomlfile. The defaults will work out of box but are not secure. -
To run the service
cd admin && ./admin-linux-amd64 cd dragonite && ./dragonite-linux-amd64
Install Golbat
-
Clone repo
git clone https://github.com/UnownHash/Golbat.git -
Change into cloned repo
cd Golbat -
Create
config.tomlfrom example filecp config.toml.example config.toml -
Modify your config file. Minimum requirement:
- database settings
-
Build and run the service
go run .
To compile a static binary run
makeInstall RotomNG
-
Clone repo
git clone https://github.com/UnownHash/RotomNG.git -
Change into cloned repo
cd RotomNG -
Create configuration file
cp configs/rotom-ng.toml.example configs/rotom-ng.toml -
Modify your configuration file at
configs/rotom-ng.tomlEvery section is optional and has sensible defaults, so you only need to add what you want to change. See the RotomNG Configuration page for all options.
Please note the RotomNG web client does not send the API secret, so setting
http_listener.secretprotects the API but leaves the web UI unable to load data. It is recommended that you run this service on your internal network, behind a Firewall, or protected by a cloud based application layer.- Set
controller_listener.secretif RotomNG is reachable from the public internet, and use the same value in Dragonite's[rotom]section. - The listeners bind to all interfaces by default (
":7070",":7071",":7072"). Prefix the address with an IP to restrict them, e.g.address = "127.0.0.1:7072".
- Set
-
Build the application
makeThis installs the frontend dependencies with Bun, builds the UI, and compiles the Go binary to
./rotom-ng. -
To run the service
./rotom-ngBy default you should be able to access the frontend via http://serverIP:7072
PM2
All services are now setup but navigating to each folder and starting each service one at a time is not ideal. Instead we will use pm2 which will maintain the lifecycle of the service, restarting, and optionally starting it on server reboot (pm2 startup).
Standard Setup
-
Navigate to each service folder and compile a static binary
cd /path/to/Dragonite/ && ./run.sh cd /path/to/Golbat && go build golbat cd /path/to/RotomNG/ && make -
Run the following to start and save a service
# Dragonite pm2 start ./dragonite-linux-amd64 --name "dragonite" -o "/dev/null" pm2 start ./admin-linux-amd64 --name "dragonite-admin" -o "/dev/null" # Golbat pm2 start ./golbat --name "golbat" -o "/dev/null" # RotomNG pm2 start ./rotom-ng --name "rotom-ng" -o "/dev/null" pm2 save
Ecosystem File
Instead of creating each service individually we can use an PM2 - Ecosystem File (opens in a new tab).
-
Navigate to each folder and compile a static binary
cd /path/to/Dragonite/ && ./run.sh cd /path/to/Golbat && go build golbat cd /path/to/RotomNG/ && make -
Create your config file
Make sure to update your
cmdpaths and optionally modify themax_memory_restartsetting.ecosystem.config.jsmodule.exports = { apps : [ { name: 'dragonite', script: 'dragonite-linux-amd64', cwd: '/home/username/Dragonite/dragonite', instances: 1, autorestart: true, log_date_format: "YYYY-MM-DD HH:mm", max_memory_restart: '4G' }, { name: 'dragonite-admin', script: 'admin-linux-amd64', cwd: '/home/username/Dragonite/admin', instances: 1, autorestart: true, log_date_format: "YYYY-MM-DD HH:mm", max_memory_restart: '1G' }, { name: 'golbat', script: 'golbat', cwd: '/home/username/Golbat/', instances: 1, autorestart: true, log_date_format: "YYYY-MM-DD HH:mm", max_memory_restart: '4G' }, { name: 'rotom-ng', script: 'rotom-ng', cwd: '/home/username/RotomNG/', instances: 1, autorestart: true, log_date_format: "YYYY-MM-DD HH:mm", max_memory_restart: '4G' }, ] } -
Start and save the services
pm2 start ecosystem.config.js pm2 save
PM2 logs
Overtime pm2 logs can take up large amounts of disk space. There is a popular pm2 module called pm2-logrotate that handles this log rotation for you. While it is optional we do recommend it.
Basic setup below:
pm2 install pm2-logrotate
pm2 set pm2-logrotate:max_size 50M
pm2 set pm2-logrotate:retain 10
pm2 set pm2-logrotate:compress trueUpdating
Since each service is an individual component it is possible to update just one. IE - no need to stop our data parser (Golbat) because the backend controller (Dragonite) has an update.
Dragonite
-
Change into Dragonite directory
cd path/to/Dragonite -
Pull latest binaries
git pull ./run.sh -
Restart services
pm2 restart dragonite dragonite-admin
Golbat
-
Change into Golbat directory
cd path/to/Golbat -
Pull latest git changes and compile
git pull && make -
Restart service
pm2 restart golbat
RotomNG
-
Change into RotomNG directory
cd path/to/RotomNG -
Pull latest git changes and compile
git pull && make -
Restart service
pm2 restart rotom-ng
All projects
If you wish to update all components and do not want to worry about forgetting a step you can use the following script. This will update all services at once.
Make sure to update the hightlighted path variable on line 2.
-
Copy the below script
update-unownhash.sh#!/usr/bin/env bash START_DIR=/home/username echo "Updating Golbat" cd "$START_DIR"/Golbat git pull go build golbat echo "Updating Dragonite" pm2 stop dragonite dragonite-admin cd "$START_DIR"/Dragonite ./run.sh echo "Updating RotomNG" cd "$START_DIR"/RotomNG git pull make cd ~ pm2 restart golbat dragonite dragonite-admin rotom-ng echo "All services have been updated" -
Make the script executable
chmod +x update-unownhash.sh -
Run the script
./update-unownhash.sh