Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Added evidence client docs #10355

Merged
merged 9 commits into from
Oct 26, 2021
100 changes: 100 additions & 0 deletions x/evidence/spec/07_client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Client

## CLI

A user can query and interact with the `evidence` module using CLI.
ryanchristo marked this conversation as resolved.
Show resolved Hide resolved

### Query

The `query` commands allows users to interact with the `evidence` state.
ryanchristo marked this conversation as resolved.
Show resolved Hide resolved

```bash
simd query evidence --help
```
### evidence

The `evidence` command allows users to list all evidences.
ryanchristo marked this conversation as resolved.
Show resolved Hide resolved

Usage:

```bash
simd query evidence [flags]
```

Example:

```bash
simd query evidence
```
Example Output:

```bash
evidence: []
pagination:
next_key: null
total: "0"
```
ryanchristo marked this conversation as resolved.
Show resolved Hide resolved

## REST

A user can query the `evidence` module using REST endpoints.

### Evidence

Get evidence by hash

```bash
/cosmos/evidence/v1beta1/evidence/{evidence_hash}
```

Example:

```bash
curl -X GET "http://localhost:1317/cosmos/evidence/v1beta1/evidence/DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660"
```

### All evidences
ryanchristo marked this conversation as resolved.
Show resolved Hide resolved

Get all evidences

```bash
/cosmos/evidence/v1beta1/evidence
```

Example:

```bash
curl -X GET "http://localhost:1317/cosmos/evidence/v1beta1/evidence"
```

## gRPC

A user can query the `evidence` module using gRPC endpoints.

### Evidence

Get evidence by hash

```bash
cosmos.evidence.v1beta1.Query/Evidence
```

Example:

```bash
grpcurl -plaintext -d '{"evidence_hash":"DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660"}' localhost:9090 cosmos.evidence.v1beta1.Query/Evidence
```

### All evidences

Get all evidences

```bash
cosmos.evidence.v1beta1.Query/AllEvidence
```

Example:

```bash
grpcurl -plaintext localhost:9090 cosmos.evidence.v1beta1.Query/AllEvidence
```