corda/docs/source/blob-inspector.rst
Shams Asari 4e0378de9c
CORDA-1238: Moved the blob inspector out of experimental and wired it to JackonSupport (#3224)
The existing output format was not complete and so was deleted to avoid it becoming a tech debt. We can always resurrect it at a later point.
2018-05-24 18:26:55 +01:00

2.5 KiB

Blob Inspector

There are many benefits to having a custom binary serialisation format (see serialization for details) but one disadvantage is the inability to view the contents in a human-friendly manner. The blob inspector tool alleviates this issue by allowing the contents of a binary blob file (or URL end-point) to be output in either YAML or JSON. It uses JacksonSupport to do this (see json).

The latest version of the tool can be downloaded from here.

To run simply pass in the file or URL as the first parameter:

java -jar blob-inspector.jar <file or URL>

Use the --help flag for a full list of command line options.

SerializedBytes` ~~~~~~~~~~~~~~~~~~ One thing to note is that the binary blob may contain embeddedSerializedBytesobjects. Rather than printing these out as a Base64 string, the blob inspector will first materialise them into Java objects and then output those. You will see this when dealing with classes such asSignedDataor other structures that attach a signature, such as thenodeInfo-*files or thenetwork-parametersfile in the node's directory. For example, the output of a node-info file may look like: .. container:: codeset .. sourcecode:: yaml net.corda.nodeapi.internal.SignedNodeInfo --- raw: class: "net.corda.core.node.NodeInfo" deserialized: addresses: - "localhost:10011" legalIdentitiesAndCerts: - "O=BankOfCorda, L=New York, C=US" platformVersion: 4 serial: 1527074180971 signatures: - !!binary | dmoAnnzcv0MzRN+3ZSCDcCJIAbXnoYy5mFWB3Nijndzu/dzIoYdIawINXbNSY/5z2XloDK01vZRV TreFZCbZAg== .. sourcecode:: json net.corda.nodeapi.internal.SignedNodeInfo { "raw" : { "class" : "net.corda.core.node.NodeInfo", "deserialized" : { "addresses" : [ "localhost:10011" ], "legalIdentitiesAndCerts" : [ "O=BankOfCorda, L=New York, C=US" ], "platformVersion" : 4, "serial" : 1527074180971 } }, "signatures" : [ "dmoAnnzcv0MzRN+3ZSCDcCJIAbXnoYy5mFWB3Nijndzu/dzIoYdIawINXbNSY/5z2XloDK01vZRVTreFZCbZAg==" ] } Notice the file is actually a serialisedSignedNodeInfoobject, which has arawproperty of typeSerializedBytes<NodeInfo>. This property is materialised into aNodeInfoand is output under thedeserialized`` field.