# Main Configuration

> **Info:**
Changes made by hand in config.yml apply with /pcur reload, except the Database settings, which need a restart. Options changed from the editor are saved straight away.

## General Configuration

* **Internal Pool Size** - The number of threads the plugin keeps for its own background work. The default of `4` suits almost every server.
* **Debug** - Adds verbose logging to the console, useful when reporting an issue.

```yaml
performance:
  internal-pool-size: 4
debug: false
```

## Database

Balances, the player list, the transaction log, banknotes, banks and the daily counters are stored in the database. The available types are sqlite, mysql, mariadb and postgresql. The PostgreSQL driver ships inside the plugin. PostgreSQL listens on port 5432, so change the port when you switch. Servers that should share balances point at the same MySQL, MariaDB or PostgreSQL database, see [Can several servers share the same balances?](../plugin-information/questions-and-answers/can-several-servers-share-balances.md)

| Option | Description |
| ------ | ----------- |
| **table-prefix** | Put in front of every table name, so several plugins or setups can share one database. |
| **pool-size** | The most connections the plugin keeps open at once. |
| **jdbc-url-options** | Extra options added to the connection URL, such as `useSSL=false` for MySQL or `sslmode=require` for PostgreSQL. Empty for none. |
| **jdbc-url** | A full connection URL that replaces the one built from address, port, name and options. Empty builds it as usual. The type still decides which SQL is used, and SQLite ignores it. |
| **driver-class** | The JDBC driver class for a custom URL. Empty picks the bundled driver for PostgreSQL and lets the server's driver handle MySQL and MariaDB. |

```yaml
database:
  type: sqlite
  address: localhost
  name: phoenixcurrencies
  port: 3306
  username: root
  password: password
  table-prefix: pcur
  pool-size: 10
  jdbc-url-options: ''
  jdbc-url: ''
  driver-class: ''
```

### Environment Variables

Any text option of the database can read an environment variable instead of holding the value, written as `${ENV:NAME}`. Missing variables read as empty and are named in the console on start. The port is a number and cannot use one.

```yaml
database:
  type: mysql
  address: ${ENV:DB_HOST}
  username: ${ENV:DB_USER}
  password: ${ENV:DB_PASSWORD}
```

### Moving from SQLite to MySQL

Your old balances stay in `plugins/PhoenixCurrencies/database.db` when you switch. To bring them over:

1. Stop the server, and every other server that uses the new database, and set `type` to `mysql`, `mariadb` or `postgresql`, with the connection details.
2. Start the server. PhoenixCurrencies creates its empty tables in the new database.
3. Before anyone joins, run `/pcur database import sqlite` from the console.
4. Restart the server when it says it is done.

The import only runs from the console while nobody is online, and nobody can join until the restart. It copies every table that starts with the `table-prefix` and exists in both databases. If a table in the new database holds data already, it stops and lists those tables; add `confirm` to replace their contents with the SQLite data. Each table is copied in one go, so a table that fails is left as it was and you can run the command again.

## Purge

Deletes the balances of players inactive for this many days, once a day. 0 turns it off. See [Purging Accounts](../features/purging-accounts.md).

```yaml
purge:
  auto-days: 0
```

## Vault

Which currency other plugins use, and how strongly. See [Vault](../features/vault.md).

```yaml
vault:
  enabled: true
  currency: money
  priority: Low
  unlocked: true
treasury:
  enabled: true
serviceio:
  enabled: true
```

**unlocked**, **treasury** and **serviceio** turn the VaultUnlocked, Treasury and ServiceIO hooks on or off.

## Leaderboard

How often the leaderboards refresh, in seconds and 30 at the least, and how many players each keeps. See [Leaderboards](../main-features/leaderboards.md).

```yaml
leaderboard:
  refresh-seconds: 300
  size: 100
  page-size: 10
  min-balance: "0"
  min-playtime-minutes: 0
```

**min-balance** and **min-playtime-minutes** hide small balances and new players, see [Hiding Players](../main-features/leaderboards.md#hiding-players).

## Payments

How long a payment confirmation stays valid, in seconds, and which default commands the Vault currency gets. See [Payments](../main-features/payments.md) and [Default Commands](../plugin-information/commands.md#default-commands).

```yaml
payments:
  confirm-seconds: 30
default-commands:
  pay: true
  balance: true
  eco: true
  paytoggle: true
rollback:
  confirm-seconds: 60
bedrock:
  forms: true
```

**rollback.confirm-seconds** is how long a [rollback](../features/rollback-and-audit.md) preview can be confirmed. **bedrock.forms** gives Bedrock players forms for the wallet, the history, the pay menu and confirmations.

## Transactions

See [Transaction Log](../features/transaction-log.md).

```yaml
transactions:
  enabled: true
  keep-days: 30
```

## Offline Players

The offline income notice, the cache of offline balances for placeholders, and the first-start import of known players. See [Offline Players](../features/offline-players.md).

```yaml
offline-income:
  enabled: true
  delay-ticks: 60
offline-cache-seconds: 30
import-known-players: true
login-plugins:
  wait-for-login: true
```

## Dupe Protection

See [Banknotes](../main-features/banknotes.md#dupe-protection).

```yaml
dupe-protection:
  enabled: true
  notify-player: true
  alert-staff: true
  discord: true
  checks:
    containers: true
    hoppers: true
    dropped-items: true
    inventory-on-join: true
performance:
  dupe-protection:
    network-sync-seconds: 5
    network-sync-margin-seconds: 30
    cache-size: 10000
    lookup-batch-size: 500
    alert-cooldown-seconds: 60
```

| Option | Description |
| ------ | ----------- |
| **network-sync-seconds** | How often notes redeemed on other servers are read from a shared MySQL database. |
| **network-sync-margin-seconds** | How far back each read looks, so servers with slightly different clocks miss nothing. |
| **cache-size** | How many note IDs are remembered, so most checks need no database lookup. |
| **lookup-batch-size** | The most notes looked up in the database at once. |
| **alert-cooldown-seconds** | How long before the same note is reported again. |

## Other Settings

| Option | See |
| ------ | --- |
| **server-name** | [Worlds and Servers](../features/worlds-and-servers.md#server-name) |
| **wallet** | [Wallet](../features/wallet.md#wallet-command) |
| **history** | [Balance History](../features/balance-history.md#history-entries) |
| **discord** | [Discord Webhook](../features/discord-webhook.md) |
| **redis** | [Redis Sync](../features/redis-sync.md) |
| **proxy** | [Velocity Proxy](../features/velocity-proxy.md#proxy-secret) |

## Currencies

There is no list of currencies in this file. Each currency is its own file, see [Currency File](currency-file.md).

## Messages & Translations

Every message the plugin sends lives in the translation file rather than in config.yml. See [Languages & Translations](languages.md).

Source: https://www.phoenixplugins.com/docs/phoenix-currencies/configurations/main-configuration