Skip to content

Commit

Permalink
chore: automatic cli doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
LesnyRumcajs committed Jan 17, 2025
1 parent ba35214 commit ef4c6db
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 46 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docs-auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflows, run daily, updates the Forest usage docs, and submits a PR with the changes.
name: Update Forest usage docs

on:
workflow_dispatch:
schedule:
- cron: "0 7 * * *"

jobs:
update-docs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Run update script
run: |
cd ./scripts/docs/docs/users/reference
./cli.sh docker > cli.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
base: main
token: ${{ secrets.ACTIONS_PAT }}
commit-message: Update Forest CLI docs
title: "[automated] Update Forest CLI docs"
body: |
### Changes
- Updates Forest CLI docs to the latest commit in the `main` branch.
142 changes: 97 additions & 45 deletions docs/docs/users/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ sidebar_position: 1

<!--
CLI reference documentation for forest, forest-wallet, forest-cli, and forest-tool.
Do not edit manually, use the cli.sh script.
Do not edit manually, use the `generate_cli_md.sh` script.
-->

This document lists every command line option and sub-command for Forest.

## `forest`

```
forest-filecoin 0.19.2+git.71e23ae6a0d
forest-filecoin 0.23.3
ChainSafe Systems <info@chainsafe.io>
Rust Filecoin implementation.
Expand Down Expand Up @@ -53,7 +53,7 @@ OPTIONS:
--import-snapshot <IMPORT_SNAPSHOT>
Import a snapshot from a local CAR file or URL
--import-mode <IMPORT_MODE>
Snapshot import mode. Available modes are `copy`, `move` and `symlink` [default: copy]
Snapshot import mode. Available modes are `auto`, `copy`, `move`, `symlink` and `hardlink` [default: auto]
--halt-after-import
Halt with exit code 0 after successfully importing a snapshot
--skip-load <SKIP_LOAD>
Expand Down Expand Up @@ -105,7 +105,7 @@ OPTIONS:
## `forest-wallet`

```
forest-filecoin 0.19.2+git.71e23ae6a0d
forest-filecoin 0.23.3
ChainSafe Systems <info@chainsafe.io>
Rust Filecoin implementation.
Expand Down Expand Up @@ -309,8 +309,8 @@ Send funds between accounts
Usage: forest-wallet send [OPTIONS] <TARGET_ADDRESS> <AMOUNT>
Arguments:
<TARGET_ADDRESS>
<AMOUNT>
<TARGET_ADDRESS>
<AMOUNT>
Options:
--from <FROM> optionally specify the account to send funds from (otherwise the default one will be used)
Expand All @@ -323,7 +323,7 @@ Options:
## `forest-cli`

```
forest-filecoin 0.19.2+git.71e23ae6a0d
forest-filecoin 0.23.3
ChainSafe Systems <info@chainsafe.io>
Rust Filecoin implementation.
Expand All @@ -344,6 +344,7 @@ SUBCOMMANDS:
attach `[REMOVED]` Attach to daemon via a JavaScript console
shutdown Shutdown Forest
healthcheck Print healthcheck info
f3 Manages Filecoin Fast Finality (F3) interactions
help Print this message or the help of the given subcommand(s)
OPTIONS:
Expand Down Expand Up @@ -380,7 +381,7 @@ Retrieves and prints out the block specified by the given CID
Usage: forest-cli chain block -c <CID>
Options:
-c <CID>
-c <CID>
-h, --help Print help
```

Expand All @@ -392,7 +393,7 @@ Reads and prints out a message referenced by the specified CID from the chain bl
Usage: forest-cli chain message -c <CID>
Options:
-c <CID>
-c <CID>
-h, --help Print help
```

Expand All @@ -404,7 +405,7 @@ Reads and prints out IPLD nodes referenced by the specified CID from chain block
Usage: forest-cli chain read-obj -c <CID>
Options:
-c <CID>
-c <CID>
-h, --help Print help
```

Expand Down Expand Up @@ -635,8 +636,8 @@ Interact with and query Filecoin chain state
Usage: forest-cli state <COMMAND>
Commands:
fetch
compute
fetch
compute
help Print this message or the help of the given subcommand(s)
Options:
Expand All @@ -649,7 +650,7 @@ Options:
Usage: forest-cli state fetch [OPTIONS] <ROOT>
Arguments:
<ROOT>
<ROOT>
Options:
-s, --save-to-file <SAVE_TO_FILE> The `.car` file path to save the state root
Expand Down Expand Up @@ -720,8 +721,8 @@ Send funds between accounts
Usage: forest-cli send [OPTIONS] <TARGET_ADDRESS> <AMOUNT>
Arguments:
<TARGET_ADDRESS>
<AMOUNT>
<TARGET_ADDRESS>
<AMOUNT>
Options:
--from <FROM> optionally specify the account to send funds from (otherwise the default one will be used)
Expand All @@ -739,7 +740,7 @@ Print node info
Usage: forest-cli info <COMMAND>
Commands:
show
show
help Print this message or the help of the given subcommand(s)
Options:
Expand Down Expand Up @@ -786,10 +787,28 @@ Options:
-h, --help Print help
```

### `forest-cli f3`

```
Manages Filecoin Fast Finality (F3) interactions
Usage: forest-cli f3 <COMMAND>
Commands:
manifest Gets the current manifest used by F3
status Checks the F3 status
certs Manages interactions with F3 finality certificates [aliases: c]
powertable Gets F3 power table at a specific instance ID or latest instance if none is specified [aliases: pt]
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
```

## `forest-tool`

```
forest-filecoin 0.19.2+git.71e23ae6a0d
forest-filecoin 0.23.3
ChainSafe Systems <info@chainsafe.io>
Rust Filecoin implementation.
Expand Down Expand Up @@ -875,7 +894,7 @@ Usage: forest-tool benchmark <COMMAND>
Commands:
car-streaming Benchmark streaming data from a CAR archive
graph-traversal Depth-first traversal of the Filecoin graph
unordered-graph-traversal
unordered-graph-traversal
forest-encoding Encoding of a `.forest.car.zst` file
export Exporting a `.forest.car.zst` file from HEAD
help Print this message or the help of the given subcommand(s)
Expand All @@ -895,7 +914,7 @@ Arguments:
<SNAPSHOT_FILES>... Snapshot input files (`.car.`, `.car.zst`, `.forest.car.zst`)
Options:
--inspect Whether or not we want to expect [`libipld_core::ipld::Ipld`] data for each block
--inspect Whether or not we want to expect [`ipld_core::ipld::Ipld`] data for each block
-h, --help Print help
```

Expand Down Expand Up @@ -1088,17 +1107,17 @@ Arguments:
Options:
-o, --output-path <OUTPUT_PATH>
Output file, will be in `.forest.car.zst` format.
Will reuse the source name (with new extension) if pointed to a directory.
[default: .]
--compression-level <COMPRESSION_LEVEL>
[default: 3]
--frame-size <FRAME_SIZE>
End zstd frames after they exceed this length
[default: 8192]
--force
Expand Down Expand Up @@ -1255,7 +1274,7 @@ Arguments:
Options:
--epoch <EPOCH> Selected epoch to validate
--depth <DEPTH>
--depth <DEPTH>
-h, --help Print help
```

Expand Down Expand Up @@ -1357,10 +1376,12 @@ API tooling
Usage: forest-tool api <COMMAND>
Commands:
serve
compare Compare two RPC providers
dump-tests
help Print this message or the help of the given subcommand(s)
serve
compare Compare two RPC providers
generate-test-snapshot
dump-tests
test
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
Expand All @@ -1375,17 +1396,18 @@ Arguments:
[SNAPSHOT_FILES]... Snapshot input paths. Supports `.car`, `.car.zst`, and `.forest.car.zst`
Options:
--chain <CHAIN> Filecoin network chain [default: mainnet]
--port <PORT> [default: 2345]
--auto-download-snapshot
--height <HEIGHT> Validate snapshot at given EPOCH, use a negative value -N to validate the last N EPOCH(s) starting at HEAD [default: -50]
--genesis <GENESIS> Genesis file path, only applicable for devnet
-h, --help Print help
--chain <CHAIN> Filecoin network chain [default: mainnet]
--port <PORT> [default: 2345]
--auto-download-snapshot
--height <HEIGHT> Validate snapshot at given EPOCH, use a negative value -N to validate the last N EPOCH(s) starting at HEAD [default: -50]
--genesis <GENESIS> Genesis file path, only applicable for devnet
--save-token <SAVE_TOKEN> If provided, indicates the file to which to save the admin token
-h, --help Print help
```

### `forest-tool api compare`

````
```
Compare two RPC providers.
The providers are labeled `forest` and `lotus`, but other nodes may be used (such as `venus`).
Expand All @@ -1405,17 +1427,17 @@ Arguments:
Options:
--forest <FOREST>
Forest address
[default: /ip4/127.0.0.1/tcp/2345/http]
--lotus <LOTUS>
Lotus address
[default: /ip4/127.0.0.1/tcp/1234/http]
--filter <FILTER>
Filter which tests to run according to method name. Case sensitive
[default: ]
--filter-file <FILTER_FILE>
Expand All @@ -1426,18 +1448,18 @@ Options:
--run-ignored <RUN_IGNORED>
Behavior for tests marked as `ignored`
[default: default]
[possible values: default, ignored-only, all]
--max-concurrent-requests <MAX_CONCURRENT_REQUESTS>
Maximum number of concurrent requests
[default: 8]
-n, --n-tipsets <N_TIPSETS>
The number of tipsets to use to generate test cases
[default: 10]
--miner-address <MINER_ADDRESS>
Expand All @@ -1448,12 +1470,30 @@ Options:
--eth-chain-id <ETH_CHAIN_ID>
Ethereum chain ID. Default to the calibnet chain ID
[default: 314159]
--dump-dir <DUMP_DIR>
Specify a directory to which the RPC tests are dumped
-h, --help
Print help (see a summary with '-h')
````
```

### `forest-tool api generate-test-snapshot`

```
Usage: forest-tool api generate-test-snapshot --db <DB> --chain <CHAIN> --out-dir <OUT_DIR> <TEST_DUMP_FILES>...
Arguments:
<TEST_DUMP_FILES>... Path to test dumps that are generated by `forest-tool api dump-tests` command
Options:
--db <DB> Path to the database folder that powers a Forest node
--chain <CHAIN> Filecoin network chain
--out-dir <OUT_DIR> Folder into which test snapshots are dumped
-h, --help Print help
```

### `forest-tool api dump-tests`

Expand All @@ -1475,11 +1515,23 @@ Options:
--path <PATH>
Which API path to dump [possible values: v0, v1]
--include-ignored
-h, --help
Print help
```

### `forest-tool api test`

```
Usage: forest-tool api test <FILES>...
Arguments:
<FILES>... Path to test snapshots that are generated by `forest-tool api generate-test-snapshot` command
Options:
-h, --help Print help
```

### `forest-tool net ping`

```
Expand Down Expand Up @@ -1529,7 +1581,7 @@ Options:
If omitted, defaults to the HEAD of the node
--ancestors <ANCESTORS>
-h, --help
Print help (see a summary with '-h')
Expand Down Expand Up @@ -1571,7 +1623,7 @@ Dump the OpenRPC definition for the node
Usage: forest-tool shed openrpc --path <PATH> [INCLUDE]...
Arguments:
[INCLUDE]...
[INCLUDE]...
Options:
--path <PATH> Which API path to dump [possible values: v0, v1]
Expand Down
Loading

0 comments on commit ef4c6db

Please sign in to comment.