IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
37 stars 13 forks source link

New `debug log-epoch-state` command #775

Closed newhoggy closed 3 months ago

newhoggy commented 3 months ago

Changelog

- description: |
    New `debug log-epoch-state` command
# uncomment types applicable to the change:
  type:
  - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

This command will log the epoch state to the given file. The contents of the log file is jsonl.

The command will not terminate.

Callers of the command can kill the process to terminate it.

Example run

$ cardano-cli debug log-epoch-state --socket-path /tmp/testnet-test-ed04aa0bdae2044f/socket/pool1/sock --node-configuration-file /tmp/testnet-test-ed04aa0bdae2044f/configuration.yaml --out-file /dev/stdout | cut -c 1-300 | head -n 20
{"currentEpoch":0,"currentEpochBlocks":{"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":1},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0},"esLState":{"delegationState":{"dstate":{"fGenDelegs":[],"genDelegs":{"3abe4942f90b5fb5e2ec7c7d2e86593ca6c38a0ff948b0ed5c
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":1,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":1},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0},"esLState":{"delegationState":{"dstate":{"fGenDelegs":[],"ge
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":2,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":1},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0},"esLState":{"delegationState":{"dstate":{"fGenDelegs":[],"ge
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":3,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":1},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0},"esLState":{"delegationState":{"dstate":{"fGenDelegs":[],"ge
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":4,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":1},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0},"esLState":{"delegationState":{"dstate":{"fGenDelegs":[],"ge
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":4,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":2},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0},"esLState":{"delegationState":{"dstate":{"fGenDelegs":[],"ge
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":4,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":3},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0},"esLState":{"delegationState":{"dstate":{"fGenDelegs":[],"ge
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":5,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":3},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0},"esLState":{"delegationState":{"dstate":{"fGenDelegs":[],"ge
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":5,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":4},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0},"esLState":{"delegationState":{"dstate":{"fGenDelegs":[],"ge
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":5,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":1,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":4},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":6,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":1,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":4},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":6,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":2,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":4},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":6,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":3,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":4},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":6,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":3,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":5},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":7,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":3,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":5},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":7,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":4,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":5},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":7,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":5,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":5},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":8,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":5,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":5},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":9,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":5,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":5},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
{"currentEpoch":0,"currentEpochBlocks":{"3d03bbf47ad37a9183ee57b5b01c92049bcd9f4468db40eb5e06854f":9,"6b92f2da974188ed1e05b2d14d0299ef1ee6a6fefc9b3e70960e8088":5,"fbfe6b9c0005569a3b751ac017a63265767a4a8c5426104d8f26497d":6},"currentEpochState":{"esAccountState":{"reserves":191999999999,"treasury":0}
Error: FoldBlocksIOException /dev/stdout: withFile: resource vanished (Broken pipe)

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist