github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/docs/wrappers/ledgerutil_preamble.md (about)

     1  # ledgerutil
     2  
     3  The `ledgerutil compare` command allows administrators to compare channel snapshots from two different peers.
     4  Although channel snapshots from the same height should be identical across peers, if the snapshot
     5  files indicate different state hashes (as seen in `_snapshot_signable_metadata.json` file from each snapshot)
     6  then it indicates that at least one of the peers state databases is not correct relative to the blockchain and
     7  may have gotten corrupted.
     8  
     9  The `ledgerutil compare` utility will output a set of JSON files if the snapshots are not identical to assist with troubleshooting in these situations.
    10  Two output JSON files will include any key/value differences sorted by key (one for public key/value differences and one for private key/value differences),
    11  another JSON file will include any key/value differences (public or private) sorted by block and transaction height so that you can identify the height where a divergence may have first occurred.
    12  
    13  The output files may help an administrator to understand the scope of a state database issue and identify which keys are impacted.
    14  Snapshots from additional peers can be compared to determine which peer has incorrect state.
    15  The block and transaction height of the first difference can be used as a reference point when looking at the peer's logs to understand what may have happened to the state database at that time.
    16  
    17  ## Syntax
    18  
    19  The `ledgerutil` command has one subcommand
    20  
    21    * compare