Linux

本教程为主网(xDAI)运行教程

Swarm测试网部署教程手册[Linux]

本教程由CryptoHunter提供,转载请注明出处

前期准备工具

  • linode

  • FinalShell

创建linode云服务器

1.注册Linode促销活动账号

免费云服务:https://cloud.linode.com/linodes/

注册时候,一定要填写促销码

注册需要信用卡信息,按提示操作。(建议用谷歌邮箱注册)

2.创建Linode服务器节点

依次选择CenOS 7.0日本,$20服务器,root,密码,创建

FinalShell下载和配置

1.下载

Windows版:http://www.hostbuf.com/downloads/finalshell_install.exe

MacOS:https://blog.csdn.net/Lonely_Ant/article/details/80594385

2.FinalShell部署

添加节点,SSH链接(Linux),节点名称(自己好记的),主机:ip地址,用户名:root,密码:云服务器密码,确定,接受并保存。

Linux环境部署

双击节点,显示“连接成功”后,

Linux部署视频教程:https://www.bilibili.com/video/BV1V64y1D7Hu?share_source=copy_web

创建并进入bee文件夹

依次输入命令:

cd /mnt
mkdir bee
cd bee

下载clef

输入命令:

yum install -y wget

显示“完毕!”后,输入命令:

wget https://github.com/ethersphere/bee-clef/releases/download/v0.5.0/bee-clef_0.5.0_amd64.rpm

安装clef

输入命令:

rpm -i bee-clef_0.5.0_amd64.rpm

下载bee

输入命令:

wget https://github.com/ethersphere/bee/releases/download/v1.0.0/bee_1.0.0_amd64.rpm

安装bee

输入命令:

rpm -i bee_1.0.0_amd64.rpm

安装screen

输入命令:

yum install -y screen

后台运行clef-service

1.输入命令:

screen -S clef

(确保路径是在/mnt/bee下)

2.下载clef-service文件

wget https://raw.githubusercontent.com/Anzai0x/swarm/main/clef-service

3.赋予文件权限

输入命令:

chmod a+x clef-service

4.启动clef

输入命令:

./clef-service start

界面无报错即标代表启动完成。

5.关掉当前窗口

按住ctrl不松,分别按a、d,关掉当前子窗口。

注意是快速同时按一次就可以

后台运行bee

1.输入命令:

screen -S bee

2.启动bee

windows环境下输入命令:

bee start   --verbosity 5   --swap-endpoint $yourAPIKey   --debug-api-enable --clef-signer-enable --clef-signer-endpoint /var/lib/bee-clef/clef.ipc

MacOS环境下输入命令:

bee start \
  --verbosity 5 \
  --swap-endpoint https://rpc.slock.it/goerli \
  --debug-api-enable \
  --clef-signer-enable \
  --clef-signer-endpoint /var/lib/bee-clef/clef.ipc

输入密码...(第一次输入需要输入2遍)

3.水龙头接“水”

运行需要至少0.01xDAI

4.后台运行bee

程序正常运行后,快速同时按下ctrl+a、d,跳出新页面即表示后台运行成功。

关闭窗口

关闭窗口即为推出当前服务器。(成功后台运行clef和bee后推出服务器程序也在跑,放心退出)

重新连入云服务器

双节节点,屏幕显示“连接成功”即表示成功连入。

查询状态

安装epel源、jq

依次输入:(有询问是都输入 y ,运行完成后输入下一个命令)

yum install epel-release
yum list jq
yum install jq

安装完成后,可输入以下对应查询命令:

查看有无支票

输入命令:

curl localhost:1635/chequebook/cheque | jq

查看当前连接到多少个节点

输入命令:

curl -s http://localhost:1635/peers | jq '.peers | length'

检查网络拓扑

输入命令:

curl -X GET http://localhost:1635/topology | jq

测试连通

输入命令:

curl http://localhost:1633

查询当前节点余额

输入命令:

curl localhost:1635/chequebook/balance | jq

检查对等余额

输入命令:

curl localhost:1635/balances | jq

查看节点地址

curl http://localhost:1635/addresses 

查看账本合约地址

curl http://localhost:1635/chequebook/address

兑换支票

下载兑现支票脚本

输入命令:

wget -O cashout.sh https://gist.githubusercontent.com/ralph-pichler/3b5ccd7a5c5cd0500e6428752b37e975/raw/cashout.sh

赋予执行权限

输入命令:

chmod a+x cashout.sh

查询兑换支票(有返回就代表有可兑换支票)

输入命令:

./cashout.sh

兑换支票

./cashout.sh cashout-all 5

记得定期兑换支票

提取私钥

输入命令:

cd /var/lib/bee-clef

打开“keystore”文件夹(load不出的话刷新一下)

右键,下载“UTC--...”文件

右键,下载,等待下载完成

(文件一定要注意归类保存好)

导入MetaMask

输入命令:

cat password

复制密码

打开浏览器上的metamask

选择【账户】→【导入账户】

选择JSON文件导入

上传下载的“UTC--...”文件

粘贴我们前面复制的密码点击下一步

↓(需要等待一段时间)

完成导入

请务必记得保存好私钥

请务必记得保存好私钥

请务必记得保存好私钥

其他报错的话:【节点正常运行可以不用管】

关注微信公众号CryptoHunter(id:Crypto_Hunter),获取更多财富密码

关注微信公众号CryptoHunter(id:Crypto_Hunter),获取更多财富密码

关注微信公众号CryptoHunter(id:Crypto_Hunter),获取更多财富密码

About CryptoHunter

Crypto Hunter is a crypto community focused on for WEB 3.0 ecology, capturing the most cutting-edge information of the crypto world and leading the front-end trend of the crypto industry. Through product and technology driven community development, empowering the traffic growth of quality Web 3.0 ecological projects, the community believes in a product-driven, traffic-centered strategy to link the bridge between the crypto world and the real world.

Join us:

Twitter: https://twitter.com/0xcryptohunter

Discord: https://discord.gg/kAUrGYgYtz

Youtube: https://www.youtube.com/channel/UCUZxmiI3Xt1CYdYaaB3IZ6A

Bilibili: https://space.bilibili.com/1691816550/video

最后更新于

这有帮助吗?