Skip to content

Commit b9bb410

Browse files
committed
Implement Lotus F3 CLI commands for general diagnostics (#12617)
Implement `lotus f3` CLI sub commands: * `manifest` to dump the current F3 manifest in either JSON or text. * `list-miners` to list the current F3 participants. * `status` to print summary status of F3. Part of #12607 (cherry picked from commit 38e4d91)
1 parent ee916fd commit b9bb410

File tree

2 files changed

+171
-0
lines changed

2 files changed

+171
-0
lines changed

cli/clicommands/cmd.go

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var Commands = []*cli.Command{
2323
lcli.WithCategory("developer", lcli.EvmCmd),
2424
lcli.WithCategory("network", lcli.NetCmd),
2525
lcli.WithCategory("network", lcli.SyncCmd),
26+
lcli.WithCategory("network", lcli.F3Cmd),
2627
lcli.WithCategory("status", lcli.StatusCmd),
2728
lcli.PprofCmd,
2829
lcli.VersionCmd,

documentation/en/cli-lotus.md

+170
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ COMMANDS:
3434
NETWORK:
3535
net Manage P2P Network
3636
sync Inspect or interact with the chain syncer
37+
f3 Manages Filecoin Fast Finality (F3) interactions
3738
STATUS:
3839
status Check node status
3940
@@ -2718,6 +2719,175 @@ OPTIONS:
27182719
--help, -h show help
27192720
```
27202721

2722+
## lotus f3
2723+
```
2724+
NAME:
2725+
lotus f3 - Manages Filecoin Fast Finality (F3) interactions
2726+
2727+
USAGE:
2728+
lotus f3 command [command options] [arguments...]
2729+
2730+
COMMANDS:
2731+
list-miners, lm Lists the miners that currently participate in F3 via this node.
2732+
certs, c Manages interactions with F3 finality certificates.
2733+
manifest Gets the current manifest used by F3.
2734+
status Checks the F3 status.
2735+
help, h Shows a list of commands or help for one command
2736+
2737+
OPTIONS:
2738+
--help, -h show help
2739+
```
2740+
2741+
### lotus f3 list-miners
2742+
```
2743+
NAME:
2744+
lotus f3 list-miners - Lists the miners that currently participate in F3 via this node.
2745+
2746+
USAGE:
2747+
lotus f3 list-miners [command options] [arguments...]
2748+
2749+
OPTIONS:
2750+
--help, -h show help
2751+
```
2752+
2753+
### lotus f3 certs
2754+
```
2755+
NAME:
2756+
lotus f3 certs - Manages interactions with F3 finality certificates.
2757+
2758+
USAGE:
2759+
lotus f3 certs command [command options] [arguments...]
2760+
2761+
COMMANDS:
2762+
get Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified.
2763+
list Lists a range of F3 finality certificates.
2764+
2765+
By default the certificates are listed in newest to oldest order,
2766+
i.e. descending instance IDs. The order may be reversed using the
2767+
'--reverse' flag.
2768+
2769+
A range may optionally be specified as the first argument to indicate
2770+
inclusive range of 'from' and 'to' instances in following notation:
2771+
'<from>..<to>'. Either <from> or <to> may be omitted, but not both.
2772+
An omitted <from> value is always interpreted as 0, and an omitted
2773+
<to> value indicates the latest instance. If both are specified, <from>
2774+
must never exceed <to>.
2775+
2776+
If no range is specified all certificates are listed, i.e. the range
2777+
of '0..'.
2778+
2779+
Examples:
2780+
* All certificates from newest to oldest:
2781+
$ lotus f3 certs list 0..
2782+
2783+
* Three newest certificates:
2784+
$ lotus f3 certs list --limit 3 0..
2785+
2786+
* Three oldest certificates:
2787+
$ lotus f3 certs list --limit 3 --reverse 0..
2788+
2789+
* Up to three certificates starting from instance 1413 to the oldest:
2790+
$ lotus f3 certs list --limit 3 ..1413
2791+
2792+
* Up to 3 certificates starting from instance 1413 to the newest:
2793+
$ lotus f3 certs list --limit 3 --reverse 1413..
2794+
2795+
* All certificates from instance 3 to 1413 in order of newest to oldest:
2796+
$ lotus f3 certs list 3..1413
2797+
2798+
help, h Shows a list of commands or help for one command
2799+
2800+
OPTIONS:
2801+
--help, -h show help
2802+
```
2803+
2804+
#### lotus f3 certs get
2805+
```
2806+
NAME:
2807+
lotus f3 certs get - Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified.
2808+
2809+
USAGE:
2810+
lotus f3 certs get [command options] [instance]
2811+
2812+
OPTIONS:
2813+
--output value The output format. Supported formats: text, json (default: "text")
2814+
--help, -h show help
2815+
```
2816+
2817+
#### lotus f3 certs list
2818+
```
2819+
NAME:
2820+
lotus f3 certs list - Lists a range of F3 finality certificates.
2821+
2822+
By default the certificates are listed in newest to oldest order,
2823+
i.e. descending instance IDs. The order may be reversed using the
2824+
'--reverse' flag.
2825+
2826+
A range may optionally be specified as the first argument to indicate
2827+
inclusive range of 'from' and 'to' instances in following notation:
2828+
'<from>..<to>'. Either <from> or <to> may be omitted, but not both.
2829+
An omitted <from> value is always interpreted as 0, and an omitted
2830+
<to> value indicates the latest instance. If both are specified, <from>
2831+
must never exceed <to>.
2832+
2833+
If no range is specified all certificates are listed, i.e. the range
2834+
of '0..'.
2835+
2836+
Examples:
2837+
* All certificates from newest to oldest:
2838+
$ lotus f3 certs list 0..
2839+
2840+
* Three newest certificates:
2841+
$ lotus f3 certs list --limit 3 0..
2842+
2843+
* Three oldest certificates:
2844+
$ lotus f3 certs list --limit 3 --reverse 0..
2845+
2846+
* Up to three certificates starting from instance 1413 to the oldest:
2847+
$ lotus f3 certs list --limit 3 ..1413
2848+
2849+
* Up to 3 certificates starting from instance 1413 to the newest:
2850+
$ lotus f3 certs list --limit 3 --reverse 1413..
2851+
2852+
* All certificates from instance 3 to 1413 in order of newest to oldest:
2853+
$ lotus f3 certs list 3..1413
2854+
2855+
2856+
USAGE:
2857+
lotus f3 certs list [command options] [range]
2858+
2859+
OPTIONS:
2860+
--output value The output format. Supported formats: text, json (default: "text")
2861+
--limit value The maximum number of instances. A value less than 0 indicates no limit. (default: No limit)
2862+
--reverse Reverses the default order of output. (default: false)
2863+
--help, -h show help
2864+
```
2865+
2866+
### lotus f3 manifest
2867+
```
2868+
NAME:
2869+
lotus f3 manifest - Gets the current manifest used by F3.
2870+
2871+
USAGE:
2872+
lotus f3 manifest [command options] [arguments...]
2873+
2874+
OPTIONS:
2875+
--output value The output format. Supported formats: text, json (default: "text")
2876+
--help, -h show help
2877+
```
2878+
2879+
### lotus f3 status
2880+
```
2881+
NAME:
2882+
lotus f3 status - Checks the F3 status.
2883+
2884+
USAGE:
2885+
lotus f3 status [command options] [arguments...]
2886+
2887+
OPTIONS:
2888+
--help, -h show help
2889+
```
2890+
27212891
## lotus status
27222892
```
27232893
NAME:

0 commit comments

Comments
 (0)