# P2Pool Configuration File Guide ## Overview P2Pool uses a configuration file (`params.conf`) to manage all runtime settings. This approach provides several advantages over command-line parameters: - **Upgrade Safety**: Configuration is preserved during package upgrades - **Centralized Management**: All settings in one location - **Documentation**: In-file comments explain each option - **Maintainability**: Easy to review and modify settings ## Configuration File Locations ### Debian Package Installation ``` /var/lib/p2pool/params.conf ``` ### Manual Installation ``` ./params.conf (in the working directory) ``` ## Basic Configuration Example ```conf # Minimum required configuration host = 127.0.0.1 rpc-port = 18081 zmq-port = 18083 wallet = 4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Advanced Configuration See [params.conf.example](params.conf.example) for a comprehensive configuration template with all available options. ## Configuration Best Practices 1. **Always backup** your `params.conf` before making changes 2. **Test changes** by running P2Pool manually before updating the systemd service 3. **Use comments** to document your customizations 4. **Keep sensitive data secure**: The config file contains your wallet address ## Switching from Command-Line to Configuration File If you're currently using command-line parameters, you can convert them to a configuration file: ```bash # Old way (command-line) p2pool --host 127.0.0.1 --rpc-port 18081 --wallet YOUR_WALLET # New way (configuration file) p2pool --params-file params.conf ``` ## Testing Your Configuration ```bash # Test configuration before starting the service sudo -u p2pool /opt/p2pool/p2pool --params-file /var/lib/p2pool/params.conf # If everything looks good, start the service sudo systemctl start p2pool.service ``` ## Troubleshooting ### Configuration Not Loading 1. Check file permissions: ```bash ls -l /var/lib/p2pool/params.conf # Should be readable by p2pool user ``` 2. Verify file syntax: ```bash # No equal signs in comments # Use "key = value" format # One setting per line ``` 3. Check systemd service logs: ```bash sudo journalctl -u p2pool -n 50 ``` ### Common Mistakes - ❌ Missing wallet address - ❌ Incorrect Monero node connection settings - ❌ Syntax errors (missing `=`, extra spaces) - ❌ Commented-out required settings ## Migration from Older Versions If you're upgrading from a version that used systemd service file configuration: 1. Copy your settings from the old service file 2. Convert them to `params.conf` format 3. Update the service file to use `--params-file` 4. Restart the service Example migration: ```bash # Old (in systemd service) ExecStart=/opt/p2pool/p2pool --host 127.0.0.1 --wallet XXXXX # New (in params.conf) host = 127.0.0.1 wallet = XXXXX ```