Overview
This document describes how to use the Process API, including:
Preparation
Execution order
DCP attachment upload
DCP VID application
DCP data upload
DCP related inquiries
Java ToolChainClient
If the client uses the Java programming language for development, VeChain has provided ToolChainClient sdk to help the client develop server-side applications more easily. Just add the following dependency in Java Maven. Other package management tools are available here
<!-- https://mvnrepository.com/artifact/com.vechain/toolchainclient -->
<dependency>
<groupId>com.vechain</groupId>
<artifactId>toolchainclient</artifactId>
<version>0.1.5</version>
</dependency>
The examples in the sample code are for reference only. The client needs to set the corresponding permissions and obtain the corresponding configuration according to his account.
Preparation
Access permission
Before starting, developers need to get appid and appkey which requires the administrator to log in to the console and apply in Developer Center->Server Application, each account can apply for up to 10 pairs of access rights.
Please use the administrator account to log in to the system, click Developer Center->Server-side application, copy appid and appkey.
Access token
The access token is used by the VeChain ToolChain™ back-end server to authenticate the client. Therefore, before calling the VeChain ToolChain™ api, the client must call the "get token" api to get the access token. The token expires every 24 hours. When using ToolChainClient, you can use appid and appkey to create a new VeChain ToolChain™ client, where "aa" refers to the application source that calls the api request. For each client application, VeChain ToolChain™ recommends using a different source, which will make it easier to manage access token.
SDK Example:
ToolChainClient toolChainClient = new ToolChainClient(appid,appkey,"aa");
Project ID
When calling the DCP interface, you need to determine the specific project. Each project has a unique UUID as an identifier. Please use the administrator account to log in to the system, click Workspace ->Project List, find the project to be uploaded, and click Configure to get the ID. For the creation of the project, please refer to here
Operator ID
When calling the DCP interface, you need to determine the operator who uploads the DCP data. Each operator has a unique ID as an identification. This operator can complete the data upload through VeChain ToolChain™ website or through the interface. Please use the administrator account to log in to the system, click Console->Staff List, find the operator you need to use, and click Details to get the Account ID. Please ensure that the operator has the authority to operate the DCP. For the permission setting method, please refer to here
DCP UUID
When calling the DCP interface, you need to determine which DCP to upload data to (such as a DCP of type Hash or a DCP of type traceability). Each DCP instance has a unique UUID as an identifier. Please use the administrator account to log in to the system, click Workspace->Project List, find the project that needs to upload data, click Configure->View->Data collection points, and find the DCP that needs to upload information to obtain the DCP UUID. For the DCP creation method, please refer to here
Data template for DCP
When calling the DCP interface, you need to obtain the data template when uploading the DCP data. Please use the administrator account to log in to the system, click Workspace->Project List in turn, find the project that needs to upload DCP data, and then click Configure->Download.
Unzip the file to get all DCP data templates, the file name consists of DCP name and DCP UUID.
Execution order
The execution order is to describe how to use the interface correctly, and gives the sample code of ToolChainClient. Customers can follow the execution order to make interface calls.
The execution order is as follows:
Upload attachment
If the DCP contains static resources, you need to refer to the upload attachment interface to first transfer the resources to VeChain ToolChain™.
DCP can support attachment uploading in multiple data formats, such as jpg, mp4, pdf, etc. Before assembling DCP data, you need to make sure that all the static resources have been uploaded. Please record the interface return after uploading the static resources. These data need to be used to point to the static resources when uploading DCP data.
Upload attachment
SDK Example:
AttachmentUploadRequest attachmentUploadRequest = new AttachmentUploadRequest();
attachmentUploadRequest.setFilePath("/Users/junzhang/Documents/jsonlist_cn.png");
logger.info("3.1 AttachmentUploadRequest: {}", attachmentUploadRequest);
AttachmentUploadResponse attachmentUploadResponse = toolChainClientV2.execute(attachmentUploadRequest);
logger.info("3.1 AttachmentUploadResponse{}", attachmentUploadResponse);
Response Example:
{
"code": "common.success",
"data":
{
"filehash": "56c9cbdb4fa51f2b247e0b4d6fbe4a6d1c6c7cecca2925b5b69d4e073e366ac4",
"filelocation": "/resource/56c9cbdb4fa51f2b247e0b4d6fbe4a6d1c6c7cecca2925b5b69d4e073e366ac4",
"filename": "jsonlist_cn.png",
"filesize": 36632,
"filetype": "png"
}
}
Query the uploaded resource information
SDK Example:
AttachmentInfoRequest attachmentInfoRequest = new AttachmentInfoRequest();
attachmentInfoRequest.setFileHash(attachmentUploadResponse.getData().getFilehash());
logger.info("4.1 AttachmentInfoRequest: {}", attachmentInfoRequest);
AttachmentInfoResponse attachmentInfoResponse = toolChainClientV2.execute(attachmentInfoRequest);
logger.info("4.1 AttachmentInfoResponse: {}", attachmentInfoResponse);
Response Example:
{
"code": "common.success",
"data":
{
"filehash": "56c9cbdb4fa51f2b247e0b4d6fbe4a6d1c6c7cecca2925b5b69d4e073e366ac4",
"filelocation": "/resource/56c9cbdb4fa51f2b247e0b4d6fbe4a6d1c6c7cecca2925b5b69d4e073e366ac4",
"filename": "jsonlist_cn.png",
"filesize": 36632,
"filetype": "png"
}
}
Download attachment
SDK Example:
AttachmentDownloadRequest attachmentDownloadRequest = new AttachmentDownloadRequest();
attachmentDownloadRequest.setFileHash(attachmentInfoResponse.getData().getFilehash());
attachmentDownloadRequest.setTargetFilePath("/Users/junzhang/Documents/temp");
attachmentDownloadRequest.setFileName(attachmentInfoResponse.getData().getFilename());
logger.info("5.1 AttachmentDownloadRequest: {}", attachmentDownloadRequest);
AttachmentDownloadResponse attachmentDownloadResponse = toolChainClientV2.execute(attachmentDownloadRequest);
logger.info("5.1 AttachmentDownloadResponse: {}", attachmentDownloadResponse);
Response Example:
{
"file": "/Users/junzhang/Documents/temp/jsonlist_cn.png"
}
VID application
For most DCP types (such as SKU binding, traceability, etc.), VID is used when uploading DCP data. A small number of DCP types such as creating SKUs, custom display pages, etc. do not require VID. If you do not need to obtain a VID, you can directly move to upload DCP data interface.
VID is a unique ID inside VeChain ToolChain™ and can be used to serialize and identify products, assets or objects.
You can use the following two methods to obtain the VID:
-
You can generate your own serial number and call the occupy VID interface to register on VeChain ToolChain™. The API will check if the submitted VID is duplicated. You are responsible for ensuring that the submitted serial number is not in VeChain ToolChain™. The format of the VID is starting with ‘0x’, hexadecimal, and the length is 32 bytes without ‘0x’.
-
You can apply for a new VID from VeChain ToolChain™ by calling the generate VID interface.
⚠️When generating or registering VID, the interface needs to do asynchronous processing on the back end, and it is necessary to repeatedly obtain the interface result until the status value becomes final state (SUCCESS).
Generate tag VID
SDK Example:
ApplyForVidV2Request applyForVidV2Request = new ApplyForVidV2Request();
applyForVidV2Request.setRequestNo("157509820791");
applyForVidV2Request.setQuantity(1);
logger.debug("{}", applyForVidV2Request);
ApplyForVidV2Response applyForVidV2Response = toolChainClientV2.execute(applyForVidV2Request);
logger.debug("{}", applyForVidV2Response);
Response Example:
{
"code": "common.success",
"data":
{
"quantity": 1,
"requestNo": "157509820791",
"status": "SUCCESS",
"url": "https://v-dev.vechaindev.com/v1/artifacts/",
"vidList": ["0X912139A4001589182992C633F1291F4A8C051FAB2E3ABE2F63BBC9CC61194ABB"]
}
}
Register tag VID
SDK Example:
RegisterVidV2Request registerVidV2Request = new RegisterVidV2Request();
registerVidV2Request.setRequestNo("1575098206");
List<String> vids = new ArrayList<>();
for (int i = 0; i < 10; i++) {
vids.add("0x"+ BytesUtils.toHexString(BytesUtils.randomBytes(32)));
}
registerVidV2Request.setVidList(vids);
logger.debug("{}", registerVidV2Request);
RegisterVidV2Response registerVidV2Response = toolChainClientV2.execute(registerVidV2Request);
logger.debug("{}", registerVidV2Response);
Response Example:
{
"code": "common.success",
"data":
{
"failureList": [],
"requestNo": "1575098206",
"status": "SUCCESS",
"successList": ["ff5dc757b84af809cb414b256471624435d55ed7a655663a341d32644b1a82f3", "c08c0bee364aaec2520c8dba556e8fab67796a8810e0475b855893ea53ce639a", "01207ee6e7811bcd1ee77b3fc1f5fe68192ba2089c441a9db3ff743bfaacd5e4", "ba889dff289804eb93c6cec60ed219b10613400bc69a2231b60e4268c644a5b6", "8db5fda98c7bf663b16c04f75b88ea6279f44f9b6c444de1efb490ab66822693", "c4686847fada9d94c82d8e49c6f45bb00627abe0e5d0d3d7a970c7043fdc5c0c", "317ff66aec1687d4afc1543c93fe52f7e2a782d0a0fa165f1b7eb01f9f6951ff", "d63dda3cadfb5495964eb4b5b661b85c0abcdfd8c80bd725b7973bec46000acd", "5916339e8675562b15ca9b71ddc7dedcc655875ed3a17a79d203170ce26d6c5d", "14f1f8b2b63e40c28003e0803f8d4ad5d4944dc8f9b92b2f7048c41fd0740b1b"],
"url": "https://v-dev.vechaindev.com/v1/artifacts/"
}
}
Upload DCP data
Please strictly refer to the json template downloaded from here to complete the data assembly. The objects defaultLangDCPValue and otherLangDCPValue in the DCPCreateRequest class are the data assembled from the template. The dataUUID returned after a successful call can be used as the value passed in when updating the DCP data.
⚠️When creating or updating DCP data, the interface needs to do asynchronous processing on the back end, and it is necessary to repeatedly obtain the interface result until the orderStatus value becomes final state (SUCCESS, FAILURE).
Create DCP data
1. When the DCP type is SKU creation, the data format to be assembled is as follows (depending on the specific structure).
{
"requestNo": "123456789022223",
"submitStatus": "SUBMIT",
"defaultLangDCPValue":
{
"bizLanguage": "zh-CN",
"dataValue":
{
"base":
{
"skucode": "SKU操作B",
"productname": "中文22223",
"mainimage":
{
"filetype": "jpg",
"filelocation": "/resource/7a9c83bf70ee49e67dff864fc2762a18ea659c85b2038679787f3f52795a19b7",
"filename": "空 格.jpg",
"filesize": "12990",
"filehash": "7a9c83bf70ee49e67dff864fc2762a18ea659c85b2038679787f3f52795a19b7"
},
"description": "VEBOOK内刊",
"productparames": [
{
"key": "刊号",
"value": "2019第一期"
}],
"files": [
{
"filetype": "pdf",
"filelocation": "/resource/4244162a1f4eeb27d98805d8ad3722a6eb093fb4613d9ab7f4bac2b50ad07115",
"filename": "111.pdf",
"filesize": "102558",
"filehash": "4244162a1f4eeb27d98805d8ad3722a6eb093fb4613d9ab7f4bac2b50ad07115"
}],
"timestamp": 0
},
"custom":
{}
}
},
"smartcontractId": "",
"dcpInstanceUUID": "10516100-e593-4bf5-806f-048401200000",
"projectUUID": "15664C28-F375-61C2-1146-934D59400001",
"toolchainOperatorUUID": "0xde7f8974f9fe41b5b4f48350594d345fcda9a74a0c00e4b52cd4720b08f5bf44"
}
SDK Example:
DCPCreateRequest dcpCreateRequest = new DCPCreateRequest();
dcpCreateRequest.setRequestNo(String.valueOf(System.currentTimeMillis()));
dcpCreateRequest.setSubmitStatus(DCPSubmitStatusEnum.SUBMIT);
dcpCreateRequest.setProjectUUID(projectUUID);
dcpCreateRequest.setDcpInstanceUUID(dcpInstanceUUID);
dcpCreateRequest.setToolchainOperatorUUID(toolchainOperator4UUID);
DCPCreateRequest.DcpValueInfo dcpValueInfo = new DCPCreateRequest.DcpValueInfo();
dcpValueInfo.setBizLanguage("zh-CN");
dcpValueInfo.setDataValue(JSON.parseObject("{\n" +
" \"base\": {\n" +
" \"skucode\": \"6900283724638\",\n" +
" \"productname\": \"Chinese22223\",\n" +
" \"mainimage\": {\n" +
" \"filetype\": \"jpg\",\n" +
" \"filelocation\": \"/resource/7a9c83bf70ee49e67dff864fc2762a18ea659c85b2038679787f3f52795a19b7\",\n" +
" \"filename\": \"space.jpg\",\n" +
" \"filesize\": \"12990\",\n" +
" \"filehash\": \"7a9c83bf70ee49e67dff864fc2762a18ea659c85b2038679787f3f52795a19b7\"\n" +
" },\n" +
" \"description\": \"VEBOOK internal\",\n" +
" \"productparames\": [\n" +
" {\n" +
" \"key\": \"Number\",\n" +
" \"value\": \"2019 No.1\"\n" +
" }\n" +
" ],\n" +
" \"files\": [\n" +
" {\n" +
" \"filetype\": \"pdf\",\n" +
" \"filelocation\": \"/resource/4244162a1f4eeb27d98805d8ad3722a6eb093fb4613d9ab7f4bac2b50ad07115\",\n" +
" \"filename\": \"111.pdf\",\n" +
" \"filesize\": \"102558\",\n" +
" \"filehash\": \"4244162a1f4eeb27d98805d8ad3722a6eb093fb4613d9ab7f4bac2b50ad07115\"\n" +
" }\n" +
" ],\n" +
" \"timestamp\": 1592905574792\n" +
" },\n" +
" \"custom\": {}\n" +
"}"));
dcpCreateRequest.setDefaultLangDCPValue(dcpValueInfo);
logger.info("6.1 DCP request:{}", JSON.toJSONString(dcpCreateRequest));
DCPCreateResponse response = toolChainClientV2.execute(dcpCreateRequest);
while (true) {
logger.info("6.1 DCP response:{}", JSON.toJSONString(response));
if(response.getData().getOrderStatus().equalsIgnoreCase(DCPResponseStatusEnum.SUCCESS.name()) ){
break;
}
Thread.sleep(10000);
response = toolChainClientV2.execute(dcpCreateRequest);
}
Response Example:
{
"code": "common.success",
"data":
{
"dataUUID": "10516100-a73d-4e5b-99c3-22f702200000",
"dataVID": "0x9e39633d001592838332e6c0ddfa343b13ff69a8770e36b76a9c3800340a646a",
"orderStatus": "SUCCESS",
"requestNo": "1593397064284"
}
}
2. When the DCP type is hash, the data format to be assembled is as follows (depending on the specific structure). You can perform the assembly upload of hash DCP according to the ordinary DCP assembly method, or you can directly use the function createHash, and the SDK will automatically assemble the corresponding json.
{
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"defaultLangDCPValue":
{
"bizLanguage": "en",
"dataValue":
{
"custom":
{},
"base":
{
"datalist": [
{
"data": "9be8c708695d55945157dea7494c53da856beb87ec2ba630dcfbcf6dd3ca2425",
"vidlist":
{
"type": 0,
"vidlist": [
"0X912139A400159290556404D08DF93FE8EA59551062CDC740ED86444ED2FF8D46",
"0X912139A400159290556416B5399A9CBBF7487D5A4E9F14C6E540A2867E88075C",
"0X912139A4001592905564E040B825DF88EC8A640E37DCFEDFEF757804613A71DB"
]
}
}],
"name": "dcp hash name1592905574792"
}
}
},
"projectUUID": "15600000-0000-3B95-A485-00205DF934B3",
"requestNo": "1592905574792",
"submitStatus": "SUBMIT",
"toolchainOperatorUUID": "0x733a4d5427d06e8a9d6d25679df8c9a12df9ed5f459abff1f5d9b22ea5691ff6"
}
SDK Example:
DCPCreateRequest simpleRequest = DCPCreateRequest.createHashRequest(requestNo, name, vids, hashData);
simpleRequest.setRequestNo(requestNo);
simpleRequest.setSubmitStatus(DCPSubmitStatusEnum.SUBMIT);
simpleRequest.setProjectUUID(projectUUID);
simpleRequest.setDcpInstanceUUID(dcpInstanceUUID);
simpleRequest.setToolchainOperatorUUID(toolchainOperatorUUID);
logger.info("6.1 DCP request:{}", JSON.toJSONString(simpleRequest));
DCPCreateResponse response = toolChainClientV2.execute(simpleRequest);
while (true) {
logger.info("6.1 DCP response:{}", JSON.toJSONString(response));
if (response.getData().getOrderStatus().equalsIgnoreCase(DCPResponseStatusEnum.SUCCESS.name())) {
break;
}
Thread.sleep(10000);
response = toolChainClientV2.execute(simpleRequest);
}
Response Example:
{
"code": "common.success",
"data":
{
"dataUUID": "11000200-9ec8-4c9f-8dcb-9ccc02200015",
"orderStatus": "SUCCESS",
"requestNo": "1592809070043"
}
}
Update DCP data
The DcpValue passed in when updating the DCP will overwrite the value when the DCP data is created.
SDK Example:
DCPUpdateRequest dcpUpdateRequest = new DCPUpdateRequest();
dcpUpdateRequest.setDataUUID(response.getData().getDataUUID());
dcpUpdateRequest.setDcpInstanceUUID(simpleRequest.getDcpInstanceUUID());
dcpUpdateRequest.setProjectUUID(simpleRequest.getProjectUUID());
dcpUpdateRequest.setToolchainOperatorUUID(simpleRequest.getToolchainOperatorUUID());
dcpUpdateRequest.setSubmitStatus(DCPSubmitStatusEnum.SUBMIT);
DCPUpdateRequest.DcpValueInfo dcpValueInfo = new DCPUpdateRequest.DcpValueInfo();
dcpValueInfo.setDataValue(simpleRequest.getDefaultLangDCPValue().getDataValue());
dcpUpdateRequest.setDefaultLangDCPValue(dcpValueInfo);
logger.info("6.1 DCP request:{}", JSON.toJSONString(dcpUpdateRequest));
DCPUpdateResponse response2 = toolChainClientV2.execute(dcpUpdateRequest);
while (true) {
logger.info("6.1 DCP response:{}", JSON.toJSONString(response2));
if (response2.getData().getOrderStatus().equalsIgnoreCase(DCPResponseStatusEnum.SUCCESS.name())) {
break;
}
Thread.sleep(10000);
response2 = toolChainClientV2.execute(dcpUpdateRequest);
}
Response Example:
{
"code": "common.success",
"data":
{
"dataUUID": "11000200-9ec8-4c9f-8dcb-9ccc02200015",
"orderStatus": "SUCCESS",
"requestNo": "1592809230498"
}
}
DCP related inquiries
There are two interfaces for querying DCP data:
-
Query the latest DCP data: When calling the create or update DCP interface until orderStatus=SUCCESS, you need to call this interface to get the return details, such as the chain information, audit information, etc.
-
Query DCP list: This interface is needed when querying DCP list data.
Query the latest DCP data
SDK Example:
dCPGetDetailRequest.setDataUUID(response.getData().getDataUUID());
dCPGetDetailRequest.setProjectUUID(projectUUID);
dCPGetDetailRequest.setDcpInstanceUUID(dcpInstanceUUID);
dCPGetDetailRequest.setToolchainOperatorUUID(toolchainOperatorUUID);
DCPGetDetailResponse dcpGetDetailResponse = toolChainClientV2.execute(dCPGetDetailRequest);
logger.info("processDetailDetail:{}", dcpGetDetailResponse);
Response Example:
{
"code": "common.success",
"data":
{
"dcpBasicInfo":
{
"blockChainStatus": "NO",
"createTime": 1592809072000,
"creator": "hm_operator",
"languageList": ["en"],
"modifier": "hm_operator",
"toolchainOperatorUUID": "0x733a4d5427d06e8a9d6d25679df8c9a12df9ed5f459abff1f5d9b22ea5691ff6",
"updateTime": 1592809111000,
"verificationStatus": "PROCESSING"
},
"dcpBlockchainInfo":
{
"dataHash": "c699df4d1013d245979887bb76810f9435e6b1df576d8e7454a7b472c660009d",
"dataUUID": "11000200-9ec8-4c9f-8dcb-9ccc02200015"
},
"dcpDataInfo":
{
"bizLanguage": "en",
"dataUUID": "11000200-9ec8-4c9f-8dcb-9ccc02200015",
"dcpDataInfo":
{
"custom":
{},
"base":
{
"datalist": [
{
"data": "02a47c46ea1bec0c12633feb7cc5b24c591194578ec8ee851fb3bdedec50fb67",
"vidlist":
{
"type": 0,
"vidlist": ["0X912139A4001592809059EB3D65ECDD0E6D6BDED0CEF9471FD10AA479C926FA5F", "0X912139A40015928090596855EEB8AAAF6D48F884204160A455B35E5AF1E13768", "0X912139A4001592809059AF5239EE32ED19B3865F87049B81FFFEDB86DAAB1ABC"]
}
}],
"name": "dcp hash name1592809070043",
"type": "HASH",
"timestamp": 1592809111067
}
},
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"name": "dcp hash name1592809070043",
"submitStatus": "SUBMIT",
"version": "V11.0"
},
"dcpVerificatonInfo":
{}
}
}
Query DCP list
SDK Example:
DCPGetListRequest dcpGetListRequest = new DCPGetListRequest();
dcpGetListRequest.setPage(1);
dcpGetListRequest.setSize(10);
dcpGetListRequest.setProjectUUID(projectUUID);
dcpGetListRequest.setDcpInstanceUUID(dcpInstanceUUID);
dcpGetListRequest.setToolchainOperatorUUID(toolchainOperatorUUID);
logger.info("processGetListRequest:{}", dcpGetListRequest);
DCPGetListResponse processGetListResponse = toolChainClientV2.execute(dcpGetListRequest);
logger.info("processGetListResponse:{}", JSON.toJSONString(processGetListResponse));
Response Example:
{
"code": "common.success",
"data":
{
"exist": true,
"list": [
{
"blockChainStatus": "NO",
"createTime": 1592809231000,
"creator": "hm_operator",
"dataUUID": "11000200-3b3e-4bcb-b67d-5b6c02200015",
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"dcpName": "dcp hash name1592809070043",
"dcpType": "DCPHASH",
"modifier": "hm_operator",
"requestNo": "54cae5af-e96e-4fdf-8239-c378808966c9",
"submitStatus": "SUBMIT",
"updateTime": 1592809262000,
"verificationStatus": "PROCESSING",
"version": "V11.0"
},
{
"blockChainStatus": "NO",
"createTime": 1592809072000,
"creator": "hm_operator",
"dataUUID": "11000200-9ec8-4c9f-8dcb-9ccc02200015",
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"dcpName": "dcp hash name1592809070043",
"dcpType": "DCPHASH",
"modifier": "hm_operator",
"requestNo": "9d805f50-0787-4e07-b945-e01fb7cda345",
"submitStatus": "SUBMIT",
"updateTime": 1592809112000,
"verificationStatus": "PROCESSING",
"version": "V11.0"
},
{
"blockChainStatus": "NO",
"createTime": 1592548153000,
"creator": "hm_operator",
"dataUUID": "11000200-0313-4331-9b92-286202200015",
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"dcpName": "哈希上链测试",
"dcpType": "DCPHASH",
"modifier": "hm_operator",
"requestNo": "8141269b-2208-4b8c-bb05-c376baceea83",
"submitStatus": "SUBMIT",
"updateTime": 1592548172000,
"verificationStatus": "PROCESSING",
"version": "V11.0"
},
{
"blockChainStatus": "NO",
"createTime": 1592547977000,
"creator": "hm_operator",
"dataUUID": "11000200-e2fd-462a-ae58-884102200015",
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"dcpName": "哈希上链测试",
"dcpType": "DCPHASH",
"modifier": "hm_operator",
"requestNo": "71c57cf6-fdcf-48aa-b1ca-5cefbe53615b",
"submitStatus": "SUBMIT",
"updateTime": 1592548022000,
"verificationStatus": "PROCESSING",
"version": "V11.0"
},
{
"blockChainStatus": "NO",
"createTime": 1592547628000,
"creator": "hm_operator",
"dataUUID": "11000200-0bba-46a6-98d4-a3e102200015",
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"dcpName": "哈希上链测试",
"dcpType": "DCPHASH",
"modifier": "hm_operator",
"requestNo": "f26188c8-0bfb-4a85-a3f4-8428eaea5d3e",
"submitStatus": "SUBMIT",
"updateTime": 1592547662000,
"verificationStatus": "PROCESSING",
"version": "V11.0"
},
{
"blockChainStatus": "NO",
"createTime": 1592534846000,
"creator": "hm_operator",
"dataUUID": "11000200-96f3-4fc9-b0e6-3b3a02200015",
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"dcpName": "dcp hash name1592534749410",
"dcpType": "DCPHASH",
"modifier": "hm_operator",
"requestNo": "a41ea950-01e3-4e2f-acb2-6128e46d3079",
"submitStatus": "SUBMIT",
"updateTime": 1592534881000,
"verificationStatus": "PROCESSING",
"version": "V11.0"
},
{
"blockChainStatus": "NO",
"createTime": 1592534751000,
"creator": "hm_operator",
"dataUUID": "11000200-882f-4a91-9865-e4c802200015",
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"dcpName": "dcp hash name1592534749410",
"dcpType": "DCPHASH",
"modifier": "hm_operator",
"requestNo": "11533e83-131f-4f0b-8702-851e2b7a5174",
"submitStatus": "SUBMIT",
"updateTime": 1592534791000,
"verificationStatus": "PROCESSING",
"version": "V11.0"
},
{
"blockChainStatus": "NO",
"createTime": 1592534426000,
"creator": "hm_operator",
"dataUUID": "11000200-bcb4-46c5-b5fc-eedf02200015",
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"dcpName": "dcp hash name1592534276633",
"dcpType": "DCPHASH",
"modifier": "hm_operator",
"requestNo": "0806e053-865f-463e-b546-8f0dcc085605",
"submitStatus": "SUBMIT",
"updateTime": 1592534462000,
"verificationStatus": "PROCESSING",
"version": "V11.0"
},
{
"blockChainStatus": "NO",
"createTime": 1592534279000,
"creator": "hm_operator",
"dataUUID": "11000200-9b22-487f-b090-52ba02200015",
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"dcpName": "dcp hash name1592534276633",
"dcpType": "DCPHASH",
"modifier": "hm_operator",
"requestNo": "bc545873-3ae7-45a3-bee5-abdd1f03db83",
"submitStatus": "SUBMIT",
"updateTime": 1592534312000,
"verificationStatus": "PROCESSING",
"version": "V11.0"
},
{
"blockChainStatus": "NO",
"createTime": 1592476524000,
"creator": "hm_operator",
"dataUUID": "11000200-2143-4ef1-9ae1-ee4102200015",
"dcpInstanceUUID": "11000200-7b66-42bf-a5d4-2fae01200015",
"dcpName": "dcp hash name1592476426064",
"dcpType": "DCPHASH",
"modifier": "hm_operator",
"requestNo": "15881c21-6a48-4201-afa5-cba4d39bacbb",
"submitStatus": "SUBMIT",
"updateTime": 1592476562000,
"verificationStatus": "PROCESSING",
"version": "V11.0"
}],
"page": 1,
"rows": 34,
"size": 10
}
}
Query on-chain results
For the on-chain information, you can use the following two methods to obtain information by VID:
-
Query the latest on-chain information interface by VID
-
Query historical on-chain information by VID
Query the latest on-chain information
SDK Example:
HashProvenanceQueryV2Request hashProvenanceQueryV2Request = new HashProvenanceQueryV2Request();
hashProvenanceQueryV2Request.setVid(vids.get(1));
HashProvenanceQueryV2Response hashProvenanceQueryV2Response = toolChainClientV2.execute(hashProvenanceQueryV2Request);
logger.debug("query vid: {}", hashProvenanceQueryV2Response);
Response Example:
{
"code": "common.success",
"data":
{
"clauseIndex": 1,
"submitTime": 1591517456,
"dataHash": "03042cf8100db386818cee4ff0f2972431a62ed78edbd09ac08accfabbefd819",
"txId": "0x215804059e2ddc58261bbcbd31cbb09920773dca464d73efa998fdc24933a3b1"
}
}
Query historical on-chain information
SDK Example:
HashProvenanceQueryListV2Request hashProvenanceQueryListV2Request = new HashProvenanceQueryListV2Request();
hashProvenanceQueryListV2Request.setVid(vids.get(1));
hashProvenanceQueryListV2Request.setPage(1);
hashProvenanceQueryListV2Request.setSize(100);
hashProvenanceQueryListV2Request.setSort("asc");
HashProvenanceQueryListV2Response hashProvenanceQueryListV2Response = toolChainClientV2.execute(hashProvenanceQueryListV2Request);
logger.debug("query list:{}", hashProvenanceQueryListV2Response);
Response Example:
{
"code": "common.success",
"data": {
"vid": "ea1451450015915120247ed1dd9f1dc44f8ab2d6a15618adc85c112391c2c886",
"smartcontractId": "3f6e5cda7baa4004b911446cfca76191",
"page": 1,
"history": [
{
"clauseIndex": 0,
"submitTime": 1591517456,
"dataHash": "03042cf8100db386818cee4ff0f2972431a62ed78edbd09ac08accfabbefd818",
"txId": "0x215804059e2ddc58261bbcbd31cbb09920773dca464d73efa998fdc24933a3b1"
},
{
"clauseIndex": 1,
"submitTime": 1591517456,
"dataHash": "03042cf8100db386818cee4ff0f2972431a62ed78edbd09ac08accfabbefd819",
"txId": "0x215804059e2ddc58261bbcbd31cbb09920773dca464d73efa998fdc24933a3b1"
}
],
"rows": 2
}
}
Comments
0 comments
Please sign in to leave a comment.