diff --git a/hyperledger/1.0/README.md b/hyperledger/1.0/README.md index 223e9e16..25b6f17f 100644 --- a/hyperledger/1.0/README.md +++ b/hyperledger/1.0/README.md @@ -147,7 +147,9 @@ Will explain the usage of `cryptogen` and `configtxgen` ### [WIP] [Some verification tests](./docs/Verification-test.md) -### [WIP] [Use couchDB](./docs/couchdb-usage.md) +### [Use database couchDB](./docs/couchdb-usage.md) + +### [WIP] [kafka usage](./docs/kafka-usage.md) ## Acknowledgement diff --git a/hyperledger/1.0/docker-compose-2orgs-4peers-couchdb.yaml b/hyperledger/1.0/docker-compose-2orgs-4peers-couchdb.yaml new file mode 100644 index 00000000..9c06add8 --- /dev/null +++ b/hyperledger/1.0/docker-compose-2orgs-4peers-couchdb.yaml @@ -0,0 +1,63 @@ + +version: '2' + +services: + couchdb0: + container_name: couchdb0 + image: hyperledger/fabric-couchdb:x86_64-1.0.0-beta + # Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service, + # for example map it to utilize Fauxton User Interface in dev environments. + ports: + - "5984:5984" + + peer0.org1.example.com: + environment: + - CORE_LEDGER_STATE_STATEDATABASE=CouchDB + - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984 + depends_on: + - couchdb0 + + couchdb1: + container_name: couchdb1 + image: hyperledger/fabric-couchdb:x86_64-1.0.0-beta + # Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service, + # for example map it to utilize Fauxton User Interface in dev environments. + ports: + - "6984:5984" + + peer1.org1.example.com: + environment: + - CORE_LEDGER_STATE_STATEDATABASE=CouchDB + - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb1:5984 + depends_on: + - couchdb1 + + couchdb2: + container_name: couchdb2 + image: hyperledger/fabric-couchdb:x86_64-1.0.0-beta + # Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service, + # for example map it to utilize Fauxton User Interface in dev environments. + ports: + - "7984:5984" + + peer0.org2.example.com: + environment: + - CORE_LEDGER_STATE_STATEDATABASE=CouchDB + - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb2:5984 + depends_on: + - couchdb2 + + couchdb3: + container_name: couchdb3 + image: hyperledger/fabric-couchdb:x86_64-1.0.0-beta + # Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service, + # for example map it to utilize Fauxton User Interface in dev environments. + ports: + - "8984:5984" + + peer1.org2.example.com: + environment: + - CORE_LEDGER_STATE_STATEDATABASE=CouchDB + - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb3:5984 + depends_on: + - couchdb3 diff --git a/hyperledger/1.0/docs/couchdb-usage.md b/hyperledger/1.0/docs/couchdb-usage.md index e69de29b..8708d9f9 100644 --- a/hyperledger/1.0/docs/couchdb-usage.md +++ b/hyperledger/1.0/docs/couchdb-usage.md @@ -0,0 +1,32 @@ + +### Start network with CouchDB + +```bash +docker-compose -f docker-compose-2orgs-4peers.yaml -f docker-compose-2orgs-4peers-couchdb.yaml up +``` + +To use CouchDB instead of the default database leveldb, The same chaincode functions are available with CouchDB, however, there is the +added ability to perform rich and complex queries against the state database +data content contingent upon the chaincode data being modeled as JSON + +### Test chaincode_example02 + +```bash +docker exec -it fabric-cli bash + +bash ./scripts/initialize.sh + +bash ./scripts/test_4peers.sh +``` + +You can use chaincode_example02 chaincode against the CouchDB state database +using the steps outlined above, however in order to exercise the CouchDB query +capabilities you will need to use a chaincode that has data modeled as JSON. +(e.g. marbles02) + +### [WIP] [Test example marbles02](https://github.com/hyperledger/fabric/blob/master/examples/chaincode/go/marbles02/marbles_chaincode.go) + +### Interact with CouchDb by WEB-UI + +The browser is `http://localhost:5984/_utils`, then you will find a database named `businesschannel` + \ No newline at end of file diff --git a/hyperledger/1.0/docs/kafka-usage.md b/hyperledger/1.0/docs/kafka-usage.md new file mode 100644 index 00000000..e69de29b diff --git a/hyperledger/1.0/scripts/download_images.sh b/hyperledger/1.0/scripts/download_images.sh index 2d812971..7faf267f 100644 --- a/hyperledger/1.0/scripts/download_images.sh +++ b/hyperledger/1.0/scripts/download_images.sh @@ -17,7 +17,8 @@ echo_b "Downloading images from DockerHub... need a while" docker pull yeasy/hyperledger-fabric-base:$IMG_VERSION \ && docker pull yeasy/hyperledger-fabric-peer:$IMG_VERSION \ && docker pull yeasy/hyperledger-fabric-orderer:$IMG_VERSION \ - && docker pull yeasy/hyperledger-fabric-ca:$IMG_VERSION + && docker pull yeasy/hyperledger-fabric-ca:$IMG_VERSION \ + && docker pull hyperledger/fabric-couchdb:$ARCH-1.0.0-beta # Only useful for debugging # docker pull yeasy/hyperledger-fabric