-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
81 lines (65 loc) · 3.13 KB
/
setup.sh
File metadata and controls
81 lines (65 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
set -e
# Stop existing sessions
echo "Checking for and stopping existing sessions..."
for session in "layeredge" "merkle"; do
if screen -list | grep -q "$session"; then
screen -X -S "$session" quit
echo "Previous $session session terminated."
else
echo "No previous $session session found."
fi
done
echo "Updating system and installing dependencies..."
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential git screen cargo
echo "Installing Rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
echo "Installing RISC Zero..."
curl -L https://risczero.com/install | bash && rzup install
source /root/.bashrc
echo "Cleaning up existing Go installation..."
sudo rm -rf /usr/local/go
rm -rf $HOME/go $HOME/.cache/go-build
echo "Installing Go..."
wget https://go.dev/dl/go1.23.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.23.1.linux-amd64.tar.gz
echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.profile
source ~/.profile
echo "Verifying Go version..."
/usr/local/go/bin/go version
cd ~
echo "Cloning LayerEdge Light Node repository..."
[ -d "light-node" ] && rm -rf light-node
git clone https://github.com/Layer-Edge/light-node.git || { echo "Git clone failed"; exit 1; }
cd light-node
# ASCII Art Banner
cat << 'EOF'
██╗ ██╗███╗ ██╗ ██████╗ ██╗ ██╗██████╗ ████████╗
██║ ██║████╗ ██║██╔═══██╗╚██╗██╔╝██╔══██╗╚══██╔══╝
██║ ██║██╔██╗ ██║██║ ██║ ╚███╔╝ ██████╔╝ ██║
██║ ██║██║╚██╗██║██║ ██║ ██╔██╗ ██╔══██╗ ██║
███████╗██║██║ ╚████║╚██████╔╝██╔╝ ██╗██████╔╝ ██║
╚══════╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚═╝
== Follow me on X : @linoxbt ===
=== Layeredge CLI Testnet ====
EOF
# Simplified private key input without validation
echo "Please enter your Ethereum private key (64 hex characters, no '0x'):"
read -s PRIVATE_KEY
echo
PRIVATE_KEY=$(echo -n "$PRIVATE_KEY" | tr -d '[:space:]')
echo "Private Key saved successfully."
echo "Setting up environment variables..."
echo "export GRPC_URL=grpc.testnet.layeredge.io:9090" >> ~/.bashrc
echo "export CONTRACT_ADDR=cosmos1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqt56709" >> ~/.bashrc
echo "export ZK_PROVER_URL=http://127.0.0.1:3001" >> ~/.bashrc
echo "export API_REQUEST_TIMEOUT=100" >> ~/.bashrc
echo "export POINTS_API=https://light-node.layeredge.io" >> ~/.bashrc
echo "export PRIVATE_KEY=$PRIVATE_KEY" >> ~/.bashrc
source ~/.bashrc
# Build the Light Node (without running it)
echo "Building the LayerEdge Light Node..."
/usr/local/go/bin/go build
echo "Setup complete! See separate commands to make executable and start services."