印度链 Shardeum 自动部署代码

直接上代码,88888888改成自己的密码,

[crypto-block]

#修改密码
operator-cli gui set password 123456
#启动GUI
operator-cli gui start
#启动验证器
operator-cli start
#停止
operator-cli stop
#验证安装
curl localhost:9001/nodeinfo
#!/bin/bash
echo "docker 安装"
programs=("git" "docker" "docker-compose" "npm" "ca-certificates" "curl" "gnupg " "lsb-release")
for program in "${programs[@]}"; do
  if ! command -v "$program" > /dev/null; then
    apt-get update
    apt-get install -y "$program"
  fi
done

curl -O https://gitlab.com/shardeum/validator/dashboard/-/raw/main/installer.sh && chmod +x installer.sh
expect <<- DONE
 spawn bash installer.sh
   expect "(y/n):"
   send "y\r"
   expect "Set the password to access the Dashboard:"
   send "88888888\r"
   expect "(default 8080):"
   send "\r"
   expect "(defaults to ~/.shardeum):"
   send "\r"
   sleep 300
   interact
DONE

cd ~/.shardeum/
echo "生成虚拟环境"
bash shell.sh
echo "运行节点"
operator-cli gui start

代码更新如下:

#!/bin/bash
echo "docker 安装"
programs=("git" "docker" "docker-compose" "npm" "ca-certificates" "curl" "gnupg " "lsb-release")
for program in "${programs[@]}"; do
  if ! command -v "$program" > /dev/null; then
    apt-get update
    apt-get install -y "$program"
  fi
done

curl -O https://gitlab.com/shardeum/validator/dashboard/-/raw/main/installer.sh && chmod +x installer.sh
expect <<- DONE
 spawn bash installer.sh
   expect "(y/n):"
   send "y\r"
   expect "Dashboard? (y/n):"
   send "y\r"
   expect "Set the password to access the Dashboard:"
   send "88888888\r"
   expect "(default 8080):"
   send "\r"
   expect "(default 9001):"
   send "\r"
   expect "(default 10001):"
   send "\r"
   expect "(defaults to ~/.shardeum):"
   send "\r"
   sleep 300
   interact
DONE

cd ~/.shardeum/
echo "生成虚拟环境"
bash shell.sh
echo "运行节点"
operator-cli gui start

全自动无人值守部署需要在后台交互,
这里需要用到screen,

最后打开你需要绑定的浏览器(跑节点要绑定钱包,需要连钱包):

输入https://xxx.xxx.xxx.xx:8080

这里xxx是创建的服务器 ip 地址,自行替换粘贴进去即可

选择高级,继续前往:

进入后,输入刚刚设置的密码:

进入网站:

点击Start Node 后,回到命令行,输入:

operator-cli start

网页变成 Stop Node,则跑节点成功(质押最少要10 shm ):

点击 Add Stake 输入10个,确认后钱包签名即可(需要切换到刚刚添加的测试网)

点击 overview 查看自己质押数,以及获得的 shm

[/crypto-block]