Crate pmonitor

source
Expand description

The pmonitor tool tracks the balances of Penumbra wallets, as identified by a FullViewingKey (FVK), in order to perform auditing. It accepts a JSON file of FVKs and a pd gRPC URL to initialize:

pmonitor init --grpc-url http://127.0.0.1:8080 --fvks fvks.json

The audit functionality runs as a single operation, evaluating compliance up to the current block height:

pmonitor audit

If regular auditing is desired, consider automating the pmonitor audit action via cron or similar. pmonitor will cache view databases for each tracked FVK, so that future audit actions need only inspect the blocks generated between the previous audit and the current height.

Modulesยง

  • config ๐Ÿ”’
    Logic for reading and writing config files for pmonitor, in the TOML format.
  • genesis ๐Ÿ”’
    Logic for inspecting the [CompactBlock] at genesis of the target chain. Used to compute balances for tracked FVKs at genesis time. The initial genesis balance is stored in the pmonitor config file, so that audit actions can reference it.

Structsยง

Enumsยง

Constantsยง

  • The permitted difference between genesis balance and current balance, specified in number of staking tokens.
  • MAX_CB_SIZE_BYTES ๐Ÿ”’
    The maximum size of a compact block, in bytes (12MB).
  • VIEW_FILE_NAME ๐Ÿ”’
    The name of the view database file

Functionsยง

  • Check whether the wallet is compliant.
  • The path to the default pmonitor home directory.
  • Prepare a human-readable text summary at the end of the audit run. This is important, as errors logged during scanning are likely to be off-screen due to backscroll.
  • init_tracing ๐Ÿ”’
    Configure tracing_subscriber for logging messages
  • main ๐Ÿ”’