Skip to content

Commit

Permalink
docs: đź“ť reference for updating the cli
Browse files Browse the repository at this point in the history
  • Loading branch information
heldrida committed Sep 6, 2023
1 parent 01a31ec commit b755892
Showing 1 changed file with 95 additions and 0 deletions.
95 changes: 95 additions & 0 deletions references/Lightning CLI/update-cli-from-source-code.md
Original file line number Diff line number Diff line change
@@ -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
---

<!--
The following import is intentional (see partial <CheckoutCommitWarning />)
-->
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 <USERNAME>
```

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
```

<Author
name="Helder Oliveira"
image="https://github.com/heldrida.png"
title="Software Developer + DX"
url="https://github.com/heldrida"
/>

0 comments on commit b755892

Please sign in to comment.