Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-16406

Statedb supports MongoDB

    XMLWordPrintable

Details

    • Story
    • Status: Backlog
    • Medium
    • Resolution: Unresolved
    • None
    • None
    • fabric-ledger, fabric-peer
    • None
    • Unset
    • Unset
    • Yes

    Description

      We have edited the code so that StateDB can support MongoDB.

      We will be supporting MongoDB from version 3.4. We have determined the version on the basis of https://hub.docker.com/_/mongo Shared Tags.

      The added code was programmed similar to the content of leveldb and touchdb to maintain compatibility with previous versions and minimize necessary changes.

      The test has been carried successfulle on first-network sameple of Fabric 1.4.2 version without any problem. Also, it appeared as twice as higher as CouchDB in the TPS test result when thoroughly checked.

      The following content is about integrating MongoDB with first-network sameple of Fabric 1.4.2 version in Ubuntu 18.04.

      Prerequisite

      1. curl(sudo apt-get update && sudo apt-get install curl)
      2. git(sudo apt-get update && sudo apt-get install git)
      3. docker(https://docs.docker.com/install/linux/docker-ce/ubuntu/)
      4. docker-compose(https://docs.docker.com/compose/install/)
      5. golang(https://golang.org/doc/install#install)
      6. Setting for GOPATH's environment variables

      Installation of Hyperledger Fabric First Network Sample

      Download Fabric Sample of the Fabric with version v1.4.2.

      curl -sSL http://bit.ly/2ysbOFE | bash -s -- 1.4.2 1.4.2 0.4.15

      After successfully downloading please move fabric-samples to directory and then make a clone of first-network sample which supports MongoDB.

      cd fabric-samples
      git remote add -f mongodb https://github.com/developer-Berith/fabric-samples.git
      git pull mongodb v1.4.2-mongodb
      

      Build Peer, Tools MongoDB

      Create src/github.com/hyperledger as a subdirectory from the directory you set for the GOPATH environment variable.

      mkdir -p $GOPATH/src/github.com/hyperledger
      

      Create src/github.com/hyperledger as a subdirectory from the directory you set for the GOPATH environment variable.

      git clone -b v1.4.2-mongodb https://github.com/developer-Berith/fabric.git
      

      Once the git clone is complete, move to fabric directory and process Build.

      make clean ; make peer ; make peer-docker
      make tools-docker
      

      Once the Build is completed, the images which were originally in hyperledger/fabric-tools, hyperledger/fabric-peer will be deleted and will be saved to the newly built hyperledger/fabric-tools, hyperledger/fabric-peer. Check if the time of creation is the latest or not from the properties of CREATED using the command of docker images.

      docker images
      

      Run Hyperledger Fabric First Network Sample

      Go to the directory of fabric-samples and run the First Network Sample after entering the option value as mongodb in byfn.sh script.

      ./byfn.sh up -s mongodb
      

      If this is processed correctly then it will perform the same operation as the original First Network Sample.

      Attachments

        Issue Links

          Activity

            People

              Berith Developer Berith
              Berith Developer Berith
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: