Skip to content

Commit bcd40fa

Browse files
committed
Updated lighthouse book & fixed slasher cli tests
1 parent 18603c9 commit bcd40fa

File tree

3 files changed

+39
-17
lines changed

3 files changed

+39
-17
lines changed

book/src/installation-source.md

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Installation: Build from Source
22

3-
Lighthouse builds on Linux, macOS, and Windows (via [WSL][] only).
3+
Lighthouse builds on Linux, macOS, and Windows (native Windows support in
4+
BETA, we also support Windows via [WSL][]).
45

5-
Compilation should be easy. In fact, if you already have Rust installed all you
6-
need is:
6+
Compilation should be easy. In fact, if you already have Rust and the build
7+
dependencies installed, all you need is:
78

89
- `git clone https://github.com/sigp/lighthouse.git`
910
- `cd lighthouse`
@@ -26,35 +27,45 @@ directory will be the location you cloned Lighthouse to during the installation
2627
- `git checkout ${VERSION}`
2728
- `make`
2829

30+
2931
## Detailed Instructions
3032

31-
1. Install Rust and Cargo with [rustup](https://rustup.rs/).
32-
- Use the `stable` toolchain (it's the default).
33-
- Check the [Troubleshooting](#troubleshooting) section for additional
34-
dependencies (e.g., `cmake`).
33+
1. Install the build dependencies for your platform
34+
- Check the [Dependencies](#dependencies) section for additional
35+
information.
3536
1. Clone the Lighthouse repository.
3637
- Run `$ git clone https://github.com/sigp/lighthouse.git`
3738
- Change into the newly created directory with `$ cd lighthouse`
3839
1. Build Lighthouse with `$ make`.
39-
1. Installation was successful if `$ lighthouse --help` displays the
40-
command-line documentation.
40+
1. The build was successful if the `lighthouse` binary exists in the `target/release` directory and `$ ./target/release/lighthouse --help` displays the command-line documentation.
4141

4242
> First time compilation may take several minutes. If you experience any
4343
> failures, please reach out on [discord](https://discord.gg/cyAszAh) or
4444
> [create an issue](https://github.com/sigp/lighthouse/issues/new).
4545
46-
## Windows Support
4746

48-
Compiling or running Lighthouse natively on Windows is not currently supported. However,
49-
Lighthouse can run successfully under the [Windows Subsystem for Linux (WSL)][WSL]. If using
50-
Ubuntu under WSL, you can should install the Ubuntu dependencies listed in the [Dependencies
51-
(Ubuntu)](#dependencies-ubuntu) section.
47+
## Dependencies
5248

53-
[WSL]: https://docs.microsoft.com/en-us/windows/wsl/about
49+
#### Installing Rust
5450

55-
## Troubleshooting
51+
The best way to install Rust (regardless of platform) is usually with [rustup](https://rustup.rs/)
52+
- Use the `stable` toolchain (it's the default).
53+
54+
#### Windows Support
55+
56+
These instructions are for compiling or running Lighthouse natively on Windows, which is currently in
57+
BETA testing. Lighthouse can also run successfully under the [Windows Subsystem for Linux (WSL)][WSL].
58+
If using Ubuntu under WSL, you should follow the instructions for Ubuntu listed in the
59+
[Dependencies (Ubuntu)](#ubuntu) section.
5660

57-
### Dependencies
61+
[WSL]: https://docs.microsoft.com/en-us/windows/wsl/about
62+
63+
1. Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
64+
1. Install [Chocolatey](https://chocolatey.org/install) Package Manager for Windows
65+
- Install `make` via `choco install make`
66+
- Install `cmake` via `choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'`
67+
1. Note that in Windows, the lighthouse binary will exist at `.\target\release\lighthouse.exe` when
68+
built successfully.
5869

5970
#### Ubuntu
6071

@@ -71,6 +82,9 @@ You will need `cmake`. You can install via homebrew:
7182

7283
brew install cmake
7384

85+
86+
## Troubleshooting
87+
7488
### Command is not found
7589

7690
Lighthouse will be installed to `CARGO_HOME` or `$HOME/.cargo`. This directory

book/src/slasher.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ of the immaturity of the slasher UX and the extra resources required.
1212
* Quad-core CPU
1313
* 16 GB RAM
1414
* 256 GB solid state storage (in addition to space for the beacon node DB)
15+
- ⚠️ **If you are running natively on Windows**: LMDB will pre-allocate the entire 256 GB for the slasher database
1516

1617
## How to Run
1718

lighthouse/tests/beacon_node.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ fn compact_db_flag() {
681681
fn slasher_flag() {
682682
CommandLineTest::new()
683683
.flag("slasher", None)
684+
.flag("slasher-max-db-size", Some(16))
684685
.run()
685686
.with_config_and_dir(|config, dir| {
686687
if let Some(slasher_config) = &config.slasher {
@@ -699,6 +700,7 @@ fn slasher_dir_flag() {
699700
CommandLineTest::new()
700701
.flag("slasher", None)
701702
.flag("slasher-dir", dir.path().as_os_str().to_str())
703+
.flag("slasher-max-db-size", Some(16))
702704
.run()
703705
.with_config(|config| {
704706
if let Some(slasher_config) = &config.slasher {
@@ -712,6 +714,7 @@ fn slasher_dir_flag() {
712714
fn slasher_update_period_flag() {
713715
CommandLineTest::new()
714716
.flag("slasher", None)
717+
.flag("slasher-max-db-size", Some(16))
715718
.flag("slasher-update-period", Some("100"))
716719
.run()
717720
.with_config(|config| {
@@ -726,6 +729,7 @@ fn slasher_update_period_flag() {
726729
fn slasher_history_length_flag() {
727730
CommandLineTest::new()
728731
.flag("slasher", None)
732+
.flag("slasher-max-db-size", Some(16))
729733
.flag("slasher-history-length", Some("2048"))
730734
.run()
731735
.with_config(|config| {
@@ -755,6 +759,7 @@ fn slasher_chunk_size_flag() {
755759
CommandLineTest::new()
756760
.flag("slasher", None)
757761
.flag("slasher-chunk-size", Some("32"))
762+
.flag("slasher-max-db-size", Some(16))
758763
.run()
759764
.with_config(|config| {
760765
let slasher_config = config
@@ -768,6 +773,7 @@ fn slasher_chunk_size_flag() {
768773
fn slasher_validator_chunk_size_flag() {
769774
CommandLineTest::new()
770775
.flag("slasher", None)
776+
.flag("slasher-max-db-size", Some(16))
771777
.flag("slasher-validator-chunk-size", Some("512"))
772778
.run()
773779
.with_config(|config| {
@@ -783,6 +789,7 @@ fn slasher_broadcast_flag() {
783789
CommandLineTest::new()
784790
.flag("slasher", None)
785791
.flag("slasher-broadcast", None)
792+
.flag("slasher-max-db-size", Some(16))
786793
.run()
787794
.with_config(|config| {
788795
let slasher_config = config

0 commit comments

Comments
 (0)