0x01 一键安装脚本

  • Ubuntu
#!/bin/shRunPath=~/tools/miner/swarm
mkdir -p $RunPath/bee
mkdir -p $RunPath/bee-clef
mkdir -p $RunPath/exportSwarmKey# Install bee-clef
wget -O $RunPath/bee-clef/bee-clef_0.4.12_amd64.deb https://github.com/ethersphere/bee-clef/releases/download/v0.4.12/bee-clef_0.4.12_amd64.deb
sudo dpkg -i $RunPath/bee-clef/bee-clef_0.4.12_amd64.deb# Install bee 0.6.2
wget -O $RunPath/bee/bee_0.6.1_amd64.deb https://github.com/ethersphere/bee/releases/download/v0.6.2/bee_0.6.2_arm64.deb
sudo dpkg -i $RunPath/bee/bee_0.6.2_arm64.deb# Install bee 0.6.1
#wget -O $RunPath/bee/bee_0.6.1_amd64.deb https://github.com/ethersphere/bee/releases/download/v0.6.1/bee_0.6.1_amd64.deb
#sudo dpkg -i $RunPath/bee/bee_0.6.1_amd64.deb# Install bee 0.5.3
#wget -O $RunPath/bee/bee_0.5.3_amd64.deb https://github.com/ethersphere/bee/releases/download/v0.5.3/bee_0.5.3_amd64.deb
#sudo dpkg -i $RunPath/bee/bee_0.5.3_amd64.deb# See address
sudo bee-get-addr > ./beeAddress.txt# Export Address Key
#wget -O $RunPath/exportSwarmKey/export-swarm-key-linux-amd64 https://github.com/ethersphere/exportSwarmKey/releases/download/v0.1.0/export-swarm-key-linux-amd64
#chmod +x $RunPath/exportSwarmKey/export-swarm-key-linux-amd64
#sudo cat /var/lib/bee/password | xargs sudo $RunPath/exportSwarmKey/export-swarm-key-linux-amd64 /var/lib/bee/keys > privatekey.txt# Download cashout.sh
wget -O $RunPath/cashout.sh https://gist.githubusercontent.com/ralph-pichler/3b5ccd7a5c5cd0500e6428752b37e975/raw/7ba05095e0836735f4a648aefe52c584e18e065f/cashout.sh
chmod +x $RunPath/cashout.sh# Export Swarm Key
sudo bee-clef-keys
sudo mv ~/bee* $RunPath/
  • CentOS
#!/bin/shRunPath=~/tools/miner/swarm
mkdir -p $RunPath/bee
mkdir -p $RunPath/bee-clef
mkdir -p $RunPath/exportSwarmKey# Install bee-clef
wget -O $RunPath/bee-clef/bee-clef_0.4.12_amd64.rpm https://github.com/ethersphere/bee-clef/releases/download/v0.4.12/bee-clef_0.4.12_amd64.rpm
sudo rpm -i $RunPath/bee-clef/bee-clef_0.4.12_amd64.rpm# Install bee 0.6.2
wget -O $RunPath/bee/bee_0.6.1_amd64.rpm https://github.com/ethersphere/bee/releases/download/v0.6.2/bee_0.6.2_amd64.rpm
sudo rpm -i $RunPath/bee/bee_0.6.2_amd64.rpm# Install bee 0.6.1
#wget -O $RunPath/bee/bee_0.6.1_amd64.rpm https://github.com/ethersphere/bee/releases/download/v0.6.1/bee_0.6.1_amd64.rpm
#sudo rpm -i $RunPath/bee/bee_0.6.1_amd64.rpm# Install bee 0.5.3
#wget -O $RunPath/bee/bee_0.5.3_amd64.rpm https://github.com/ethersphere/bee/releases/download/v0.5.3/bee_0.5.3_amd64.rpm
#sudo rpm -i $RunPath/bee/bee_0.5.3_amd64.rpm# See address
sudo bee-get-addr > ./beeAddress.txt# Export Address Key
wget -O $RunPath/exportSwarmKey/export-swarm-key-linux-amd64 https://github.com/ethersphere/exportSwarmKey/releases/download/v0.1.0/export-swarm-key-linux-amd64
chmod +x $RunPath/exportSwarmKey/export-swarm-key-linux-amd64
sudo cat /var/lib/bee/password | xargs sudo $RunPath/exportSwarmKey/export-swarm-key-linux-amd64 /var/lib/bee/keys > privatekey.txt# Download cashout.sh
wget -O $RunPath/cashout.sh https://gist.githubusercontent.com/ralph-pichler/3b5ccd7a5c5cd0500e6428752b37e975/raw/7ba05095e0836735f4a648aefe52c584e18e065f/cashout.sh
chmod +x $RunPath/cashout.sh# Export Swarm Key
#sudo bee-clef-keys
#sudo mv ~/bee* $RunPath/

0x02 一些基础操作整理

  • 1、简单命令行
# 查询当前节点余额
curl localhost:1635/chequebook/balance | jq# 查询对等节点余额
curl localhost:1635/balances | jq# 查询支票
curl localhost:1635/chequebook/cheque | jq# 查询有效支票
curl -s http://localhost:1635/chequebook/cheque | jq '.lastcheques[].lastreceived'# 统计有效票总数
curl -s http://localhost:1635/chequebook/cheque | jq '.lastcheques[].lastreceived' | grep "payout" | wc -l# 支票兑换bzz - 后面的地址为对等节点的peer
curl -XPOST http://localhost:1635/chequebook/cashout/d7881307e793e389642ea733451db368c4c9b9e23f188cca659c8674d183a56b# 支票兑换状态
curl http://localhost:1635/chequebook/cashout/d7881307e793e389642ea733451db368c4c9b9e23f188cca659c8674d183a56b | jq# 取出bzz到节点钱包
# 支票额度与BZZ兑换比例
# 1,000,000,000,000,000,000 = 1BZZ
curl -XPOST http://localhost:1635/chequebook/withdraw\?amount\=1000 | jq# 将bzz继续存入支票簿
curl -XPOST http://localhost:1635/chequebook/deposit\?amount\=1000 | jq
  • 2、一句话命令行,需要自编脚本的可以自行修改
# 取出peer地址
curl -s http://localhost:1635/chequebook/cheque | jq '.lastcheques[]' | grep "peer" | sed -e 's/\"peer\": \"//g' | sed -e 's/\",//g'# 取有效票的peer地址以及支票额度
curl -s http://localhost:1635/chequebook/cheque | jq '.lastcheques[]' | jq 'if .lastreceived.payout > 0 then "true \(.peer) \(.lastreceived.payout) " else "false" end'# 统计有效票的数量
curl -s http://localhost:1635/chequebook/cheque | jq '.lastcheques[]' | jq 'if .lastreceived.payout > 0 then "true \(.peer) \(.lastreceived.payout) " else "false" end' | grep true | wc -l# 查看支票状态
curl -s http://localhost:1635/chequebook/cheque | jq '.lastcheques[]' | \jq 'if .lastreceived.payout > 0 then "true \(.peer) \(.lastreceived.payout) " else "" end' | \grep "true" | \awk '{print "http://localhost:1635/chequebook/cashout/"$2}' | xargs curl | jq '.'# 兑换支票
curl -s http://localhost:1635/chequebook/cheque | jq '.lastcheques[]' | \jq 'if .lastreceived.payout > 0 then "true \(.peer) \(.lastreceived.payout) " else "" end' | \grep "true" | \awk '{print "http://localhost:1635/chequebook/cashout/"$2}' | xargs curl -X POST | jq '.'
  • 3、cashout.sh 脚本
# 支票管理脚本下载
wget -O cashout.sh https://gist.githubusercontent.com/ralph-pichler/3b5ccd7a5c5cd0500e6428752b37e975/raw/cashout.sh# 查看支票
./cashout.sh# 兑现所有支票
./cashout.sh cashout-all 5

0x03 其它


  • v0.5.3 手动引导节点,可以自行添加到bee.yaml配置文件,无需手动curl
curl -X POST localhost:1635/connect/ip4/157.122.62.228/tcp/1634/p2p/16Uiu2HAmUvTfJ7qVTtyGbcc6QNzvdC5Fj4qyQLgPL8KMHPW7GeWA
curl -X POST localhost:1635/connect/ip4/219.137.67.229/tcp/1634/p2p/16Uiu2HAmEq2DgfDSnkoZZHRWEnovgQcoAYebwxPDi1M4k3qHUwuq
curl -X POST localhost:1635/connect/ip4/47.241.6.61/tcp/1634/p2p/16Uiu2HAmVj4MJr1bzooQHUAbWDivuh6uuNCaNgJzeJoyzxETNrBq
curl -X POST localhost:1635/connect/ip4/120.24.145.255/tcp/1634/p2p/16Uiu2HAmJGFBoYHvtnW4xYfFmHmH4CyJBPpBHc7Ri92kZctncJt4
curl -X POST localhost:1635/connect/ip4/121.89.234.168/tcp/1634/p2p/16Uiu2HAmTKweMDg9jtsNkx8sxmAHwY3d7Eq2vMwps2aYEJC7g1V2

Swarm 一键安装脚本 一些基础操作整理相关推荐

  1. 内网穿透神器Frps一键安装脚本及设置教程

    frps 是一个高性能的反向代理应用,可以帮助您轻松地进行内网穿透,对外网提供服务,支持 tcp, http, https 等协议类型,并且 web 服务支持根据域名进行路由转发. *因为frps是g ...

  2. k3s单机版安装部署 附一键安装脚本

    作者:SRE运维博客 博客地址: https://www.cnsre.cn/ 文章地址:https://www.cnsre.cn/posts/211109907029/ 相关话题:https://ww ...

  3. CentOS7下pptp ***一键安装脚本

    CentOS 6.7下pptp ***一键安装脚本,安装如下: wget http://mirrors.linuxeye.com/scripts/***_centos.sh chmod +x ./** ...

  4. mysql脚本简书,mysql一键安装脚本

    #!/bin/bash #MySQL一键安装脚本 #脚本运行前请确认本机没有安装其他版本的MySQL #运行脚本前请详细阅读my.cnf文件 PASSWORD=`cat my.cnf | grep p ...

  5. *** Python版一键安装脚本

    本脚本适用环境: 系统支持:CentOS 6,7,Debian,Ubuntu 内存要求:≥128M 日期:2018 年 02 月 07 日 关于本脚本: 一键安装 Python 版 *** 的最新版. ...

  6. nginx一键安装脚本

    nginx一键安装脚本 [root@cc nginx]# cat nginx_install.sh #!/bin/bash # > File Name: nginx_install.sh # & ...

  7. linux安装yum的脚本,lnmp一键安装脚本yum方式快速安装

    自己编写的yum安装方式的LNMP一键安装脚本,yum方式安装,速度非常快,目前只有centos版本,其他系统没有弄. Centos5 chmod +x lnmp.sh sh lnmp.sh Cent ...

  8. NPS内网穿透服务端一键安装脚本

    NPS内网穿透服务端一键安装脚本,支持安装,更新,卸载以及重新生成配置文件,基于官方GitHub制作,自动安装最新版本 作者博客链接 脚本概览 安装 wget https://content.928w ...

  9. Frps一键安装脚本,带Frpc Windows便捷启动脚本

    说明:Frp估计很多人都用过,一个高性能的内网穿透工具,支持tcp.udp.http.https协议,安装和使用教程可以直接查看官方中文文档→传送门,写的超详细.这里博主分享个某大佬写的Frps一键脚 ...

最新文章

  1. 收藏 | Linux常用156个命令汇总!
  2. python flask 返回值 状态码 设置
  3. forward 方法详解 java_详解Java从后台重定向(redirect)到另一个项目的方法
  4. MIMIC 以太坊医疗项目开发(2) 前端H5介绍
  5. HTML引入第三方类库项目需要授权解决方案
  6. duilib中界面的布局方式
  7. 汇编语言:实验7寻址方式在结构化数据访问中的应用
  8. java异步线程池同时请求多个接口数据
  9. “滴血验癌”?昔日“女乔布斯”被控诈骗!身价估值从290亿元直降为0!或面临20年刑期...
  10. 开源android手写批注,浅析各阅读平台手写批注 智器阅读显身手
  11. Linux线程同步读写锁 rwlock
  12. java day10【接口、多态】
  13. FindBoost 查找Boost的inlude目录和库
  14. 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_4-2.微服务下登录检验解决方案 JWT讲解...
  15. 算法与数据结构 第2章 排序基础 下 插入排序
  16. html导航栏下拉菜单怎么做,css制作导航栏下拉菜单及问题
  17. IE浏览器下载excel文件时不弹出下载保存提示框的解决方法
  18. buu crypto 变异凯撒
  19. 如何更优雅的对接第三方API
  20. 3dAPI的一些介绍

热门文章

  1. 阿里CEO逍遥子,为什么要去做客服?
  2. Linux下Java程序不识别宋体
  3. u盘在电脑读不出来,但别的可以读,别的u盘在我电脑又可以识别
  4. java发送ipmsg,[导入]用Java向IPMSG发送消息(转)
  5. sklearn学习(逻辑回归)
  6. 转:国内网址导航的现状和未来
  7. HDMI中继器,HDMI延长器支持更远音视频信号的传输
  8. 人脸识别(cv2,face_recognition)
  9. css网页技术的网页交互方法
  10. 关于RC移相电路的知识点