コンテンツにスキップ

サポートされているAPIメソッド

Ethereum GatewayがサポートするAPIメソッドの完全なリストは以下に示されています。 サポートされていないメソッドが指定された場合、ゲートウェイは403を返します。

JSON-RPC APIメソッドの完全なリストについては、JSON-RPC仕様 ↗を参照してください。

JSON-RPCメソッドCloudflare Ethereum Gatewayサポート
web3_clientVersion ↗✅
web3_sha3 ↗✅
net_version ↗✅
net_listening ↗✅
eth_syncing ↗✅
eth_mining ↗✅
eth_gasPrice ↗✅
eth_feeHistory ↗1✅
eth_blockNumber ↗✅
eth_chainId ↗✅
eth_getBalance ↗✅
eth_getStorageAt ↗✅
eth_getTransactionCount ↗✅
eth_getBlockTransactionCountByHash ↗✅
eth_getBlockTransactionCountByNumber ↗✅
eth_getUncleCountByBlockHash ↗✅
eth_getUncleCountByBlockNumber ↗✅
eth_getCode ↗✅
eth_sendRawTransaction ↗✅
eth_call ↗✅
eth_estimateGas ↗✅
eth_getBlockByHash ↗✅
eth_getBlockByNumber ↗✅
eth_getTransactionByHash ↗✅
eth_getTransactionByBlockHashAndIndex ↗✅
eth_getTransactionByBlockNumberAndIndex ↗✅
eth_getTransactionReceipt ↗✅
eth_getUncleByBlockHashAndIndex ↗✅
eth_getUncleByBlockNumberAndIndex ↗✅
eth_getLogs ↗2✅
eth_getWork ↗✅
eth_getProof ↗✅
net_peerCount ↗❌
eth_protocolVersion ↗❌
eth_coinbase ↗❌
eth_hashrate ↗❌
eth_accounts ↗❌
eth_sign ↗❌
eth_sendTransaction ↗❌
eth_getCompilers ↗❌
eth_compileLLL ↗❌
eth_compileSolidity ↗❌
eth_compileSerpent ↗❌
eth_newFilter ↗❌
eth_newBlockFilter ↗❌
eth_newPendingTransactionFilter ↗❌
eth_uninstallFilter ↗❌
eth_getFilterChanges ↗❌
eth_getFilterLogs ↗❌
eth_submitWork ↗❌
eth_submitHashrate ↗❌

トレースメソッド

EVMトレースは、Ethereumブロックチェーン上のスマートコントラクトの実行を追跡する方法です。これは、スマートコントラクトが実行される際にEthereum仮想マシン(EVM)が取ったすべてのステップを記録します。これには、実行された特定の操作、コストにかかったガスの量、結果としてブロックチェーンに加えられた変更などの情報が含まれます。トレースモジュールは、開発者がこれらのトレースにアクセスし、分析するためのツールであり、デバッグ、テスト、スマートコントラクトの監視に役立ちます。これを使用してエラーを特定して修正したり、パフォーマンスを最適化したり、スマートコントラクトがブロックチェーンとどのように相互作用しているかを理解したりできます。

trace_filter

trace_filterメソッドは、単一のリクエストで複数のトランザクションのトレースを取得します。このメソッドは、Ethereumブロックチェーン上の特定のアドレスをデバッグおよび監視するのに特に便利です。

リクエストパラメータ

  • fromBlock: QuantityまたはTag - (オプション)トレースの受信を開始するブロック番号。
  • toBlock: QuantityまたはTag - (オプション)トレースの受信を停止するブロック番号。
  • fromAddress: Array - (オプション)トレースの受信を開始するアドレスの配列。
  • toAddress: Address - (オプション)トレースの取得を停止するアドレスの配列。
  • after: Quantity - (オプション)オフセットトレース番号。
  • count: Quantity - (オプション)返すトレースの数。

戻り値

このメソッドは、指定されたフィルターに一致するトレースのArrayを返します。

例

trace_filterリクエスト
curl https://web3-trial.cloudflare-eth.com/v1/mainnet \
-X POST \
-H 'Content-Type: application/json' \
--data '{
"jsonrpc":"2.0",
"method":"trace_filter",
"params":[
{
"count": 200,
"fromBlock": "0xccb943",
"toBlock": "0xccbc62",
"fromAddress": [
"0xEdC763b3e418cD14767b3Be02b667619a6374076"
]
}
],
"id":1
}'

レスポンス

{
"jsonrpc": "2.0",
"result": [
{
"action": {
"from": "0xedc763b3e418cd14767b3be02b667619a6374076",
"callType": "call",
"gas": "0x8462",
"input": "0x095ea7b30000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"to": "0x7ff4169a6b5122b664c51c95727d87750ec07c84",
"value": "0x0"
},
"blockHash": "0x351e7c06ec010c8f7e7358eb580238dd23e1e129be96822aa93ebb6da08558e6",
"blockNumber": 13416771,
"result": {
"gasUsed": "0x6009",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0x054bbb9fbb855bf23f755e548c7409f45fc5eff8a824b2ad06380bc038d7b049",
"transactionPosition": 54,
"type": "call"
}
],
"id": 1
}

制限

trace_filterメソッドには、ノードが過負荷にならないようにするためのいくつかの制限があります。

  • trace_filterメソッドのブロック範囲は800ブロックに制限されています。
  • トレースのcountは200に制限されています。

Footnotes

  1. 制限: 最大ブロック数は10です。 ↩

  2. 制限: 最大ブロック範囲は800ブロックです。 ↩