You can call this operation to query the content tree of a contract project in Ant Blockchain.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
ProjectId | String | Yes | 2L9VK68g |
The ID of the contract project whose content tree is to be queried. |
Action | String | No | DescribeAntChainContractProjectContentTree |
The operation that you want to perform. Set the value to DescribeAntChainContractProjectContentTree. |
RegionId | String | No | cn-hangzhou |
The ID of the region where Ant Blockchain is used. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | A0DF307A-A44A-476F-99D8-BA4F205350BD |
The ID of the request. |
Result |
The result of the operation. |
||
Children | [] |
The content tree that was returned. |
|
ProjectDescription | String | description |
The description of the contract project to which the content tree belongs. |
ProjectId | String | 2L9VK68g |
The ID of the contract project to which the content tree belongs. |
ProjectName | String | projectname |
The name of the contract project to which the content tree belongs. |
ProjectVersion | String | 5 |
The version of the contract project to which the content tree belongs. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=DescribeAntChainContractProjectContentTree
&<Common request parameters>
Sample success responses
JSON
format
{
"successResponse":true,
"requestId":"A0DF307A-A44A-476F-99D8-BA4F205350BD",
"data":{
"Result":{
"ProjectDescription":"",
"ProjectName":"projectname",
"ProjectVersion":"5",
"Children":[
{
"id":"bz9kr4X2",
"gmtModified":1563937111000,
"gmtCreate":1563937111000,
"directory":true,
"name":"wenjianjia",
"children":[
{
"content":"",
"id":"5m91BL8Y",
"gmtModified":1563954481000,
"parentId":"bz9kr4X2",
"gmtCreate":1563954481000,
"directory":false,
"name":"ads",
"children":[],
"projectId":"2L9VK68g"
}
],
"projectId":"2L9VK68g"
},
{
"content":"",
"id":"broOrJ8k",
"gmtModified":1563937114000,
"gmtCreate":1563869464000,
"directory":false,
"name":"123",
"children":[],
"projectId":"2L9VK68g"
},
{
"content":"pragma solidity ^0.4.23;\n// We have to specify which version of compiler this code will compile with, \n// version should be lower than (or equals to) the supported version showing on this tool.\ncontract Voting {\n /* Solidity doesn't let you pass in an array of strings in the constructor (yet).\n We will use an array of bytes32 instead to store the list of candidates with string type.\n */\n bytes32[] public candidateList;\n\n FDGGFDGFDGFDGFDGFDGFDGFDGFDGFD\n mapping (bytes32 => uint8) public votesReceived;\n\n /* Counting for candidate counts and total votes for all candidates\n */\n uint256 public candidateCount;\n uint256 public totalVotes;\n\n\n /* Events which will help for logging and debugging\n 'identity' is like 'address' in original Solidity, length of 'identity' is 256 (bits).\n */\n event VOTE(bytes32 candidate, identity voterId);\n event VALID(bool valid);\n\n\n /* This is the constructor which will be called once when you\n deploy the contract to the blockchain. When we deploy the contract,\n we will pass an array of candidates who will be contesting in the election.\n You can input a candidate name like: Mike , it will be converted to bytes32.\n */\n constructor(bytes32[] candidateNames) public {\n candidateList = candidateNames;\n candidateCount = candidateList.length;\n }\n\n // This function returns the total votes a candidate has received so far.\n function totalVotesFor(bytes32 candidate) view public returns (uint8) {\n require(validCandidate(candidate));\n return votesReceived[candidate];\n }\n\n // This function increments the vote count for the specified candidate. \n // This is equivalent to casting a vote.\n function voteForCandidate(bytes32 candidate) public {\n require(validCandidate(candidate));\n votesReceived[candidate] += 1;\n totalVotes += 1;\n \n emit VOTE(candidate, msg.sender);\n }\n\n // This function will help to check whether target candidate is in the candidateList.\n function validCandidate(bytes32 candidate) view public returns (bool) {\n for (uint i = 0; i < candidateList.length; i++) {\n if (candidateList[i] == candidate) {\n emit VALID(true);\n return true;\n }\n }\n emit VALID(false);\n return false;\n }\n}",
"id":"1q8Bv68p",
"gmtModified":1563860292000,
"gmtCreate":1562847564000,
"directory":false,
"name":"demo.sol",
"children":[],
"projectId":"2L9VK68g"
},
{
"content":"",
"id":"GKX7KZX0",
"gmtModified":1563954499000,
"gmtCreate":1563954499000,
"directory":false,
"name":"test",
"children":[],
"projectId":"2L9VK68g"
}
],
"ProjectId":"2L9VK68g"
},
"RequestId":"A0DF307A-A44A-476F-99D8-BA4F205350BD"
},
"code":"200"
}
Error codes
For a list of error codes, visit the API Error Center.