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

     1  ## chifra export
     2  
     3  The `chifra export` tools provides a major part of the functionality of the TrueBlocks system. Using
     4  the index of appearances created with `chifra scrape` and the list of transaction identifiers
     5  created with `chifra list`, `chifra export` completes the actual extraction of an address's transactional
     6  history from the node.
     7  
     8  You may use `topics`, `fourbyte` values at the start of a transaction's input data, and/or a log's
     9  `source address` or `emitter` to filter the results.
    10  
    11  You may also choose which portions of the Ethereum data structures (`--transactions`, `--logs`,
    12  `--traces`, etc.) as you wish.
    13  
    14  By default, the results of the extraction are delivered to your console, however, you may export
    15  the results to any database (with a little bit of work). The format of the data, its content and
    16  its destination are up to you.
    17  
    18  ```[plaintext]
    19  Purpose:
    20    Export full details of transactions for one or more addresses.
    21  
    22  Usage:
    23    chifra export [flags] <address> [address...] [topics...] [fourbytes...]
    24  
    25  Arguments:
    26    addrs - one or more addresses (0x...) to export (required)
    27    topics - filter by one or more log topics (only for --logs option)
    28    fourbytes - filter by one or more fourbytes (only for transactions and trace options)
    29  
    30  Flags:
    31    -p, --appearances         export a list of appearances
    32    -r, --receipts            export receipts instead of transactional data
    33    -l, --logs                export logs instead of transactional data
    34    -t, --traces              export traces instead of transactional data
    35    -n, --neighbors           export the neighbors of the given address
    36    -C, --accounting          attach accounting records to the exported data (applies to transactions export only)
    37    -A, --statements          for the accounting options only, export only statements
    38    -b, --balances            traverse the transaction history and show each change in ETH balances
    39    -i, --withdrawals         export withdrawals for the given address
    40    -a, --articulate          articulate transactions, traces, logs, and outputs
    41    -R, --cache_traces        force the transaction's traces into the cache
    42    -U, --count               for --appearances mode only, display only the count of records
    43    -c, --first_record uint   the first record to process
    44    -e, --max_records uint    the maximum number of records to process (default 250)
    45    -N, --relevant            for log and accounting export only, export only logs relevant to one of the given export addresses
    46    -m, --emitter strings     for the --logs option only, filter logs to show only those logs emitted by the given address(es)
    47    -B, --topic strings       for the --logs option only, filter logs to show only those with this topic(s)
    48    -V, --reverted            export only transactions that were reverted
    49    -P, --asset strings       for the accounting options only, export statements only for this asset
    50    -f, --flow string         for the accounting options only, export statements with incoming, outgoing, or zero value
    51                              One of [ in | out | zero ]
    52    -y, --factory             for --traces only, report addresses created by (or self-destructed by) the given address(es)
    53    -u, --unripe              export transactions labeled unripe (i.e. less than 28 blocks old)
    54    -E, --reversed            produce results in reverse chronological order
    55    -z, --no_zero             for the --count option only, suppress the display of zero appearance accounts
    56    -F, --first_block uint    first block to process (inclusive)
    57    -L, --last_block uint     last block to process (inclusive)
    58    -H, --ether               specify value in ether
    59    -o, --cache               force the results of the query into the cache
    60    -D, --decache             removes related items from the cache
    61    -x, --fmt string          export format, one of [none|json*|txt|csv]
    62    -v, --verbose             enable verbose output
    63    -h, --help                display this help screen
    64  
    65  Notes:
    66    - An address must be either an ENS name or start with '0x' and be forty-two characters long.
    67    - Articulating the export means turn the EVM's byte data into human-readable text (if possible).
    68    - For the --logs option, you may optionally specify one or more --emitter, one or more --topics, or both.
    69    - The --logs option is significantly faster if you provide an --emitter or a --topic.
    70    - Neighbors include every address that appears in any transaction in which the export address also appears.
    71    - If present, --first_/--last_block are applied, followed by user-supplied filters such as asset or topic, followed by --first_/--max_record if present.
    72    - The --first_record and --max_record options are zero-based (as are the block options).
    73    - The _block and _record filters are ignored when used with the --count option.
    74    - If the --reversed option is present, the appearance list is reversed prior to all processing (including filtering).
    75    - The --decache option will remove all cache items (blocks, transactions, traces, etc.) for the given address(es).
    76    - The --withdrawals option is only available on certain chains. It is ignored otherwise.
    77    - The --traces option requires your RPC to provide trace data. See the README for more information.
    78  ```
    79  
    80  Data models produced by this tool:
    81  
    82  - [appearance](/data-model/accounts/#appearance)
    83  - [function](/data-model/other/#function)
    84  - [log](/data-model/chaindata/#log)
    85  - [message](/data-model/other/#message)
    86  - [monitor](/data-model/accounts/#monitor)
    87  - [parameter](/data-model/other/#parameter)
    88  - [receipt](/data-model/chaindata/#receipt)
    89  - [statement](/data-model/accounts/#statement)
    90  - [token](/data-model/chainstate/#token)
    91  - [trace](/data-model/chaindata/#trace)
    92  - [traceaction](/data-model/chaindata/#traceaction)
    93  - [traceresult](/data-model/chaindata/#traceresult)
    94  - [transaction](/data-model/chaindata/#transaction)
    95  - [withdrawal](/data-model/chaindata/#withdrawal)
    96  
    97  ### further information
    98  
    99  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.
   100  
   101  ### Other Options
   102  
   103  All tools accept the following additional flags, although in some cases, they have no meaning.
   104  
   105  ```[plaintext]
   106    -v, --version         display the current version of the tool
   107        --output string   write the results to file 'fn' and return the filename
   108        --append          for --output command only append to instead of replace contents of file
   109        --file string     specify multiple sets of command line options in a file
   110  ```
   111  
   112  **Note:** For the `--file string` option, you may place a series of valid command lines in a file using any
   113  valid flags. In some cases, this may significantly improve performance. A semi-colon at the start
   114  of any line makes it a comment.
   115  
   116  **Note:** If you use `--output --append` option and at the same time the `--file` option, you may not switch
   117  export formats in the command file. For example, a command file with two different commands, one with `--fmt csv`
   118  and the other with `--fmt json` will produce both invalid CSV and invalid JSON.
   119  
   120  *Copyright (c) 2024, TrueBlocks, LLC. All rights reserved. Generated with goMaker.*