.env

.env File Settings

Below is a detailed explanation of the .env file options to configure your ONO Coin node.


⚙️ Server Settings

Variable
Description

HTTP_PORT=3000

HTTP port for API and UI connections. Example: http://localhost:3000.

P2P_PORT=5001

Port for P2P connections. Example: ws://localhost:5001.

FORGING=true

Set to true if you want this node to forge (create) new blocks. Note: You must burn at least 100 ONO coins from the wallet used for forging, or forging won't start.

TESTNET=false

Set to true to run on the testnet instead of the mainnet. Warning: If you enable this, make sure to use testnet peers, or you risk being banned for sending invalid blocks.

ALLOW_SECURE_ROUTES=true

Enables /secure admin routes if set to true. These routes can perform dangerous actions (like resetting the blockchain). Be very careful and ensure these routes are protected and not exposed to the public!

SECURE_ROUTES_AUTHORIZATION_HEADER=exampledksadklsdlksalkdmsalkdmsk

Authorization token required for /secure routes if ALLOW_SECURE_ROUTES is enabled. Use this value in the Authorization header when making requests.


🗄️ Database Settings (PostgreSQL)

⚠️ WARNING: Misconfiguring database options can lead to complete data loss.

Variable
Description

DATABASE_NAME="ono_coin"

Name of your ONO Coin PostgreSQL database.

DATABASE_USERNAME="postgres"

PostgreSQL username.

DATABASE_PASSWORD="toor"

PostgreSQL password.

DATABASE_HOST="127.0.0.1"

Database host (e.g., 127.0.0.1 for localhost).

DATABASE_DIALECT="postgres"

Database type (should always be postgres).

DATABASE_FORCE_SYNC=false

⚠️ Danger: If set to true, this will delete and recreate the entire database from scratch. Set this only for initial setups or resets.

DATABASE_LOGGING=false

Set to true to enable SQL query logging (for debugging).


📝 Logs Settings

Variable
Description

LOG_LEVEL='trace'

Sets the log verbosity. Possible values: trace, debug, info, warn, error, fatal, silent.


⚠️ Important Security Notice

  • Do not enable ALLOW_SECURE_ROUTES unless you fully understand what /secure routes can do.

  • Make sure to protect the SECURE_ROUTES_AUTHORIZATION_HEADER value and do not expose your node to the public internet without proper security (e.g., firewall, VPN).

  • Always backup your database regularly, especially before making changes to DATABASE_FORCE_SYNC.

Last updated