Skip to content

Instantly share code, notes, and snippets.

@Fible1
Last active April 23, 2024 03:42
Show Gist options
  • Save Fible1/459508438a09ef9c53b79a2ab47b0be7 to your computer and use it in GitHub Desktop.
Save Fible1/459508438a09ef9c53b79a2ab47b0be7 to your computer and use it in GitHub Desktop.
Install Aligned Layer in one Line
#!/bin/bash
# Generate a random name
name=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)
# Update and upgrade the system
sudo apt-get update -y
sudo DEBIAN_FRONTEND=noninteractive apt upgrade -y
# Install required packages
sudo DEBIAN_FRONTEND=noninteractive apt-get install jq moreutils make gcc -y
# Install Go
wget https://golang.org/dl/go1.22.2.linux-amd64.tar.gz
tar -xzf go1.22.2.linux-amd64.tar.gz
sudo mv go /usr/local
# Update bashrc with Go path
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
# Spawn a new Bash process and execute the remaining commands
bash -c "
# Reload the Bash configuration
source ~/.bashrc
# Check if Go is installed correctly
if ! command -v go &> /dev/null
then
echo \"Error: Go is not installed or not found in the PATH.\"
exit 1
fi
# Install Ignite CLI
curl https://get.ignite.com/cli! | bash
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.76.0 -y
source \"\$HOME/.cargo/env\"
rustc --version
# Clone the aligned_layer_tendermint repository
cd
git clone https://github.com/yetanotherco/aligned_layer_tendermint.git
cd aligned_layer_tendermint
# Set the PEER_ADDR environment variable
export PEER_ADDR=91.107.239.79,116.203.81.174,88.99.174.203,128.140.3.188
# Run the setup_node.sh script with the random name argument
bash setup_node.sh \"$name\"
# Check if alignedlayerd is installed
if ! command -v alignedlayerd &> /dev/null
then
echo \"Error: alignedlayerd is not installed or not found in the PATH.\"
exit 1
fi
# Start alignedlayerd
alignedlayerd start
echo \"Successful! Your node name is $name\"
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment