Where does hyperledger fabric store the database for the blockchain

+1 vote

Hi. I need to know where the Hyperledger fabric stores the database of the Blockchain. I am trying to develop a new chaincode and so I want to clean up the existing Blockchain. I am working on Ubuntu machine and want to delete the relevant files of Hyperledger fabric. So can you tell me where the files of Hyperledger is stored? 

Jul 5, 2018 in Blockchain by charlie_brown
• 7,780 points

recategorized Jul 6, 2018 by Vardhan 1,746 views

4 answers to this question.

+1 vote
Best answer

The data of the Hyperledger Blockchain is stored in folder /var/hyperledger/production/db. Go to this directory:

$ cd /var/hyperledger/production/db

and then remove all the files in it:

$ rm -rf *
answered Apr 29, 2019 by Tina

selected Apr 29, 2019 by Omkar
+1 vote

If you want to delete the installed chaincode, then you can use Docker to delete it. Try this command:

docker stop $(docker ps -aq) && docker rm $(docker ps -aq)
answered Apr 29, 2019 by Rishi
0 votes

You can also try restarting the docker. It will clear the Blockchain. 

$ docker restart
answered Apr 29, 2019 by Kamal
0 votes


$ chaincode stop
answered Apr 29, 2019 by Dinesh
Hey @Dinesh. This might stop the chaincode but the requirement is to clear the files.

Related Questions In Blockchain

0 votes
1 answer

Where does Hyperledger Fabric store the database for the Blockchain?

The Hyperledger Fabric stores the database in ...READ MORE

answered Jul 13, 2018 in Blockchain by Perry
• 17,100 points
0 votes
1 answer

Where can I find the reference format for crypto-config.yaml and configtx.yaml Hyperledger Fabric files?

The sample config files in the Hyperledger Fabric main ...READ MORE

answered Jun 27, 2018 in Blockchain by aryya
• 7,440 points
+1 vote
1 answer
+1 vote
5 answers

Where does the smart contracts stored and executed on blockchain?

Ethereum smart contracts are executed on EVM ...READ MORE

answered May 2, 2018 in Blockchain by Shashank
• 10,400 points
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,720 points
+1 vote
1 answer
0 votes
1 answer

How blocks are linked in the Hyperledger Fabric blockchain?

The structure of block in Hyperledger Fabric ...READ MORE

answered Jul 3, 2018 in Blockchain by Omkar
• 69,150 points
+1 vote
3 answers

Is it possible to store data about arbitrary objects on the blockchain using smart contracts?

Consider following tutorial from Hyperledger Fabric "Getting Started" pages. Basically ...READ MORE

answered Aug 30, 2018 in Blockchain by Artem