Skip to main content

Remove the source code locally

For users who build the Docker image from source-code.

Assuming the default installation source-code path ~/fleek-network/lightning, run the command:

rm -rf ~/fleek-network/lightning

If you have a custom path, you need to change the pathname to the correct path you have selected during your custom install.

Stop the Docker service

The Fleek Network recommends systemctl to manage the services, either natively or docker. It's an interface that is easily to translate across the setups, and to communicate to the users in a common manner.

warning

To prevent any negative impact on the node's reputation, it's advisable to wait until the end of the Epoch (~24h) before shutting down the node when opting out. The same applies to nodes that have opted-in but are currently offline.

To learn more, read the Lightning-CLI section for command opt.

tip

Shutting down a Node after an Epoch can be tedious, given the remaining time an Epoch can take to end. Doing it prematurely, will cause reputation penalties, e.g. shutting down before the participation state change to offline. Therefore, a shutdown utility is available in the Tools menu option of get.fleek.network.

To access it, execute the command:

curl https://get.fleek.network | bash

If you have followed the recommendations, you should have the Systemd Unit Service setup.

To stop the service run the command:

sudo systemctl stop docker-lightning

Confirm the Docker service status

Check the status by:

sudo systemctl status docker-lightning

Disable the service by:

sudo systemctl disable docker-lightning
tip

Once stop, you can run the following command to confirm it is not running. If you have used the recommended container name lightning-node the command you'd have to execute is:

You can check the Docker container isn't running by running the following command. Notice that we are assuming that your docker container name is the default lightning-node. If you have customized the name use the correct selected name:

sudo docker container inspect -f '{{.State.Running}}' lightning-node

Reload the daemon

Reload the daemon by:

sudo systemctl daemon-reload

Remove the Systemd Service Unit file

If you have followed the recommendations, you should find the Systemd Service Unit file at:

/etc/systemd/system/docker-lightning

To remove the file, run the command:

sudo rm -f /etc/systemd/system/docker-lightning

Delete the Docker image

For our example, we'll assume that the Docker image for Fleek Network is the default lightning-node. If you have created the image under a different name, change in accordance to your preference.

Delete the image by running the following command:

sudo docker rmi $(docker images | grep 'lightning-node')

To learn more about the docker image remove command, visit the official documentation here

Uninstall Docker

Uninstalling Docker should only be performed if you don't need in your system. If you already had Docker for some purpose, you should not have to uninstall it.

Visit the Docker official documentation site for uninstall instructions here.

Manage keys

The configuration directory of Fleek Network is in the host machine file system. This is the directory where you can find the config.toml, keystore for the public keys, amongst others.

/home/<USERNAME>/.lightning

For example, for the user lgtn the location of these files is:

/home/lgtn/.lightning
warning

The directory can be deleted but have in mind that the keystore is located here. If you need to backup the keystore, be careful as this is not possible to recover by anyone. The keys are your responsibility.

To learn more about the keystore read the guide managing the keystore.

If you are happy to delete the directory, run the following command by replacing the <USERNAME> by yours:

rm -rf /home/<USERNAME>/.lightning

Remove the logs

The Docker container generates output to stdout and stderr. All the content is stored in the location:

/var/log/lightning

To completely remove the directory run the command:

sudo rm -rf /var/log/lightning
Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on discord!