Cleaned up blob inspector doc (#3284)

This commit is contained in:
Shams Asari 2018-06-01 14:26:58 +01:00 committed by GitHub
parent 9efb1ecfe0
commit b7fbebb490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,8 +14,12 @@ To run simply pass in the file or URL as the first parameter:
Use the ``--help`` flag for a full list of command line options.
``SerializedBytes`
~~~~~~~~~~~~~~~~~~
When inspecting your custom data structures, there's no need to include the jars containing the class definitions for them
in the classpath. The blob inspector (or rather the serialization framework) is able to synthesis any classes found in the
blob that aren't on the classpath.
SerializedBytes
~~~~~~~~~~~~~~~
One thing to note is that the binary blob may contain embedded ``SerializedBytes`` objects. 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
@ -23,41 +27,41 @@ see this when dealing with classes such as ``SignedData`` or other structures th
``nodeInfo-*`` files or the ``network-parameters`` file in the node's directory. For example, the output of a node-info
file may look like:
.. container:: codeset
.. sourcecode:: yaml
**-\\-format=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==
net.corda.nodeapi.internal.SignedNodeInfo
---
raw:
class: "net.corda.core.node.NodeInfo"
deserialized:
addresses:
- "localhost:10005"
legalIdentitiesAndCerts:
- "O=BankOfCorda, L=London, C=GB"
platformVersion: 4
serial: 1527851068715
signatures:
- !!binary |-
VFRy4frbgRDbCpK1Vo88PyUoj01vbRnMR3ROR2abTFk7yJ14901aeScX/CiEP+CDGiMRsdw01cXt\nhKSobAY7Dw==
.. sourcecode:: json
**-\\-format=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==" ]
net.corda.nodeapi.internal.SignedNodeInfo
{
"raw" : {
"class" : "net.corda.core.node.NodeInfo",
"deserialized" : {
"addresses" : [ "localhost:10005" ],
"legalIdentitiesAndCerts" : [ "O=BankOfCorda, L=London, C=GB" ],
"platformVersion" : 4,
"serial" : 1527851068715
}
},
"signatures" : [ "VFRy4frbgRDbCpK1Vo88PyUoj01vbRnMR3ROR2abTFk7yJ14901aeScX/CiEP+CDGiMRsdw01cXthKSobAY7Dw==" ]
}
Notice the file is actually a serialised ``SignedNodeInfo`` object, which has a ``raw`` property of type ``SerializedBytes<NodeInfo>``.
This property is materialised into a ``NodeInfo`` and is output under the ``deserialized`` field.