github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/internal/blocks/README.md (about)

     1  ## chifra blocks
     2  
     3  The `chifra blocks` tool retrieves block data from your Ethereum node or, if previously cached, from the
     4  TrueBlocks cache. You may specify multiple blocks per invocation.
     5  
     6  By default, `chifra blocks` queries the full transactional details of the block (including receipts).
     7  You may optionally retrieve only the transaction hashes in the block (which is significantly faster).
     8  Additionally, you may also use this tool to retrieve uncle blocks at a give height.
     9  
    10  Another useful feature of `chifra blocks` is the ability to extract address appearances from a block.
    11  TrueBlocks uses a similar feature internally to build its index of appearances. This type of data
    12  is very insightful when studying end user behavior and chain-wide adoption analysis.
    13  
    14  ```[plaintext]
    15  Purpose:
    16    Retrieve one or more blocks from the chain or local cache.
    17  
    18  Usage:
    19    chifra blocks [flags] <block> [block...]
    20  
    21  Arguments:
    22    blocks - a space-separated list of one or more block identifiers (required)
    23  
    24  Flags:
    25    -e, --hashes            display only transaction hashes, default is to display full transaction detail
    26    -c, --uncles            display uncle blocks (if any) instead of the requested block
    27    -t, --traces            export the traces from the block as opposed to the block data
    28    -u, --uniq              display a list of uniq address appearances per transaction
    29    -f, --flow string       for the --uniq option only, export only from or to (including trace from or to)
    30                            One of [ from | to | reward ]
    31    -l, --logs              display only the logs found in the block(s)
    32    -m, --emitter strings   for the --logs option only, filter logs to show only those logs emitted by the given address(es)
    33    -B, --topic strings     for the --logs option only, filter logs to show only those with this topic(s)
    34    -i, --withdrawals       export the withdrawals from the block as opposed to the block data
    35    -a, --articulate        for the --logs option only, articulate the retrieved data if ABIs can be found
    36    -U, --count             display only the count of appearances for --addrs or --uniq
    37    -X, --cache_txs         force a write of the block's transactions to the cache (slow)
    38    -R, --cache_traces      force a write of the block's traces to the cache (slower)
    39    -H, --ether             specify value in ether
    40    -o, --cache             force the results of the query into the cache
    41    -D, --decache           removes related items from the cache
    42    -x, --fmt string        export format, one of [none|json*|txt|csv]
    43    -v, --verbose           enable verbose output
    44    -h, --help              display this help screen
    45  
    46  Notes:
    47    - Blocks is a space-separated list of values, a start-end range, a special, or any combination.
    48    - Blocks may be specified as either numbers or hashes.
    49    - Special blocks are detailed under chifra when --list.
    50    - With the --logs option, optionally specify one or more --emitter, one or more --topics, either or both.
    51    - The --logs option is significantly faster if you provide an --emitter and/or a --topic.
    52    - Multiple topics match on topic0, topic1, and so on, not on different topic0's.
    53    - The --decache option removes the block(s), all transactions in those block(s), and all traces in those transactions from the cache.
    54    - The --withdrawals option is only available on certain chains. It is ignored otherwise.
    55    - The --traces option requires your RPC to provide trace data. See the README for more information.
    56  ```
    57  
    58  Data models produced by this tool:
    59  
    60  - [appearance](/data-model/accounts/#appearance)
    61  - [block](/data-model/chaindata/#block)
    62  - [blockcount](/data-model/chaindata/#blockcount)
    63  - [lightblock](/data-model/chaindata/#lightblock)
    64  - [log](/data-model/chaindata/#log)
    65  - [message](/data-model/other/#message)
    66  - [trace](/data-model/chaindata/#trace)
    67  - [traceaction](/data-model/chaindata/#traceaction)
    68  - [traceresult](/data-model/chaindata/#traceresult)
    69  - [withdrawal](/data-model/chaindata/#withdrawal)
    70  
    71  ### further information
    72  
    73  The `--traces` option requires your node to enable the `trace_block` (and related) RPC endpoints. Please see the README file for the `chifra traces` command for more information.
    74  
    75  ### Other Options
    76  
    77  All tools accept the following additional flags, although in some cases, they have no meaning.
    78  
    79  ```[plaintext]
    80    -v, --version         display the current version of the tool
    81        --output string   write the results to file 'fn' and return the filename
    82        --append          for --output command only append to instead of replace contents of file
    83        --file string     specify multiple sets of command line options in a file
    84  ```
    85  
    86  **Note:** For the `--file string` option, you may place a series of valid command lines in a file using any
    87  valid flags. In some cases, this may significantly improve performance. A semi-colon at the start
    88  of any line makes it a comment.
    89  
    90  **Note:** If you use `--output --append` option and at the same time the `--file` option, you may not switch
    91  export formats in the command file. For example, a command file with two different commands, one with `--fmt csv`
    92  and the other with `--fmt json` will produce both invalid CSV and invalid JSON.
    93  
    94  *Copyright (c) 2024, TrueBlocks, LLC. All rights reserved. Generated with goMaker.*