Filecoin.GasEstimateGasLimit
Filecoin.GasEstimateGasLimit估算并返回消息要消耗的gas。如果消息执行失败, 该调用也将失败。
参数
- message:要进行估算的消息
返回值
Filecoin.GasEstimateGasLimit调用返回估算结果。
示例代码
请求:
curl -X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc":"2.0",
"method":"Filecoin.GasEstimateGasLimit",
"params":[
{
"Version": 42,
"To": "f01234",
"From": "f01234",
"Nonce": 42,
"Value": "0",
"GasLimit": 9,
"GasFeeCap": "0",
"GasPremium": "0",
"Method": 1,
"Params": "Ynl0ZSBhcnJheQ==",
"CID": {
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
}
}
],
"id":7878
}' \
http://127.0.0.1:1234/rpc/v0
响应:
{
"id": 7878,
"jsonrpc": "2.0",
"result": 9
}