Install Hyperledger Besu On Linux For Beginners
Today, I read the documentation of Hyperledger Besu. It’s nice but they assume all Linux users have experience with environment variables and usage of binary packages. So I created this article for a Linux beginner to run Besu on their machine.
Download Binary File And Extract It
The only prerequisite you need for this article is Java if you don’t have it run this command
sudo apt-get update && sudo apt-get install openjdk-11-jdk
First, you need to download the binary distribution from Pegasys choose the .tar.gz
file. Now we will make some operations as a root user. The easiest way is to access your GUI as root user by running this command
sudo -i nautilus
A screen will pop to you on your home directory with root access. Now you can do any operations on directories with root access now go to ‘opt’ directory then extract your binary file on it. Rename your extracted folder fromhyperledger-besu-x-x-x
to besu
only.
check everything works correctly by this command
/opt/besu/bin/besu --help
It should give you a list of commands options.
Add Environment Variable
It’s not fun to write /opt/besu/bin/besu
each time you need to run a besu command it will be better to make write besu
only. To do that go to .bashrc
(the file where you define environment variables)
nano .bashrc
the file will open add this line
export PATH=/opt/besu/bin:$PATH
Now refresh your file
source .bashrc
Try to run the same command again like this
besu --help
It should work now. That it! congratulations now you can use besu commands.