Skip to content

Conversation

@google-labs-jules
Copy link

This change introduces multi-network support to the PHPCoin node, allowing both mainnet and testnet to be run from the same branch. The active network is determined by a chain_id file, and all network-specific configurations are loaded dynamically. This simplifies the deployment and maintenance of the node.


PR created automatically by Jules for task 17701494183429558572 started by @attogram

This commit refactors the codebase to support multiple networks (mainnet and testnet) from a single `main` branch. The active network is determined by the contents of a `./chain_id` file.

- `main` is now useable for both mainnet and testnet
- The source of truth is the `./chain_id` file (`00` for mainnet, `01` for testnet)
- New setup for support of multiple databases
- Per-chain files for config, checkpoints, rewards, coinspecs, genesis
- Refactored how code identifies network, using `CHAIN_ID` instead of `NETWORK`
- Updated deploy/install/docker scripts to be driven by the `chain_id` file
- Added safe defaults to the system to fall back to mainnet if the `chain_id` file is missing or invalid.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

google-labs-jules bot and others added 4 commits November 29, 2025 17:25
This commit refactors the codebase to support multiple networks (mainnet and testnet) from a single `main` branch. The active network is determined by the contents of a `./chain_id` file.

- `main` is now useable for both mainnet and testnet
- The source of truth is the `./chain_id` file (`00` for mainnet, `01` for testnet)
- New setup for support of multiple databases
- Per-chain files for config, checkpoints, rewards, coinspecs, genesis
- Refactored how code identifies network, using `CHAIN_ID` instead of `NETWORK`
- Updated deploy/install/docker scripts to be driven by the `chain_id` file
- Added safe defaults to the system to fall back to mainnet if the `chain_id` file is missing or invalid.
This commit refactors the codebase to support multiple networks (mainnet and testnet) from a single `main` branch. The active network is determined by the contents of a `./chain_id` file.

- `main` is now useable for both mainnet and testnet
- The source of truth is the `./chain_id` file (`00` for mainnet, `01` for testnet)
- New setup for support of multiple databases
- Per-chain files for config, checkpoints, rewards, coinspecs, genesis
- Refactored how code identifies network, using `CHAIN_ID` instead of `NETWORK`
- Updated deploy/install/docker scripts to be driven by the `chain_id` file
- Added safe defaults to the system to fall back to mainnet if the `chain_id` file is missing or invalid.
Makes the auto-update feature safe for development branches by dynamically detecting the current git branch. The updater will now pull changes for the branch that is currently checked out, preventing it from overwriting a development branch with the default branch from the configuration.

This change also completely overhauls the "Updating Existing Installations" section in the `ONE_BRANCH_TO_RULE_THEM_ALL.md` documentation to be safer and more comprehensive.

The improvements to the documentation include:
- Adding a database backup step using `mysqldump`.
- Adding a file backup step for the application directory.
- Replacing the insecure `curl | bash` command with instructions to run the local `scripts/install_node.sh` script.
- Adding instructions on how to handle the existing `config.inc.php` file.
- Improving the overall clarity and safety of the instructions by correcting numbering and typos.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants