0x01 一键安装脚本
#!/bin/sh
RunPath= ~/tools/miner/swarm
mkdir -p $RunPath /bee
mkdir -p $RunPath /bee-clef
mkdir -p $RunPath /exportSwarmKey
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
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
sudo bee-get-addr > ./beeAddress.txt
wget -O $RunPath /cashout.sh https://gist.githubusercontent.com/ralph-pichler/3b5ccd7a5c5cd0500e6428752b37e975/raw/7ba05095e0836735f4a648aefe52c584e18e065f/cashout.sh
chmod +x $RunPath /cashout.sh
sudo bee-clef-keys
sudo mv ~/bee* $RunPath /
#!/bin/sh
RunPath= ~/tools/miner/swarm
mkdir -p $RunPath /bee
mkdir -p $RunPath /bee-clef
mkdir -p $RunPath /exportSwarmKey
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
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
sudo bee-get-addr > ./beeAddress.txt
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
wget -O $RunPath /cashout.sh https://gist.githubusercontent.com/ralph-pichler/3b5ccd7a5c5cd0500e6428752b37e975/raw/7ba05095e0836735f4a648aefe52c584e18e065f/cashout.sh
chmod +x $RunPath /cashout.sh
0x02 一些基础操作整理
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
curl -XPOST http://localhost:1635/chequebook/cashout/d7881307e793e389642ea733451db368c4c9b9e23f188cca659c8674d183a56b
curl http://localhost:1635/chequebook/cashout/d7881307e793e389642ea733451db368c4c9b9e23f188cca659c8674d183a56b | jq
curl -XPOST http://localhost:1635/chequebook/withdraw\?amount\= 1000 | jq
curl -XPOST http://localhost:1635/chequebook/deposit\?amount\= 1000 | jq
curl -s http://localhost:1635/chequebook/cheque | jq '.lastcheques[]' | grep "peer" | sed -e 's/\"peer\": \"//g' | sed -e 's/\",//g'
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 '.'
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