-
Notifications
You must be signed in to change notification settings - Fork 0
/
alignedlayer_auto
100 lines (67 loc) · 3.19 KB
/
alignedlayer_auto
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
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
clear
if [[ ! -f "$HOME/.bash_profile" ]]; then
touch "$HOME/.bash_profile"
fi
if [ -f "$HOME/.bash_profile" ]; then
source $HOME/.bash_profile
fi
clear
echo "===========Aligned Layer Install Easy======= " && sleep 1
read -p "Do you want run node Aligned Layer ? (y/n): " choice
if [ "$choice" == "y" ]; then
sudo apt update && sudo apt upgrade -y
sudo apt install make curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
#Install GO
ver="1.22.1"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
cd $HOME
rm -rf $HOME/aligned_layer_tendermint && git clone --depth 1 --branch v0.0.2 https://github.com/yetanotherco/aligned_layer_tendermint && cd $HOME/aligned_layer_tendermint/cmd/alignedlayerd && go build
chmod +x alignedlayerd
sudo mv alignedlayerd /usr/local/bin/
cd $HOME
alignedlayerd version
alignedlayerd init NodeName --chain-id alignedlayer
curl -Ls https://snap.nodex.one/alignedlayer-testnet/genesis.json > $HOME/.alignedlayer/config/genesis.json
curl -Ls https://snap.nodex.one/alignedlayer-testnet/addrbook.json > $HOME/.alignedlayer/config/addrbook.json
SEEDS=
STAKETAB_PEER=dc2011a64fc5f888a3e575f84ecb680194307b56@148.251.235.130:20656
sed -i -e 's|^persistent_peers *=.*|persistent_peers = "'$STAKETAB_PEER','$PEERS'"|' $HOME/.alignedlayer/config/config.toml
sed -i -e 's|^seeds *=.*|seeds = "'$SEEDS'"|' $HOME/.alignedlayer/config/config.toml
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.0001stake\"|" $HOME/.alignedlayer/config/app.toml
sudo tee /etc/systemd/system/alignedlayerd.service > /dev/null <<EOF
[Unit]
Description=alignedlayerd
After=network-online.target
[Service]
User=root
ExecStart=$(which alignedlayerd) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
port_side=28
echo "export alignedlayerd_port=$port_side" >> $HOME/.bash_profile
alignedlayerd config node tcp://localhost:28657
sed -i.bak -e "s%:1317%:${port_side}317%g; s%:8080%:${port_side}080%g; s%:9090%:${port_side}090%g; s%:9091%:${port_side}091%g; s%:8545%:${port_side}545%g; s%:8546%:${port_side}546%g; s%:6065%:${port_side}065%g" $HOME/.alignedlayer/config/app.toml
sed -i.bak -e "s%:26658%:${port_side}658%g; s%:26657%:${port_side}657%g; s%:6060%:${port_side}060%g; s%:26656%:${port_side}656%g; s%:26660%:${port_side}660%g" $HOME/.alignedlayer/config/config.toml
cd $HOME
curl -L https://snap.nodex.one/alignedlayer-testnet/alignedlayer-latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.alignedlayer
cd $HOME
sudo systemctl daemon-reload
sudo systemctl enable alignedlayerd
sudo systemctl restart alignedlayerd
sudo journalctl -u alignedlayerd -f --no-hostname -o cat
echo "===================Install Success==================="
else
echo "Not installed"
fi