Start the service and check it's working as expected.
Besu - Command Aliases
daemon-reload # Reload any changes made to the besu.service
besu-enable # Enable the besu.service
besu-start # Start the besu.service
besu-status # View the status of the besu.service
besu-log # View the besu.service logs
Besu - Update Scripts
Create Besu update script.
vim ~/besu-update.sh
~/besu-update.sh
#!/bin/bash
set -e
while true; do
read -p "Are you sure you want to update Besu? (Y/N) " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer Y or N.";;
esac
done
read -p "Enter the commit hash you want to checkout: " commit_hash
# Delete existing besu directory to avoid commit mismatch errors
cd ~
sudo rm -rf besu
git clone --recursive https://github.com/hyperledger/besu
cd ~/besu
git checkout $commit_hash
echo
echo "**************"
echo "Making Besu..."
echo "**************"
./gradlew build -x test
./gradlew clean installDist
# Check if besu.service is running
service_was_running=0
if sudo systemctl is-active --quiet besu.service; then
service_was_running=1
echo "****************"
echo "Stopping Besu..."
sudo systemctl stop besu.service
fi
echo "Replacing previous version..."
sudo rm -rf /usr/local/bin/besu
sudo cp -R ~/besu/build/install/besu /usr/local/bin
# Only start besu.service if it was running originally
if [ $service_was_running -eq 1 ]; then
echo "Restarting Besu..."
echo "******************"
sudo systemctl start besu.service
fi
Make the script executable.
chmod u+x ~/besu-update.sh
JWT Secret is now shared between all clients on the same machine: