-
Clone the protocol-server repository twice and rename the project folders to
- PS-BAP-Client
- PS-BAP-Network
git clone https://github.com/beckn/protocol-server.git cd {folder_name} git checkout master npm i
-
Create default.yml file in PS-BAP-Client directory at location
~/config/default.yml
. -
Create default.yml file in PS-BAP-Network directory at location
~/config/default.yml
-
To install Redis, MongoDB and RabbitMQ on docker, navigate to
docker
directory in either PS-BAP-Client or PS-BAP-Network and run docker-compose using below command.
NOTE: The same instance of Redis, MongoDB, and RabbitMQ can be used for the BAP-Client, BAP-Network & BPP-Client, BPP-Network
cd docker
docker-compose up -d
-
Copy the content of
PS-BAP-Client/config/samples/bap-client.yaml
and paste it toPS-BAP-Client/config/default.yml
. -
copy the content of
PS-BAP-Network/config/samples/bap-network.yaml
and paste it toPS-BAP-Network/config/default.yml
. -
To generate key pairs that will be used in registry entry and
default.yml
files, go into PS-BAP-Network dir and runnpm run generate-keys
Sample Output:
Generating Key Pairs... Key Pairs Generated Your Public Key : taRF+XAJ3o2E3NDWPj5fPGq5HTVNqa/DKPx8VTpMvlg= Your Private Key : Uh/qEeDz5LrZapUKal2vY4fxffIONciN1JWMMSVvcwu1pEX5cAnejYTc0NY+Pl88arkdNU2pr8Mo/HxVOky+WA==
-
To expose local PS-BAP-Network to the Internet follow Exposing local Protocol-server to Internet
-
After generating the public URL follow Registering on BECKN Registry to register the PS-BAP-Network on Beckn registry.
-
After Registration, configure the
default.yml
of both PS-BAP-Client and PS-BAP-Network as per the details provided below.-
Port: Enter the port where you want to run your application.
-
Cache: Change the host and port where your Redis is running. If you are running it on the same machine using a Docker Compose file, set
host
to "0.0.0.0" andport
to 6379. -
Response Cache: Change the host and port where your MongoDB is running. If you are running it on the same machine using a Docker Compose file, set
host
to "0.0.0.0,"port
to 27017, and provide the username, password, and database as set in the Docker Compose file. This url will also be used in synchronous mode asmongoURL
-
Private Key: Copy the private key generated in the Key-Pair Generation step.
-
Public Key: Copy the public key generated in the Key-Pair Generation step.
-
Subscriber Id: Copy the subscriber ID from the respective Registry entry.
-
Subscriber Uri: Copy the subscriberUri from the Registry entry.
-
Unique Key: Copy the participant-key from the Registry entry (participant key tab).
-
-
Run the
BAP-Client
in Development Mode :cd PS-BAP-Client npm run dev
-
Run the
BAP-Network
in Development Mode :cd PS-BAP-Network npm run dev
-
Clone the protocol-server repository twice and rename the project folders to
- PS-BPP-Client
- PS-BPP-Network
git clone https://github.com/beckn/protocol-server.git cd {folder_name} git checkout master npm i
-
Create default.yml file in PS-BPP-Client directory at location
~/config/default.yml
. -
Create default.yml file in PS-BPP-Network directory at location
~/config/default.yml
-
To install Redis, MongoDB and RabbitMQ on docker, navigate to
docker
directory in either PS-BPP-Client or PS-BPP-Network and run docker-compose using the below command.
NOTE: The same instance of Redis, MongoDB, and RabbitMQ can be used for the BAP-Client, BAP-Network & BPP-Client, BPP-Network
cd docker
docker-compose up -d
-
Copy the content of
BPP-client/config/samples/BPP-client.yaml
and paste it toBPP-client/config/default.yml
. -
copy the content of
BPP-network/config/samples/BPP-network.yaml
and paste it toBPP-network/config/default.yml
. -
To generate key pairs that will be used in registry entry and
default.yml
files, go into PS-BPP-Network directory and runnpm run generate-keys
Sample Output:
Generating Key Pairs... Key Pairs Generated Your Public Key : taRF+XAJ3o2E3NDWPj5fPGq5HTVNqa/DKPx8VTpMvlg= Your Private Key : Uh/qEeDz5LrZapUKal2vY4fxffIONciN1JWMMSVvcwu1pEX5cAnejYTc0NY+Pl88arkdNU2pr8Mo/HxVOky+WA==
-
To expose local PS-BPP-Network to the Internet follow Exposing local Protocol-server to Internet
-
After generating the public URL follow Registering on BECKN Registry to register the PS-BPP-Network on Beckn registry.
-
After registration, configure the
default.yml
of both PS-BPP-Client and PS-BPP-Network as per the details provided below.-
Port: Enter the port where you want to run your application.
-
Cache: Change the host and port where your Redis is running. If running it on the same machine using a Docker Compose file, set
host
to "0.0.0.0" andport
to 6379. -
Response Cache: Change the host and port where your MongoDB is running. If you are running it on the same machine using a Docker Compose file, set
host
to "0.0.0.0,"port
to 27017, and provide the username, password, and database as set in the Docker Compose file. -
Private Key: Copy the private key generated in the Key-Pair Generation step.
-
Public Key: Copy the public key generated in the Key-Pair Generation step.
-
Subscriber Id: Copy the subscriber ID from the respective Registry entry.
-
Subscriber Uri: Copy the subscriberUri from the Registry entry.
-
Unique Key: Copy the participant-key from the Registry entry (participant key tab).
-
Webhook URL: Copy the public URL generated by the local-tunnel for webhook.
-
-
Run the
BPP-Client
in Development Mode :cd PS-BPP-Client npm run dev
-
Run the
BPP-Network
in Development Mode :cd PS-BPP-Network npm run dev
- Install localtunnel globally using
npm install -g localtunnel
. - Run
lt --port <BAP/BPP network port> --subdomain <any subdomain>
for both BAP and BPP networks (use the same subdomain each time for consistency). [Example:lt --port 5001 --subdomain beckn-bap-network
]
NOTE:
Whenever the system or LocalTunnel is restarted the the generated localtunnel DNS will be changed. We have to register the newly generated local tunnel DNS after restarting the registry and default.yml files respectively.
To register on the BECKN Registry, follow these steps:
-
Access the Registry URL.
-
Create an account using signup flow.
-
In the Registry, go to the admin tab and choose "Network Participant."
-
Click the "+" icon to create entries for both the BAP and BPP networks.
-
Enter ParticipantIDs for each network, for BAP Network and BPP Network. (Note: We will refer to these as "subscriberIDs" going forward.)
-
Edit the created entries for BAP and BPP networks.
-
Select the "Network Role Tab."
-
Choose the network domain (leave it blank for universal BAP/BPP).
-
Set the Type as "BAP" for the BAP network and "BPP" for the BPP network.
-
Enter the respective "SubscriberID" created in the previous step (Create Network Participants).
-
Set the Status field to "subscribed."
-
Copy the generated URLs (LocalTunnel) and paste them in the URL field on the respective network role tab in the Registry.
-
Save the changes.
-
In the Registry, go to the participant key tab for both BAP and BPP networks.
-
Click the "+" icon to add a participant key entry.
-
Provide a key (used as uniqueKey in default.yml).
-
Copy the generated public keys from the Key-Pair Generation step and paste them in the "Signing Public Key" and "Encryption Public Key" fields.
-
Set the Valid from date to the current date and the Valid until date to a date at least one year ahead.
-
Check the "Verified" checkbox and save the entry.
To access the Postman collection please follow these steps:
- Navigate to the Beckn-Sandbox repository on GitHub, available at github.com/beckn/beckn-sandbox.
- Within the repository, locate and enter the
artifacts
directory. - Inside the artifacts directory, find the
Industry 4.0
collection. - Once you have located the Industry 4.0 collection, open it and copy the URL directly from your browser's address bar.
- Paste this URL into Postman to begin working with the collection.