stxmap-rank-shell 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,150 @@
1
+ Crontab_file="/usr/bin/crontab"
2
+ Green_font_prefix="\033[32m"
3
+ Red_font_prefix="\033[31m"
4
+ Green_background_prefix="\033[42;37m"
5
+ Red_background_prefix="\033[41;37m"
6
+ Font_color_suffix="\033[0m"
7
+ Info="[${Green_font_prefix}信息${Font_color_suffix}]"
8
+ Error="[${Red_font_prefix}错误${Font_color_suffix}]"
9
+ Tip="[${Green_font_prefix}注意${Font_color_suffix}]"
10
+ AleoFile="/root/aleo.txt"
11
+ AleoPoolFile="/root/aleo-pool-prover"
12
+
13
+ check_root() {
14
+ [[ $EUID != 0 ]] && echo -e "${Error} 当前非ROOT账号(或没有ROOT权限),无法继续操作,请更换ROOT账号或使用 ${Green_background_prefix}sudo su${Font_color_suffix} 命令获取临时ROOT权限(执行后可能会提示输入当前账号的密码)。" && exit 1
15
+ }
16
+
17
+ install_aleo() {
18
+ check_root
19
+ apt install git
20
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
21
+ source $HOME/.cargo/env
22
+ git clone https://github.com/AleoHQ/snarkOS.git --depth 1 /root/snarkOS
23
+ cd /root/snarkOS
24
+ /root/snarkOS/build_ubuntu.sh
25
+ cargo install --path /root/snarkOS
26
+ if [ -f ${AleoFile} ]; then
27
+ echo "address exist"
28
+ else
29
+ snarkos account new >/root/aleo.txt
30
+ fi
31
+ cat /root/aleo.txt
32
+ PrivateKey=$(cat /root/aleo.txt | grep Private | awk '{print $3}')
33
+ echo export PROVER_PRIVATE_KEY=$PrivateKey >>/etc/profile
34
+ source /etc/profile
35
+ }
36
+
37
+ run_aleo_client() {
38
+ source $HOME/.cargo/env
39
+ source /etc/profile
40
+ cd /root/snarkOS
41
+ nohup ./run-client.sh >run-client.log 2>&1 &
42
+ tail -f /root/snarkOS/run-client.log
43
+ }
44
+
45
+ run_aleo_prover() {
46
+ source $HOME/.cargo/env
47
+ source /etc/profile
48
+ cd /root/snarkOS
49
+ nohup ./run-prover.sh >run-prover.log 2>&1 &
50
+ tail -f /root/snarkOS/run-prover.log
51
+ }
52
+
53
+ read_aleo_address() {
54
+ cat /root/aleo.txt
55
+ }
56
+
57
+
58
+ install_aleo_pool_cpu_and_run() {
59
+ check_root
60
+ if [ -f ${AleoPoolFile} ]; then
61
+ echo " "
62
+ else
63
+ apt install wget
64
+ cd ~ && wget -O /root/aleo-pool-prover https://nd-valid-data-bintest1.oss-cn-hangzhou.aliyuncs.com/aleo/aleo-pool-prover_ubuntu_2004_cpu && chmod +x aleo-pool-prover
65
+ ufw allow 30009
66
+ fi
67
+
68
+ echo -e "\n"
69
+ read -e -p "请输入你的aleo pool矿池帐号名称: " ALEO_POOL_NAME
70
+ read -e -p "请输入你的设备名称(可随便取,便于区分多台设备): " ALEO_POOL_SERVER_NAME
71
+ /root/aleo-pool-prover --account_name $ALEO_POOL_NAME --miner_name $ALEO_POOL_SERVER_NAME
72
+ }
73
+
74
+ install_aleo_pool_gpu() {
75
+ check_root
76
+ sudo apt update
77
+ sudo apt-get remove --purge nvidia*
78
+ sudo apt-get install wget make gcc-7 g++-7 ubuntu-drivers-common -y
79
+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 9
80
+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 1
81
+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 9
82
+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 1
83
+ sudo update-alternatives --display g++
84
+
85
+ sudo ubuntu-drivers autoinstall
86
+
87
+ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
88
+ sudo dpkg -i cuda-keyring_1.0-1_all.deb
89
+ sudo apt-get update
90
+ sudo apt-get -y install cuda
91
+
92
+ echo "export PATH=/usr/local/cuda-11.8/bin\${PATH:+:\${PATH}}
93
+ export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}" >> ~/.bashrc
94
+ source ~/.bashrc
95
+
96
+ cd ~ && wget -O /root/aleo-pool-prover-gpu https://nd-valid-data-bintest1.oss-cn-hangzhou.aliyuncs.com/aleo/aleo-pool-prover_ubuntu_2004_gpu && chmod +x aleo-pool-prover-gpu
97
+
98
+ sudo reboot
99
+ }
100
+
101
+ run_aleo_pool_gpu() {
102
+ read -e -p "请输入你的aleo pool矿池帐号名称: " ALEO_POOL_NAME
103
+ read -e -p "请输入你的设备名称(可随便取,便于区分多台设备): " ALEO_POOL_SERVER_NAME
104
+ /root/aleo-pool-prover-gpu --account_name $ALEO_POOL_NAME --miner_name $ALEO_POOL_SERVER_NAME
105
+ }
106
+
107
+
108
+ echo && echo -e " ${Red_font_prefix}aleo testnet3二阶段pover节点激励测试 一键运行
109
+ 此脚本完全免费开源, 由推特用户${Green_font_prefix}@ouyoung11修改${Font_color_suffix},脚本${Font_color_suffix} fork by \033[1;35m@Daniel\033[0m
110
+ 欢迎关注,如有收费请勿上当受骗.
111
+ ———————————————————————
112
+ ${Green_font_prefix} 1.安装或更新 aleo 环境包${Font_color_suffix}
113
+ ${Green_font_prefix} 2.运行 aleo_client ${Font_color_suffix}
114
+ ${Green_font_prefix} 3.运行 aleo_prover ${Font_color_suffix}
115
+ ${Green_font_prefix} 4.读取 aleo 地址私钥 ${Font_color_suffix}
116
+ --------------(以下为aleo矿池CPU版本,请勿和上面3步混用)----------------
117
+ ${Green_font_prefix} 5.安装aleo pool的CPU版本 ${Font_color_suffix}
118
+ --------------(以下为aleo矿池GPU版本,请勿和上面混用)----------------
119
+ ${Green_font_prefix} 6.安装aleo pool的GPU版本并重启系统应用(如果系统已有显卡驱动和cuda,请不要执行此步) ${Font_color_suffix}
120
+ ${Green_font_prefix} 7.启动aleo pool的GPU挖矿(如若启动出错请手动安装对应显卡驱动版本及cuda) ${Font_color_suffix}
121
+
122
+ ———————————————————————" && echo
123
+ read -e -p " 请输入数字 [1-7]:" num
124
+ case "$num" in
125
+ 1)
126
+ install_aleo
127
+ ;;
128
+ 2)
129
+ run_aleo_client
130
+ ;;
131
+ 3)
132
+ run_aleo_prover
133
+ ;;
134
+ 4)
135
+ read_aleo_address
136
+ ;;
137
+ 5)
138
+ install_aleo_pool_cpu_and_run
139
+ ;;
140
+ 6)
141
+ install_aleo_pool_gpu
142
+ ;;
143
+ 7)
144
+ run_aleo_pool_gpu
145
+ ;;
146
+ *)
147
+ echo
148
+ echo -e " ${Error} 请输入正确的数字"
149
+ ;;
150
+ esac
@@ -0,0 +1,180 @@
1
+ Crontab_file="/usr/bin/crontab"
2
+ Green_font_prefix="\033[32m"
3
+ Red_font_prefix="\033[31m"
4
+ Green_background_prefix="\033[42;37m"
5
+ Red_background_prefix="\033[41;37m"
6
+ Font_color_suffix="\033[0m"
7
+ Info="[${Green_font_prefix}信息${Font_color_suffix}]"
8
+ Error="[${Red_font_prefix}错误${Font_color_suffix}]"
9
+ Tip="[${Green_font_prefix}注意${Font_color_suffix}]"
10
+
11
+ CHAIN_ID="bbn-test-3"
12
+
13
+ check_root() {
14
+ [[ $EUID != 0 ]] && echo -e "${Error} 当前非ROOT账号(或没有ROOT权限), 无法继续操作, 请更换ROOT账号或使用 ${Green_background_prefix}sudo su${Font_color_suffix} 命令获取临时ROOT权限(执行后可能会提示输入当前账号的密码)。" && exit 1
15
+ }
16
+
17
+ install_go() {
18
+ check_root
19
+ # Install dependencies for building from source
20
+ sudo apt update
21
+ sudo apt install -y curl git jq lz4 build-essential
22
+
23
+ # Install Go
24
+ sudo rm -rf /usr/local/go
25
+ curl -L https://go.dev/dl/go1.21.6.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
26
+ echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile
27
+ source .bash_profile
28
+ }
29
+
30
+ install_babylon_env() {
31
+ read -e -p "请输入你的节点名称: " node_name
32
+ sudo ufw allow 9100
33
+ sudo ufw allow 26656
34
+ install_go
35
+
36
+ # Clone project repository
37
+ cd && rm -rf babylon
38
+ git clone https://github.com/babylonchain/babylon
39
+ cd babylon
40
+ git checkout v0.8.4
41
+
42
+ # Build binary
43
+ make install
44
+
45
+ # Set node CLI configuration
46
+ babylond config set client chain-id bbn-test-3
47
+ babylond config set client keyring-backend test
48
+ babylond config set client node tcp://localhost:20657
49
+
50
+ # Initialize the node
51
+ babylond init $node_name --chain-id $CHAIN_ID
52
+
53
+ # Download genesis and addrbook files
54
+ curl -L https://snapshots-testnet.nodejumper.io/babylon-testnet/genesis.json > $HOME/.babylond/config/genesis.json
55
+ curl -L https://snapshots-testnet.nodejumper.io/babylon-testnet/addrbook.json > $HOME/.babylond/config/addrbook.json
56
+
57
+ # Set seeds
58
+ sed -i -e 's|^seeds *=.*|seeds = "49b4685f16670e784a0fe78f37cd37d56c7aff0e@3.14.89.82:26656,9cb1974618ddd541c9a4f4562b842b96ffaf1446@3.16.63.237:26656,d66d4275cc6592ee3f51bf940f9d4a7b79431c0f@185.215.167.27:26656,04a7f5517d24383a36ce2b51a43a0d4f482fef29@84.247.189.41:26656,b00808ac8951f831d057a9e2bf04227e3fdf7464@37.60.237.230:26656,e810a17b116de8a288ec32ad60f261254be8cdeb@31.220.82.89:26656,f32fb74f8c0e12d478449ef3de04981a95581519@84.247.186.148:26656,f0d7cbf3d77f0eae2d3f83db8371e6ceda70a39f@89.117.55.59:26656,d509c94b73559d846ff89b638a7e42e7a25193b5@37.60.252.50:26656,98f285fca723700622b3918ddac0f627c7e63d76@161.97.94.87:26656,360c627efaa3e5dac16f6ba3d43fff7f0ec5c266@176.57.188.179:26656,4b456bbafe3ff6a28f6e7d0edb20668683c966cd@38.242.222.32:26656,fe923e35845fd14d4415b6fd2f073c52d0880a05@109.199.116.232:26656,66af16cf6b888ef0c631cc293d26f3cb06a04b4a@194.163.177.76:26656,063a8473f2327e9c39bb50196e11f969f02a1a71@82.208.20.172:26656,8c78c9a2acfc9e36459565f1d6c9ce35f87f3911@156.225.129.62:26656,136f4877771a86c7072b53ec86d0afddcdc1502b@84.247.172.135:26656,bcdda9e5c162d307e8126668f9e1edffacb8b9c0@85.239.235.144:26656,a3b57c4a5f06ae5876abf8d4294de4a320fb5e0f@194.163.166.144:26656,ac63a0965ab674db6d7b2bdc1d488a88fa5ad3da@93.185.166.236:26656,cc28a8a19d0cd8ea03e20c5313796c702bd815c4@62.171.176.205:26656,29c5f973b66c6f2c3cd9bd8335f92afd5ed7aeec@109.199.117.124:26656"|' $HOME/.babylond/config/config.toml
59
+ PEERS="49b4685f16670e784a0fe78f37cd37d56c7aff0e@3.14.89.82:26656,9cb1974618ddd541c9a4f4562b842b96ffaf1446@3.16.63.237:26656,d66d4275cc6592ee3f51bf940f9d4a7b79431c0f@185.215.167.27:26656,04a7f5517d24383a36ce2b51a43a0d4f482fef29@84.247.189.41:26656,b00808ac8951f831d057a9e2bf04227e3fdf7464@37.60.237.230:26656,e810a17b116de8a288ec32ad60f261254be8cdeb@31.220.82.89:26656,f32fb74f8c0e12d478449ef3de04981a95581519@84.247.186.148:26656,f0d7cbf3d77f0eae2d3f83db8371e6ceda70a39f@89.117.55.59:26656,d509c94b73559d846ff89b638a7e42e7a25193b5@37.60.252.50:26656,98f285fca723700622b3918ddac0f627c7e63d76@161.97.94.87:26656,360c627efaa3e5dac16f6ba3d43fff7f0ec5c266@176.57.188.179:26656,4b456bbafe3ff6a28f6e7d0edb20668683c966cd@38.242.222.32:26656,fe923e35845fd14d4415b6fd2f073c52d0880a05@109.199.116.232:26656,66af16cf6b888ef0c631cc293d26f3cb06a04b4a@194.163.177.76:26656,063a8473f2327e9c39bb50196e11f969f02a1a71@82.208.20.172:26656,8c78c9a2acfc9e36459565f1d6c9ce35f87f3911@156.225.129.62:26656,136f4877771a86c7072b53ec86d0afddcdc1502b@84.247.172.135:26656,bcdda9e5c162d307e8126668f9e1edffacb8b9c0@85.239.235.144:26656,a3b57c4a5f06ae5876abf8d4294de4a320fb5e0f@194.163.166.144:26656,ac63a0965ab674db6d7b2bdc1d488a88fa5ad3da@93.185.166.236:26656,cc28a8a19d0cd8ea03e20c5313796c702bd815c4@62.171.176.205:26656,29c5f973b66c6f2c3cd9bd8335f92afd5ed7aeec@109.199.117.124:26656"
60
+ sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.babylond/config/config.toml
61
+
62
+ # Set minimum gas price
63
+ sed -i -e 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.00001ubbn"|' $HOME/.babylond/config/app.toml
64
+
65
+ # Set pruning
66
+ sed -i \
67
+ -e 's|^pruning *=.*|pruning = "custom"|' \
68
+ -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
69
+ -e 's|^pruning-interval *=.*|pruning-interval = "17"|' \
70
+ $HOME/.babylond/config/app.toml
71
+
72
+ # Set additional configs
73
+ sed -i 's|^network *=.*|network = "signet"|g' $HOME/.babylond/config/app.toml
74
+
75
+ # Change ports
76
+ sed -i -e "s%:1317%:20617%; s%:8080%:20680%; s%:9090%:20690%; s%:9091%:20691%; s%:8545%:20645%; s%:8546%:20646%; s%:6065%:20665%" $HOME/.babylond/config/app.toml
77
+ sed -i -e "s%:26658%:20658%; s%:26657%:20657%; s%:6060%:20660%; s%:26656%:20656%; s%:26660%:20661%" $HOME/.babylond/config/config.toml
78
+
79
+ # Download latest chain data snapshot
80
+ curl "https://snapshots-testnet.nodejumper.io/babylon-testnet/babylon-testnet_latest.tar.lz4" | lz4 -dc - | tar -xf - -C "$HOME/.babylond"
81
+
82
+ # Create a service
83
+ # Create a service
84
+ sudo tee /etc/systemd/system/babylond.service > /dev/null << EOF
85
+ [Unit]
86
+ Description=Babylon node service
87
+ After=network-online.target
88
+ [Service]
89
+ User=$USER
90
+ ExecStart=$(which babylond) start
91
+ Restart=on-failure
92
+ RestartSec=10
93
+ LimitNOFILE=65535
94
+ [Install]
95
+ WantedBy=multi-user.target
96
+ EOF
97
+
98
+ echo -e "\n"
99
+ echo -e "下面开始创建babylon钱包,会让你创建一个钱包密码..."
100
+ babylond --keyring-backend test keys add wallet
101
+ sed -i -e "s|^key-name *=.*|key-name = \"wallet\"|" ~/.babylond/config/app.toml
102
+ sed -i -e "s|^timeout_commit *=.*|timeout_commit = \"30s\"|" ~/.babylond/config/config.toml
103
+ babylond create-bls-key $(babylond keys show wallet -a)
104
+ cat $HOME/.babylond/config/priv_validator_key.json
105
+ echo -e "\n"
106
+ echo -e "请保存上面创建好的钱包地址、私钥、助记词等信息..."
107
+
108
+ sudo systemctl daemon-reload
109
+ sudo systemctl enable babylond.service
110
+ }
111
+
112
+ start_babylon_node() {
113
+ # Start the service and check the logs
114
+ sudo systemctl start babylond.service
115
+ sudo journalctl -u babylond.service -f --no-hostname -o cat
116
+ }
117
+
118
+ check_node_status_and_height() {
119
+ babylond status | jq
120
+ systemctl status babylond
121
+ }
122
+
123
+ get_log() {
124
+ sudo journalctl -u babylond.service -f --no-hostname -o cat
125
+ }
126
+
127
+ start_validator_node() {
128
+ read -e -p "请输入你的验证者名称: " validator_name
129
+ sudo tee ~/validator.json > /dev/null <<EOF
130
+ {
131
+ "pubkey": $(babylond tendermint show-validator),
132
+ "amount": "50000ubbn",
133
+ "moniker": "$validator_name",
134
+ "details": "$validator_name validator node",
135
+ "commission-rate": "0.10",
136
+ "commission-max-rate": "0.20",
137
+ "commission-max-change-rate": "0.01",
138
+ "min-self-delegation": "1"
139
+ }
140
+ EOF
141
+ babylond tx checkpointing create-validator ~/validator.json \
142
+ --chain-id=$CHAIN_ID \
143
+ --gas="auto" \
144
+ --gas-adjustment="1.5" \
145
+ --gas-prices="0.025ubbn" \
146
+ --from=wallet
147
+ }
148
+
149
+ echo && echo -e " ${Red_font_prefix}babylon节点 一键安装脚本${Font_color_suffix} by \033[1;35moooooyoung\033[0m
150
+ 此脚本完全免费开源, 由推特用户 ${Green_font_prefix}@ouyoung11开发${Font_color_suffix},
151
+ 欢迎关注, 如有收费请勿上当受骗。
152
+ ———————————————————————
153
+ ${Green_font_prefix} 1.安装babylon节点环境 ${Font_color_suffix}
154
+ ${Green_font_prefix} 2.运行babylon节点 ${Font_color_suffix}
155
+ ${Green_font_prefix} 3.检查节点状态 ${Font_color_suffix}
156
+ ${Green_font_prefix} 4.显示同步日志 ${Font_color_suffix}
157
+ ${Green_font_prefix} 5.成为验证者(需要等节点同步到最新区块) ${Font_color_suffix}
158
+ ———————————————————————" && echo
159
+ read -e -p " 请参照教程执行以上步骤,请输入数字 [1-5]:" num
160
+ case "$num" in
161
+ 1)
162
+ install_babylon_env
163
+ ;;
164
+ 2)
165
+ start_babylon_node
166
+ ;;
167
+ 3)
168
+ check_node_status_and_height
169
+ ;;
170
+ 4)
171
+ get_log
172
+ ;;
173
+ 5)
174
+ start_validator_node
175
+ ;;
176
+ *)
177
+ echo
178
+ echo -e " ${Error} 请输入正确的数字"
179
+ ;;
180
+ esac
@@ -0,0 +1,116 @@
1
+ Crontab_file="/usr/bin/crontab"
2
+ Green_font_prefix="\033[32m"
3
+ Red_font_prefix="\033[31m"
4
+ Green_background_prefix="\033[42;37m"
5
+ Red_background_prefix="\033[41;37m"
6
+ Font_color_suffix="\033[0m"
7
+ Info="[${Green_font_prefix}信息${Font_color_suffix}]"
8
+ Error="[${Red_font_prefix}错误${Font_color_suffix}]"
9
+ Tip="[${Green_font_prefix}注意${Font_color_suffix}]"
10
+ disk_info=$(df -h | grep -E '^/dev/' | sort -k4 -h -r)
11
+ max_disk=$(echo "$disk_info" | head -n 1 | awk '{print $1}')
12
+ max_disk_path=$(echo "$disk_info" | head -n 1 | awk '{print $6}')
13
+ cd "$max_disk_path" || exit
14
+
15
+ check_root() {
16
+ [[ $EUID != 0 ]] && echo -e "${Error} 当前非ROOT账号(或没有ROOT权限), 无法继续操作, 请更换ROOT账号或使用 ${Green_background_prefix}sudo su${Font_color_suffix} 命令获取临时ROOT权限(执行后可能会提示输入当前账号的密码)。" && exit 1
17
+ }
18
+
19
+ install_btc_full_node() {
20
+ check_root
21
+ sudo apt update && sudo apt upgrade -y
22
+ sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential git make ncdu unzip zip -y
23
+ sudo ufw allow 8333
24
+
25
+ echo "最大磁盘路径为: $max_disk_path"
26
+
27
+ latest_version_info=$(curl -s https://api.github.com/repos/bitcoin/bitcoin/releases/latest | grep "tag_name" | cut -d'"' -f4)
28
+ latest_version=${latest_version_info#v}
29
+ download_link="https://bitcoincore.org/bin/bitcoin-core-$latest_version/bitcoin-$latest_version-x86_64-linux-gnu.tar.gz"
30
+ bitcoin_coin_path="$max_disk_path/bitcoin-core.tar.gz"
31
+
32
+ wget -O $bitcoin_coin_path $download_link && \
33
+ tar -xvf $bitcoin_coin_path && \
34
+ bitcoin_directory=$(tar -tf $bitcoin_coin_path | head -n 1 | cut -f1 -d'/') && \
35
+ mv "$bitcoin_directory" bitcoin-core && \
36
+ chmod +x bitcoin-core
37
+
38
+ echo "# Bitcoin environment variables" >> ~/.bashrc
39
+ echo "export BTCPATH=$max_disk_path/bitcoin-core/bin" >> ~/.bashrc
40
+ echo 'export PATH=$BTCPATH:$PATH' >> ~/.bashrc
41
+
42
+ mkdir $max_disk_path/btc-data
43
+
44
+ conf_file="$max_disk_path/btc-data/bitcoin.conf"
45
+ conf_content=$(cat <<EOL
46
+ server=1
47
+ daemon=1
48
+ txindex=1
49
+ rpcuser=mybtc
50
+ rpcpassword=mybtc123
51
+ addnode=101.43.124.195:8333
52
+ addnode=27.152.157.149:8333
53
+ addnode=101.43.95.152:8333
54
+ addnode=222.186.20.60:8333
55
+ addnode=175.27.247.104:8333
56
+ addnode=110.40.210.253:8333
57
+ addnode=202.108.211.135:8333
58
+ addnode=180.108.105.174:8333
59
+ EOL
60
+ )
61
+ # 检查配置文件是否已存在,如果不存在则创建
62
+ if [ ! -f "$conf_file" ]; then
63
+ echo "$conf_content" > "$conf_file"
64
+ echo "bitcoin.conf created at $conf_file"
65
+ else
66
+ echo "bitcoin.conf already exists at $conf_file"
67
+ fi
68
+
69
+ source ~/.bashrc
70
+ }
71
+
72
+ run_btc_full_node() {
73
+ source ~/.bashrc
74
+ bitcoin-cli -datadir=$max_disk_path/btc-data stop > /dev/null 2>&1
75
+ bitcoind -datadir=$max_disk_path/btc-data -txindex
76
+ }
77
+
78
+ check_btc_full_node_block_height() {
79
+ source ~/.bashrc
80
+ bitcoin-cli -rpcuser=mybtc -rpcpassword=mybtc123 getblockchaininfo
81
+ }
82
+
83
+ check_btc_full_node_log() {
84
+ source ~/.bashrc
85
+ tail -f $max_disk_path/btc-data/debug.log
86
+ }
87
+
88
+ echo && echo -e " ${Red_font_prefix}dusk_network 一键安装脚本${Font_color_suffix} by \033[1;35moooooyoung\033[0m
89
+ 此脚本完全免费开源, 由推特用户 ${Green_font_prefix}@ouyoung11开发${Font_color_suffix},
90
+ 欢迎关注, 如有收费请勿上当受骗。
91
+ ———————————————————————
92
+ ${Green_font_prefix} 1.安装Btc全节点环境 ${Font_color_suffix}
93
+ ${Green_font_prefix} 2.运行Btc全节点 ${Font_color_suffix}
94
+ ${Green_font_prefix} 3.查看Btc全节点同步的区块高度 ${Font_color_suffix}
95
+ ${Green_font_prefix} 4.查看Btc全节点日志 ${Font_color_suffix}
96
+ ———————————————————————" && echo
97
+ read -e -p " 请参照上面的步骤,请输入数字:" num
98
+ case "$num" in
99
+ 1)
100
+ install_btc_full_node
101
+ ;;
102
+ 2)
103
+ run_btc_full_node
104
+ ;;
105
+ 3)
106
+ check_btc_full_node_block_height
107
+ ;;
108
+ 4)
109
+ check_btc_full_node_log
110
+ ;;
111
+ *)
112
+ echo
113
+ echo -e " ${Error} 请输入正确的数字"
114
+ ;;
115
+ esac
116
+
@@ -0,0 +1,151 @@
1
+ Crontab_file="/usr/bin/crontab"
2
+ Green_font_prefix="\033[32m"
3
+ Red_font_prefix="\033[31m"
4
+ Green_background_prefix="\033[42;37m"
5
+ Red_background_prefix="\033[41;37m"
6
+ Font_color_suffix="\033[0m"
7
+ Info="[${Green_font_prefix}信息${Font_color_suffix}]"
8
+ Error="[${Red_font_prefix}错误${Font_color_suffix}]"
9
+ Tip="[${Green_font_prefix}注意${Font_color_suffix}]"
10
+
11
+ LIGHT_RPC_ADDRESS="https://limani.celestia-devops.dev"
12
+ FULL_RPC_ADDRESS="https://rpc-1.celestia.nodes.guru"
13
+
14
+ check_root() {
15
+ [[ $EUID != 0 ]] && echo -e "${Error} 当前非ROOT账号(或没有ROOT权限), 无法继续操作, 请更换ROOT账号或使用 ${Green_background_prefix}sudo su${Font_color_suffix} 命令获取临时ROOT权限(执行后可能会提示输入当前账号的密码)。" && exit 1
16
+ }
17
+
18
+ install_celestia_node() {
19
+ check_root
20
+ ufw allow 9090
21
+ ufw allow 26659
22
+ sudo apt update && sudo apt upgrade -y
23
+ sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential git make ncdu -y
24
+ ver="1.19.1"
25
+ cd $HOME
26
+ wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
27
+ sudo rm -rf /usr/local/go
28
+ sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
29
+ rm "go$ver.linux-amd64.tar.gz"
30
+ echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
31
+ source $HOME/.bash_profile
32
+
33
+ cd $HOME
34
+ rm -rf celestia-app
35
+ git clone https://github.com/celestiaorg/celestia-app.git
36
+ cd celestia-app/
37
+ APP_VERSION=$(curl -s \
38
+ https://api.github.com/repos/celestiaorg/celestia-app/releases/latest \
39
+ | jq -r ".tag_name")
40
+ git checkout tags/$APP_VERSION -b $APP_VERSION
41
+ make install
42
+
43
+ cd $HOME
44
+ rm -rf celestia-node
45
+ git clone https://github.com/celestiaorg/celestia-node.git
46
+ NODE_VERSION=$(curl -s \
47
+ https://api.github.com/repos/celestiaorg/celestia-node/releases/latest \
48
+ | jq -r ".tag_name")
49
+ cd celestia-node/
50
+ git checkout tags/$NODE_VERSION -b $NODE_VERSION
51
+ make install
52
+ make cel-key
53
+ }
54
+
55
+ create_wallet_run_light_node() {
56
+ cd ~
57
+ celestia light init --p2p.network arabica
58
+ echo -e "\n"
59
+ read -e -p "请输入钱包名称创建你的轻节点钱包: " WALLET_NAME
60
+ celestia-node/cel-key add $WALLET_NAME --keyring-backend test --node.type light
61
+ echo -e "\n"
62
+ read -e -p "请保存上面创建好的轻节点钱包地址、私钥、助记词,然后按回车键继续..."
63
+ celestia light start --keyring.accname $WALLET_NAME --core.ip $LIGHT_RPC_ADDRESS --core.grpc.port 9090 --gateway --gateway.addr 0.0.0.0 --gateway.port 26659 --p2p.network arabica
64
+ }
65
+
66
+ create_wallet_run_full_node() {
67
+ cd ~
68
+ celestia full init --p2p.network arabica
69
+ echo -e "\n"
70
+ read -e -p "请输入钱包名称创建你的全存储节点钱包: " WALLET_NAME
71
+ celestia-node/cel-key add $WALLET_NAME --keyring-backend test --node.type full
72
+ echo -e "\n"
73
+ read -e -p "请保存上面创建好的全存储节点钱包地址、私钥、助记词,然后按回车键继续..."
74
+ celestia full start --core.ip $FULL_RPC_ADDRESS --core.grpc.port 9090 --keyring.accname $WALLET_NAME --p2p.network arabica
75
+ }
76
+
77
+ run_light_node() {
78
+ cd ~
79
+ celestia light init --p2p.network arabica
80
+ echo -e "\n"
81
+ read -e -p "请输入你的轻节点钱包名称: " WALLET_NAME
82
+ celestia light start --keyring.accname $WALLET_NAME --core.ip $LIGHT_RPC_ADDRESS --core.grpc.port 9090 --gateway --gateway.addr 0.0.0.0 --gateway.port 26659 --p2p.network arabica
83
+ }
84
+
85
+ run_full_node() {
86
+ cd ~
87
+ celestia full init --p2p.network arabica
88
+ echo -e "\n"
89
+ read -e -p "请输入你的全存储节点钱包名称: " WALLET_NAME
90
+ celestia full start --core.ip $FULL_RPC_ADDRESS --core.grpc.port 9090 --keyring.accname $WALLET_NAME --p2p.network arabica
91
+ }
92
+
93
+ wallet_recover_account() {
94
+ read -e -p "请输入你的celestia节点钱包名称: " WALLET_NAME
95
+ source $HOME/.bash_profile
96
+ cd ~/celestia-app/
97
+ celestia-appd config keyring-backend test
98
+ celestia-appd keys add $WALLET_NAME --recover
99
+ }
100
+
101
+ wallet_staking() {
102
+ read -e -p "请输入你的celestia节点钱包名称: " WALLET_NAME
103
+ read -e -p "请输入质押数量: " STAKING_COUNT
104
+ STAKING_COUNT_UTIA="${STAKING_COUNT}000000utia"
105
+ source $HOME/.bash_profile
106
+ cd ~/celestia-app/
107
+ celestia-appd tx staking delegate \
108
+ celestiavaloper1q3v5cugc8cdpud87u4zwy0a74uxkk6u4q4gx4p $STAKING_COUNT_UTIA \
109
+ --from=$WALLET_NAME --chain-id=mamaki --node https://rpc-mamaki.pops.one:443
110
+ }
111
+
112
+ echo && echo -e " ${Red_font_prefix}dusk_network 一键安装脚本${Font_color_suffix} by \033[1;35moooooyoung\033[0m
113
+ 此脚本完全免费开源, 由推特用户 ${Green_font_prefix}@ouyoung11开发${Font_color_suffix},
114
+ 欢迎关注, 如有收费请勿上当受骗。
115
+ ———————————————————————
116
+ ${Green_font_prefix} 1.安装依赖环境和工具包 ${Font_color_suffix}
117
+ ${Green_font_prefix} 2.创建轻节点钱包并运行轻节点 ${Font_color_suffix}
118
+ ${Green_font_prefix} 3.创建全存储节点钱包并运行全存储节点 ${Font_color_suffix}
119
+ ${Green_font_prefix} 4.重新运行轻节点 ${Font_color_suffix}
120
+ ${Green_font_prefix} 5.重新运行全存储节点 ${Font_color_suffix}
121
+ ${Green_font_prefix} 6.导入之前创建的celestia钱包 ${Font_color_suffix}
122
+ ${Green_font_prefix} 7.质押测试代币 ${Font_color_suffix}
123
+ ———————————————————————" && echo
124
+ read -e -p " 请参照上面的步骤,请输入数字 [1-7]:" num
125
+ case "$num" in
126
+ 1)
127
+ install_celestia_node
128
+ ;;
129
+ 2)
130
+ create_wallet_run_light_node
131
+ ;;
132
+ 3)
133
+ create_wallet_run_full_node
134
+ ;;
135
+ 4)
136
+ run_light_node
137
+ ;;
138
+ 5)
139
+ run_full_node
140
+ ;;
141
+ 6)
142
+ wallet_recover_account
143
+ ;;
144
+ 7)
145
+ wallet_staking
146
+ ;;
147
+ *)
148
+ echo
149
+ echo -e " ${Error} 请输入正确的数字"
150
+ ;;
151
+ esac