LoginSignup
1
0

More than 1 year has passed since last update.

Tezos clientでblock levelごとのoperation数を調べる方法

Posted at

Tezos のblockごとのoperation情報が知りたかったら RPC interface を使うと調べることができるようだ。

Tezos nodeが動いているサーバー上で例えば次のようなコマンドをするとTezos RPC 機能を使うことができる。

./tezos-client rpc get /chains/main/blocks/1600000/hash
"BKmvtKhYPKSniwP6mGNtFrsTU2umW6t6hYoWug7uFBQQboaFsrW"

blockごとのoperationのhash一覧は次のパスで取得できる:

GET /chains/<chain_id>/blocks/<block_id>/operation_hashes

<chain_id> は本番環境のmainnetなら main でOK。<block_id> はブロックレベルで指定することができる。

./tezos-client rpc get /chains/main/blocks/1600000/operation_hashes

なぜかoperationのリストのリストになっているので、数を調べるためにjqで flattenしてから lengthを取る。

./tezos-client rpc get /chains/main/blocks/1600000/operation_hashes | jq ". | flatten | length"
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0