Skip to content

Commit 3d25f0d

Browse files
authored
book updates (#2345)
* edit log rotation page * update command line options * add github edit button
1 parent a3a0df1 commit 3d25f0d

File tree

4 files changed

+43
-17
lines changed

4 files changed

+43
-17
lines changed

docs/the_nimbus_book/book.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,12 @@ multilingual = false
55
src = "src"
66
title = "The Nimbus Beacon Chain Book"
77

8+
[preprocessor.open-on-gh]
9+
command = "mdbook-open-on-gh"
10+
renderer = ["html"]
11+
812
[output.html]
913
additional-css = ["custom.css"]
14+
git-repository-url = "https://github.com/status-im/nimbus-eth2"
15+
git-branch = "unstable"
16+

docs/the_nimbus_book/custom.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,12 @@
4040
blockquote {
4141
padding: 10px 20px;
4242
}
43+
44+
footer {
45+
margin-top: 1rem;
46+
margin-bottom: 1rem;
47+
font-size: 0.8em;
48+
text-align: center;
49+
border-top: 1px solid black;
50+
padding: 10px 0;
51+
}

docs/the_nimbus_book/src/log-rotate.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Log rotation
22

3-
Nimbus logs are written to the console, and optionally to a file. Using the log file option for a long-running process may lead to difficulties when the file grows large. This is typically solved with a log rotator that will switch which file is witten to as well as compress and remove old logs.
3+
Nimbus logs are written to the console, and optionally to a file. Writing to a file for a long-running process may lead to difficulties when the file grows large. This is typically solved with a *log rotator*. A log rotator is responsible for switching the written to file, as well as compressing and removing old logs.
44

55
To set up file-based log rotation, an application such as [rotatelogs](https://httpd.apache.org/docs/2.4/programs/rotatelogs.html) is used - `rotatelogs` is available on most servers and can be used with `docker`, `systemd` and manual setups to write rotated logs files.
66

7-
In particular, when using `systemd` and its accompanying `journald` log daemon, this setup avoids clogging the the system log and keep the Nimbus logs in a separate location.
7+
In particular, when using `systemd` and its accompanying `journald` log daemon, this setup avoids clogging the the system log by keeping the Nimbus logs in a separate location.
88

99
## Compression
1010

11-
`rotatelogs` works by reading stdin and redirecting it to a file based on a name pattern. Whenever the log is about to be rotated, the application will invoke a shell script with the old and new log files. Our aim is to compress the log file to save space. [repo](https://github.com/status-im/nimbus-eth2/tree/unstable/scripts/rotatelogs-compress.sh) provides a helper script to do so:
11+
`rotatelogs` works by reading stdin and redirecting it to a file based on a name pattern. Whenever the log is about to be rotated, the application invokes a shell script with the old and new log files. Our aim is to compress the log file to save space. [repo](https://github.com/status-im/nimbus-eth2/tree/unstable/scripts/rotatelogs-compress.sh) provides a helper script to do so:
1212

1313
```bash
1414
# Create a rotation script for rotatelogs
@@ -28,7 +28,7 @@ chmod +x rotatelogs-compress.sh
2828

2929
## Build
3030

31-
Logs in files generally don't benefit from colors - to avoid colors being written to the file, additional flags can be added to the Nimbus [build process](./build.md) - these flags are best saved in a build script to which one can add more options. Future versions of Nimbus will support disabling colors at runtime.
31+
Logs in files generally don't benefit from colors. To avoid colors being written to the file, additional flags can be added to the Nimbus [build process](./build.md) -- these flags are best saved in a build script to which one can add more options. Future versions of Nimbus will support disabling colors at runtime.
3232

3333
```bash
3434

@@ -41,7 +41,7 @@ EOF
4141

4242
## Run
4343

44-
The final step is to redirect logs to `rotatelogs` using a pipe when starting nimbus:
44+
The final step is to redirect logs to `rotatelogs` using a pipe when starting Nimbus:
4545

4646
```bash
4747
build/nimbus_beacon_node \
@@ -50,11 +50,11 @@ build/nimbus_beacon_node \
5050
--data-dir:$DATADIR | rotatelogs -L "$DATADIR/nbc_bn.log" -p "/path/to/rotatelogs-compress.sh" -D -f -c "$DATADIR/log/nbc_bn_%Y%m%d%H%M%S.log" 3600
5151
```
5252

53-
The options used in this example will:
53+
The options used in this example do the following:
5454

55-
* `-L nbc_bn.log` - symlink to the latest log file, for use with `tail -F`
56-
* `-p "/path/to/rotatelogs-compress.sh"` - script to run when rotation is about to happen
57-
* `-D` - create the `log` directory if needed
58-
* `-f` - open the log immediately when starting `rotatelogs`
59-
* `-c "$DATADIR/log/nbc_bn_%Y%m%d%H%M%S.log"` - include timestamp in log filename
60-
* `3600` - rotate logs every hour (3600 seconds)
55+
* `-L nbc_bn.log` - symlinks to the latest log file, for use with `tail -F`
56+
* `-p "/path/to/rotatelogs-compress.sh"` - runs `rotatelogs-compress.sh` when rotation is about to happen
57+
* `-D` - creates the `log` directory if needed
58+
* `-f` - opens the log immediately when starting `rotatelogs`
59+
* `-c "$DATADIR/log/nbc_bn_%Y%m%d%H%M%S.log"` - includes timestamp in log filename
60+
* `3600` - rotates logs every hour (3600 seconds)

docs/the_nimbus_book/src/options.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ nimbus_beacon_node [OPTIONS]... command
2121
2222
The following options are available:
2323
24-
--log-level Sets the log level.
24+
--log-level Sets the log level for process and topics (e.g. "DEBUG;
25+
TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none").
2526
--log-file Specifies a path for the written Json log file.
2627
--network The Eth2 network to join.
2728
-d, --data-dir The directory where nimbus will store all blockchain data.
2829
--validators-dir A directory containing validator keystores.
2930
--secrets-dir A directory containing validator keystore passwords.
3031
--wallets-dir A directory containing wallet files.
3132
--web3-url URL of the Web3 server to observe Eth1.
32-
--deposit-contract Address of the deposit contract.
33-
--deposit-contract-block The Eth1 block number or hash where the deposit contract has
34-
been deployed.
3533
--non-interactive Do not display interative prompts. Quit on missing
3634
configuration.
3735
--netkey-file Source of network (secp256k1) private key file
3836
(random|<path>) (default: random).
3937
--insecure-netkey-password Use pre-generated INSECURE password for network private key
4038
file (default: false).
39+
--agent-string Node agent string which is used as identifier in network.
40+
--subscribe-all-subnets Subscribe to all attestation subnet topics when gossiping.
4141
-b, --bootstrap-node Specifies one or more bootstrap nodes to use when connecting
4242
to the network.
4343
--bootstrap-file Specifies a line-delimited file of bootstrap Ethereum network
@@ -49,6 +49,10 @@ The following options are available:
4949
--max-peers The maximum number of peers to connect to.
5050
--nat Specify method to use for determining public address. Must be
5151
one of: any, none, upnp, pmp, extip:<IP>.
52+
--enr-auto-update Discovery can automatically update its ENR with the IP
53+
address and UDP port as seen by other nodes it communicates
54+
with. This option allows to enable/disable this
55+
functionality.
5256
--weak-subjectivity-checkpoint Weak subjectivity checkpoint in the format
5357
block_root:epoch_number.
5458
--finalized-checkpoint-state SSZ file specifying a recent finalized state.
@@ -76,5 +80,11 @@ The following options are available:
7680
--discv5 Enable Discovery v5.
7781
--dump Write SSZ dumps of blocks, attestations and states to data
7882
dir.
79-
```
83+
--doppelganger-detection Whether to detect whether another validator is be running the
84+
same validator keys (default true).
85+
86+
Available sub-commands:
87+
88+
...
89+
```
8090

0 commit comments

Comments
 (0)