Skip to content

Commit

Permalink
Documentation update: external chaincode and index for db
Browse files Browse the repository at this point in the history
Signed-off-by: Yury Andreev <andreevym@gmail.com>
  • Loading branch information
yandreev authored and denyeart committed Jan 20, 2020
1 parent 04e5312 commit b6a2325
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/source/cc_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ The chaincode package should be used to provide two pieces of information to the
* provide chaincode endpoint information in a `connection.json` file placed in the release directory. The `bin/run` section describes the `connection.json` file

There is plenty of flexibility to gathering the above information. The sample scripts in the [External builder and launcher sample scripts](#external-builder-and-launcher-sample-scripts) illustrate a simple approach to providing the information.
As an example of flexibility, consider packaging couchdb index files ( see https://hyperledger-fabric.readthedocs.io/en/release-1.4/couchdb_tutorial.html#add-the-index-to-your-chaincode-folder
) (`/metadata/statedb/couchdb/indexes/`). Sample scripts below describe an approach to packaging the files into code.tar.gz.
As an example of flexibility, consider packaging couchdb index files (see [Add the index to your chaincode folder](https://hyperledger-fabric.readthedocs.io/en/release-1.4/couchdb_tutorial.html#add-the-index-to-your-chaincode-folder)) (`/metadata/statedb/couchdb/indexes/`). Sample scripts below describe an approach to packaging the files into code.tar.gz.

```
tar cfz code.tar.gz connection.json metadata
Expand Down Expand Up @@ -119,15 +118,15 @@ SOURCE=$1
OUTPUT=$3

#external chaincodes expect connection.json file in the chaincode package
if [ ! -f "$SOURCE/connection.json" ] ; then
if [ ! -f "$SOURCE/connection.json" ]; then
>&2 echo "$SOURCE/connection.json not found"
exit 1
fi

#simply copy the endpoint information to specified output location
cp $SOURCE/connection.json $OUTPUT/connection.json

if [ -d "$SOURCE/metadata" ] ; then
if [ -d "$SOURCE/metadata" ]; then
cp -a $SOURCE/metadata $OUTPUT/metadata
fi

Expand Down

0 comments on commit b6a2325

Please sign in to comment.