Merge branch 'beckn:main' into main

This commit is contained in:
MishalAbdullah
2024-07-12 11:38:22 +05:30
committed by GitHub
7 changed files with 38 additions and 13 deletions

View File

@@ -2,6 +2,8 @@
Beckn-ONIX is [FIDE](https://fide.org/) project aimed at easing setup and maintainance of a [Beckn](https://becknprotocol.io/) Network using reference implementations. Objectives include setting up reliable, configurable and fast Beckn network as a virtual appliance. This initiative is independent of the evolution of the Beckn protocol. This effort is also aimed at inviting contributions from the community to create secure, reliable builds for production environments. Beckn-ONIX is [FIDE](https://fide.org/) project aimed at easing setup and maintainance of a [Beckn](https://becknprotocol.io/) Network using reference implementations. Objectives include setting up reliable, configurable and fast Beckn network as a virtual appliance. This initiative is independent of the evolution of the Beckn protocol. This effort is also aimed at inviting contributions from the community to create secure, reliable builds for production environments.
> Disclaimer : Beckn-onix is a reference implementation of the Beckn-onix stack. It is a reference application only and has not been tested for production environmens. However, implementers can fork this repository and build it for scale. The maintainer of this repository holds no liabillity for deployments of this application in production environments.
## GUI Installer ## GUI Installer
There is a community contributed browser based GUI installer to install multi-node reference implementation Beckn network. Refer to the [Installation Guide](./onix-gui/GUI/README.md) and [wizard guide](./onix-gui/README.md) for details. There is a community contributed browser based GUI installer to install multi-node reference implementation Beckn network. Refer to the [Installation Guide](./onix-gui/GUI/README.md) and [wizard guide](./onix-gui/README.md) for details.

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -1,6 +1,8 @@
# Nginx sample configuration for the different components # Nginx sample configuration for the different components
This document lists the various Nginx configuration sample files used in the demo. These use the URLs used as example in the user guide and demo walkthrough. These can be used as a reference. This document lists the various Nginx configuration sample files used in the demo. These use the URLs used as example in the user guide and demo walkthrough. These can be used as a reference. This diagram illustrates the proxy_pass configuration (which is the primary part required) of all the nodes. If you know reverse proxy configuration, this diagram is all you need and you can ignore the rest of this page.
![Reverse Proxy Configuration](../images/reverse_proxy_configuration.png)
## Nginx sample configuration for Registry ## Nginx sample configuration for Registry

View File

@@ -17,7 +17,12 @@ For the sake of illustration, all the urls are shown as subdomains of becknproto
Some of the outputs listed below might be different when you run the script for the first time. The output depends on whether the required docker containers are present in the machine or not. Some of the outputs listed below might be different when you run the script for the first time. The output depends on whether the required docker containers are present in the machine or not.
Note: Due to a [known issue](https://github.com/beckn/beckn-onix/issues/11), on certain machines, when the script is run for the first time, it errors out complaining about permission error in accessing docker daemon. Till this issue is fixed, the work around is to exit the terminal and restart the installation in a new terminal. Run the following two commands on all machines where the script is being run for the first time. Login to a new shell for the command to take effect and continue with the installation. Not doing so will result in docker permisssion error
```
sudo groupadd docker
sudo usermod -aG docker $USER
```
Please refer to the [Beckn-ONIX User Guide](./user_guide.md) for detailed explanation of the below steps. Please refer to the [Beckn-ONIX User Guide](./user_guide.md) for detailed explanation of the below steps.
@@ -48,6 +53,8 @@ The following diagram shows a conceptual view of a multi-node Bekn network that
- https://onix-bpp-client.becknprotocol.io to port 6001 on the machine - https://onix-bpp-client.becknprotocol.io to port 6001 on the machine
- https://onix-bpp.becknprotocol.io to port 6002 on the machine - https://onix-bpp.becknprotocol.io to port 6002 on the machine
![Reverse Proxy Configuration Illustrated](./images/reverse_proxy_configuration.png)
- This guide assumes you have a marketplace or a headless store and want to set it up to work with the Beckn network. It is still useful for people who are developing the buyer side software and want to set it up with the network. In such cases a [sandbox](https://github.com/beckn/beckn-sandbox) might be required to mimic a marketplace or a headless shop. - This guide assumes you have a marketplace or a headless store and want to set it up to work with the Beckn network. It is still useful for people who are developing the buyer side software and want to set it up with the network. In such cases a [sandbox](https://github.com/beckn/beckn-sandbox) might be required to mimic a marketplace or a headless shop.
## Create a new network and install the registry ## Create a new network and install the registry

View File

@@ -15,6 +15,7 @@
- [Connecting BAP Beckn Adapter to BAP Software](#connecting-bap-beckn-adapter-to-bapbuyer-side-software) - [Connecting BAP Beckn Adapter to BAP Software](#connecting-bap-beckn-adapter-to-bapbuyer-side-software)
- [Connecting BPP Beckn Adapter to BPP Software](#connecting-bpp-beckn-adapter-to-bppseller-side-software) - [Connecting BPP Beckn Adapter to BPP Software](#connecting-bpp-beckn-adapter-to-bppseller-side-software)
- [Running Beckn-ONIX locally](#running-beckn-onix-locally) - [Running Beckn-ONIX locally](#running-beckn-onix-locally)
- [Upgrading to a new version](#upgrading-to-a-new-version)
- [Appendix A - subdomain/domain name configuration](#appendix-a---registering-or-adding-domain-or-subdomains) - [Appendix A - subdomain/domain name configuration](#appendix-a---registering-or-adding-domain-or-subdomains)
- [Appendix B - Nginx reverse proxy configuration](#appendix-b---nginx-reverse-proxy-configuration) - [Appendix B - Nginx reverse proxy configuration](#appendix-b---nginx-reverse-proxy-configuration)
@@ -39,6 +40,10 @@ The following diagram shows a conceptual view of a multi-node Beckn network. The
![Typical deployment](./images/sample_deployment.png) ![Typical deployment](./images/sample_deployment.png)
The following diagram shows the reverse proxy configuration (referred to also in the individual installations below) using the URLs used in the examples. Refer to this diagram during the reverse proxy configuration steps.
![Reverse Proxy Configuration](./images/reverse_proxy_configuration.png)
**Use of docker and reference implementations** **Use of docker and reference implementations**
Docker compose and docker are extensively used in the installation and running of the various component software. Similarly the Beckn-ONIX installer, itself being a reference implementation, installs the reference implentation of the Beckn Adapter for the BAP and BPP, reference implementation of the registry and gateway. In order to interact with the internals of these components, we will need to enter the container. Familiarity with Docker will be useful in working with the installation. To list the running containers use `docker ps`. Similarly for example to connect to a container and browse it using shell, use `docker exec -it bap-client sh` Docker compose and docker are extensively used in the installation and running of the various component software. Similarly the Beckn-ONIX installer, itself being a reference implementation, installs the reference implentation of the Beckn Adapter for the BAP and BPP, reference implementation of the registry and gateway. In order to interact with the internals of these components, we will need to enter the container. Familiarity with Docker will be useful in working with the installation. To list the running containers use `docker ps`. Similarly for example to connect to a container and browse it using shell, use `docker exec -it bap-client sh`
@@ -242,6 +247,16 @@ Refer to the [core specification](https://github.com/beckn/protocol-specificatio
- In order for people new to Beckn who want to try out Beckn on their own machine, choose the option to "Set up a network on your local machine" in the main screen. The all in one installation has preconfigured values for variables and so pretty much does not ask for any input. - In order for people new to Beckn who want to try out Beckn on their own machine, choose the option to "Set up a network on your local machine" in the main screen. The all in one installation has preconfigured values for variables and so pretty much does not ask for any input.
## Upgrading to a new version
- The following commands illustrate upgrade of the docker image for Protocol Server (here BPP). Use similar process for other components
```
docker compose -f docker-compose-bpp.yml down
docker rmi fidedocker/protocol-server
docker compose -f docker-compose-bpp.yml up -d
```
## Appendix A - Registering or adding domain or subdomains ## Appendix A - Registering or adding domain or subdomains
All the components of Beckn network need to be publicly accessible. Using domain names for them is the easiest. There are two options for domain names. One is a separate domain name for each component(e.g. registrybp.io). Second is to use subdomains for the individual componetns (e.g. onix-registry.becknprotocol.io , onix-gateway.becknprotocol.io etc). Which one of these two to use depends on the business requirement. For example if an organization is the network facilitator, they might go for a domain name for the registry instead of subdomain. In the examples given above we have primarily used subdomain approach. All the components of Beckn network need to be publicly accessible. Using domain names for them is the easiest. There are two options for domain names. One is a separate domain name for each component(e.g. registrybp.io). Second is to use subdomains for the individual componetns (e.g. onix-registry.becknprotocol.io , onix-gateway.becknprotocol.io etc). Which one of these two to use depends on the business requirement. For example if an organization is the network facilitator, they might go for a domain name for the registry instead of subdomain. In the examples given above we have primarily used subdomain approach.
@@ -278,4 +293,4 @@ In the role of reverse proxy, Nginx will forward communication that came on a pa
[This document](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) explains the configuration of reverse proxy using proxy_pass [This document](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) explains the configuration of reverse proxy using proxy_pass
You can find sample Nginx configuration for the Registry, Gateway, BAP and BPP [here](./sample_nginx_configurations.md) You can find sample Nginx configuration for the Registry, Gateway, BAP and BPP [here](./notes/sample_nginx_configurations.md)

View File

@@ -50,14 +50,12 @@ echo "Your Private Key: $private_key"
echo "Your Public Key: $public_key" echo "Your Public Key: $public_key"
valid_from=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
if [[ $(uname -s ) == 'Darwin' ]];then if [[ $(uname -s ) == 'Darwin' ]];then
valid_from=$(date -u +"%Y-%m-%dT%H:%M:%S.%000Z") valid_from=$(date -u -v-1d +"%Y-%m-%dT%H:%M:%S.%000Z")
valid_until=$(date -u -v+1y +"%Y-%m-%dT%H:%M:%S.%000Z") valid_until=$(date -u -v+3y +"%Y-%m-%dT%H:%M:%S.%000Z")
else else
valid_from=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ") valid_from=$(date -u -d "-1 day" +"%Y-%m-%dT%H:%M:%S.%3NZ")
valid_until=$(date -u -d "+1 year" +"%Y-%m-%dT%H:%M:%S.%3NZ") valid_until=$(date -u -d "+3 year" +"%Y-%m-%dT%H:%M:%S.%3NZ")
fi fi
type=BAP type=BAP

View File

@@ -52,12 +52,13 @@ get_keys
if [[ $(uname -s ) == 'Darwin' ]];then if [[ $(uname -s ) == 'Darwin' ]];then
valid_from=$(date -u +"%Y-%m-%dT%H:%M:%S.%000Z") valid_from=$(date -u -v-1d +"%Y-%m-%dT%H:%M:%S.%000Z")
valid_until=$(date -u -v+1y +"%Y-%m-%dT%H:%M:%S.%000Z") valid_until=$(date -u -v+3y +"%Y-%m-%dT%H:%M:%S.%000Z")
else else
valid_from=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ") valid_from=$(date -u -d "-1 day" +"%Y-%m-%dT%H:%M:%S.%3NZ")
valid_until=$(date -u -d "+1 year" +"%Y-%m-%dT%H:%M:%S.%3NZ") valid_until=$(date -u -d "+3 year" +"%Y-%m-%dT%H:%M:%S.%3NZ")
fi fi
type=BPP type=BPP