Skip to content

Commit

Permalink
bor: restructure query command section and minor refactor (#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raneet10 authored Oct 20, 2023
1 parent ef29c1e commit f90892b
Showing 1 changed file with 22 additions and 32 deletions.
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)
* [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>""
```

0 comments on commit f90892b

Please sign in to comment.