github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/docs/source/commands/peersnapshot.md (about)

     1  <!---
     2   File generated by help_docs.sh. DO NOT EDIT.
     3   Please make changes to preamble and postscript wrappers as appropriate.
     4   --->
     5  
     6  # peer snapshot
     7  
     8  The `peer snapshot` command allows administrators to perform snapshot related
     9  operations on a peer, such as submit a snapshot request, cancel a snapshot request
    10  and list pending requests. Once a snapshot request is submitted for a specified
    11  block number, the snapshot will be automatically generated when the block number is
    12  committed on the channel.
    13  
    14  ## Syntax
    15  
    16  The `peer snapshot` command has the following subcommands:
    17  
    18    * cancelrequest
    19    * listpending
    20    * submitrequest
    21  
    22  ## peer snapshot cancelrequest
    23  ```
    24  Cancel a request for a snapshot at the specified block.
    25  
    26  Usage:
    27    peer snapshot cancelrequest [flags]
    28  
    29  Flags:
    30    -b, --blockNumber uint         The block number for which a snapshot will be generated
    31    -c, --channelID string         The channel on which this command should be executed
    32    -h, --help                     help for cancelrequest
    33        --peerAddress string       The address of the peer to connect to
    34        --tlsRootCertFile string   The path to the TLS root cert file of the peer to connect to, required if TLS is enabled and ignored if TLS is disabled.
    35  ```
    36  
    37  
    38  ## peer snapshot listpending
    39  ```
    40  List pending requests for snapshots.
    41  
    42  Usage:
    43    peer snapshot listpending [flags]
    44  
    45  Flags:
    46    -c, --channelID string         The channel on which this command should be executed
    47    -h, --help                     help for listpending
    48        --peerAddress string       The address of the peer to connect to
    49        --tlsRootCertFile string   The path to the TLS root cert file of the peer to connect to, required if TLS is enabled and ignored if TLS is disabled.
    50  ```
    51  
    52  
    53  ## peer snapshot submitrequest
    54  ```
    55  Submit a request for a snapshot at the specified block. When the blockNumber parameter is set to 0 or not provided, it will submit a request for the last committed block.
    56  
    57  Usage:
    58    peer snapshot submitrequest [flags]
    59  
    60  Flags:
    61    -b, --blockNumber uint         The block number for which a snapshot will be generated
    62    -c, --channelID string         The channel on which this command should be executed
    63    -h, --help                     help for submitrequest
    64        --peerAddress string       The address of the peer to connect to
    65        --tlsRootCertFile string   The path to the TLS root cert file of the peer to connect to, required if TLS is enabled and ignored if TLS is disabled.
    66  ```
    67  
    68  ## Example Usage
    69  
    70  ### peer snapshot cancelrequest example
    71  
    72  Here is an example of the `peer snapshot cancelrequest` command.
    73  
    74    * Cancel a snapshot request for block number 1000 on channel `mychannel`
    75      for `peer0.org1.example.com:7051`:
    76  
    77      ```
    78      peer snapshot cancelrequest -c mychannel -b 1000 --peerAddress peer0.org1.example.com:7051
    79  
    80      Snapshot request cancelled successfully
    81  
    82      ```
    83  
    84      A successful response indicates that the snapshot request for block number 1000 has been removed from `mychannel`.
    85      If there is no pending snapshot request for block number 1000, the command will return an error.
    86  
    87    * Use the `--tlsRootCertFile` flag in a network with TLS enabled
    88  
    89  ### peer snapshot listpending example
    90  
    91  Here is an example of the `peer snapshot listpending` command.
    92  If a snapshot is already generated, the corresponding block number will be removed from the pending list.
    93  
    94    * List pending snapshot requests on channel `mychannel`
    95      for `peer0.org1.example.com:7051`:
    96  
    97      ```
    98      peer snapshot listpending -c mychannel --peerAddress peer0.org1.example.com:7051
    99  
   100      Successfully got pending snapshot requests: [1000 5000]
   101  
   102      ```
   103  
   104      You can see that the command returns a list of block numbers for the pending snapshot requests.
   105  
   106    * Use the `--tlsRootCertFile` flag in a network with TLS enabled
   107  
   108  ### peer snapshot submitrequest example
   109  
   110  Here is an example of the `peer snapshot submitrequest` command.
   111  
   112    * Submit a snapshot request for block number 1000 on channel `mychannel`
   113      for `peer0.org1.example.com:7051`:
   114  
   115      ```
   116      peer snapshot submitrequest -c mychannel -b 1000 --peerAddress peer0.org1.example.com:7051
   117  
   118      Snapshot request submitted successfully
   119  
   120      ```
   121  
   122      You can see that the snapshot request is successfully submitted on channel `mychannel`.
   123      A snapshot will be automatically generated after the block number 1000 is committed on the channel.
   124  
   125      The specified block number must be at or above the last block number on the channel.
   126      Otherwise, the command will return an error.
   127  
   128    * Use the `--tlsRootCertFile` flag in a network with TLS enabled
   129