From 9bbe63d0b12b89a31516d42a32eefe50a6e1ab22 Mon Sep 17 00:00:00 2001 From: Mishalabdullah Date: Sat, 25 May 2024 12:43:54 +0530 Subject: [PATCH 1/7] add basic prompts for merging nets --- install/beckn-onix.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/install/beckn-onix.sh b/install/beckn-onix.sh index 429385a..160d684 100755 --- a/install/beckn-onix.sh +++ b/install/beckn-onix.sh @@ -162,6 +162,21 @@ install_bpp_protocol_server(){ echo "Protocol server BPP installation successful" } +mergingNetworks(){ + echo -e "1. Merge Two Different Registries \n2. Merge Multiple Registries into a Super Registry" + read -p "Enter your choice: " merging_network + if [[ $merging_network == 1 ]]; then + echo "Merging Two Different Registries" + elif [[ $merging_network == 2 ]]; then + echo "Merging Multiple Registries into a Super Registry" + else + echo "Invalid option. Please restart the script and select a valid option." + exit 1 + fi +} + + + # Function to install BPP Protocol Server with Sandbox install_bpp_protocol_server_with_sandbox(){ start_support_services @@ -292,20 +307,13 @@ boldGreen="\e[1m\e[92m" reset="\e[0m" if [[ $choice -eq 3 ]]; then - echo "Installing all components on the local machine" - install_package - install_registry - install_gateway - install_bap_protocol_server - install_bpp_protocol_server_with_sandbox -else - # Determine the platforms available based on the initial choice + echo "Determining the platforms available based on the initial choice" platforms=("Gateway" "BAP" "BPP") [ "$choice" -eq 2 ] && platforms=("Registry" "${platforms[@]}") # Add Registry for new network setups echo "Great choice! Get ready." echo -e "\nWhich platform would you like to set up?" - for i in "${!platforms[@]}"; do + for i in "${!platforms[@]}"; do echo "$((i+1)). ${platforms[$i]}" done @@ -319,6 +327,10 @@ else echo "Invalid option. Please restart the script and select a valid option." exit 1 fi +elif [[ $choice -eq 4 ]]; then + echo "Determining the platforms available based on the initial choice" + mergingNetworks + fi echo "Process complete. Thank you for using Beckn-ONIX!" From 1fa30b6a8b6437e6594a205487cda1d3963b8ccd Mon Sep 17 00:00:00 2001 From: Mishalabdullah Date: Sun, 26 May 2024 05:43:52 +0530 Subject: [PATCH 2/7] Fetching data from registries --- install/beckn-onix.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/install/beckn-onix.sh b/install/beckn-onix.sh index 160d684..2005b8a 100755 --- a/install/beckn-onix.sh +++ b/install/beckn-onix.sh @@ -163,11 +163,44 @@ install_bpp_protocol_server(){ } mergingNetworks(){ + # Now need implement the logic where registry A gets merged to registry B + # And also registry B & registry A gets merged into a super registry echo -e "1. Merge Two Different Registries \n2. Merge Multiple Registries into a Super Registry" read -p "Enter your choice: " merging_network if [[ $merging_network == 1 ]]; then + echo "Merging Registry A to Registry B" + read -p "Enter Registry A URL: " registry_a_url + read -p "Enter Registry B URL: " registry_b_url + response1=$(curl -s -H 'ACCEPT: application/json' -H 'CONTENT-TYPE: application/json' "$registry_a_url" -d '{}') + response2=$(curl -s -H 'ACCEPT: application/json' -H 'CONTENT-TYPE: application/json' "$registry_b_url" -d '{}') + combined_response="${response1}${response2}" + echo "$combined_response" + # Need to to know how to send data to registry B , facing issues in authorization echo "Merging Two Different Registries" elif [[ $merging_network == 2 ]]; then + urls=() + while true; do + read -p "Enter registry URL (or 'N' to stop): " url + if [[ $url == 'N' ]]; then + break + else + urls+=("$url") + fi + done + + if [[ ${#urls[@]} -gt 0 ]]; then + echo "Entered registry URLs:" + all_responses="" + for url in "${urls[@]}"; do + response=$(curl -s -H 'ACCEPT: application/json' -H 'CONTENT-TYPE: application/json' "$url/subscribers/lookup" -d '{}') + all_responses+="$response" + echo "$all_responses" + done + echo "$all_responses" + else + echo "No registry URLs entered." + fi + echo "Merging Multiple Registries into a Super Registry" else echo "Invalid option. Please restart the script and select a valid option." From 2306fe16d23915f7e06b2f04431ef877f6cb2f72 Mon Sep 17 00:00:00 2001 From: Mishalabdullah Date: Tue, 28 May 2024 15:00:41 +0530 Subject: [PATCH 3/7] Merging reg a to reg b --- install/beckn-onix.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/install/beckn-onix.sh b/install/beckn-onix.sh index 2005b8a..23c732b 100755 --- a/install/beckn-onix.sh +++ b/install/beckn-onix.sh @@ -171,12 +171,15 @@ mergingNetworks(){ echo "Merging Registry A to Registry B" read -p "Enter Registry A URL: " registry_a_url read -p "Enter Registry B URL: " registry_b_url - response1=$(curl -s -H 'ACCEPT: application/json' -H 'CONTENT-TYPE: application/json' "$registry_a_url" -d '{}') - response2=$(curl -s -H 'ACCEPT: application/json' -H 'CONTENT-TYPE: application/json' "$registry_b_url" -d '{}') - combined_response="${response1}${response2}" - echo "$combined_response" - # Need to to know how to send data to registry B , facing issues in authorization - echo "Merging Two Different Registries" + response=$(curl -X -H 'Accept: application/json' -H 'Content-Type: application/json' "$registry_b_url"+/subscribers/lookup -d '{}') && + combined_response="${response}" + for element in $(echo "$combined_response" | jq -c '.[]'); do + curl --location "$registry_a_url"+/subscribers/register \ + --header 'Content-Type: application/json' \ + --data "$element" + echo + done + echo "Merging Two Different Registries Done ..." elif [[ $merging_network == 2 ]]; then urls=() while true; do From 55d85a81e73fde87da32ba7368898284b2a57cad Mon Sep 17 00:00:00 2001 From: Mishalabdullah Date: Wed, 29 May 2024 12:12:08 +0530 Subject: [PATCH 4/7] Feat merging networks to a super registry --- install/beckn-onix.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/install/beckn-onix.sh b/install/beckn-onix.sh index 23c732b..090f935 100755 --- a/install/beckn-onix.sh +++ b/install/beckn-onix.sh @@ -163,10 +163,9 @@ install_bpp_protocol_server(){ } mergingNetworks(){ - # Now need implement the logic where registry A gets merged to registry B - # And also registry B & registry A gets merged into a super registry echo -e "1. Merge Two Different Registries \n2. Merge Multiple Registries into a Super Registry" read -p "Enter your choice: " merging_network + # OPTION 1: Merging Two Different Registries if [[ $merging_network == 1 ]]; then echo "Merging Registry A to Registry B" read -p "Enter Registry A URL: " registry_a_url @@ -180,6 +179,7 @@ mergingNetworks(){ echo done echo "Merging Two Different Registries Done ..." + # OPTION 2: Merging Multiple Registries into a Super Registry elif [[ $merging_network == 2 ]]; then urls=() while true; do @@ -190,16 +190,21 @@ mergingNetworks(){ urls+=("$url") fi done - + read -p "Enter the Super Registry URL: " registry_super_url if [[ ${#urls[@]} -gt 0 ]]; then echo "Entered registry URLs:" all_responses="" for url in "${urls[@]}"; do - response=$(curl -s -H 'ACCEPT: application/json' -H 'CONTENT-TYPE: application/json' "$url/subscribers/lookup" -d '{}') + response=$(curl -s -H 'ACCEPT: application/json' -H 'CONTENT-TYPE: application/json' "$url"+/subscribers/lookup -d '{}') all_responses+="$response" - echo "$all_responses" done - echo "$all_responses" + for element in $(echo "$all_responses" | jq -c '.[]'); do + curl --location "$registry_super_url"+/subscribers/register \ + --header 'Content-Type: application/json' \ + --data "$element" + echo + done + echo "Merging Multiple Registries into a Super Registry Done ..." else echo "No registry URLs entered." fi From 23e5b044e9323c5e82682c590575d35ca406521a Mon Sep 17 00:00:00 2001 From: Mishalabdullah Date: Wed, 29 May 2024 13:24:10 +0530 Subject: [PATCH 5/7] Cleaned mergin networks code --- install/beckn-onix.sh | 57 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/install/beckn-onix.sh b/install/beckn-onix.sh index 090f935..f3399c8 100755 --- a/install/beckn-onix.sh +++ b/install/beckn-onix.sh @@ -165,32 +165,23 @@ install_bpp_protocol_server(){ mergingNetworks(){ echo -e "1. Merge Two Different Registries \n2. Merge Multiple Registries into a Super Registry" read -p "Enter your choice: " merging_network - # OPTION 1: Merging Two Different Registries - if [[ $merging_network == 1 ]]; then - echo "Merging Registry A to Registry B" - read -p "Enter Registry A URL: " registry_a_url - read -p "Enter Registry B URL: " registry_b_url - response=$(curl -X -H 'Accept: application/json' -H 'Content-Type: application/json' "$registry_b_url"+/subscribers/lookup -d '{}') && - combined_response="${response}" - for element in $(echo "$combined_response" | jq -c '.[]'); do - curl --location "$registry_a_url"+/subscribers/register \ - --header 'Content-Type: application/json' \ - --data "$element" - echo - done - echo "Merging Two Different Registries Done ..." - # OPTION 2: Merging Multiple Registries into a Super Registry - elif [[ $merging_network == 2 ]]; then urls=() - while true; do - read -p "Enter registry URL (or 'N' to stop): " url - if [[ $url == 'N' ]]; then - break - else - urls+=("$url") - fi - done - read -p "Enter the Super Registry URL: " registry_super_url + if [ "$merging_network" = "2" ]; then + while true; do + read -p "Enter registry URL (or 'N' to stop): " url + if [[ $url == 'N' ]]; then + break + else + urls+=("$url") + fi + done + read -p "Enter the Super Registry URL: " registry_super_url + else + read -p "Enter A registry URL: " registry_a_url + read -p "Enter B registry URL: " registry_b_url + urls+=("$registry_a_url") + + fi if [[ ${#urls[@]} -gt 0 ]]; then echo "Entered registry URLs:" all_responses="" @@ -199,16 +190,24 @@ mergingNetworks(){ all_responses+="$response" done for element in $(echo "$all_responses" | jq -c '.[]'); do - curl --location "$registry_super_url"+/subscribers/register \ - --header 'Content-Type: application/json' \ - --data "$element" - echo + if [ "$merging_network" -eq 1 ]; then + curl --location "$registry_b_url"+/subscribers/register \ + --header 'Content-Type: application/json' \ + --data "$element" + echo + else + curl --location "$registry_super_url"+/subscribers/register \ + --header 'Content-Type: application/json' \ + --data "$element" + echo + fi done echo "Merging Multiple Registries into a Super Registry Done ..." else echo "No registry URLs entered." fi + if [ "$merging_network" = "2" ]; then echo "Merging Multiple Registries into a Super Registry" else echo "Invalid option. Please restart the script and select a valid option." From aa68f44efcd4090958c90f685b786552fdf16870 Mon Sep 17 00:00:00 2001 From: Mishalabdullah Date: Wed, 29 May 2024 15:09:01 +0530 Subject: [PATCH 6/7] Fixed option bug --- install/beckn-onix.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/install/beckn-onix.sh b/install/beckn-onix.sh index f3399c8..8850c51 100755 --- a/install/beckn-onix.sh +++ b/install/beckn-onix.sh @@ -345,15 +345,24 @@ read -p "Enter your choice: " choice boldGreen="\e[1m\e[92m" reset="\e[0m" - if [[ $choice -eq 3 ]]; then + echo "Installing all components on the local machine" + install_package + install_registry + install_gateway + install_bap_protocol_server + install_bpp_protocol_server_with_sandbox +elif [[ $choice -eq 4 ]]; then echo "Determining the platforms available based on the initial choice" + mergingNetworks +else + # Determine the platforms available based on the initial choice platforms=("Gateway" "BAP" "BPP") [ "$choice" -eq 2 ] && platforms=("Registry" "${platforms[@]}") # Add Registry for new network setups echo "Great choice! Get ready." echo -e "\nWhich platform would you like to set up?" - for i in "${!platforms[@]}"; do + for i in "${!platforms[@]}"; do echo "$((i+1)). ${platforms[$i]}" done @@ -367,12 +376,11 @@ if [[ $choice -eq 3 ]]; then echo "Invalid option. Please restart the script and select a valid option." exit 1 fi -elif [[ $choice -eq 4 ]]; then - echo "Determining the platforms available based on the initial choice" - mergingNetworks - fi echo "Process complete. Thank you for using Beckn-ONIX!" +echo "Process complete. Thank you for using Beckn-ONIX!" + + From d766bf271a254293185dc6cd0f5165a9152b3881 Mon Sep 17 00:00:00 2001 From: Mishalabdullah Date: Sun, 23 Jun 2024 11:50:33 +0530 Subject: [PATCH 7/7] realese notes and contributor info update --- docs/release_notes.md | 33 +++++++++++++++++++++++++++++++-- onix-gui/GUI/README.md | 5 ++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/docs/release_notes.md b/docs/release_notes.md index cfa3b35..7b98660 100644 --- a/docs/release_notes.md +++ b/docs/release_notes.md @@ -8,11 +8,41 @@ Experience the convenience and efficiency of Beckn-ONIX as you embark on your jo | Version | Release Date | | -------------------------------------------- | ------------ | +| [v0.4.1](#beckn-onix-version-041-2024-06-22) | 2024-06-22 | | [v0.4.0](#beckn-onix-version-040-2024-05-06) | 2024-05-06 | | [v0.3.0](#beckn-onix-version-030-2024-03-20) | 2024-03-20 | | [v0.2.0](#beckn-onix-version-020-2024-03-01) | 2024-03-01 | | [v0.1.0](#beckn-onix-version-010-2024-02-16) | 2024-02-16 | +## Beckn-ONIX Version 0.4.1 (2024-06-22) + +- This release adds a new feature for in CLI where its will be able to merge multiple registries. + +### New Features + +- Merging registry A to registry B +- Creting a new super-registry from multiple registries. + +### Enhancements + +- None + +### Bug fixes + +- None + +### Limitations + +- None + +### Upcoming Version + +- GUI support for the Merging feature. + +### Release date + +2024-06-22 + ## Beckn-ONIX Version 0.4.0 (2024-05-06) - This release adds a new browser based GUI for installing Beckn network components @@ -156,8 +186,7 @@ This release is specifically tailored for deployment on Linux machines, encompas ### Limitations -- The current installer is tested only for Linux (Ubuntu), it might support other flavors also. -- The current version installs all the components with the default configurations. +- None ### Upcoming Version diff --git a/onix-gui/GUI/README.md b/onix-gui/GUI/README.md index 26cf942..14ab8e1 100644 --- a/onix-gui/GUI/README.md +++ b/onix-gui/GUI/README.md @@ -42,7 +42,6 @@ Contributions are welcome! If you'd like to contribute to the beckn-onix-gui pro The beckn-onix-gui project is licensed under the MIT License. See the LICENSE file for more information. - ## Contact If you have any questions or issues with the beckn-onix-gui project, please don't hesitate to reach out. @@ -50,8 +49,8 @@ If you have any questions or issues with the beckn-onix-gui project, please don' ### Made with ❤️ built by the [Mulearn Team](https://mulearn.org/) + 1. [Mishal Abdullah](https://github.com/Mishalabdullah/) 2. [Aswin Asok](https://github.com/AswinAsok) 3. [Viraj Prabhu ](https://github.com/viraka) -4. [Adasrsh](https://adarshmohanks.framer.website/) - +4. [Adarsh Mohan](https://www.linkedin.com/in/adarshmohanks/)