get level db key-values without query
Nikos Karamolegkos
Can I somehow (as admin of the network) get all the level DB key-values without querying the ledger via the chaincode?
-- Nikos Karamolegkos R & D engineer at ICS-FORTH Telecommunications and Networks Lab (TNL) |
|
Matthew White
Hi - not sure with LevelDB - CouchDB if configured can be connected to directly.
toggle quoted message
Show quoted text
However it's not something I'd suggest as doing as a routine thing - as the chaincode is there to help enforce access control to data. Matthew -----Original Message-----
From: fabric@... <fabric@...> On Behalf Of Nikos Karamolegkos Sent: 04 October 2022 14:36 To: fabric <fabric@...> Subject: [EXTERNAL] [Hyperledger Fabric] get level db key-values without query Can I somehow (as admin of the network) get all the level DB key-values without querying the ledger via the chaincode? -- Nikos Karamolegkos R & D engineer at ICS-FORTH Telecommunications and Networks Lab (TNL) Unless otherwise stated above: IBM United Kingdom Limited Registered in England and Wales with number 741598 Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU |
|
Nikos Karamolegkos
Ok, it is just for debug. Any ideas will be helpful
toggle quoted message
Show quoted text
On 5/10/22 12:03, Matthew White wrote:
Hi - not sure with LevelDB - CouchDB if configured can be connected to directly. --
Nikos Karamolegkos R & D engineer at ICS-FORTH Telecommunications and Networks Lab (TNL) |
|
David Enyeart
If you are the admin of a Fabric node, in theory you could write a client application that connects to LevelDB to query data. But you would have to understand Fabric data storage internals, and stop the peer process while connecting, so it isn’t really a feasible approach for users.
Another option is taking a snapshot of a peer’s channel. This will output the state database content for the purpose of joining another peer from the current state snapshot, and for comparing snapshots across peers to verify ledger integrity. Again, the snapshot is in an internal format optimized for Fabric utilities, but you could in theory write a utility to parse it with some Fabric internals knowledge (not quite as difficult as writing a LevelDB application). If you do write a utility, please contribute it back! See the ledger snapshot doc - https://hyperledger-fabric.readthedocs.io/en/latest/peer_ledger_snapshot.html
From:
fabric@... <fabric@...> on behalf of Matthew White <whitemat@...> Hi - not sure with LevelDB - CouchDB if configured can be connected to directly.
-----Original Message-----
From: fabric@... <fabric@...> On Behalf Of Nikos Karamolegkos Sent: 04 October 2022 14:36 To: fabric <fabric@...> Subject: [EXTERNAL] [Hyperledger Fabric] get level db key-values without query Can I somehow (as admin of the network) get all the level DB key-values without querying the ledger via the chaincode? -- Nikos Karamolegkos R & D engineer at ICS-FORTH Telecommunications and Networks Lab (TNL) Unless otherwise stated above: IBM United Kingdom Limited Registered in England and Wales with number 741598 Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU |
|
Hi,
If understand correctly, you just want to debug. So I guess the most straight-forward way is to expose the leveldb file from the container to the host. Then you can connect to it, for example by implementing a client and your test-cases that you want to debug or using an existing application that offers for example a GUI. I hope it helps. |
|