soon-migrate
🚀 soon-migrate is a CLI tool that helps developers migrate their Solana Anchor projects to the SOON Network. It modifies the Anchor.toml configuration file and updates the cluster RPC URL to point to the SOON Network, among other tasks. This tool is designed to simplify the process of upgrading and migrating existing Solana Anchor projects.
Features
- 🛠 Automatic Migration: Updates the
Anchor.tomlfile to migrate from standard Solana clusters to SOON Network. - 📾 Backup & Restore: Automatically backs up the existing
Anchor.tomlto ensure you can restore it if needed. - 🔍 Dry Run Option: See what changes would be made without applying them.
- 🗑 Verbose Logging: Provides detailed output to help you understand the migration process.
Installation
You can install soon-migrate using Cargo:
Usage
Basic Usage
Navigate to the root directory of your Anchor project and run:
This will migrate your project by modifying Anchor.toml and updating the cluster RPC URL to the SOON Network. The tool will also create a backup (Anchor.toml.bak) before making any changes.
Running with a Specific Path
You can specify the path to your Anchor project explicitly:
Dry Run Mode (Recommended First Step)
If you want to preview the changes that will be made without modifying the actual files, use the --dry-run flag:
This will print out the changes that would be made to Anchor.toml without making any modifications.
Verbose Mode
For more detailed logging about the migration process, use the --verbose flag:
Restore from Backup
If you need to revert the changes made by soon-migrate, you can restore the backup using the --restore flag:
Full Command Reference
- Basic Migration:
- Specify Path:
- Dry Run:
- Verbose Logging:
- Restore Backup:
Example Workflow
-
Run a Dry Run to see what changes will be made:
-
Run the Actual Migration after reviewing the dry run output:
-
Verify the updated
Anchor.tomland run your project's tests. -
If something went wrong, restore from the backup:
How it Works
soon-migrate performs the following tasks:
- Validation: Ensures that the specified directory is a valid Anchor project with
Anchor.tomlandCargo.toml. - Backup: Creates a backup of
Anchor.tomlbefore making changes. - Modification: Updates the RPC URL in
Anchor.tomlto point to the SOON Network:https://rpc.devnet.soo.network/rpc/rpc - Logging: Provides detailed progress, error messages, and final instructions.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request or open an Issue for suggestions, improvements, or bug reports.
Development Setup
-
Clone the Repository:
-
Build the Project:
-
Run Tests:
License
Licensed under the MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT).
Contact
- Author: Akshat Sharma (akshatsharma0023@outlook.com)
- GitHub: akshatcoder-hash
If you have any questions or suggestions, feel free to reach out!
Give soon-migrate a ⭐ on GitHub if you find it useful!