TTOS Transactions
This chapter introduces how to achieve asset transfer, investment, withdrawal, pledge, cancellation of pledge on Transformers chain.
Preparation
Prepare account
Before sending the transaction, make sure you already have the wallet address and corresponding private key,public key.
Please refer to the Account related function for details on account related content
Understand the transaction process
- Step1: Send transaction information to
GetTransaction
interface in JSON format. - Step2: Sign the transaction body after returning the transaction body information.
- Step3: After signing, send
SendMessage
to broadcast the transaction.
TTOS transaction
GetTransaction
- Send transaction information to
/GetTransaction
interface according to the following format:
Sample Request:
{
"id": "",
"jsonrpc": "",
"params": {
"fromAddr": [
"0xcED97dA085527Fe7e1772CA59Aa1e64A78143128"
],
"isFindUtxo": false,
"toAddr": [
{
"addr": "0x06BA76F46631d4F344d1344303895001F1E3Af29",
"value": "13.5"
}
],
"txInfo": ""
}
}
The "value" here is the actual transaction amount, and there is no need to convert the digits.
Sample Response:
{
"id": "",
"jsonrpc": "",
"method": "",
"result": {
"code": 0,
"gas": "20200",
"height": "600",
"message": "0",
"time": "1717148047269517",
"txJson": "{\"time\":\"1717148047269517\",\"identity\":\"2eb2F635320c3Dbf29eadD35E894c13EE3F20bd5\",\"utxo\":{\"owner\":[\"cED97dA085527Fe7e1772CA59Aa1e64A78143128\"],\"vin\":[{\"prevOut\":[{\"hash\":\"3f1342e96e426e2905021ad991787131ec70d31298646b1e80da9d912eeff274\"}]}],\"vout\":[{\"value\":\"1350000000\",\"addr\":\"06BA76F46631d4F344d1344303895001F1E3Af29\"},{\"value\":\"1982446992477\",\"addr\":\"cED97dA085527Fe7e1772CA59Aa1e64A78143128\"},{\"value\":\"20200\",\"addr\":\"VirtualBurnGas\"}]},\"type\":\"Tx\",\"consensus\":7,\"txType\":1}",
"txType": "1",
"vrfJson": "{\"vrfdata\":{\"hash\":\"6cf89d80c98eecd9138caca4f55d7ad0fda2aed9d8e68dd4642543ae3ee056d6\"},\"Vrfsign\":{\"sign\":\"u5dNZ16Rd77B4nLd8gAcKTwz+GxeHH1HIlcGennGbPaKgIFXUkmFzS/EnVxRC4nmSfESAdWyMEmj4pKBhwuqAg==\",\"pub\":\"MCowBQYDK2VwAyEAcUcydwF7CSr9bjBiUbd3drV+WMd4yd8xFL7HWGA4FTw=\"}}"
}
}
sig_tx()
- Sign the returned transaction information content using the SDK's
sig_tx
method
/*Sign transactions using a private key handle*/
char *sig_tx(long long pkey, const char *message, int msize);
SendMessage
- The signed content is sent to the entire network for broadcasting through the
SendMessage
interface.
The content after signing, as a parameter of SendMessage
{
"id": "",
"jsonrpc": "",
"result": {
"code": "",
"gas": "20200",
"height": "600",
"message": "",
"time": "1717148047269517",
"txJson": "{\"time\":\"1717148047269517\",\"identity\":\"2eb2F635320c3Dbf29eadD35E894c13EE3F20bd5\",\"utxo\":{\"owner\":[\"cED97dA085527Fe7e1772CA59Aa1e64A78143128\"],\"vin\":[{\"prevOut\":[{\"hash\":\"3f1342e96e426e2905021ad991787131ec70d31298646b1e80da9d912eeff274\"}],\"vinSign\":{\"sign\":\"ApxL8NDgh9YYDuUXpdbsbVv0cEAr3HyXmr2TICkD4mfuDIZqVlZJNUmaPAKHCs5kkn7JnZx7r12+CpnnR4ZpAg==\",\"pub\":\"MCowBQYDK2VwAyEA89VSBQU7d4uL+jvqAKeCRbgYz2tzk/Rf8DNRhB0sLbg=\"}}],\"vout\":[{\"value\":\"1350000000\",\"addr\":\"06BA76F46631d4F344d1344303895001F1E3Af29\"},{\"value\":\"1982446992477\",\"addr\":\"cED97dA085527Fe7e1772CA59Aa1e64A78143128\"},{\"value\":\"20200\",\"addr\":\"VirtualBurnGas\"}],\"multiSign\":[{\"sign\":\"WCoFsLKML69x1rSpQc7pwbnd+GMfZ0Ce3wTPg96Rdb1v7ezFw9KuEBXwvGecTz264pVZB6T8hzgJIx26GuKVAA==\",\"pub\":\"MCowBQYDK2VwAyEA89VSBQU7d4uL+jvqAKeCRbgYz2tzk/Rf8DNRhB0sLbg=\"}]},\"type\":\"Tx\",\"consensus\":7,\"txType\":1}",
"txType": "1",
"vrfJson": "{\"vrfdata\":{\"hash\":\"6cf89d80c98eecd9138caca4f55d7ad0fda2aed9d8e68dd4642543ae3ee056d6\"},\"Vrfsign\":{\"sign\":\"u5dNZ16Rd77B4nLd8gAcKTwz+GxeHH1HIlcGennGbPaKgIFXUkmFzS/EnVxRC4nmSfESAdWyMEmj4pKBhwuqAg==\",\"pub\":\"MCowBQYDK2VwAyEAcUcydwF7CSr9bjBiUbd3drV+WMd4yd8xFL7HWGA4FTw=\"}}"
}
}
After signing and before signing, there is a difference in the median content of the txJson parameter in the JSON format, which needs to be carefully observed.
Return to content:
{
"id": "",
"jsonrpc": "",
"result": {
"code": "",
"message": "",
"txhash":"0xe144683e5c2a088706b1e44d551826ca4bcf448f7b66117fbc21c184ba451110"
}
}
code
is "0" and the txhash
values are returned, indicating that there is no problem with the transaction content.
- Save the
txhash
andheight
values to query whether the transaction is on the chain.
Staking transaction
The staking transaction process is similar to that of TTOS ordinary transactions, with only differences in the first step of transaction issuance.
Prerequisite
- Ensure that there is sufficient balance on the account before stake.
- Make sure that the account you stake is a validator account and validator is highly synchronized with the entire network.
- The minimum amount of validator stake is 1000 TTOS
- The freeze period is 30 days.
GetStakeTransaction
- Send staking transaction information to
/GetStakeTransaction
interface according to the following format:
{
"id" : "1",
"jsonrpc": "2.0",
"params" : "{"fromAddr" : "69b34b7538DeB6913f2b9f59Cbc8610059442e5A", "stakeAmount" : "1000", "PledgeType" : "0","CommissionRate": "5", "isFindUtxo": true, "txInfo": ""}"
}
Parameter:
fromAddr – the node address
stake_amount – staked amount
PledgeType – PledgeType(default 0)
Returned value:
code – Return code,0 is success
message – Return message
time – Transaction timestamp
txJson – Transaction info
txType – Transaction type
vrfJson – Verifiable random signature information
height – block height
gas – sign fee
- Sign the returned staking transaction information content using the SDK's
sig_tx
method
/*Sign transactions using a private key handle*/
char *sig_tx(long long pkey, const char *message, int msize);
- The signed content is sent to the entire network for broadcasting through the
SendMessage
interface.
{
"id": "1",
"jsonrpc": "2.0",
"method": "GetStakeTransaction",
"result": {
"code": 0,
"gas": "28100",
"height": "593",
"message": "success",
"time": "1717146934713506",
"txJson": "{\"time\":\"1717146934713506\",\"identity\":\"8F66e288547032026dd1ddFb992ff7eEcD9261f0\",\"utxo\":{\"owner\":[\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"],\"vin\":[{\"prevOut\":[{\"hash\":\"1a9446933109a33766fde80ced93142b261f81e315bc8afd9abd5306239842c1\"}]}],\"vout\":[{\"value\":\"100000000000\",\"addr\":\"VirtualStake\"},{\"value\":\"1899899508900\",\"addr\":\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"},{\"value\":\"28100\",\"addr\":\"VirtualBurnGas\"}]},\"type\":\"Tx\",\"consensus\":7,\"txType\":2,\"data\":\"{\\\"TxInfo\\\":{\\\"CommissionRate\\\":0.05,\\\"StakeAmount\\\":100000000000,\\\"StakeType\\\":\\\"Net\\\"}}\"}",
"txType": "0",
"vrfJson": "{}"
}
}
Unstake
Before Unstake, it is necessary to first query the stake transaction information and obtain utxo_hash
,utxo
value,etc.
GetStakeUtxo
- Query stake information content through
/GetStakeUtxo
interface.
The parameter format is as follows:
{
"id":"1",
"jsonrpc":"2.0",
"params":{"fromAddr":"5c8bf650F93d82A7131C2FeA01Ec2bFB3C61A03B"}
}
Sample Response:
{
"id": "1",
"jsonrpc": "2.0",
"method": "GetAllStakeNodeList",
"result": {
"code": 973051808,
"message": "",
"utxos": {
"827022b125d2b60e9ed40a1e7bfa6874b90bb6dbccd515824cb353f0ab3397c6": 100000000000
}
}
}
The key of the utxos
is used as the value of the parameter utxo_hash
GetUnStakeTransaction
- Send unstake request through
/GetUnStakeTransaction
interface.
Parameter:
fromAddr – Node address that has been stake
utxo_hash – The utxo that needs to be unstaked
Returned value:
code – Return code,0 is success
message – Return message
time – Transaction timestamp
txJson – Transaction info
txType – Transaction type
vrfJson – Verifiable random signature information
height – block height
gas – sign fee
The parameter format is as follows:
{
"id" : "1",
"jsonrpc": "2.0",
"params" : "{"fromAddr" : "69b34b7538DeB6913f2b9f59Cbc8610059442e5A", "utxoHash" : "405efe5ae260a8297751784ce5bb590efea1324b29c24b658b3b2e1ed948eec3","isFindUtxo": true, "txInfo": ""}"
}
Sample Response:
{
"id": "1",
"jsonrpc": "2.0",
"method": "GetUnStakeTransaction",
"result": {
"code": 0,
"gas": "39300",
"height": "595",
"message": "success",
"time": "1717147041334522",
"txJson": "{\"time\":\"1717147041334522\",\"identity\":\"372b320ECA35F86A28249E3e309545A44270DD7D\",\"utxo\":{\"owner\":[\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\",\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"],\"vin\":[{\"prevOut\":[{\"hash\":\"b088fde1b1b270399134a7027408b2ef270d7f00859f306f9cb006e46de77e18\",\"n\":1}]},{\"prevOut\":[{\"hash\":\"e47b853d8d59e8d5982f68ed19dee6cdc5ce7e173df3e699af817366bd7b7541\"}],\"sequence\":1}],\"vout\":[{\"value\":\"100000000000\",\"addr\":\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"},{\"value\":\"899899437600\",\"addr\":\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"},{\"value\":\"39300\",\"addr\":\"VirtualBurnGas\"}]},\"type\":\"Tx\",\"consensus\":7,\"txType\":3,\"data\":\"{\\\"TxInfo\\\":{\\\"UnstakeUtxo\\\":\\\"b088fde1b1b270399134a7027408b2ef270d7f00859f306f9cb006e46de77e18\\\"}}\"}",
"txType": "0",
"vrfJson": "{}"
}
}
-
Sign the returned information content using the SDK's
sig_tx
method -
The signed content is sent to the entire network for broadcasting through the
SendMessage
interface.
Investment
- The minimum amount of invest stake is 35 TTOS
- The freeze period is 1 days.
GetInvestTransaction
- Send investment request through
/GetInvestTransaction
interface.
Parameter:
fromAddr – Transaction initiator
toAddr – Investee node address
investAmount – Invest amount
investType – InvestType(default 0)
pumpingPercentage – InvestType(default 0)
Returned value:
code – Return code,0 is success
message – Return message
time – Transaction timestamp
txJson – Transaction info
txType – Transaction type
vrfJson – Verifiable random signature information
height – block height
gas – sign fee
The parameter format is as follows:
{
"id" : "1",
"jsonrpc": "2.0",
"params" : "{"fromAddr" : "69b34b7538DeB6913f2b9f59Cbc8610059442e5A","toAddr":"69b34b7538DeB6913f2b9f59Cbc8610059442e5A","investAmount":"1000", "investType" : "0","pumpingPercentage": "5", "isFindUtxo": false, "txInfo": ""}"
}
Sample Response:
{
"id": "1",
"jsonrpc": "2.0",
"method": "GetInvestTransaction",
"result": {
"code": 0,
"gas": "32000",
"height": "590",
"message": "success",
"time": "1717146585760939",
"txJson": "{\"time\":\"1717146585760939\",\"identity\":\"8fFb06c288C30F3e62b31d6c5FD34328A964774a\",\"utxo\":{\"owner\":[\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"],\"vin\":[{\"prevOut\":[{\"hash\":\"ed71842812bd3d5e0032d40f5a01ff8db1b0018a0a36c11292ed97e3783b2a78\"}]}],\"vout\":[{\"value\":\"1000000000000\",\"addr\":\"VirtualInvest\"},{\"value\":\"899899621300\",\"addr\":\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"},{\"value\":\"32000\",\"addr\":\"VirtualBurnGas\"}]},\"type\":\"Tx\",\"consensus\":7,\"txType\":4,\"data\":\"{\\\"TxInfo\\\":{\\\"BonusAddr\\\":\\\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\\\",\\\"InvestAmount\\\":1000000000000,\\\"InvestType\\\":\\\"Normal\\\"}}\"}",
"txType": "0",
"vrfJson": "{}"
}
}
- Sign the returned information content using the SDK's
sig_tx
method - The signed content is sent to the entire network for broadcasting through the
SendMessage
interface.
Disinvestment
Before disinvestment, it is necessary to first query the investment information and obtain utxo_hash
,toAddr
value,etc.
GetDisinvestUtxo
The parameter format is as follows:
{
"id":"1",
"jsonrpc":"2.0",
"params":{
"fromAddr":"5c8bf650F93d82A7131C2FeA01Ec2bFB3C61A03B",
"toAddr":"5c8bf650F93d82A7131C2FeA01Ec2bFB3C61A03B"
}
}
Sample Response:
{
"id": "1",
"jsonrpc": "2.0",
"method": "GetDisinvestUtxo",
"result": {
"code": 0,
"message": "success",
"utxos": {
"utxo": [
"17c62bacc4db9eee7a9b4596894dbf6a17754319fc8b24204fd4e7519a3f4457"
]
}
}
}
The key of the utxo
is used as the value of the parameter utxoHash
GetDisInvestTransaction
- Send disinvestment request through
/GetDisInvestTransaction
interface.
Parameter:
fromAddr – Transaction initiator
toAddr – Investee node address
utxoHash – Invest amount
Returned value:
code – Return code,0 is success
message – Return message
time – Transaction timestamp
txJson – Transaction info
txType – Transaction type
vrfJson – Verifiable random signature information
height – block height
gas – sign fee
The parameter format is as follows:
{
"id" : "1",
"jsonrpc": "2.0",
"params" : "{"fromAddr" : "69b34b7538DeB6913f2b9f59Cbc8610059442e5A","toAddr":"69b34b7538DeB6913f2b9f59Cbc8610059442e5A","utxoHash":"db2caaf71ff57ec954e67cabede4a4b2207fd8645e684e66983eaefea63f4e2a","isFindUtxo": false, "txInfo": ""}"
}
Sample Response:
{
"id": "1",
"jsonrpc": "2.0",
"method": "GetDisInvestTransaction",
"result": {
"code": 0,
"gas": "45000",
"height": "591",
"message": "success",
"time": "1717146744611408",
"txJson": "{\"time\":\"1717146744611408\",\"identity\":\"3292FEAbea61A76cf59Fa917b9DCcC937Ca489eE\",\"utxo\":{\"owner\":[\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\",\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"],\"vin\":[{\"prevOut\":[{\"hash\":\"3941c0cc427c3053222b9d1f32a2882a564e1ed3c45bcf59a48dc08c6eceb6e3\",\"n\":1}]},{\"prevOut\":[{\"hash\":\"3941c0cc427c3053222b9d1f32a2882a564e1ed3c45bcf59a48dc08c6eceb6e3\"}],\"sequence\":1}],\"vout\":[{\"value\":\"1000000000000\",\"addr\":\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"},{\"value\":\"899899576300\",\"addr\":\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\"},{\"value\":\"45000\",\"addr\":\"VirtualBurnGas\"}]},\"type\":\"Tx\",\"consensus\":7,\"txType\":5,\"data\":\"{\\\"TxInfo\\\":{\\\"BonusAddr\\\":\\\"69b34b7538DeB6913f2b9f59Cbc8610059442e5A\\\",\\\"DisinvestUtxo\\\":\\\"3941c0cc427c3053222b9d1f32a2882a564e1ed3c45bcf59a48dc08c6eceb6e3\\\"}}\"}",
"txType": "0",
"vrfJson": "{}"
}
}
- Sign the returned information content using the SDK's
sig_tx
method - The signed content is sent to the entire network for broadcasting through the
SendMessage
interface.
GetBounsTransaction
- Node to apply for rewards
Parameter:
Addr – Reward application node
Returned value:
code – Return code,0 is success
message – Return message
time – Transaction timestamp
txJson – Transaction info
txType – Transaction type
vrfJson – Verifiable random signature information
height – block height
gas – sign fee
- The node receives the reward from the previous day.
- New node must meet the requirement of 24 hours to successfully apply for it after being pledged
- Send apply for rewards request through
/GetBounsTransaction
interface.
The parameter format is as follows:
{
"id" : "1",
"jsonrpc": "2.0",
"params" : "{"Addr" : "116058AcF188BB96F9Da1317Bd11fD737E4f8Cd2","isFindUtxo": false, "txInfo": ""}"
}
Sample Response:
{
"id": "1",
"jsonrpc": "2.0",
"method": "GetBounsTransaction",
"result": {
"code": 0,
"gas": "25600",
"height": "597",
"message": "success",
"time": "1717147601683173",
"txJson": "{\"time\":\"1717147601683173\",\"identity\":\"08C08F389c8255c0B4d1C5e337C811D02F220B6e\",\"utxo\":{\"owner\":[\"9234e37d86AE7De3Dd0Ac57AF815b54551873504\"],\"vin\":[{\"prevOut\":[{\"hash\":\"594692911bbc616737809e0abd991637079501160b1b2eff4e7e0e83f9af4658\"}]}],\"vout\":[{\"value\":\"503890410\",\"addr\":\"9234e37d86AE7De3Dd0Ac57AF815b54551873504\"},{\"value\":\"1900026434448\",\"addr\":\"9234e37d86AE7De3Dd0Ac57AF815b54551873504\"},{\"value\":\"25600\",\"addr\":\"VirtualBurnGas\"}]},\"type\":\"Tx\",\"consensus\":7,\"txType\":99,\"data\":\"{\\\"TxInfo\\\":{\\\"BonusAddrList\\\":3,\\\"BonusAmount\\\":530410958}}\"}",
"txType": "0",
"vrfJson": "{}"
}
}
- Sign the returned information content using the SDK's
sig_tx
method - The signed content is sent to the entire network for broadcasting through the
SendMessage
interface.
ConfirmTransaction
- Confirm whether the transaction is on the chain
Send confirm request through /ConfirmTransaction
interface.
For example: http://IP:port/ConfirmTransaction
curl http://localhost:20620/ConfirmTransaction -X POST -H "Content-Type: application/json" -d '
{
"id":"1",
"jsonrpc":"2.0",
"params":{
"txhash":"64e91e7fa9ce873a1891806ae1adcc0af98d38ff78660c8408ad9caa81c67495",
"height": "500"
}
}
'
Sample Request:
{
"id":"1",
"jsonrpc":"2.0",
"params":{
"txhash":"64e91e7fa9ce873a1891806ae1adcc0af98d38ff78660c8408ad9caa81c67495",
"height": "500"
}
}
Sample Response:
{
"id": "1",
"jsonrpc": "2.0",
"method": "ConfirmTransaction",
"result": {
"code": 0,
"message": "",
"percent": "1.000000",
"receivedsize": "27",
"sendsize": "34",
"tx": {
"Consensus": 7,
"Type": "Tx",
"data": {
"TxInfo": {
"BonusAddr": "0xFFFF91572cC21352BD6044f91506294f4B01D73D",
"InvestAmount": 1000000000000,
"InvestType": "Normal"
}
},
"identity": "0x0796B6DB27e5eb1e9F8Bd2c4d03191C902D22F0f",
"time": 1716775934685374,
"txHash": "0x64e91e7fa9ce873a1891806ae1adcc0af98d38ff78660c8408ad9caa81c67495",
"txType": 4,
"utxo": {
"multisign": [
{
"pub": "Hv7Z7SrYgnK9WGI0qZJJkCcDBVG5mYZlAN2fe0RsdEEIY3i9iAbRK+JtT+hxrv1+pWJeR3IdT/81Mx6TlAkkAg==",
"sign": "Hv7Z7SrYgnK9WGI0qZJJkCcDBVG5mYZlAN2fe0RsdEEIY3i9iAbRK+JtT+hxrv1+pWJeR3IdT/81Mx6TlAkkAg=="
}
],
"owner": [
"0xFFFF91572cC21352BD6044f91506294f4B01D73D"
],
"vin": {
"prevout": {
"hash": [
"0x7dd57386b958cb7ad02170bd5c190e369c1694f596d524d2b2bfa5e1a55c253b"
]
},
"vinsign": [
{
"pub": "MCowBQYDK2VwAyEA+X/pIfbC/gTA+iuG5yoLn6AH90PFdko5gWfURmCYC90=",
"sign": "eArBhLH2J24CjgE6SnPMV1/p+5Uqyuh2QwCwD7ldeqpJ63hPpcQ0n9CiNXh8CNPeKJNufduL1WjfDvqHymiZBA=="
}
]
},
"vout": [
{
"addr": "VirtualInvest",
"value": 1000000000000
},
{
"addr": "0xFFFF91572cC21352BD6044f91506294f4B01D73D",
"value": 6998899999939100
},
{
"addr": "VirtualBurnGas",
"value": 32400
}
]
},
"verifySign": [
{
"pub": "MCowBQYDK2VwAyEAHDoLfSX+ygmvSICr/1Q/UnfLlPFkAQBB4oPZne/SoVo=",
"sign": "bCoIyAR1qH5LDHpX5Y5E5OqZogQo0EDDPnihTaPDHV5jQdT9AEadCo/+uhRMOi7l9XlwxhrCcxesnfJDXbQmCg==",
"signaddr": "0x0796B6DB27e5eb1e9F8Bd2c4d03191C902D22F0f"
}
]
},
"txhash": "0x64e91e7fa9ce873a1891806ae1adcc0af98d38ff78660c8408ad9caa81c67495"
}
}
Return the JSON type to determine whether the transaction is on the chain based on the percent
value.
When the percent
value is greater than 0.8, it can be concluded that the transaction has been on the chain.
GetTransactionByHash
- Get transaction information interface
For example: http://IP:port/GetTransactionByHash
curl http://localhost:20620/GetTransactionByHash -X POST -H "Content-Type: application/json" -d '
{
"id":"1",
"jsonrpc":"2.0",
"params":{"txHash":"434026a97ff15f3519a95f3600c527d8b68cc72f279a4e36705b526900cbfbf0"}
}
'
Sample Request:
{
"id":"1",
"jsonrpc":"2.0",
"params":{"txHash":"434026a97ff15f3519a95f3600c527d8b68cc72f279a4e36705b526900cbfbf0"}
}
Sample Response:
{
"id": "1",
"jsonrpc": "2.0",
"method": "GetTransactionByHash",
"result": {
"code": 0,
"message": "success",
"tx": {
"Consensus": 7,
"Type": "Tx",
"data": {
"TxInfo": {
"BonusAddr": "0xFFFF91572cC21352BD6044f91506294f4B01D73D",
"InvestAmount": 1000000000000,
"InvestType": "Normal"
}
},
"identity": "0x0796B6DB27e5eb1e9F8Bd2c4d03191C902D22F0f",
"time": 1716775934685374,
"txHash": "0x64e91e7fa9ce873a1891806ae1adcc0af98d38ff78660c8408ad9caa81c67495",
"txType": 4,
"utxo": {
"multisign": [
{
"pub": "Hv7Z7SrYgnK9WGI0qZJJkCcDBVG5mYZlAN2fe0RsdEEIY3i9iAbRK+JtT+hxrv1+pWJeR3IdT/81Mx6TlAkkAg==",
"sign": "Hv7Z7SrYgnK9WGI0qZJJkCcDBVG5mYZlAN2fe0RsdEEIY3i9iAbRK+JtT+hxrv1+pWJeR3IdT/81Mx6TlAkkAg=="
}
],
"owner": [
"0xFFFF91572cC21352BD6044f91506294f4B01D73D"
],
"vin": {
"prevout": {
"hash": [
"0x7dd57386b958cb7ad02170bd5c190e369c1694f596d524d2b2bfa5e1a55c253b"
]
},
"vinsign": [
{
"pub": "MCowBQYDK2VwAyEA+X/pIfbC/gTA+iuG5yoLn6AH90PFdko5gWfURmCYC90=",
"sign": "eArBhLH2J24CjgE6SnPMV1/p+5Uqyuh2QwCwD7ldeqpJ63hPpcQ0n9CiNXh8CNPeKJNufduL1WjfDvqHymiZBA=="
}
]
},
"vout": [
{
"addr": "VirtualInvest",
"value": 1000000000000
},
{
"addr": "0xFFFF91572cC21352BD6044f91506294f4B01D73D",
"value": 6998899999939100
},
{
"addr": "VirtualBurnGas",
"value": 32400
}
]
},
"verifySign": [
{
"pub": "MCowBQYDK2VwAyEAHDoLfSX+ygmvSICr/1Q/UnfLlPFkAQBB4oPZne/SoVo=",
"sign": "bCoIyAR1qH5LDHpX5Y5E5OqZogQo0EDDPnihTaPDHV5jQdT9AEadCo/+uhRMOi7l9XlwxhrCcxesnfJDXbQmCg==",
"signaddr": "0x0796B6DB27e5eb1e9F8Bd2c4d03191C902D22F0f"
}
]
}
}
}
Callback interface
After the transaction is completed, it is very unlikely to encounter a situation of transaction rollback. At this point, it is necessary to configure callback information to capture the rolled back block information.
-
Enable and set interface parameters for
config.json
.Modify parameter
http_callback
in config.json,The parameter has the following meanings:- ip: Callback IP address
- path: Callback Path
- port: Callback Port
- ip: Callback IP address
-
The node will add the following interfaces based on the content set above.
These interfaces are used for callback of transaction information
http://ip:port/path/add_block // Add block callback
http://ip:port/path/rollback_block // Rollback block callback
The content returned by the add_block
or rollback_block
interface is block information,so the callback data is json's block data.
Callback Example:
{
"blockdata": {
"0x9486c7cb49e22726b5fbbcaac4f4842e020bc3357feeed3037c23e1fc88c8715": {
"output": "0000000000000000000000000000000000000000000000000000000000000001",
"preHash": {
"0xf4C69F83A5DC57f1772124E6F7EAF9DBcEd2e603": "0x1093122915e33857c377df82abefa3c00954c0d89935d9cdd60a01fd0066b016"
},
"log": [
{
"creator": "0xf4C69F83A5DC57f1772124E6F7EAF9DBcEd2e603",
"data": "0000000000000000000000000000000000000000000000000000000000000014",
"topics": [
"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0000000000000000000000006298d7a621bf8c37e74a51c6b3e9c788975d9cf1",
"000000000000000000000000a5818edcbee321f479f8143ecddc28ccebf1c99d"
]
}
],
"dependentCTx": [
"f4C69F83A5DC57f1772124E6F7EAF9DBcEd2e603"
],
"storage": {
"f4C69F83A5DC57f1772124E6F7EAF9DBcEd2e603_1969923b79d750ee12954b254446ef55c8a3f443d736b4378c9934266f6934b8": "f8978080808080808080b842b8406664346637326364643333323466366361393364633831646639316435356638386131663235333235336539363964343436636365643430663231393533303980b842b84036633231313535653264636461393735636665373564363338643732643435353161343033386334656363613037393637666263333463363165343130383331808080808080",
"f4C69F83A5DC57f1772124E6F7EAF9DBcEd2e603_rootHash": "5fa5c49a6a46424be09a8620b58e0e4ae9fdfa3d1e05ff819f52ac36947ad662",
"f4C69F83A5DC57f1772124E6F7EAF9DBcEd2e603_5fa5c49a6a46424be09a8620b58e0e4ae9fdfa3d1e05ff819f52ac36947ad662": "f90160b842b84064313663626466616437653964636135303361356633346565333666646432333635376334393137613731663337363938623236613737376666343435323635808080808080b842b84035623730306433626535663437646461313233396566376465393866626237393333353530616139613533623631313635316330613033393166643336346462b842b840313936393932336237396437353065653132393534623235343434366566353563386133663434336437333662343337386339393334323636663639333462388080b842b8403936643466646462616566396439343664306136343261336462616539376438306464346634323638366330393762626534646564663865376533643533303380b842b84033333864376136393065646435383361376464616435323731653966333031616438633132653739616261653030303336373962623066383237363538636534808080",
"f4C69F83A5DC57f1772124E6F7EAF9DBcEd2e603_fd4f72cdd3324f6ca93dc81df91d55f88a1f253253e969d446cced40f2195309": "f886b8406537396138326337313165626563356261353638356533323964613937633533356139313163393732663636376362393561373933373335376366333938387ab842b84030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030313261303566316334",
"f4C69F83A5DC57f1772124E6F7EAF9DBcEd2e603_6c21155e2dcda975cfe75d638d72d4551a4038c4ecca07967fbc34c61e410831": "f886b8403235333263303731623631646363643634643439616332396533616461623533643431663135356237653431663134656335343137363362316337376234347ab842b84030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303363"
},
"creation": {},
"destruction": {}
},
"dependentCTx": ""
},
"tx": [
{
"data": {
"TxInfo": {
"blockPrevRandao": 4279,
"output": "0000000000000000000000000000000000000000000000000000000000000001",
"virtualMachine": 0,
"input": "a9059cbb000000000000000000000000a5818edcbee321f479f8143ecddc28ccebf1c99d0000000000000000000000000000000000000000000000000000000000000014",
"transfer": 0,
"sender": "0x6298D7a621bF8C37E74a51c6b3E9c788975d9cF1",
"contractDeployer": "0xfE7EfC12a4803A655f3629d05AbbB5Cd57d5beeD",
"recipient": "0xf4C69F83A5DC57f1772124E6F7EAF9DBcEd2e603",
"donation": 0,
"blockTimestamp": 1716012240,
"version": 0
}
},
"from": [
"0x6298D7a621bF8C37E74a51c6b3E9c788975d9cF1"
],
"time": 1716012233085554,
"to": [
{
"pub": "0xVirtualCallContractBurnGas",
"value": 48119
},
{
"pub": "0x6298D7a621bF8C37E74a51c6b3E9c788975d9cF1",
"value": 197899479843
},
{
"pub": "0xVirtualBurnGas",
"value": 71400
}
],
"type": 8,
"hash": "0x9486c7cb49e22726b5fbbcaac4f4842e020bc3357feeed3037c23e1fc88c8715"
}
],
"time": 1716012235389455,
"hash": "0x01faeeb788a7c927a725dfc02d9b9c05920063ece30ef1b93dbcb1708efed09f",
"height": 228
}
The numbers corresponding to the Transaction type
value in the returned information represent:
- -1: Genesis block
- 0: Unknown
- 1: Ordinary transactions
- 2: Stake transaction
- 3: UnStake transaction
- 4: Investment transactions
- 5: Divestment transaction
- 6: Reserved
- 7: Deployment contract
- 8: Execute contract
- 9: Get bonus