Skip to content

Trace

History record RPC interface

Query transaction address and other information (need to open the record module)

1. trace_getRawTransaction

  • Usage:

  Query transaction bytes according to transaction hash

  • Params:

   1. transaction hash

  • Return:transaction byte code

  • Example:

shell:

curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"trace_getRawTransaction","params":["0x00001c9b8c8fdb1f53faf02321f76253704123e2b56cce065852bab93e526ae2"], "id": 3}' -H "Content-Type:application/json"

cli:

drep-cli 127.0.0.1:10085 trace_getRawTransaction 0x00001c9b8c8fdb1f53faf02321f76253704123e2b56cce065852bab93e526ae2 3
  • Response:
{
    "jsonrpc": "2.0",
    "id": 3,
    "result": "0x02a7ae20007923a30bbfbcb998a6534d56b313e68c8e0c594a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002011102011003030000bc9889d00b004120eba14c77eab7a154833ff14832d8769cfc0b30db288445d6a83ef2fe337aa09042f8174a593543c4acabe7fadf1ad5fceea9c835682cb9dbea3f1d8fec181fb9"
}

2. trace_getTransaction

  • Usage:

  Query transaction details according to transaction hash

  • Params:

   1. transaction hash

  • Return:Transaction details

  • Example:

shell:

curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"trace_getTransaction","params":["0x00001c9b8c8fdb1f53faf02321f76253704123e2b56cce065852bab93e526ae2"], "id": 3}' -H "Content-Type:application/json"

cli:

drep-cli 127.0.0.1:10085 trace_getTransaction 0x00001c9b8c8fdb1f53faf02321f76253704123e2b56cce065852bab93e526ae2 3
  • Response:
{
    "jsonrpc": "2.0",
    "id": 3,
    "result": {
    "Hash": "0x00001c9b8c8fdb1f53faf02321f76253704123e2b56cce065852bab93e526ae2",
    "From": "0x7923a30bbfbcb998a6534d56b313e68c8e0c594a",
    "Version": 1,
    "Nonce": 530215,
    "Type": 0,
    "To": "0x7923a30bbfbcb998a6534d56b313e68c8e0c594a",
    "ChainId": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "Amount": "0x111",
    "GasPrice": "0x110",
    "GasLimit": "0x30000",
    "Timestamp": 1560356382,
    "Data": null,
    "Sig": "0x20eba14c77eab7a154833ff14832d8769cfc0b30db288445d6a83ef2fe337aa09042f8174a593543c4acabe7fadf1ad5fceea9c835682cb9dbea3f1d8fec181fb9"
    }
}

3. trace_decodeTrasnaction

  • Usage:

  De parsing transaction byte information into transaction details

  • Params:

   1. Transaction byte information

  • Return:transaction details

  • Example:

shell:

curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"trace_decodeTrasnaction","params":["0x02a7ae20007923a30bbfbcb998a6534d56b313e68c8e0c594a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002011102011003030000bc9889d00b004120eba14c77eab7a154833ff14832d8769cfc0b30db288445d6a83ef2fe337aa09042f8174a593543c4acabe7fadf1ad5fceea9c835682cb9dbea3f1d8fec181fb9"], "id": 3}' -H "Content-Type:application/json"

cli:

drep-cli 127.0.0.1:10085 trace_decodeTrasnaction "0x02a7ae20007923a30bbfbcb998a6534d56b313e68c8e0c594a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002011102011003030000bc9889d00b004120eba14c77eab7a154833ff14832d8769cfc0b30db288445d6a83ef2fe337aa09042f8174a593543c4acabe7fadf1ad5fceea9c835682cb9dbea3f1d8fec181fb9" 3
  • Response:
{
    "jsonrpc": "2.0",
    "id": 3,
    "result": {
    "Hash": "0x00001c9b8c8fdb1f53faf02321f76253704123e2b56cce065852bab93e526ae2",
    "From": "0x7923a30bbfbcb998a6534d56b313e68c8e0c594a",
    "Version": 1,
    "Nonce": 530215,
    "Type": 0,
    "To": "0x7923a30bbfbcb998a6534d56b313e68c8e0c594a",
    "ChainId": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "Amount": "0x111",
    "GasPrice": "0x110",
    "GasLimit": "0x30000",
    "Timestamp": 1560356382,
    "Data": null,
    "Sig": "0x20eba14c77eab7a154833ff14832d8769cfc0b30db288445d6a83ef2fe337aa09042f8174a593543c4acabe7fadf1ad5fceea9c835682cb9dbea3f1d8fec181fb9"
    }
}

4. trace_getSendTransactionByAddr

  • Usage:

  Query the transaction sent from the address according to the address, and pagination is supported

  • Params:

   1. address
   2. Page number (from 1)
   3. Page size

  • Return:Transaction list

  • Example:

shell:

curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"trace_getSendTransactionByAddr","params":["0x7923a30bbfbcb998a6534d56b313e68c8e0c594a",1,10], "id": 3}' -H "Content-Type:application/json"

cli:

drep-cli 127.0.0.1:10085 trace_getSendTransactionByAddr "0x7923a30bbfbcb998a6534d56b313e68c8e0c594a" 1 10 3
  • Response:
{
    "jsonrpc": "2.0",
    "id": 3,
    "result": [
        {
            "Hash": "0x00001c9b8c8fdb1f53faf02321f76253704123e2b56cce065852bab93e526ae2",
            "From": "0x7923a30bbfbcb998a6534d56b313e68c8e0c594a",
            "Version": 1,
            "Nonce": 530215,
            "Type": 0,
            "To": "0x7923a30bbfbcb998a6534d56b313e68c8e0c594a",
            "ChainId": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "Amount": "0x111",
            "GasPrice": "0x110",
            "GasLimit": "0x30000",
            "Timestamp": 1560356382,
            "Data": null,
            "Sig": "0x20eba14c77eab7a154833ff14832d8769cfc0b30db288445d6a83ef2fe337aa09042f8174a593543c4acabe7fadf1ad5fceea9c835682cb9dbea3f1d8fec181fb9"
        }
    ]
}

5. trace_getReceiveTransactionByAddr

  • Usage:

  Query the transaction accepted by the address and support paging

  • Params:

   1. addr
   2. Page number (from 1)
   3. page size

  • Return:transaction list

  • Example:

shell:

curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"trace_getReceiveTransactionByAddr","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5",1,10], "id": 3}' -H "Content-Type:application/json"

cli:

drep-cli 127.0.0.1:10085 trace_getReceiveTransactionByAddr "0x7923a30bbfbcb998a6534d56b313e68c8e0c594a" 1 10 3
  • Response:
{
    "jsonrpc": "2.0",
    "id": 3,
    "result": [
        {
            "Hash": "0x3d3e7da272a5128bec6fd7ad10d8557b08e0fb9de4af6753641e29740eb7054e",
            "From": "0x7923a30bbfbcb998a6534d56b313e68c8e0c594a",
            "Version": 1,
            "Nonce": 553770,
            "Type": 0,
            "To": "0x3ebcbe7cb440dd8c52940a2963472380afbb56c5",
            "ChainId": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "Amount": "0xde0b6b3a7640000",
            "GasPrice": "0x12c",
            "GasLimit": "0x7530",
            "Timestamp": 1560403673,
            "Data": null,
            "Sig": "0x1f073cd3f2621abe15ef949b27c7d0a16d69a64aaa9e95973b9c94de2d7b8f4b103928988478d2f248ae7a9dc6a156d12d300adc5e9059decc037a67e94fe0c3a2"
        }
    ]
}

6. trace_rebuild

  • Usage:

  Reconstructing block records in trace

  • Params:

   1. Start block (included)
   2. Termination block (not included)

  • Return:none

  • Example:

shell:

curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"trace_rebuild","params":[1,10], "id": 3}' -H "Content-Type:application/json"

cli:

drep-cli 127.0.0.1:10085 trace_rebuild 1,10 3
  • Response:
{"jsonrpc":"2.0","id":3,"result":None}