4

BlockPI 测试网节点搭建 — Ericet

 2 years ago
source link: https://mirror.xyz/ericet.eth/cpns-YSEyGNwbjY-VShlPy4i1DbNDu3pobrQuxtvBd0
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
image.png

image.png

BlockPI 是web3.0的基础设施项目,目的是为开发者提供多个链网络的去中心基础设施服务

目前正在测试网测试,跑起来不难,就是需要的机子配置要求很高

这是官方要求的配置:

  • CPU with 6 cores
  • 32GB RAM
  • 4TB SSD

运行Klaytn节点

搭建节点的大部分时间要浪费在运行Klaytn节点上,因为目前节点备份,解压后就要占据了2TB的硬盘空间

version=v1.8.4
wget https://packages.klaytn.net/klaytn/$version/ken-$version-0-linux-amd64.tar.gz
tar zxf ken-$version-0-linux-amd64.tar.gz
mv ken-linux-amd64/bin/ken /usr/local/bin/ken
rm -rf ken-linux-amd64 ken-$version-0-linux-amd64.tar.gz

下载Klaytn节点备份

mkdir -p /node/full/klaytn/

https://packages.klaytn.net/cypress/chaindata/ 找到最新的备份下载到 /node/full/klaytn/

备份要600多GB,所以需要一段时间下载

下载好后,运行

tar -xvf 文件名

解压备份,解压后的文件大概2TB

/usr/local/bin/ken --cypress --datadir /node/full/klaytn/ --syncmode full --gcmode full --multichannel --srvtype fasthttp --txpool.exec-slots.all 4096 --txpool.nonexec-slots.all 4096 --txpool.exec-slots.account 4096 --txpool.nonexec-slots.account 4096 --rpc --rpcaddr "localhost" --rpc.concurrencylimit 60000 --rpcapi "debug,klay,eth,personal,rpc,txpool,web3,net" --rpccorsdomain all --rpcvhosts all --ws --wsaddr "localhost" --wsapi "klay,eth,personal,rpc,txpool,web3" --wsorigins all --metrics --prometheus --port 31270 --rpcport 31271 --wsport 31272 --subport 31274 --prometheusport 31275

背后运行节点

cat > /etc/systemd/system/klaytn.service << EOF
[Unit]
Description=daemon
After=network-online.target

[Service]
User=root
ExecStart=/usr/local/bin/ken --cypress --datadir /node/full/klaytn/ --syncmode full --gcmode full --multichannel --srvtype fasthttp --txpool.exec-slots.all 4096 --txpool.nonexec-slots.all 4096 --txpool.exec-slots.account 4096 --txpool.nonexec-slots.account 4096 --rpc --rpcaddr "localhost" --rpc.concurrencylimit 60000 --rpcapi "debug,klay,eth,personal,rpc,txpool,web3,net" --rpccorsdomain all --rpcvhosts all --ws --wsaddr "localhost" --wsapi "klay,eth,personal,rpc,txpool,web3" --wsorigins all --metrics --prometheus --port 31270 --rpcport 31271 --wsport 31272 --subport 31274 --prometheusport 31275
Restart=on-failure
RestartSec=5
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
EOF

# Auto-start when os startup
systemctl enable klaytn

# Run Klaytn Endpoint
systemctl start klaytn

查看节点同步状态

ken attach /node/full/klaytn/klay.ipc
klay.syncing
klay.blockNumber

如果klay.syncing 命令显示的结果是 false, 那就代表同步成功,可以安装HyperNode了

安装HyperNode

mkdir ~/HyperNode
cd ~/HyperNode
version=`wget -qO- -t1 -T2 "https://api.github.com/repos/BlockPILabs/testnets/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g'`
wget https://github.com/BlockPILabs/testnets/releases/download/${version}/HyperNode
wget https://github.com/BlockPILabs/testnets/releases/download/${version}/config.yml
chmod +x ./HyperNode
mv ./HyperNode /usr/local/bin/
cd ~/HyperNode
HyperNode init

创建passwd.txt文件,{密码} 代入上面初始输入的地址

echo '{密码}' > ~/HyperNode/passwd.txt

设置config.yml

# 填你钱包的地址,需要用这个钱包登陆网站查看节点状态
provider: "0x**************"

# {beacon_ip} 选择一个ip填入:
# 141.95.205.50
# 15.235.145.122
# 15.235.11.42
beacon: 
[ "{beacon_ip}:9090" ]

# {name} 填入你节点的名字
name: "{name}"
cd ~/HyperNode
HyperNode --datadir ~/HyperNode --keystore_path ~/HyperNode/keystore/key --password_path passwd.txt

背后运行节点

cat > /etc/systemd/system/HyperNode.service << EOF
[Unit]
Description=daemon
After=network-online.target

[Service]
User=root
WorkingDirectory=/root/HyperNode
ExecStart=/usr/local/bin/HyperNode --datadir /root/HyperNode --keystore_path keystore/key --password_path passwd.txt
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
EOF

systemctl enable HyperNode
systemctl start HyperNode

查看节点日志

journalctl -u HyperNode -f

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK