starcoinorg / starcoin-java

Apache License 2.0
5 stars 10 forks source link

[feat] 新增 transaction proof 相关的 RPC API #44

Closed nangongamo closed 2 years ago

nangongamo commented 2 years ago

RPC API

  1. chain.get_transaction_proof
  2. chain.get_block_info_by_number
  3. chain.get_txn_info_by_block_and_index

chain.get_transaction_proofchain.get_block_info_by_number 用于 Transaction Proof 的。

curl --location --request POST 'https://barnard-seed.starcoin.org' \
--header 'Content-Type: application/json' \
--data-raw '{
 "id":101, 
 "jsonrpc":"2.0", 
 "method":"chain.get_transaction_proof", 
 "params":["0x49622a10f52d88909c09510898c4bc15ebc338d56c22f2a197d76fa8b627b35c",10502811,1,"0x00000000000000000000000000000001/1/0x00000000000000000000000000000001::Account::WithdrawEvent"]
}'

四个参数: blockHash(必填) transactionGlobalIndex(必填) eventIndex(选填) accessPath(选填)

accessPath 注意格式有效性

get_transaction_proof 新增三个重载函数。

其他用法见 BlockRPCClientTest.testGetTransactionProof()