Skip to content

Commit

Permalink
doc: book cli updater (paradigmxyz#3576)
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct authored Jul 5, 2023
1 parent 64ca521 commit 9309279
Show file tree
Hide file tree
Showing 14 changed files with 1,662 additions and 451 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,30 @@ jobs:
retention-days: 1
if-no-files-found: error

up-to-date:
runs-on: ubuntu-latest
name: up-to-date

steps:
- uses: actions/checkout@v3

- name: Try to update the book cli documentation
run: make update-book-cli BUILD_PATH=reth/target

- name: Check if the book cli documentation is up to date
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "Error: Documentation is not up to date. Please run \`make update-book-cli\`."
exit 1
else
echo "The documentation is up to date."
fi
deploy:
# Only deploy if a push to main
if: github.ref_name == 'main' && github.event_name == 'push'
runs-on: ubuntu-latest
needs: [test, lint, build]
needs: [test, lint, build, up-to-date]

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,9 @@ db-tools: ## Compile MDBX debugging tools.
@$(MAKE) -C $(MDBX_PATH) IOARENA=1 clean > /dev/null
@echo "Run \"$(DB_TOOLS_DIR)/mdbx_stat\" for the info about MDBX db file."
@echo "Run \"$(DB_TOOLS_DIR)/mdbx_chk\" for the MDBX db file integrity check."

.PHONY: update-book-cli
update-book-cli: ## Update book cli documentation.
cargo build --bin reth --features "$(FEATURES)" --profile "$(PROFILE)"
@echo "Updating book cli doc..."
@./book/cli/update.sh $(BUILD_PATH)
12 changes: 6 additions & 6 deletions book/cli/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Commands:
db
Database debugging utilities
stage
Manipulate individual stages.
Manipulate individual stages
p2p
P2P Debugging utilities
test-vectors
Expand All @@ -64,21 +64,21 @@ Logging:

--log.directory <PATH>
The path to put log files in

[default: /Users/georgios/Library/Caches/reth/logs]
[default: /reth/logs]

--log.journald
Log events to journald

--log.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]
[default: error]

Display:
-v, --verbosity...
Set the minimum log level.

-v Errors
-vv Warnings
-vvv Info
Expand Down
33 changes: 33 additions & 0 deletions book/cli/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"commands": {
"config": [],
"db": {
"stats": [],
"list": [],
"get": [],
"drop": [],
"version": [],
"path": []
},
"debug": {
"execution": [],
"merkle": []
},
"import": [],
"init": [],
"node": [],
"p2p": {
"header": [],
"body": []
},
"stage": {
"run": [],
"drop": [],
"dump": ["execution", "storage-hashing", "account-hashing", "merkle"],
"unwind": ["to-block", "num-blocks"]
},
"test-vectors": {
"tables": []
}
}
}
13 changes: 8 additions & 5 deletions book/cli/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,30 @@ Options:
--default
Show the default config

-h, --help
Print help (see a summary with '-h')

Logging:
--log.persistent
The flag to enable persistent logs

--log.directory <PATH>
The path to put log files in

[default: /Users/georgios/Library/Caches/reth/logs]
[default: /reth/logs]

--log.journald
Log events to journald

--log.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]
[default: error]

Display:
-v, --verbosity...
Set the minimum log level.

-v Errors
-vv Warnings
-vvv Info
Expand Down
Loading

0 comments on commit 9309279

Please sign in to comment.