Skip to content

Commit

Permalink
[FABN-1350] enhance network-config tutorial
Browse files Browse the repository at this point in the history
fix typo: add "is"

Signed-off-by: eujungkim <[email protected]>
Change-Id: I5900deaf29a9ab8d54af7c4abbb1683c2da366f4
  • Loading branch information
eujungkim committed Aug 16, 2019
1 parent 79b528a commit fbad794
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/tutorials/network-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ client.initCredentialStores()
```

### Work with user context
When there is certificate Authority information on the organization, the fabric client may be used to simplify the enrollment and user context creation. The application will still have to register new users with the certificate authority, however when a connection profile configuration has been loaded there a simpler way to get a certificate authority client.
When there is certificate Authority information on the organization, the fabric client may be used to simplify the enrollment and user context creation. The application will still have to register new users with the certificate authority, however when a connection profile configuration has been loaded there is a simpler way to get a certificate authority client.

So first let's enroll an admin user so that we have the credentials (crypto material) needed to interact with the certificate authority and the fabric network. The following convenience method will first look in the state store (as defined above) to see if the user exist. If the user is not found and there is a connection profile configuration loaded, the fabric client will build a certificate authority client object as defined in the fabric client configuration with the address as defined in the currently loaded connection profile configuration. The fabric client uses the certificate authority client to enroll the admin user with the certificate authority, this requires that a new set of keys be generated on the client side. The fabric client will then use the signed certificate returned by the certificate authority from the enroll to create a user context. The context will then be assign it to fabric client and stored in the state store along with storing the keys in the crypto store. At this point the fabric client is ready to interact with the fabric network and the application may use the returned user object to interact with the certificate authority.

In the following example we are able to enroll the user because it known by the certificate authority. New users will have to be registered first.
In the following example we are able to enroll the user because it is known by the certificate authority. New users will have to be registered first.
```
client.setUserContext({username:'admin', password:'adminpw'})
.then((admin) => {
Expand Down

0 comments on commit fbad794

Please sign in to comment.