github.com/Finschia/finschia-sdk@v0.48.1/x/slashing/spec/09_client.md (about)

     1  <!--
     2  order: 9
     3  -->
     4  
     5  # CLI
     6  
     7  A user can query and interact with the `slashing` module using the CLI.
     8  
     9  ### Query
    10  
    11  The `query` commands allow users to query `slashing` state.
    12  
    13  ```bash
    14  simd query slashing --help
    15  ```
    16  
    17  #### params
    18  
    19  The `params` command allows users to query genesis parameters for the slashing module.
    20  
    21  ```bash
    22  simd query slashing params [flags]
    23  ```
    24  
    25  Example:
    26  
    27  ```bash
    28  simd query slashing params
    29  ```
    30  
    31  Example Output:
    32  
    33  ```bash
    34  downtime_jail_duration: 600s
    35  min_signed_per_window: "0.500000000000000000"
    36  signed_blocks_window: "100"
    37  slash_fraction_double_sign: "0.050000000000000000"
    38  slash_fraction_downtime: "0.010000000000000000"
    39  ```
    40  
    41  #### signing-info
    42  
    43  The `signing-info` command allows users to query signing-info of the validator using consensus public key.
    44  
    45  ```bash
    46  simd query slashing signing-infos [flags]
    47  ```
    48  
    49  Example:
    50  
    51  ```bash
    52  simd query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Auxs3865HpB/EfssYOzfqNhEJjzys6jD5B6tPgC8="}'
    53  
    54  ```
    55  
    56  Example Output:
    57  
    58  ```bash
    59  address: cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c
    60  index_offset: "2068"
    61  jailed_until: "1970-01-01T00:00:00Z"
    62  missed_blocks_counter: "0"
    63  start_height: "0"
    64  tombstoned: false
    65  ```
    66  
    67  #### signing-infos
    68  
    69  The `signing-infos` command allows users to query signing infos of all validators.
    70  
    71  ```bash
    72  simd query slashing signing-infos [flags]
    73  ```
    74  
    75  Example:
    76  
    77  ```bash
    78  simd query slashing signing-infos
    79  ```
    80  
    81  Example Output:
    82  
    83  ```bash
    84  info:
    85  - address: cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c
    86    index_offset: "2075"
    87    jailed_until: "1970-01-01T00:00:00Z"
    88    missed_blocks_counter: "0"
    89    start_height: "0"
    90    tombstoned: false
    91  pagination:
    92    next_key: null
    93    total: "0"
    94  ```
    95  
    96  ### Transactions
    97  
    98  The `tx` commands allow users to interact with the `slashing` module.
    99  
   100  ```bash
   101  simd tx slashing --help
   102  ```
   103  
   104  #### unjail
   105  
   106  The `unjail` command allows users to unjail a validator previously jailed for downtime.
   107  
   108  ```bash
   109    simd tx slashing unjail --from mykey [flags]
   110  ```
   111  
   112  Example:
   113  
   114  ```bash
   115  simd tx slashing unjail --from mykey
   116  ```
   117  
   118  ## gRPC
   119  
   120  A user can query the `slashing` module using gRPC endpoints.
   121  
   122  ### Params
   123  
   124  The `Params` endpoint allows users to query the parameters of slashing module.
   125  
   126  ```bash
   127  cosmos.slashing.v1beta1.Query/Params
   128  ```
   129  
   130  Example:
   131  
   132  ```bash
   133  grpcurl -plaintext localhost:9090 cosmos.slashing.v1beta1.Query/Params
   134  ```
   135  
   136  Example Output:
   137  
   138  ```bash
   139  {
   140    "params": {
   141      "signedBlocksWindow": "100",
   142      "minSignedPerWindow": "NTAwMDAwMDAwMDAwMDAwMDAw",
   143      "downtimeJailDuration": "600s",
   144      "slashFractionDoubleSign": "NTAwMDAwMDAwMDAwMDAwMDA=",
   145      "slashFractionDowntime": "MTAwMDAwMDAwMDAwMDAwMDA="
   146    }
   147  }
   148  ```
   149  
   150  ### SigningInfo
   151  
   152  The SigningInfo queries the signing info of given cons address.
   153  
   154  ```bash
   155  cosmos.slashing.v1beta1.Query/SigningInfo
   156  ```
   157  
   158  Example:
   159  
   160  ```bash
   161  grpcurl -plaintext -d '{"cons_address":"cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c"}' localhost:9090 cosmos.slashing.v1beta1.Query/SigningInfo
   162  ```
   163  
   164  Example Output:
   165  
   166  ```bash
   167  {
   168    "valSigningInfo": {
   169      "address": "cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c",
   170      "indexOffset": "3493",
   171      "jailedUntil": "1970-01-01T00:00:00Z"
   172    }
   173  }
   174  ```
   175  
   176  ### SigningInfos
   177  
   178  The SigningInfos queries signing info of all validators.
   179  
   180  ```bash
   181  cosmos.slashing.v1beta1.Query/SigningInfos
   182  ```
   183  
   184  Example:
   185  
   186  ```bash
   187  grpcurl -plaintext localhost:9090 cosmos.slashing.v1beta1.Query/SigningInfos
   188  ```
   189  
   190  Example Output:
   191  
   192  ```bash
   193  {
   194    "info": [
   195      {
   196        "address": "cosmosvalcons1nrqslkwd3pz096lh6t082frdqc84uwxn0t958c",
   197        "indexOffset": "2467",
   198        "jailedUntil": "1970-01-01T00:00:00Z"
   199      }
   200    ],
   201    "pagination": {
   202      "total": "1"
   203    }
   204  }
   205  ```
   206  
   207  ## REST
   208  
   209  A user can query the `slashing` module using REST endpoints.
   210  
   211  ### Params
   212  
   213  ```bash
   214  /cosmos/slashing/v1beta1/params
   215  ```
   216  
   217  Example:
   218  
   219  ```bash
   220  curl "localhost:1317/cosmos/slashing/v1beta1/params"
   221  ```
   222  
   223  Example Output:
   224  
   225  ```bash
   226  {
   227    "params": {
   228      "signed_blocks_window": "100",
   229      "min_signed_per_window": "0.500000000000000000",
   230      "downtime_jail_duration": "600s",
   231      "slash_fraction_double_sign": "0.050000000000000000",
   232      "slash_fraction_downtime": "0.010000000000000000"
   233  }
   234  ```
   235  
   236  ### signing_info
   237  
   238  ```bash
   239  /cosmos/slashing/v1beta1/signing_infos/%s
   240  ```
   241  
   242  Example:
   243  
   244  ```bash
   245  curl "localhost:1317/cosmos/slashing/v1beta1/signing_infos/cosmosvalcons1nrqslkwd3pz096lh6t082frdqc84uwxn0t958c"
   246  ```
   247  
   248  Example Output:
   249  
   250  ```bash
   251  {
   252    "val_signing_info": {
   253      "address": "cosmosvalcons1nrqslkwd3pz096lh6t082frdqc84uwxn0t958c",
   254      "start_height": "0",
   255      "index_offset": "4184",
   256      "jailed_until": "1970-01-01T00:00:00Z",
   257      "tombstoned": false,
   258      "missed_blocks_counter": "0"
   259    }
   260  }
   261  ```
   262  
   263  ### signing_infos
   264  
   265  ```bash
   266  /cosmos/slashing/v1beta1/signing_infos
   267  ```
   268  
   269  Example:
   270  
   271  ```bash
   272  curl "localhost:1317/cosmos/slashing/v1beta1/signing_infos
   273  ```
   274  
   275  Example Output:
   276  
   277  ```bash
   278  {
   279    "info": [
   280      {
   281        "address": "cosmosvalcons1nrqslkwd3pz096lh6t082frdqc84uwxn0t958c",
   282        "start_height": "0",
   283        "index_offset": "4169",
   284        "jailed_until": "1970-01-01T00:00:00Z",
   285        "tombstoned": false,
   286        "missed_blocks_counter": "0"
   287      }
   288    ],
   289    "pagination": {
   290      "next_key": null,
   291      "total": "1"
   292    }
   293  }
   294  ```