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

Restructure query command section in bor #1087

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 22 additions & 32 deletions bor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
* [Preliminary terminology](#preliminary-terminology)
* [Overview](#overview)
* [How does it work](#how-does-it-work)
* [How to propose a span](#how-to-propose-a-span)
* [How to propose a span](#how-to-propose-a-span)
marcello33 marked this conversation as resolved.
Show resolved Hide resolved
* [Query commands](#query-commands)


## Preliminary terminology

* A `side-transaction` is a normal heimdall transaction but the data with which the message is composed needs to be voted on by the validators since the data is obscure to the consensus protocol itself and it has no way of validating the data's correctness.
Expand Down Expand Up @@ -89,7 +91,7 @@ newSpan := hmTypes.NewSpan(
return k.AddNewSpan(ctx, newSpan)
```

## How to propose a span
### How to propose a span

A validator can leverage the CLI to propose a span like so :

Expand All @@ -107,69 +109,57 @@ curl -X POST "localhost:1317/bor/propose-span?bor-chain-id=<BOR_CHAIN_ID>&start-

One can run the following query commands from the bor module :

* `span` - Query the span corresponding to the given span id:
* `span` - Query the span corresponding to the given span id.
* `latest span` - Query the latest span.
* `params` - Fetch the parameters associated to bor module.
* `spanlist` - Fetch span list.
* `next-span-seed` - Query the seed for the next span.
* `propose-span` - Print the `propose-span` command.

### CLI commands

via CLI
```
heimdallcli query bor span --span-id=<SPAN_ID>
```

via REST
```
curl localhost:1317/bor/span/<SPAN_ID>
heimdallcli query bor latest-span
```

* `latest span` - Query the latest span :

via CLI
```
heimdallcli query bor latest-span
heimdallcli query bor params
```

via REST
```
curl localhost:1317/bor/latest-span
heimdallcli query bor spanlist --page=<PAGE_NUM> --limit=<LIMIT>
```

* `params` - Fetch the parameters associated to bor module :

via CLI
```
heimdallcli query bor params
heimdallcli query bor next-span-seed
```

via REST
```
curl localhost:1317/bor/params
heimdallcli query bor propose-span --proposer <VALIDATOR ADDRESS> --start-block <BOR_START_BLOCK> --span-id <SPAN_ID> --bor-chain-id <BOR_CHAIN_ID>
```

* `spanlist` - Fetch span list :
### REST endpoints

via CLI
```
heimdallcli query bor spanlist --page=<PAGE_NUM> --limit=<LIMIT>
curl localhost:1317/bor/span/<SPAN_ID>
```

* `next-span-seed` - Query the seed for the next span :

via CLI
```
heimdallcli query bor next-span-seed
curl localhost:1317/bor/latest-span
```

via REST
```
curl localhost:1317/bor/next-span-seed
curl localhost:1317/bor/params
```

* `propose-span` - Print the `propose-span` command :

via CLI
```
heimdallcli query bor propose-span --proposer <VALIDATOR ADDRESS> --start-block <BOR_START_BLOCK> --span-id <SPAN_ID> --bor-chain-id <BOR_CHAIN_ID>
curl localhost:1317/bor/next-span-seed
```

via REST
```
curl "localhost:1317/bor/prepare-next-span?span_id=<SPAN_ID>&start_block=<BOR_START_BLOCK>&chain_id="<BOR_CHAIN_ID>""
```