Updating Your Bridgechain
Now that your bridgechain is deployed, you may want to update it to the most recent release of Core. Deployer makes the process of updating your bridgechain as easy as deploying it. Follow the steps bellow:
After updating, you should check whether your application still works as expected and no plugins are broken. Plugins will likely have to be updated to accommodate the latest Core changes. Consult the releases page for an overview of each breaking change on ARK Core.
Executing Update Script
Deployer is equipped with a script to update your bridgechain to the latest Core release. The update script will perform the following operations:
- Stop all Core processes
- Update your bridgechain to the latest Core release
- Run post-update scripts
- Generate update script for relay nodes
- Compile Core
- Push the updated branch to your GitHub repository
Before updating, it’s important to take a snapshot of your database. This is a backup of your blockchain that you can use to roll back later, if desired. To take a snapshot, run:
bridgechain with the CLI alias that is used by your bridgechain.
To update your bridgechain, perform the following:
- Change directories using:
- Ensure that your Deployer script is up to date:
- The script will perform the necessary changes to update your bridgechain. To start the update process, type:
bash bridgechain.sh update-core
- Once the update has been completed, we then need to push it to your bridgechain’s repository. When prompted, provide your GitHub username or email address and password. A new branch called
update/CORE_VERSIONwill be created in your repository, where
CORE_VERSIONwill be the version that your bridgechain was updated to.
plugins.jsconfiguration file will be updated. If you have modified it before, or registered custom plugins, you will have to add your changes again. You can find a backup of your previous
- At this point, you can start the Core processes again. Check the logs to ensure that bridgechain was updated successfully.
With your genesis node and bridgechain repository now up to date, it’s time to update the peers in your network. For each peer server, perform the following:
- Change directories to your bridgechain’s directory:
bash <(curl -s https://raw.githubusercontent.com/GITHUB_USERNAME/REPOSITORY/update/CORE_VERSION/upgrade/CORE_VERSION/update.sh)
Replace the following and execute:
GITHUB_USERNAMEwith your or your project’s GitHub username
REPOSITORYwith your bridgechain’s repository
CORE_VERSIONwith the Core version that your bridgechain was updated to
Once it finishes updating your peer, start the Core processes and check the logs to ensure that it was updated successfully.
plugins.jsconfiguration file is also updated on peer nodes. If you have modified it before, you will have to add your changes again.
- Test your bridgechain thoroughly. It is recommended to deploy the update to a devnet or testnet network before migrating it to your mainnet network.
- Ensure that all custom plugins are updated and compatible with the Core version you’re updating to.
- The v1 API has been deprecated and removed from Core. Make sure that your applications are compatible with the v2 API.
- Coordinate a plan of action with your bridgechain’s delegates and peers. Making sure that most of the network updates in a timely matter is essential for a healthy network update.
Security Recommendation: Ensure that your bridgechain is always up to date with the latest Core release. Releases include important security patches that are essential to keep your bridgechain secure!