How To Setup
Follow these steps in order and you will have one auction house shared across all your servers. Do not skip a step, especially step 4.
You can do this with Redis, for a fully live network, or without it, for a shared but slightly slower one. The steps are the same until Redis.
Before you start
You need:
- Two or more servers already running ProtonAuctions.
- One database server they can all reach over the network: MySQL, MariaDB, or PostgreSQL. Most hosts provide one, or you can run your own. SQLite, the default, will not work here, it is a single file and cannot be shared.
- For the live version, one Redis server, version 6 or newer, they can all reach.
Have these database details ready: its address (host), port, database name, a username, and that user's password.
Step 1: Create the database
On your database server, create an empty database and a user that can reach it. On MySQL or MariaDB:
CREATE DATABASE protonauctions;CREATE USER 'protonuser'@'%' IDENTIFIED BY 'a-strong-password';GRANT ALL PRIVILEGES ON protonauctions.* TO 'protonuser'@'%';FLUSH PRIVILEGES;Make sure the database accepts connections from each of your Minecraft servers. If they are on different machines, that usually means opening the database port in the firewall.
Step 2: Configure the first server
Pick one server to set up first. Stop it, open plugins/ProtonAuctions/config.yml, and point the database block at the database you just made:
database: type: mysql address: your-database-host port: 3306 database: protonauctions username: protonuser password: a-strong-passwordUse type: postgresql and port 5432 if you are on PostgreSQL. Then, for a live network, set the redis block too:
redis: enabled: true uri: redis://your-redis-host:6379 channel: proton:updatesLeave channel as it is unless you have a reason to change it, but whatever it says, it must match on every server.
Step 3: Start the first server
Start that server and watch the console. It should connect to the database with no errors, and /ah should open normally. This first start also creates the file plugins/ProtonAuctions/proton.lock, which you need in the next step.
If it cannot connect, the console usually says why: a wrong address, port, username or password, or a firewall in the way. Fix that before continuing.
Step 4: Copy proton.lock to every other server (do not skip this)
This is the step people miss, and the one that ties the network together.
ProtonAuctions encrypts your auction data with a key stored in proton.lock. Every server must use the same one, or a server cannot read auctions another server wrote.
With the other servers stopped, copy plugins/ProtonAuctions/proton.lock from your first server into plugins/ProtonAuctions/ on each of the others, replacing the file already there.
Step 5: Configure and start the other servers
On each remaining server, set the exact same database and redis blocks as the first server, then start it.
Step 6: Check it works
List an item with /ah sell on one server, then open /ah on another. It should appear there within a second or two, at the same price. Buy or cancel it, and it should disappear everywhere. If it does, you are done.
Without Redis
If you do not want to run Redis, do everything above but set enabled: false in the redis block on every server. Your servers still share one database and one proton.lock, so they sell from the same listings and nothing is ever duplicated. The only difference is that changes are not pushed between servers instantly, so a listing sold on one server can linger on another for a short while until its view refreshes on its own. For a small network that is fine. For a busy one, use Redis.
If something is wrong
- The console warns it cannot decrypt auction data. That server does not have the shared
proton.lock. Repeat step 4 for it. - A server will not connect to the database. Recheck the address, port, username and password, and that the database accepts connections from that server.
- Listings do not appear on other servers. Check that Redis is running, reachable from every server, and that
redis.enabledistruewith the sameuriandchanneleverywhere.
The economy engine keeps its own separate database, set under economyEngine.database. If you want your whole network to learn prices as one market, point every server at a shared one there too, the same way you did for database. It is optional, the auction house syncs without it.