github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/internal/state/README.md (about) 1 ## chifra state 2 3 The `chifra state` tool retrieves the balance of an address (or list of addresses) at the given block 4 (or blocks). Specify multiple addresses and/or multiple blocks if you wish, but you must specify 5 at least one address. If no block is specified, the latest block is reported. 6 7 You may also query to see if an address is a smart contract as well as retrieve a contract's 8 byte code. 9 10 ```[plaintext] 11 Purpose: 12 Retrieve account balance(s) for one or more addresses at given block(s). 13 14 Usage: 15 chifra state [flags] <address> [address...] [block...] 16 17 Arguments: 18 addrs - one or more addresses (0x...) from which to retrieve balances (required) 19 blocks - an optional list of one or more blocks at which to report balances, defaults to 'latest' 20 21 Flags: 22 -p, --parts strings control which state to export 23 One or more of [ balance | nonce | code | proxy | deployed | accttype | some | all ] 24 -c, --changes only report a balance when it changes from one block to the next 25 -z, --no_zero suppress the display of zero balance accounts 26 -l, --call string call a smart contract with one or more solidity calls, four-byte plus parameters, or encoded call data strings 27 -a, --articulate for the --call option only, articulate the retrieved data if ABIs can be found 28 -r, --proxy_for string for the --call option only, redirects calls to this implementation 29 -H, --ether specify value in ether 30 -o, --cache force the results of the query into the cache 31 -D, --decache removes related items from the cache 32 -x, --fmt string export format, one of [none|json*|txt|csv] 33 -v, --verbose enable verbose output 34 -h, --help display this help screen 35 36 Notes: 37 - An address must be either an ENS name or start with '0x' and be forty-two characters long. 38 - Blocks is a space-separated list of values, a start-end range, a special, or any combination. 39 - If the queried node does not store historical state, the results are undefined. 40 - Special blocks are detailed under chifra when --list. 41 - Balance is the default mode. To select a single mode use none first, followed by that mode. 42 - Valid parameters for --call include Solidity-like syntax: balanceOf(0x316b...183d), a four-byte followed by parameters: 0x70a08231(0x316b...183d), or encoded input data. 43 - You may specify multiple parts on a single line. 44 - In the --call string, you may separate multiple calls with a colon. 45 ``` 46 47 Data models produced by this tool: 48 49 - [function](/data-model/other/#function) 50 - [message](/data-model/other/#message) 51 - [parameter](/data-model/other/#parameter) 52 - [result](/data-model/chainstate/#result) 53 - [state](/data-model/chainstate/#state) 54 55 ### Other Options 56 57 All tools accept the following additional flags, although in some cases, they have no meaning. 58 59 ```[plaintext] 60 -v, --version display the current version of the tool 61 --output string write the results to file 'fn' and return the filename 62 --append for --output command only append to instead of replace contents of file 63 --file string specify multiple sets of command line options in a file 64 ``` 65 66 **Note:** For the `--file string` option, you may place a series of valid command lines in a file using any 67 valid flags. In some cases, this may significantly improve performance. A semi-colon at the start 68 of any line makes it a comment. 69 70 **Note:** If you use `--output --append` option and at the same time the `--file` option, you may not switch 71 export formats in the command file. For example, a command file with two different commands, one with `--fmt csv` 72 and the other with `--fmt json` will produce both invalid CSV and invalid JSON. 73 74 *Copyright (c) 2024, TrueBlocks, LLC. All rights reserved. Generated with goMaker.*