Skip to content

BaerChain get_received

weidong edited this page Apr 9, 2020 · 3 revisions

Receive income(get_received)

1. Request json file Back Dir

{
	"source":[
	{
		"from":"0xc6f73c3b14456434c7db388bcb4fd47377c0d738",
		"to":"0x00000000000000000000000000000000766f7465",
		"value":"0x0",
		"data":[
		{
			"type":8,
			"m_receivingType":1,
			"m_from":"0x042610e447c94ff0824b7aa89fab123930edc805"
		}
		],
		"chainId":"0x1",
		"nonce":"0x0",
		"gas":"0x13808",
		"gasPrice":"0x5"
	}
	],
	"keys":[
		"8kZJMg3BfpkD6yzWh84N2ACPZaqWSZof1G23YQ7PD3u6"
	]
}
  • params description
from     : string, the address from which you initiated the claim
to       : string, Fixed address, cannot be changed
value    : string, default: "0x0"
data     : Receive earnings data
           > type            : int, Fixed at 8, indicating receipt of income
           > m_receivingType : int, 1: Receiving the income from the block, 2: Receiving the income from the matching system
           > m_from          : string, The address from which you initiated the claim

chainId  : string, Chain ID, hexadecimal must be the same as chain creation chainId
nonce    : string, Hexadecimal, nonce value, +1 after each execution
gas      : string, Hexadecimal, the gas integer provided for transaction execution
gasPrice : string, Hexadecimal, for each gasPrice integer paid for gas
keys     : Private key

Remarks: When to fill in another address, and data is not empty, the default to is the contract address of the call, and transfer the value of the value from (from value if there is a value) to to, generally prohibit this operation

2. Receive income statement Back Dir

  • Explanation

    • Income conditions: Only if the block person has cast a valid number of votes, and the block has a transaction, will the corresponding income be obtained
  • Execute in the compilation directory to obtain the cmdWallet execution file (in this example, use the offline wallet description)

cd cpp-lsac/build : Enter the directory
cmake ..          : Execute instruction
make              : Execute instruction
cd cpp-lsac/build/wallet/cmdWallet : You can find the cmdWallet executable file just compiled in this directory

  • 2.1 Block income collection
    • The value of m_receivingType in the above json file field is 1, that is, "m_receivingType": 1
    • Execute instruction
      ./cmdWallet -j get_received.json -s 127.0.0.1:8866
      
    • Return result
      {"id":1,"jsonrpc":"2.0","result":"0x0ebcbba36d33cc1b2168591d03267662845f7db9a1d7656cc6e6f65719131bc6"}
      
  • 2.2 The matching revenue is the same as the block revenue, but the value of the m_receivingType in the above json file field is 2, which is "m_receivingType": 2

Clone this wiki locally