You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changes:
modified: docs/Setup/NodeSDK-setup.md
modified: docs/index.md
new file: docs/nodeSDK/app-developer-env-setup.md
new file: docs/nodeSDK/app-overview.md
new file: docs/nodeSDK/node-sdk-guide.md
new file: docs/nodeSDK/node-sdk-indepth.md
new file: docs/nodeSDK/node-sdk-self-contained.md
new file: docs/nodeSDK/sample-standalone-app.md
new file: docs/nodeSDK/sample-web-app.md
new sample file: examples/sdk/node/standalone-app.js
new sample file: examples/sdk/node/web-app.js
Change-Id: I65f0f470806bc66a28d151780e1f36cf05b509df
Signed-off-by: Bret Harrison <[email protected]>
cd $GOPATH/src/github.com/chaincode_example02
187
-
curl GET https://raw.githubusercontent.com/hyperledger/fabric/master/examples/chaincode/go/chaincode_example02/chaincode_example02.go > chaincode_example02.go
188
-
```
189
-
190
-
After you have placed your chaincode project under the `$GOPATH/src`, you will need to vendor the dependencies. From the directory containing your chaincode source, run the following commands:
191
-
192
-
```
193
-
go get -u github.com/kardianos/govendor
194
-
cd $GOPATH/src/github.com/chaincode_example02
*Note:* If you cleanup the folder `/var/hyperledger/production` then don't
270
-
forget to copy again the *tlsca.cert* file as described above.
271
-
272
-
## Running Unit Tests
273
-
HFC includes a set of unit tests implemented with the
274
-
[tape framework](https://github.com/substack/tape). The
275
-
[unit test script](https://github.com/hyperledger/fabric/blob/master/sdk/node/bin/run-unit-tests.sh)
276
-
builds and runs both the membership service server and the peer node for you,
277
-
therefore you do not have to start those manually.
278
-
279
-
### Running the SDK unit tests
280
-
HFC includes a set of unit tests implemented with the
281
-
[tape framework](https://github.com/substack/tape). To run the unit tests,
282
-
execute the following commands:
283
-
284
-
cd $GOPATH/src/github.com/hyperledger/fabric
285
-
make node-sdk-unit-tests
286
-
287
-
The following are brief descriptions of each of the unit tests that are being
288
-
run.
289
-
290
-
#### registrar
291
-
The [registrar.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/registrar.js)
292
-
test case exercises registering users with Membership Services. It also tests
293
-
registering a designated registrar user which can then register additional users.
294
-
295
-
#### chain-tests
296
-
The [chain-tests.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/chain-tests.js)
297
-
test case exercises the [chaincode_example02.go](https://github.com/hyperledger/fabric/tree/master/examples/chaincode/go/chaincode_example02)
298
-
chaincode when it has been deployed in both development mode and network mode.
299
-
300
-
#### asset-mgmt
301
-
The [asset-mgmt.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/asset-mgmt.js)
302
-
test case exercises the [asset_management.go](https://github.com/hyperledger/fabric/tree/master/examples/chaincode/go/asset_management)
303
-
chaincode when it has been deployed in both development mode and network mode.
304
-
305
-
#### asset-mgmt-with-roles
306
-
The [asset-mgmt-with-roles.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/asset-mgmt-with-roles.js)
307
-
test case exercises the [asset_management_with_roles.go](https://github.com/hyperledger/fabric/tree/master/examples/chaincode/go/asset_management_with_roles)
308
-
chaincode when it has been deployed in both development mode and network mode.
309
-
310
-
#### Troublingshooting
311
-
If you see errors stating that the client has already been registered/enrolled,
312
-
keep in mind that you can perform the enrollment process only once, as the
313
-
enrollmentSecret is a one-time-use password. You will see these errors if you
314
-
have performed a user registration/enrollment and subsequently deleted the
315
-
cryptographic tokens stored on the client side. The next time you try to enroll,
316
-
errors similar to the ones below will be seen.
317
-
318
-
```
319
-
Error: identity or token do not match
320
-
```
321
-
```
322
-
Error: user is already registered
323
-
```
324
-
325
-
To address this, remove any stored cryptographic material from the CA server by
326
-
following the instructions [here](https://github.com/hyperledger/fabric/blob/master/docs/Setup/Chaincode-setup.md#removing-temporary-files-when-security-is-enabled).
327
-
You will also need to remove any of the cryptographic tokens stored on the
328
-
client side by deleting the KeyValStore directory. That directory is
329
-
configurable and is set to `/tmp/keyValStore` within the unit tests.
26
+
First, you'll want to have a running peer node and member services. The
27
+
instructions for setting up a network are
28
+
[here](Network-setup.md). You may also use the [self contained environment](../nodeSDK/node-sdk-self-contained.md) that provides the network.
0 commit comments