Skip to content

Commit 9daabb5

Browse files
authored
Merge pull request #1 from johnnymatthews/update-lite-node-tutorial
Clarifies git checkout steps. Cleans up grammar and formatting.
2 parents 1a0552c + c17a3da commit 9daabb5

File tree

1 file changed

+52
-35
lines changed

1 file changed

+52
-35
lines changed

nodes/lite-nodes/spin-up-a-lite-node.md

Lines changed: 52 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
22
description: >-
3-
Lite-nodes are a simplified node option that allow developers to perform
4-
lightweight tasks on a local node. This page covers how to spin-up a lite node
5-
on your local machine.
3+
Lite-nodes are a simplified node option that allows developers to perform lightweight tasks on a local node. This page covers how to spin up a lite node on your local machine.
64
---
75

86
# Spin up a lite-node
97

10-
In this guide, we’re going to use the [Lotus](../implementations/lotus.md) Filecoin implementation. We’ll show how to install a lite-node on MacOS and Ubuntu. For other Linux distributions, check out the [Lotus documentation](https://lotus.filecoin.io/lotus/install/linux/#building-from-source). To run a lite-node on Windows, install [WLS with Ubuntu](https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#1-overview) on your system and follow the _Ubuntu_ instructions below.
8+
In this guide, we will use the [Lotus](../implementations/lotus.md) Filecoin implementation to install a lite-node on MacOS and Ubuntu. For other Linux distributions, check out the [Lotus documentation](https://lotus.filecoin.io/lotus/install/linux/#building-from-source). To run a lite-node on Windows, install [WLS with Ubuntu](https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#1-overview) on your system and follow the _Ubuntu_ instructions below.
119

1210
## Prerequisites
1311

14-
Lite-nodes have relatively lightweight hardware requirements – it’s possible to run a lite-node on a Raspberry Pi 4. Your machine should meet the following hardware requirements:
12+
Lite-nodes have relatively lightweight hardware requirements. Your machine should meet the following hardware requirements:
1513

1614
1. At least 2 GiB of RAM
1715
2. A dual-core CPU.
16+
3. At least 4 GiB of storage space.
1817

1918
To build the lite-node, you’ll need some specific software. Run the following command to install the software prerequisites:
2019

@@ -23,30 +22,30 @@ To build the lite-node, you’ll need some specific software. Run the following
2322
1. Ensure you have [XCode](https://developer.apple.com/xcode/) and [Homebrew](https://brew.sh/) installed.
2423
2. Install the following dependencies:
2524

26-
```sh
25+
```shell
2726
brew install go jq pkg-config hwloc coreutils rust
2827
```
2928

3029
{% endtab %}
3130
{% tab title="Ubuntu" %}
3231
1. Install the following dependencies:
3332

34-
```sh
33+
```shell
3534
sudo apt update -y
3635
sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y
3736
```
3837

3938
2. [Install Go](https://go.dev/doc/install) and add `/usr/local/go/bin` to your `$PATH` variable:
4039

41-
```sh
40+
```shell
4241
wget https://go.dev/dl/go1.21.7.linux-amd64.tar.gz
4342
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.7.linux-amd64.tar.gz
4443
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc && source ~/.bashrc
4544
```
4645

4746
3. [Install Rust](https://www.rust-lang.org/tools/install), choose the standard installation option, and source the `~/.cargo/env` config file:
4847

49-
```sh
48+
```shell
5049
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
5150
source "$HOME/.cargo/env"
5251
```
@@ -56,52 +55,64 @@ To build the lite-node, you’ll need some specific software. Run the following
5655

5756
## Pre-build
5857

59-
Before we can build the Lotus binaries, there’s some setup we need to do. MacOS users should select their CPU architecture from the tabs:
58+
Before we can build the Lotus binaries, we need to follow a few pre-build steps. MacOS users should select their CPU architecture from the tabs:
6059

6160
{% tabs %}
6261
{% tab title="MacOS Intel" %}
63-
1. Clone the repository, and move into the `lotus` directory:
62+
1. Clone the repository and move into the `lotus` directory:
6463

65-
```sh
64+
```shell
6665
git clone https://github.com/filecoin-project/lotus.git
6766
cd lotus/
6867
```
6968

70-
2. Checkout the latest release branch. First retrieve the latest release version:
69+
2. Retrieve the latest Lotus release version:
7170

72-
```sh
71+
```shell
7372
git tag -l 'v*' | grep -v '-' | sort -V -r | head -n 1
7473
```
7574

76-
Using the value returned from the previous command, i.e. v1.29.0, and checkout that branch:
75+
This should output something like:
7776

78-
```sh
77+
```output
78+
v1.29.0
79+
```
80+
81+
3. Using the value returned from the previous command, checkout to the latest release branch:
82+
83+
```shell
7984
git checkout v1.29.0
8085
```
8186

82-
3. Done! You can move on to the [Build](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary) section.
87+
4. Done! You can move on to the [Build](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary) section.
8388
{% endtab %}
8489
{% tab title="MacOS ARM" %}
85-
1. Clone the repository, and move into the `lotus` directory:
90+
1. Clone the repository and move into the `lotus` directory:
8691

87-
```sh
92+
```shell
8893
git clone https://github.com/filecoin-project/lotus.git
8994
cd lotus
9095
```
9196

92-
2. Checkout the latest release branch. First retrieve the latest release version:
97+
2. Retrieve the latest Lotus release version:
9398

94-
```sh
99+
```shell
95100
git tag -l 'v*' | grep -v '-' | sort -V -r | head -n 1
96101
```
97102

98-
Using the value returned from the previous command, i.e. v1.29.0, and checkout that branch:
103+
This should output something like:
104+
105+
```output
106+
v1.29.0
107+
```
108+
109+
3. Using the value returned from the previous command, checkout to the latest release branch:
99110

100-
```sh
111+
```shell
101112
git checkout v1.29.0
102113
```
103114

104-
3. Create the necessary environment variables to allow Lotus to run on M1 architecture:
115+
4. Create the necessary environment variables to allow Lotus to run on M1 architecture:
105116

106117
```bash
107118
export LIBRARY_PATH=/opt/homebrew/lib
@@ -112,28 +123,34 @@ Before we can build the Lotus binaries, there’s some setup we need to do. MacO
112123
4. Done! You can move on to the [Build](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary) section.
113124
{% endtab %}
114125
{% tab title="Ubuntu" %}
115-
1. Clone the repository, and move into the `lotus` directory:
126+
1. Clone the repository and move into the `lotus` directory:
116127

117-
```sh
128+
```shell
118129
git clone https://github.com/filecoin-project/lotus.git
119130
cd lotus
120131
```
121132

122-
2. Checkout the latest release branch. First retrieve the latest release version:
133+
2. Retrieve the latest Lotus release version:
123134

124-
```sh
135+
```shell
125136
git tag -l 'v*' | grep -v '-' | sort -V -r | head -n 1
126137
```
127138

128-
Using the value returned from the previous command, i.e. v1.29.0, and checkout that branch:
139+
This should output something like:
140+
141+
```output
142+
v1.29.0
143+
```
144+
145+
3. Using the value returned from the previous command, checkout to the latest release branch:
129146

130-
```sh
147+
```shell
131148
git checkout v1.29.0
132149
```
133150

134-
3. If your processor was released later than an AMD Zen or Intel Ice Lake CPU, enable the use of SHA extensions by adding these two environment variables. If in doubt, ignore this command and move on to [the next section](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary).
151+
4. If your processor was released later than an AMD Zen or Intel Ice Lake CPU, enable SHA extensions by adding these two environment variables. If in doubt, ignore this command and move on to [the next section](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary).
135152

136-
```sh
153+
```shell
137154
export RUSTFLAGS="-C target-cpu=native -g"
138155
export FFI_BUILD_FROM_SOURCE=1
139156
```
@@ -245,7 +262,7 @@ Let's start the lite-node by connecting to a remote full-node. We can use the pu
245262
246263
## Expose the API
247264
248-
To send JSON-RPC requests to our lite-node we need to expose the API.
265+
To send JSON-RPC requests to our lite-node, we need to expose the API.
249266
250267
{% tabs %}
251268
{% tab title="Mainnet" %}
@@ -301,7 +318,7 @@ To send JSON-RPC requests to our lite-node we need to expose the API.
301318
```
302319
303320
2. Open the terminal window where your lite-node is running and press `CTRL` + `c` to close the daemon.
304-
3. In the same window restart the lite-node:
321+
3. In the same window, restart the lite-node:
305322
306323
```shell
307324
FULLNODE_API_INFO=wss://wss.calibration.node.glif.io/apigw/lotus lotus daemon --lite
@@ -390,7 +407,7 @@ Let's run a couple of commands to see if the JSON-RPC API is set up correctly.
390407
391408
The result field is the public key for our address. The private key is stored within our lite-node.
392409
393-
3. Set the new address as the default wallet for our lite-node, reminder to replace the Bearer token with our auth key `eyJhbGc...` and the `"params"` value with the wallet address, `f1vuc4...`, returned from the previous command:
410+
3. Set the new address as the default wallet for our lite-node. Remember to replace the Bearer token with our auth key `eyJhbGc...` and the `"params"` value with the wallet address, `f1vuc4...`, returned from the previous command:
394411
395412
```shell
396413
curl -X POST '127.0.0.1:1234/rpc/v0' \

0 commit comments

Comments
 (0)