This guide provides a comprehensive overview of the configuration system for your node. Proper configuration is essential for the security, performance, and functionality of your node.
The node uses a multi-file system to manage its configuration, ensuring that your custom settings are not overwritten during updates.
config/config.default.php: This file contains all the default settings for the node. You should not edit this file directly. It serves as a template and a reference for all available configuration options.config/config.inc.php: This is where you should place your custom settings. Create this file if it doesn't exist. Any setting you define in this file will override the corresponding default setting fromconfig.default.php.
To customize your node's configuration, copy the relevant settings from config.default.php to config.inc.php and modify their values.
- Description: A unique identifier for the blockchain. This helps differentiate between mainnet, testnet, or private chains.
- Default: The value from the
chain_idfile at the root of the project. - Example:
$_config['chain_id'] = 'mainnet';
- Description: The database connection string (DSN) for connecting to your MySQL database.
- Default:
'mysql:host=localhost;dbname=phpcoin;charset=utf8' - Example:
$_config['db_connect'] = 'mysql:host=127.0.0.1;dbname=my_phpcoin;charset=utf8mb4';
- Description: The username for your MySQL database.
- Default:
'phpcoin'
- Description: The password for your MySQL database.
- Default:
'phpcoin'
- Description: If
true, allows any remote host to connect to your node's API. Iffalse, only hosts listed inallowed_hostscan connect. - Default:
true
- Description: A list of IP addresses or hostnames that are allowed to mine on this node or connect to the API if
public_apiisfalse.*allows all hosts. - Default:
['*'] - Example:
$_config['allowed_hosts'] = ['192.168.1.100', 'mynode.local'];
- Description: A list of trusted initial peers to connect to and sync the blockchain from when your node first starts.
- Default: A list of official PHPCoin nodes.
- Description: If
true, your node will not actively seek out new peers. It will only use theinitial_peer_listfor syncing. This typically requires a cron job onsync.php. - Default:
false
- Description: The maximum number of peers your node will propagate blocks and transactions to.
- Default:
30
- Description: If
true, your node will run in offline mode. It will not send or receive any peer requests. - Default:
false
- Description: If you need to use a proxy for outgoing peer requests, define it here.
- Default:
null - Example:
$_config['proxy'] = 'socks5://127.0.0.1:9050';
- Description: The maximum number of transactions your node will accept into its mempool from a single peer during a sync.
- Default:
100
- Description: If
true, your node will block transfers from addresses that have been blacklisted by the PHPCoin developers. - Default:
true
- Description: The number of recent blocks to re-check during a sync to ensure chain integrity.
- Default:
10
- Description: Set to
trueonly if you need to change your node's public hostname. - Default:
false
- Description: If
true, enables logging to the file specified inlog_file. - Default:
true
- Description: The path to the log file. This file should not be publicly accessible via the web.
- Default:
'tmp/phpcoin.log'
- Description: The level of detail for logs.
0is the default, and5is the most verbose. - Default:
0
- Description: If
true, logs will be sent to the web server's error log (e.g., Apache'serror_log). - Default:
false
- Description: Set to
trueto enable the mining functionality on your node. - Default:
false
- Description: The public and private keys for your miner. The public key is used to receive mining rewards.
- Default:
""
- Description: The number of CPU cores to use for mining.
0attempts to auto-detect. - Default:
0
- Description: Set to
trueto enable block generation (forging). - Default:
false
- Description: The public and private keys for your block generator.
- Default:
""
- Description: Set to
trueto enable the web-based administration panel. - Default:
false
- Description: The password for the web admin panel.
- Default:
''
- Description: Alternatively, you can specify a public key to log in to the admin panel using its corresponding private key.
- Default:
''
- Description: Set to
trueto enable masternode functionality. - Default:
false
- Description: The public and private keys for your masternode.
- Default:
""
- Description: Set to
trueto enable support for Dapps. - Default:
false
- Description: The public and private keys for your Dapps identity.
- Default:
""
- Description: If
true, allows Dapps to be used anonymously. - Default:
false
- Description: If
true, disables the automatic propagation of Dapps data. - Default:
true
This setting allows you to fully customize the clickable application blocks on your node's homepage. It is an associative array where each key is a unique identifier for an app, and the value is another array containing the app's properties.
To customize the apps, you should copy the entire homepage_apps array from config.default.php into your config.inc.php file and then make your modifications.
Each app in the array supports the following properties:
title: (string, required) The text displayed on the app block.url: (string, required) The URL the app block links to.icon_type: (string, required) The type of icon. Supported values are:'fa': For a Font Awesome icon.'img': For an image URL.
icon: (string, required) The icon identifier.- If
icon_typeis'fa', this should be the Font Awesome class (e.g.,fas fa-binoculars). - If
icon_typeis'img', this should be the full URL to the image.
- If
condition: (mixed, required) Determines if the app block is displayed.true: The app is always displayed.'miner_enabled': The app is displayed only if mining is enabled on the node ($_config['miner']is true).'dapps_enabled': The app is displayed only if Dapps are enabled ($_config['dapps']is true and a public key is set).
target: (string, optional) Thetargetattribute for the link. Use'_blank'to open the link in a new tab.tooltip: (string, optional) Text to display as a tooltip when the user hovers over the app block.
1. Adding a New App
To add a new link, simply add a new key-value pair to the array in your config.inc.php.
$_config['homepage_apps']['my-explorer'] = [
"title" => "My Explorer",
"url" => "https://my-custom-explorer.com",
"icon_type" => "fa",
"icon" => "fas fa-search",
"condition" => true,
"target" => "_blank"
];2. Removing an App
To remove an app, you can either delete its entry from the array in your config.inc.php or comment it out.
$_config['homepage_apps'] = [
"explorer" => [
// ... explorer config
],
// The "Exchange" app is now disabled
// "exchange" => [
// "title" => "Exchange",
// "url" => "https://klingex.io/trade/PHP-USDT?ref=3436CA42",
// "icon_type" => "img",
// "icon" => "https://klingex.io/symbol.svg",
// "target" => "_blank",
// "condition" => true,
// "tooltip" => "Exchange"
// ],
"docs" => [
// ... docs config
]
];3. Reordering Apps
The apps appear in the order they are defined in the array. To change the order, simply rearrange the blocks of code in your config.inc.php.