github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/internal/traces/README.md (about) 1 ## chifra traces 2 3 The `chifra traces` tool retrieves a transaction's traces. You may specify multiple transaction 4 identifiers per invocation. 5 6 The `--articulate` option fetches the ABI from each encountered smart contract to better describe 7 the reported data. 8 9 The `--filter` option calls your node's `trace_filter` routine (if available) using a bang-separated 10 string of the same values used by `trace_fitler`. 11 12 ```[plaintext] 13 Purpose: 14 Retrieve traces for the given transaction(s). 15 16 Usage: 17 chifra traces [flags] <tx_id> [tx_id...] 18 19 Arguments: 20 transactions - a space-separated list of one or more transaction identifiers (required) 21 22 Flags: 23 -a, --articulate articulate the retrieved data if ABIs can be found 24 -f, --filter string call the node's trace_filter routine with bang-separated filter 25 -U, --count display only the number of traces for the transaction (fast) 26 -H, --ether specify value in ether 27 -o, --cache force the results of the query into the cache 28 -D, --decache removes related items from the cache 29 -x, --fmt string export format, one of [none|json*|txt|csv] 30 -v, --verbose enable verbose output 31 -h, --help display this help screen 32 33 Notes: 34 - The transactions list may be one or more transaction hashes, blockNumber.transactionID pairs, or a blockHash.transactionID pairs. 35 - This tool checks for valid input syntax, but does not check that the transaction requested actually exists. 36 - If the queried node does not store historical state, the results for most older transactions are undefined. 37 - A bang separated filter has the following fields (at least one of which is required) and is separated with a bang (!): fromBlk, toBlk, fromAddr, toAddr, after, count. 38 - This command requires your RPC to provide trace data. See the README for more information. 39 ``` 40 41 Data models produced by this tool: 42 43 - [function](/data-model/other/#function) 44 - [message](/data-model/other/#message) 45 - [parameter](/data-model/other/#parameter) 46 - [trace](/data-model/chaindata/#trace) 47 - [traceaction](/data-model/chaindata/#traceaction) 48 - [tracecount](/data-model/chaindata/#tracecount) 49 - [tracefilter](/data-model/chaindata/#tracefilter) 50 - [traceresult](/data-model/chaindata/#traceresult) 51 52 ### further information 53 54 The `--traces` option requires your node to enable the `trace_block` (and related) RPC endpoints. Many remote RPC providers do not enable these endpoints due to the additional load they can place on the node. If you are running your own node, you can enable these endpoints by adding `trace` to your node's startup. 55 56 The test for tracing assumes your node provides tracing starting at block 1. If your is partially synced, you may export the following enviroment variable before running the command to instruct `chifra` where to test. 57 58 ```[bash] 59 export TB_<chain>_FIRSTTRACE=<bn> 60 ``` 61 62 where `<chain>` is the chain you are running and `<bn>` is the block number at which tracing starts. For example, to start tracing at block 1000 on the mainnet, you would export `TB_MAINNET_FIRSTTRACE=1000`. 63 64 ### Other Options 65 66 All tools accept the following additional flags, although in some cases, they have no meaning. 67 68 ```[plaintext] 69 -v, --version display the current version of the tool 70 --output string write the results to file 'fn' and return the filename 71 --append for --output command only append to instead of replace contents of file 72 --file string specify multiple sets of command line options in a file 73 ``` 74 75 **Note:** For the `--file string` option, you may place a series of valid command lines in a file using any 76 valid flags. In some cases, this may significantly improve performance. A semi-colon at the start 77 of any line makes it a comment. 78 79 **Note:** If you use `--output --append` option and at the same time the `--file` option, you may not switch 80 export formats in the command file. For example, a command file with two different commands, one with `--fmt csv` 81 and the other with `--fmt json` will produce both invalid CSV and invalid JSON. 82 83 *Copyright (c) 2024, TrueBlocks, LLC. All rights reserved. Generated with goMaker.*