Package: eth-monitor
NAMEeth-monitor - Cache, index and monitor transactions with an EVM node rpcSYNOPSISeth-monitor[ --skip-history ] [ --single ] [ peth_provider] [ --includes-filefile] [ -i chain_spec ]eth-monitor[
--skip-history ] [ --single ] [ peth_provider] [
--excludes-filefile] [ --include-default ] [ -i chain_spec ]DESCRIPTIONTheeth-monitorhas fulfills three distinct but related functions:1. A customizable view of on transactions of interest.2. A block and transaction cache.3. Arbitrary code executions using a transaction (and its block) as
input.Using an EVM RPC endpoint, theeth-monitortool will retrieve blocks
within a given range and provides arbitrary processing of each
transaction.A collection of options is provided to control the behavior of which
block ranges to sync, which criteria to use for display and cache, and
what code to execute for matching transactions. Details on each topic
can be found in theSYNCING,MATCHING ADDRESSESandDEFINING
FILTERSsections below, respectively.Example executions of the tool can be found in theEXAMPLESsection.OPTIONS-0Omit newline to output**--addressaddressAdd an address of interest to match any role. Complements--address-file.**-c ***config_dir, ***--config **config_dirLoad configuration files from given directory. All files with an .ini
extension will be loaded, of which all must contain valid ini file data.**--dumpconfig **formatOutput configuration settings rendered from environment and inputs.
Valid arguments areini for ini file output, and env for environment
variable output. SeeCONFIGURATION.--env-prefixEnvironment prefix for variables to overwrite configuration. Example: If--env-prefix* is set toFOOthen configuration variableBAR_BAZwould be set by environment variableFOO_BAZ_BAR.
Also seeENVIRONMENT.***--excludes-filefileLoad address exclude matching rules from file. SeeMATCHING
ADDRESSES.**--execaddressAdd an address of interest to executable address array. Complements--address-file.**--filtermoduleAdd code execution filter to all matched transactions. The argument must
be a python module path. Several filters may be added by supplying the
option multiple times. Filters will be executed in the order the options
are given. SeeDEFINING FILTERSsection ofeth-monitor (1)for more details.--heightBlock height at which to query state for. Does not apply to
transactions.**-i ***chain_spec, ***--chain-spec **chain_specChain specification string, in the format
<engine>:<fork>:<chain_id>:<common_name>. Example:
"evm:london:1:ethereum". Overrides theRPC_CREDENTIALS configuration
setting.**--include-default **Match all addresses by default. Addresses may be excluded using
--excludes-file. If this is set, --input, --output, --exec and
--includes-file will have no effect.**--includes-filefileLoad address include matching rules from file. SeeMATCHING
ADDRESSES.**--inputaddressAdd an address of interest to inputs (recipients) array. Complements--address-file.**-n ***namespace, ***--namespace **namespaceLoad given configuration namespace. Configuration will be loaded from
the immediate configuration subdirectory with the same name.--no-logsTurn of logging completely. Negates-v* and *-vv**--outputaddressAdd an address of interest to outputs (sender) array. Complements--address-file.-p*, *--rpc-providerFully-qualified URL of RPC provider. Overrides theRPC_PROVIDER
configuration setting.--rawProduce output most optimized for machines.**--renderermoduleAdd output renderer filter to all matched transactions. The argument
must be a python module path. Several renderers may be added by
supplying the option multiple times. SeeRENDERERSsection ofeth-monitor (1)for more details.--rpc-dialectRPC backend dialect. If specified itmay help with encoding and
decoding issues. Overrides the RPC_DIALECT configuration setting.--store-block-data **Store block data in cache for matching transactions. Requires--cache-dir.--store-tx-data **Store transaction data in cache for matching transactions. Requires--cache-dir.-u*, *--unsafeAllow addresses that do not pass checksum.-vVerbose. Show logs for important state changes.-vvVery verbose. Show logs with debugging information.**--x-address **addressAdd an address of interest to match any role.**--x-exec **addressAdd an address of disinterest to executable address array.**--x-input **addressAdd an address of disinterest to inputs (recipients) array.**--x-output **addressAdd an address of disinterest to outputs (sender) array.CONFIGURATIONAll configuration settings may be overriden both by environment
variables, or by overriding settings with the contents of ini-files in
the directory defined by the-c* option.*The active configuration, with values assigned from environment and
arguments, can be output using the--dumpconfig* format option. Note
that entries having keys prefixed with underscore (e.g. _SEQ) are not
actual configuration settings, and thus cannot be overridden with
environment variables.*To refer to a configuration setting by environment variables, thesection and key are concatenated together with an underscore, and
transformed to upper-case. For example, the configuration variable
FOO_BAZ_BAR refers to an ini-file entry as follows:[foo]
bar_baz = xyzzyIn theENVIRONMENT* section below, the relevant configuration
settings for this tool is listed along with a short description of its
meaning.*Some configuration settings may also be overriden by command line
options. Also note that the use of the-n* and--env-prefixoptions affect how environment and configuration is read. The effects of
options on how configuration settings are affective is described in the
respectiveOPTIONSsection.*MATCHING ADDRESSESBy default, addresses to match against transactions need to be
explicitly specified. This behavior can be reversed with the--include-default* option. Addresses to match are defined using the--input,--outputand--execoptions. Addresses
specified multiple times will be deduplicated.*Inclusion rules may also be loaded from file by specifying the--includes-file* and--excludes-fileoptions. Each file must
specify the outputs, inputs and exec addresses as comma separated lists
respectively, separated by tabs.*In the current state of this tool, address matching will affect all
parts of the processing; cache, code execution and rendering.SYNCINGWhen a sync is initiated, the state of this sync is persisted. This way,
previous syncs that did not complete for some reason will be resumed
where they left off.A special sync type--head* starts syncing at the current head of
the chain, and continue to sync until interrupted. When resuming sync, a
new sync range between the current block head and the block height at
which the previous--headsync left off will automatically be
created.*Syncs can be forced to (re)run for ranges regardless of previous state
by using the--single* option. However, there is no protection in
place from preventing code filters from being executed again on the same
transaction when this is done. SeeDEFINING FILTERSbelow.*CACHEWhen syncing, the hash of a block and transaction matching the address
criteria will be stored in the cache. The hashes can be used for future
data lookups.If--store-block-data* and/or--store-tx-datais set, a copy
of the block and/or transaction data will also be stored, respectively.*RENDERINGRendering in the context ofeth-monitor* refers to a formatted
output stream that occurs independently of caching and code execution.*Filters for rendering may be specified by specifying python modules to
the--renderer* option. This option may be specified multiple
times.*Rendering filters will be executed in order, and the first filter to
returnFalseDEFINING FILTERSA python module used for filter must fulfill two conditions:1. It must provide a class namedFilter in the package base
namespace.2. The *Filter class must include a method named filter with the
signature def filter(self, conn, block, tx, db_session=None). *Filters will strictly be executed in the order which they are defined on
the command line.FURTHER READINGRefer to thechainsyncer* chapter n info chaintool for in-depth
information on the subjects of syncing and filtering.*ENVIRONMENTCHAIN_SPECString specifying the type of chain connected to, in the format<engine>:<fork>:<network_id>:<common_name>. For EVM nodes the
engine value will always be evm.RPC_DIALECTEnables translations of EVM node specific formatting and response codes.RPC_PROVIDERFully-qualified URL to the RPC endpoint of the blockchain node.LICENSEThis documentation and its source is licensed under the Creative Commons
Attribution-Sharealike 4.0 International license.The source code of the tool this documentation describes is licensed
under the GNU General Public License 3.0.COPYRIGHTLouis Holbrook <dev@holbrook.no> (https://holbrook.no) PGP:
59A844A484AC11253D3A3E9DCDCBD24DD1D0E001SOURCE CODEhttps://git.defalsify.org