- Find the Docker Container ID:
List all running Docker containers to find the ID of the peer container you are interested in:
docker ps
- Access the Container's Filesystem:
Once you have the Container ID, you can access its filesystem using the following command:
docker exec -it <container_id> /bin/sh
- Navigate to Ledger Data:
Inside the container, you can navigate to the directories where Hyperledger Fabric stores the ledger data. The default paths are often as follows:
For the world state:
/var/hyperledger/production/ledgersData/stateLeveldb
For the blockchain data:
<!-- Open folder -->
cd /var/hyperledger/production/ledgersData/chains
<!-- Read block data -->
cat /var/hyperledger/production/ledgersData/chains/chains/mychannel/blockfile_000000
POST /init HTTP/1.1
Host: localhost:4000
POST /add-authority HTTP/1.1
Host: localhost:4000
Content-Type: application/json
Content-Length: 113
{
"type":"authority",
"name": "Ruhul amin",
"authorityId":"ruhul",
"otherInformation":"other "
}
GET /get-all-authorities HTTP/1.1
Host: localhost:4000
POST /create-university HTTP/1.1
Host: localhost:4000
Content-Type: application/json
Content-Length: 120
{
"universityName":"Shahjalal University of Science & Technology (SUST)",
"universityId":"sust",
"status": 1
}
GET /get-university/sust HTTP/1.1
Host: localhost:4000
GET /get-all-universities HTTP/1.1
Host: localhost:4000
POST /create-certificate HTTP/1.1
Host: localhost:4000
Content-Type: application/json
Content-Length: 168
{
"IssueDate":"12-5-2024",
"certID":"123",
"studentID":"bidyut",
"course":"BSC in CSE ",
"details":"write details here"
}
GET /get-certificate/123 HTTP/1.1
Host: localhost:4000
GET /get-all-certificates HTTP/1.1
Host: localhost:4000
POST /share-certificate HTTP/1.1
Host: localhost:4000
Content-Type: application/json
Content-Length: 62
{
"id":123,
"shareWithID":"saif",
"prefix":"cert"
}