RPM安装 Bee v1.0.0-rc1 🐝

官方:下载地址

安装很简单找到对应你系统的软件包,使用wget下载即可。

wget https://github.com/ethersphere/bee/releases/download/v1.0.0-rc1/bee_1.0.0-rc1_amd64.rpm

如系统提示没有wget,按照系统提示显示输入命令比如yum install wget

接下来安装

rpm -i bee_1.0.0-rc1_amd64.rpm

可以看到以下输出消息

Bee requires an Ethereum endpoint to function. By default is using ws://localhost:8546 ethereum endpoint.
If needed obtain a free Infura account and set:

It is recommended to use external signer with bee.
Check documentation for more info:
- SWAP https://docs.ethswarm.org/docs/installation/manual#swap-bandwidth-incentives
- External signer https://docs.ethswarm.org/docs/installation/bee-clef

After you finish configuration run 'sudo bee-get-addr'.

我们首先确实/usr/lib/systemd/system/bee.service里面写的启动服务是否正确。

cat vim /usr/lib/systemd/system/bee.service

显示内容

[Unit]
Description=Bee - Ethereum Swarm node
Documentation=https://docs.ethswarm.org
After=network.target

[Service]
EnvironmentFile=-/etc/default/bee
NoNewPrivileges=true
User=bee
Group=bee
ExecStart=/usr/bin/bee start --config /etc/bee/bee.yaml
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

找到启动命令使用的配置文件/etc/bee/bee.yaml

修改配置文件内容,比如不使用clef,就把对应的clef-signer-enable改成false,修改swap-endpoint

## Bee configuration - https://gateway.ethswarm.org/bzz/docs.swarm.eth/docs/installation/configuration/

## HTTP API listen address (default ":1633")
# api-addr: :1633
## chain block time (default 15)
# block-time: 15
## initial nodes to connect to (default [/dnsaddr/bootnode.ethswarm.org])
# bootnode: [/dnsaddr/bootnode.ethswarm.org]
## cause the node to always accept incoming connections
# bootnode-mode: false
## enable clef signer
clef-signer-enable: false
## clef signer endpoint
#clef-signer-endpoint: /var/lib/bee-clef/clef.ipc
## config file (default is /home/<user>/.bee.yaml)
config: /etc/bee/bee.yaml
## origins with CORS headers enabled
# cors-allowed-origins: []
## data directory (default "/home/<user>/.bee")
data-dir: /var/lib/bee
## cache capacity in chunks, multiply by 4096 to get approximate capacity in bytes
# cache-capacity: 1000000
## number of open files allowed by database
# db-open-files-limit: 200
## size of block cache of the database in bytes
# db-block-cache-capacity: 33554432
## size of the database write buffer in bytes
# db-write-buffer-size: 33554432
## disables db compactions triggered by seeks
# db-disable-seeks-compaction: false
## debug HTTP API listen address (default ":1635")
debug-api-addr: 127.0.0.1:1635
## enable debug HTTP API
debug-api-enable: true
## disable a set of sensitive features in the api
# gateway-mode: false
## enable global pinning
# global-pinning-enable: false
## cause the node to start in full mode
full-node: true
## NAT exposed address
# nat-addr: ""
## ID of the Swarm network (default 1)
# network-id: 1
## P2P listen address (default ":1634")
# p2p-addr: :1634
## enable P2P QUIC protocol
# p2p-quic-enable: false
## enable P2P WebSocket transport
# p2p-ws-enable: false
## password for decrypting keys
# password: ""
## path to a file that contains password for decrypting keys
password-file: /var/lib/bee/password
## amount in BZZ below the peers payment threshold when we initiate settlement (default 1000000000000)
# payment-early: 1000000000000
## threshold in BZZ where you expect to get paid from your peers (default 10000000000000)
# payment-threshold: 10000000000000
## excess debt above payment threshold in BZZ where you disconnect from your peer (default 10000000000000)
# payment-tolerance: 10000000000000
## postage stamp contract address
# postage-stamp-address: ""
## ENS compatible API endpoint for a TLD and with contract address, can be repeated, format [tld:][[email protected]]url
# resolver-options: []
## whether we want the node to start with no listen addresses for p2p
# standalone: false
## enable swap (default true)
# swap-enable: true
## swap ethereum blockchain endpoint (default "ws://localhost:8546")
swap-endpoint: wss://rpc.xdaichain.com/wss
## swap factory address
# swap-factory-address: ""
## legacy swap factory addresses
# swap-legacy-factory-addresses: ""
## initial deposit if deploying a new chequebook (default 10000000000000000)
swap-initial-deposit: 10000000000000000
## gas price in wei to use for deployment and funding (default "")
# swap-deployment-gas-price: ""
## enable tracing
# tracing-enable: false
## endpoint to send tracing data (default "127.0.0.1:6831")
# tracing-endpoint: 127.0.0.1:6831
## service name identifier for tracing (default "bee")
# tracing-service-name: bee
## proof-of-identity transaction hash
# transaction: ""
## log verbosity level 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=trace (default "info")
# verbosity: info
## send a welcome message string during handshakes
# welcome-message: ""

接下来先测试是否可以正常启动swarm

bee start --config /etc/bee/bee.yaml

如果正常启动没有提示错误,可以ctrl+c停止,然后使用服务自启动

  • 重新加载配置命令
systemctl daemon-reload
  • 使bee服务生效命令
systemctl enable bee
  • 启动bee命令
systemctl start bee
  • 显示状态命令
systemctl status bee
  • 查看日志命令
 journalctl -f -u bee.service
rpm的常用命令

使用rpm查询bee的安装包

rpm -qa | grep bee

显出如下信息

bee-1.0.0~rc1-1.x86_64

接下来查此版本的bee安装路径

rpm -ql bee-1.0.0~rc1-1.x86_64

显示如下:

/etc/bee/bee.yaml
/etc/default/bee
/lib/systemd/system/bee.service
/usr/bin/bee
/usr/bin/bee-get-addr
/usr/bin/bee-slim

其它指令我们可以使用help查询,比如想卸载,可以看到-e是卸载

 -e, --erase=<package>+           erase (uninstall) package

使用rpm -e bee-1.0.0~rc1-1.x86_64即可卸载bee

升级也是同样

 -U, --upgrade=<packagefile>+     upgrade package(s)

使用rpm -U bee-1.0.0~rc1-1.x86_64即可升级bee

结尾讲一下自启动服务,比如我们想再启动一个新的bee,使用配置文件bee1.yaml,可以新建bee1.service

vim /usr/lib/systemd/system/bee1.service

复制下面代码即可

[Unit]
Description=Bee - Ethereum Swarm node
Documentation=https://docs.ethswarm.org
After=network.target
StartLimitIntervalSec=0

[Service]
EnvironmentFile=-/etc/default/bee
NoNewPrivileges=true
User=bee
Group=bee
LimitNOFILE=65536
ExecStart=/usr/bin/bee start --config /etc/bee/bee1.yaml
Restart=always
RestartSec=5s
User=root

[Install]
WantedBy=multi-user.target

然后重新加载配置文件systemctl daemon-reload,使服务生效systemctl enable bee1再启动systemctl start bee1


作者赞赏码:
点赞

Copyright © OneZos all right reserved,powered by Gitbook本书发布时间: 2021-06-29 09:56:51

results matching ""

    No results matching ""