官方示例其实是有完整例子的, 但是我想你可能对那几千行代码不是很感兴趣, 所以把解析读写集部分给摘出来了, 代码奉上
public static List
解析出来的结果:
{
"MSPID": "Org1MSP",
"validationCodeName": "VALID",
"isValid": true,
"endorsementsCount": 2,
"validationCode": 0,
"usercert": "-----BEGIN CERTIFICATE-----\nMIICKzCCAdGgAwIBAgIRAIF2IpfrV1NNOxn4LvKa2wAwCgYIKoZIzj0EAwIwczEL\nMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG\ncmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjAwNjE5MTI0MDAwWhcNMzAwNjE3MTI0MDAw\nWjBsMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN\nU2FuIEZyYW5jaXNjbzEPMA0GA1UECxMGY2xpZW50MR8wHQYDVQQDDBZVc2VyMUBv\ncmcxLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzYjdYD03\n5MyUfJMu6jXFLGBHJLYUsIUM5FbW+0x6x/6ncT921QDZKuKRvGZY9X/NmNerzAri\nf12OFnfKEhfLBaNNMEswDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYD\nVR0jBCQwIoAgIlJzB2U8NvdZvMWgATkcePQFA9u7ELRjZy66MSZLE7cwCgYIKoZI\nzj0EAwIDSAAwRQIhALSjWg1uKJkM/HseDRwbGDrrX3OnnQpx7/3eYWydz9vFAiBE\npMOUnQUtwNHb+S39qJV+6lnuaBbbYGVytcCu4KPa9Q==\n-----END CERTIFICATE-----\n",
"transactionID": "48369bb2bedf4a404e19cde5e57566b090a524ffdc497cec709440b422847f7b",
"RWSet": [
{
"read": [
"mycc2"
],
"write": {}
},
{
"read": [
"a",
"b"
],
"write": {
"a": "142",
"b": "413"
}
}
],
"argus": [
"invoke",
"a",
"b",
"5"
],
"chaincodeVersion": "1.0",
"timestamp": 1593584729787,
"status": 200,
"chaincodeName": "mycc2"
}
另外附上官方给的验证结果表
/**
* VALID = 0;
*/
public static final int VALID_VALUE = 0;
/**
* NIL_ENVELOPE = 1;
*/
public static final int NIL_ENVELOPE_VALUE = 1;
/**
* BAD_PAYLOAD = 2;
*/
public static final int BAD_PAYLOAD_VALUE = 2;
/**
* BAD_COMMON_HEADER = 3;
*/
public static final int BAD_COMMON_HEADER_VALUE = 3;
/**
* BAD_CREATOR_SIGNATURE = 4;
*/
public static final int BAD_CREATOR_SIGNATURE_VALUE = 4;
/**
* INVALID_ENDORSER_TRANSACTION = 5;
*/
public static final int INVALID_ENDORSER_TRANSACTION_VALUE = 5;
/**
* INVALID_CONFIG_TRANSACTION = 6;
*/
public static final int INVALID_CONFIG_TRANSACTION_VALUE = 6;
/**
* UNSUPPORTED_TX_PAYLOAD = 7;
*/
public static final int UNSUPPORTED_TX_PAYLOAD_VALUE = 7;
/**
* BAD_PROPOSAL_TXID = 8;
*/
public static final int BAD_PROPOSAL_TXID_VALUE = 8;
/**
* DUPLICATE_TXID = 9;
*/
public static final int DUPLICATE_TXID_VALUE = 9;
/**
* ENDORSEMENT_POLICY_FAILURE = 10;
*/
public static final int ENDORSEMENT_POLICY_FAILURE_VALUE = 10;
/**
* MVCC_READ_CONFLICT = 11;
*/
public static final int MVCC_READ_CONFLICT_VALUE = 11;
/**
* PHANTOM_READ_CONFLICT = 12;
*/
public static final int PHANTOM_READ_CONFLICT_VALUE = 12;
/**
* UNKNOWN_TX_TYPE = 13;
*/
public static final int UNKNOWN_TX_TYPE_VALUE = 13;
/**
* TARGET_CHAIN_NOT_FOUND = 14;
*/
public static final int TARGET_CHAIN_NOT_FOUND_VALUE = 14;
/**
* MARSHAL_TX_ERROR = 15;
*/
public static final int MARSHAL_TX_ERROR_VALUE = 15;
/**
* NIL_TXACTION = 16;
*/
public static final int NIL_TXACTION_VALUE = 16;
/**
* EXPIRED_CHAINCODE = 17;
*/
public static final int EXPIRED_CHAINCODE_VALUE = 17;
/**
* CHAINCODE_VERSION_CONFLICT = 18;
*/
public static final int CHAINCODE_VERSION_CONFLICT_VALUE = 18;
/**
* BAD_HEADER_EXTENSION = 19;
*/
public static final int BAD_HEADER_EXTENSION_VALUE = 19;
/**
* BAD_CHANNEL_HEADER = 20;
*/
public static final int BAD_CHANNEL_HEADER_VALUE = 20;
/**
* BAD_RESPONSE_PAYLOAD = 21;
*/
public static final int BAD_RESPONSE_PAYLOAD_VALUE = 21;
/**
* BAD_RWSET = 22;
*/
public static final int BAD_RWSET_VALUE = 22;
/**
* ILLEGAL_WRITESET = 23;
*/
public static final int ILLEGAL_WRITESET_VALUE = 23;
/**
* INVALID_WRITESET = 24;
*/
public static final int INVALID_WRITESET_VALUE = 24;
/**
* NOT_VALIDATED = 254;
*/
public static final int NOT_VALIDATED_VALUE = 254;
/**
* INVALID_OTHER_REASON = 255;
*/
public static final int INVALID_OTHER_REASON_VALUE = 255;