我正在 Hashscan 上查看交易
其交易哈希为:
0x89eb7e219df6f8b3b3406c8a3698d5b484a4945059af643861c878e41ffc161b2589cc82ff40b4392ceb53856c5252c1
...不适用于eth_getTransactionByHash
RPC:
TXHASH=0x89eb7e219df6f8b3b3406c8a3698d5b484a4945059af643861c878e41ffc161b2589cc82ff40b4392ceb53856c5252c1
curl -s -X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":"2","method":"eth_getTransactionByHash","params":["'"${TXHASH}"'"]}' \
http://localhost:7546 | jq
错误是:
{
"jsonrpc": "2.0",
"id": "2",
"error": {
"code": -32602,
"name": "Invalid parameter",
"message": "[Request ID: 5fda4d4a-3160-4f8f-8ed3-51ad64dada46] Invalid parameter 0: Expected 0x prefixed string representing the hash (32 bytes) of a transaction, value: 0x89eb7e219df6f8b3b3406c8a3698d5b484a4945059af643861c878e41ffc161b2589cc82ff40b4392ceb53856c5252c1"
}
如何获得可以在 RPC 中使用的交易哈希?