-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathauto_install
140 lines (104 loc) · 4.81 KB
/
auto_install
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/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
logo_nodesync(){
clear
cat << "EOF"
=========================================================================
_ _ _ ____
| \ | | | | / ___|
| \| | ___ __| | ___| (__ _ _ ___ __ _____ ___ ___
| |/ _ \ / _ |/ __\\__ \| | | | _ \ / _| |_ _|/ _ \| _ \
| |\ | (_) | (_) | /o_ ___) | |_| | | | | (_ _ | | | (_) | |_) |
|_| \_|\___/ \____|\___|____/ \__ |_| |_|\__(_) |_| \___/| _ /
_/ | | |
|__/ |_|
=========================================================================
Developed by: NodeSync.Top
Twitter: https://twitter.com/nodesync_top
Telegram: https://t.me/nodesync_top
=========================================================================
EOF
}
logo_nodesync;
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.21.5"
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
wget https://github.com/yetanotherco/aligned_layer_tendermint/releases/download/v0.1.0/alignedlayerd
chmod +x alignedlayerd
sudo mv alignedlayerd /usr/local/bin/
cd $HOME
alignedlayerd version
NODE_HOME=$HOME/.alignedlayer
CHAIN_BINARY=alignedlayerd
CHAIN_ID=alignedlayer
PEER_ADDRESSES=("91.107.239.79" "116.203.81.174" "88.99.174.203" "128.140.3.188")
$CHAIN_BINARY init NodeName \
--chain-id $CHAIN_ID --overwrite
curl -Ls https://raw.githubusercontent.com/nodesynctop/Alignedlayer/main/genesis.json > $HOME/.alignedlayer/config/genesis.json
curl -Ls https://raw.githubusercontent.com/nodesynctop/Alignedlayer/main/addrbook.json > $HOME/.alignedlayer/config/addrbook.json
for ADDR in "${PEER_ADDRESSES[@]}"; do
GENESIS=$(curl -f "$ADDR:26657/genesis" | jq '.result.genesis')
if [ -n "$GENESIS" ]; then
echo "$GENESIS" > $NODE_HOME/config/genesis.json;
break;
fi
done
for ADDR in "${PEER_ADDRESSES[@]}"; do
PEER_ID=$(curl -s "$ADDR:26657/status" | jq -r '.result.node_info.id')
if [ -n "$PEER_ID" ]; then
PEERS+=("$PEER_ID@$ADDR:26656")
fi
done
PEER_LIST=$(IFS=,; echo "${PEERS[*]}")
$CHAIN_BINARY config set config p2p.persistent_peers "$PEER_LIST" --skip-validate
$CHAIN_BINARY config set config rpc.laddr "tcp://0.0.0.0:26657" --skip-validate
sed -i -e "s|^seeds *=.*|seeds = \"[email protected]:24210\"|" $HOME/.alignedlayer/config/config.toml
sed -i -e 's|^persistent_peers *=.*|persistent_peers ="[email protected]:20656,[email protected]:26656,[email protected]:26656,[email protected]:26656, [email protected]:20656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656"|' $HOME/.alignedlayer/config/config.toml
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.0001stake\"|" $HOME/.alignedlayer/config/app.toml
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
$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
cd $HOME
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