Skip to content

Commit 38d7521

Browse files
maheshwarishikhadipeeka Patil
authored and
dipeeka Patil
committed
Update README.md
1 parent fd56500 commit 38d7521

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## ** Work in Progress **
2-
# Postgre SQL Database as a Fabric Certificate Wallet
2+
# Postgre SQL Database as a Fabric Wallet
33

44
Security on the Hyperledger Fabric is enforced with digital signatures. All requests made to the fabric must be signed by users with appropriate enrolment certificates. Once user is enrolled, Node js application persist certificate in wallet for future usages.
55

@@ -84,11 +84,17 @@ There are two approaches to set up PostgreSQL DB instance. Follow any one of tho
8484

8585
### PostgreSQL as a service on IBM Cloud
8686

87-
IBM Cloud provides [PostgreSQL DB](https://cloud.ibm.com/catalog/services/databases-for-postgresql) as a service. Type postgreSQL in catalog search box on IBM Cloud Dashboard and create PostgreSQL instance. Once service is created, navigate to left menu and create service credentials.
87+
IBM Cloud provides [PostgreSQL DB](https://cloud.ibm.com/catalog/services/databases-for-postgresql) as a service. Type postgreSQL in catalog search box on IBM Cloud Dashboard and create PostgreSQL instance.
8888

8989
![PostgreSQL Service](images/postgresql-service.PNG)
9090

9191

92+
Once service is created, navigate to left menu and create service credentials.
93+
94+
![](images/postgresql_cloud.PNG)
95+
96+
DB credentials will be used further in `step 5`.
97+
9298
### PostgreSQL as a Kubernetes container
9399

94100
To Deploy PostgreSQL on Kubernetes, ensure you are able to run `kubectl` commands properly and then follow below steps.
@@ -148,9 +154,18 @@ $ kubectl create -f postgres-service.yaml
148154
service "postgres" created
149155
```
150156

151-
* **Prepare connection string for Postgres DB**
157+
* **Get Credentials for Postgres DB**
152158

153159
* *Get port of Postgre*
160+
161+
To get port number, run command as:
162+
163+
```
164+
$ kubectl get svc postgres
165+
NAME       TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
166+
postgres   NodePort   *.**7.*1.*53   <none>        5432:31070/TCP   5m
167+
```
168+
Here, 31070 is external port number for postgreSQL service running on kubernetes cluster.
154169
155170
* *Get the public IP for Kubernetes Cluster*
156171
@@ -164,26 +179,19 @@ service "postgres" created
164179
165180
Make a note of this public IP.
166181
167-
* *Connection string of PostgresDB*
182+
* *Credentials of PostgresDB*
183+
184+
This port number and cluster public ip will be used further in `step 5`.
168185
169186
170187
## 5. Update connection profile and PostgreSQL credentials
171188
172-
After setting up fabric network and postgreSQL DB as mentioned in step 3 and 4, perform the following steps:
173-
* replace ```server/config/connection-profile.json``` with your fabric network connection profile which was downloaded in `step 3`.
174-
* replace ```server/config/local-postgres-config.json``` with your postgreSQL credentials (in case of IBM Cloud PostgreSQL service).
175-
![](images/postgresql_cloud.PNG)
176-
177-
Current postgresconfig contains postgreSQL credentials for dockerized postgreSQL.replace public_ip with your public cluster IP noted from above step.
189+
After setting up fabric network and PostgreSQL DB as mentioned above, perform the following steps:
178190
179-
To get port number
180-
```
181-
$ kubectl get svc postgres
182-
NAME       TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
183-
postgres   NodePort   *.**7.*1.*53   <none>        5432:31070/TCP   5m
184-
```
185-
31070 is external port number for postgreSQL service running on kubernetes cluster. Replace your port number and cluster ip in ```server/config/local-postgres-config.json```
191+
* Replace ```server/config/connection-profile.json``` with your fabric network connection profile which was downloaded in `step 3`.
186192
193+
* Replace your postgreSQL credentials in ```server/config/local-postgres-config.json```. In case of containerised Postgres DB replace IP and port in this json file. And in case of IBM Cloud PostgreSQL service copy your postgreSQL credentials in this json file.
194+
187195
## 6. Run the application
188196
189197
**Deploy node app locally**

0 commit comments

Comments
 (0)