From b75589278dd2d9ced7fa88bf6770f9164fd245d9 Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Wed, 6 Sep 2023 12:27:20 +0100 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=93=9D=20reference=20for=20updati?= =?UTF-8?q?ng=20the=20cli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../update-cli-from-source-code.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 references/Lightning CLI/update-cli-from-source-code.md diff --git a/references/Lightning CLI/update-cli-from-source-code.md b/references/Lightning CLI/update-cli-from-source-code.md new file mode 100644 index 000000000..19a0b5818 --- /dev/null +++ b/references/Lightning CLI/update-cli-from-source-code.md @@ -0,0 +1,95 @@ +--- +title: Update CLI from source code +slug: update-cli-from-source-code +hide_title: true +tags: +- references +- help +- update +- upgrade +- fix +--- + + +import Author from '@site/src/components/Author'; + +## Switch to the installation user + +Switch to the username you've used throughout the installation process. + +```sh +su +``` + +For example, if you used the username `lgtn` it'll look like the following command: + +```sh +su lgtn +``` + +## Change directory to the source code + +If you have installed it via the recommended process or instructions, then the default location where the [source code](https://github.com/fleek-network/lightning) is stored is `~/fleek-network/lightning`. + +```sh +cd ~/fleek-network/lightning +``` + +:::tip +Notice that we use `~`, which refers to `$HOME`. You must use the username used for the installation process. For example, on [Ubuntu](/docs/node/requirements#server) if you used the username `lgtn`, the pathname for `$HOME` is `/home/lgtn`. +::: + +## Pull the latest changes + +To pull the latest changes use the `git pull` command, as follows: + +```sh +git pull origin testnet-alpha-0 +``` + +:::tip +We are using the branch named `testnet-alpha-0`, which is specific to the early testnet launch. Change to the correct branch name according to needs. For example, in the future the mainnet version will go on branch name `main`. +::: + +## Build binary from the source + +To build the binary from the source code, we execute the cargo build command: + +```sh +cargo +stable build --release +``` + +### Restart the service + +Once the cargo build process completes, you have to restart the service, as follows: + +```sh +systemctl restart lightning +``` + +:::tip +If you have installed the Fleek Network lightning manually, the [installation instructions](/docs/node/install#systemd-service-setup) recommended setting up a systemd service for the Fleek Network process. If you haven't, you're advised to check the instructions provided. +::: + +### Health checkup + +Do a quick health check by running: + +```sh +curl -w "\p" localhost:4069/health +``` + +If successful, you should get the response `OK`, as follows: + +```sh +OK +``` + +