I have hyperledger fabric "First Network" up and running in Vagrant on Window 7. I would like to query on following tables of fabric ca database:
Kindly help me how and where I can find fabric ca database,
Thank You.
If you are using version 1.1, you can use the fabric-ca-client affiliation list and fabric-ca-client identity list commands to see the affiliations and users table, respectively. The ability to list the certificates will be in a future version of the fabric-ca-client.
By default, the fabric-ca-server uses SQLITE and the name of the database file is fabric-ca-server.db in the home directory of the fabric-ca-server. You can use the sqlite3 fabric-ca-server.db command to enter a sqlite shell, and then issue select * from users to list the users table for example.
You need to login to the docker container to run sqlite3 fabric-ca-server.db. Follow these steps:
$ docker ps
find your Fabric-ca container name from the response. Then issue this command:
$ sudo docker exec -it <your-ca> /bin/bash
After logging in, change directories:
root@c6cc601b0360:/# cd ca
root@c6cc601b0360:/ca#
Then connect to the database:
root@c6cc601b0360:/ca# sqlite3 fabric-ca-server.db
Run a test query:
root@c6cc601b0360:/ca# select * from users
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With