lotus-farcaster 搭建

发布时间:2024年01月06日

安装

# cat /etc/issue
Ubuntu 20.04.6 LTS \n \l
git clone https://github.com/s0nik42/lotus-farcaster.git
cd lotus-farcaster/lotus-exporter-farcaster/

修改配置文件

cp config.toml.example config.toml
miner_api = "miner_api"
markets_api = "miner_api"
daemon_api = "lotus_api"
boost_api = ""
boost_graphql = "http://127.0.0.1:8080/graphql/query"
markets_type = "boost"
boostd auth api-info --perm admin

监听钱包地址

cp addresses.toml.example addresses.toml

指定安装目录

  • 创建安装目录
mkdir /backup/lotus-exporter-farcaster

可以修改脚本指定miner配置文件路径

elif [ ! -f "$IUSER_HOME/.lotusminer/config.toml" ]

执行安装脚本

./install.sh -c /backup/lotus-exporter-farcaster root
  • 报错,端口被占用
* connect to 127.0.0.1 port 9100 failed: Connection refused
* Failed to connect to localhost port 9100: Connection refused

修改

  • 端口9100 已经被yb-tserver占用
journalctl -fu prometheus-node-exporter.service
cat /lib/systemd/system/prometheus-node-exporter.service

修改端口为9200

cat /etc/default/prometheus-node-exporter | grep "web.listen-address"
#  --web.listen-address=":9100"
ARGS=--web.listen-address=":9200"

修改安装脚本 9100改为9200,重新安装

# cat install.sh | grep 9200
TRACELOG=$(curl -vs -o - http://localhost:9200/metrics 2>&1)
verify "curl -vs -o - http://localhost:9200/metrics"

安装超时可以使用代理安装

pip3 install py-multibase gql

修改检查脚本 端口 9200,重新安装

cat check.sh | grep 9200
r=$(curl -s -o - http://localhost:9200/metrics |wc -l 2>/dev/null)
    echo -e "$KO cannot connect to prometheus-node-exporter (cannot access to http://localhost:9200/metrics)"
    r=$(curl -s -o - http://localhost:9200/metrics |grep "lotus_info")
# ./install.sh -c /backup/lotus-exporter-farcaster root

安装成功

在这里插入图片描述

prometheus 安装

wget https://github.com/prometheus/prometheus/releases/download/v2.45.2/prometheus-2.45.2.linux-amd64.tar.gz
tar -zxvf prometheus-2.45.2.linux-amd64.tar.gz
mv prometheus-2.45.2.linux-amd64 prometheus
cd prometheus/

创建存储目录

mkdir /backup/prometheus/data
cat /lib/systemd/system/prometheus.service
[Unit]
Description=prometheus service

[Service]
User=root
ExecStart=/backup/prometheus/prometheus \
	--config.file=/backup/prometheus/prometheus.yml \
	--storage.tsdb.path=/backup/prometheus/data \
	--web.enable-lifecycle \
    --storage.tsdb.retention.time=365d

TimeoutStopSec=10
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable prometheus.service
systemctl start prometheus.service
systemctl status prometheus.service
curl localhost:9090/metrics

配置文件添加 prometheus-node-exporter

  - job_name: 'node'
    static_configs:
      - targets: ['localhost:9200']
systemctl restart prometheus.service

热加载配置文件

curl -X POST http://localhost:9090/-/reload

grafana

apt-get install -y adduser libfontconfig1 musl
wget https://dl.grafana.com/enterprise/release/grafana-enterprise_10.2.3_amd64.deb
dpkg -i grafana-enterprise_10.2.3_amd64.deb
systemctl daemon-reload
systemctl enable grafana-server
systemctl start grafana-server
systemctl status grafana-server

在这里插入图片描述

参考

  1. github lotus-farcaster
  2. INSTALLATION : Lotus Farcaster
  3. Install lotus-exporter-farcaster - Standalone
文章来源:https://blog.csdn.net/u010953692/article/details/135422048
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。