How to deserialize GetTransactionByID response in node-sdk? #wsl2 #fabric #fabric-questions #consensus #fabric-sdk-node


Samyak Jain | TraceX
 

Hi All, I've managed to invoke the qscc chaincode to retrieve the transaction serialized response. My question is how do I deserialize it in node.js to get some relevant info out of the same? Can it be parsed into JSON? Please see example below:

�2
�1
�
|�������"common-network-channel*@5551e835471afb4eac6dbbe6f4613de41aa823e88abe93b8e074cb07f75815d6:organization�
�
	tracexMSP�-----BEGIN CERTIFICATE-----
MIICIzCCAcqgAwIBAgIRAL5R5W7fUDIUtK2HKi9Dil4wCgYIKoZIzj0EAwIwbzEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xFzAVBgNVBAoTDnRyYWNleHRlY2guY29tMRowGAYDVQQDExFjYS50
cmFjZXh0ZWNoLmNvbTAeFw0yMDEwMjMxNzIwMDBaFw0zMDEwMjExNzIwMDBaMGkx
CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4g
RnJhbmNpc2NvMQ4wDAYDVQQLEwVhZG1pbjEdMBsGA1UEAwwUQWRtaW5AdHJhY2V4
dGVjaC5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQobLBaWdYKhORgMyLU
m5tvHym4XgdQNrAGEq8K8OIT8slPYbbkCXb2i3JwlVeYH5z22XVqYTc4di/5yyXd
/dOvo00wSzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADArBgNVHSMEJDAi
gCDr3+Ywb+7AvzjlrS03sKLy3LVv39vwgHq2jShyofg+oTAKBggqhkjOPQQDAgNH
ADBEAiBe3kGhlUcMDZJCIYWOjCn7cUL3+YOZnlPBepMFyHvWVwIgDG8FXm4AtDrI
fpVnpOio/blkwjz1HqSZVDvQxpgDaGQ=
-----END CERTIFICATE-----
$D�G#���Lh
���ah�π�de�*
�)
�
�
	tracexMSP�-----BEGIN CERTIFICATE-----
MIICIzCCAcqgAwIBAgIRAL5R5W7fUDIUtK2HKi9Dil4wCgYIKoZIzj0EAwIwbzEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xFzAVBgNVBAoTDnRyYWNleHRlY2guY29tMRowGAYDVQQDExFjYS50
cmFjZXh0ZWNoLmNvbTAeFw0yMDEwMjMxNzIwMDBaFw0zMDEwMjExNzIwMDBaMGkx
CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4g
RnJhbmNpc2NvMQ4wDAYDVQQLEwVhZG1pbjEdMBsGA1UEAwwUQWRtaW5AdHJhY2V4
dGVjaC5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQobLBaWdYKhORgMyLU
m5tvHym4XgdQNrAGEq8K8OIT8slPYbbkCXb2i3JwlVeYH5z22XVqYTc4di/5yyXd
/dOvo00wSzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADArBgNVHSMEJDAi
gCDr3+Ywb+7AvzjlrS03sKLy3LVv39vwgHq2jShyofg+oTAKBggqhkjOPQQDAgNH
ADBEAiBe3kGhlUcMDZJCIYWOjCn7cUL3+YOZnlPBepMFyHvWVwIgDG8FXm4AtDrI
fpVnpOio/blkwjz1HqSZVDvQxpgDaGQ=
-----END CERTIFICATE-----
$D�G#���Lh
���ah�π�de�#
�
�
�organization�
so
�{"id":"7702906226","name":"arunorg","description":"education","address":{"line":"amb road","street":"yengupalem street","village":"vinukonda","city":"vinukonda","district":"prakasam","state":"AP","country":"india","zipcode":"522642","other":[{"SubPlot":"Diamond Towers"}]},"incorporation_date":"1597729360","tax":{"tax_type":"solo","tax_number":"1597729360"},"profileimage":"profileimage","preferences":{"primary_unit":"vinukonda","secondary_unit":"vinukonda","is_active":true,"is_buyer":true,"preferred_language":"uk"},"support_agency":{"name":"arun agency","country":"india","profileimage":"profileimage","type":["aggr"]},"website":{"domain":"arun@...","url":"arun@..."},"userid":"7702906226","audit":{"created_by":"tracextech","updated_by":"tracextech","creation_date":"1597729795","updated_date":"1597729795"},"organization_type":["aggr"],"geolocation":{"id":"7702906226","lat":14.22,"lng":15.22,"alt":14.22}}�
�
 ��5���C��߀5��nn���{�k��J��_�
�	=

_lifecycle/
-
'namespaces/fields/organization/Sequence�	
organization�	


7702906226�

7702906226�{"asset_type":"organization","id":"7702906226","name":"arunorg","description":"education","address":{"line":"amb road","street":"yengupalem street","village":"vinukonda","city":"vinukonda","district":"prakasam","state":"AP","country":"india","zipcode":"522642","other":[{"SubPlot":"Diamond Towers"}]},"incorporation_date":"1597729360","tax":{"tax_type":"solo","tax_number":"1597729360"},"profileimage":"profileimage","preferences":{"primary_unit":"vinukonda","secondary_unit":"vinukonda","is_active":true,"is_buyer":true,"preferred_language":"uk"},"support_agency":{"name":"arun agency","type":["aggr"],"country":"india","profileimage":"profileimage"},"website":{"domain":"arun@...","url":"arun@..."},"userid":"7702906226","audit":{"created_by":"tracextech","updated_by":"tracextech","creation_date":"1597729795","updated_date":"1597729795"},"organization_type":["aggr"],"geolocation":{"id":"7702906226","lat":14.22,"lng":15.22,"alt":14.22},"ledger_meta":{"txn_id":"5551e835471afb4eac6dbbe6f4613de41aa823e88abe93b8e074cb07f75815d6","crtr":"tracextech.com","uby":"tracextech.com","cts":"1603475840","uts":"1604573954"}}�
��
{"data":{"asset_type":"organization","id":"7702906226","name":"arunorg","description":"education","address":{"line":"amb road","street":"yengupalem street","village":"vinukonda","city":"vinukonda","district":"prakasam","state":"AP","country":"india","zipcode":"522642","other":[{"SubPlot":"Diamond Towers"}]},"incorporation_date":"1597729360","tax":{"tax_type":"solo","tax_number":"1597729360"},"profileimage":"profileimage","preferences":{"primary_unit":"vinukonda","secondary_unit":"vinukonda","is_active":true,"is_buyer":true,"preferred_language":"uk"},"support_agency":{"name":"arun agency","type":["aggr"],"country":"india","profileimage":"profileimage"},"website":{"domain":"arun@...","url":"arun@..."},"userid":"7702906226","audit":{"created_by":"tracextech","updated_by":"tracextech","creation_date":"1597729795","updated_date":"1597729795"},"organization_type":["aggr"],"geolocation":{"id":"7702906226","lat":14.22,"lng":15.22,"alt":14.22},"ledger_meta":{"txn_id":"5551e835471afb4eac6dbbe6f4613de41aa823e88abe93b8e074cb07f75815d6","crtr":"tracextech.com","uby":"tracextech.com","cts":"1603475840","uts":"1604573954"}},"meta":{"creator_id":"","modifier_id":"tracexMSP","txn_id":"5551e835471afb4eac6dbbe6f4613de41aa823e88abe93b8e074cb07f75815d6"},"status":{"code":"200","debug_message":"null","display_message":"success","error":"null"}}"organization1.0�
�
	tracexMSP�-----BEGIN CERTIFICATE-----
MIICITCCAcigAwIBAgIQa5NGzoV4eU0C5sKoSKvQcjAKBggqhkjOPQQDAjBvMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
YW5jaXNjbzEXMBUGA1UEChMOdHJhY2V4dGVjaC5jb20xGjAYBgNVBAMTEWNhLnRy
YWNleHRlY2guY29tMB4XDTIwMTAyMzE3MjAwMFoXDTMwMTAyMTE3MjAwMFowaDEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xDTALBgNVBAsTBHBlZXIxHTAbBgNVBAMTFHBlZXIwLnRyYWNleHRl
Y2guY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJKfSqtypNp8WypKBHZ9P
GrUm1ttTU4N9D12dj9T1w2xssATIRgUlbOztaUsjsADPUbMbSe58SPwdh5cv30ei
N6NNMEswDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAg
69/mMG/uwL845a0tN7Ci8ty1b9/b8IB6to0ocqH4PqEwCgYIKoZIzj0EAwIDRwAw
RAIgSDnJjs/OHmFgt9iYjcQaDlufImCFjPqyUmnxZiUfB+gCIBLldSzvrTGI9nqJ
KCbjPhOABYryvAP6XxUWU24hU+cl
-----END CERTIFICATE-----
G0E!

Thanks! Samyak Jain

Join fabric@lists.hyperledger.org to automatically receive all group messages.