# 加密狗整编空投第138篇:Celestia全节点安装教程 - 加密狗 - Medium **Published by:** [nishishui](https://paragraph.com/@nishishui/) **Published on:** 2023-04-11 **URL:** https://paragraph.com/@nishishui/138-celestia-medium ## Content Celestia是由Binance Labs 和 Interchain Foundation领投5650 万美的第一个模块化的区块链系统,旨在让任何人都能以最小的开销轻松部署自己的区块链,为其提供方便、轻松构建的所有工具。Celestia 也没有智能合约功能,可以随着节点数量的增加而扩展,同时保持高度的去中心化和安全性。 往期教程: 节点挖矿教程: 以下教程基于 Ubuntu Linux 20.04 (LTS) x64。 有关更多信息,可以在此处访问有关 Celestia完整节点的官方文档。 目录 1、硬件要求 2、配置环境 3、安装 Celestia 节点 4、同步快照(可选) 5、SystemD 服务 6、SystemD 命令 7、节点信息 8、官方链接 一、硬件要求 建议运行完整节点的硬件最低要求如下: 内存:8 GB 内存 中央处理器:四核 磁盘:250 GB SSD 存储 带宽:下载 1 Gbps/上传 100 Mbps 二、配置环境 1、更新系统 sudo apt update && sudo apt upgrade –y 2、安装 dependencies sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential git make ncdu -y 3、安装 Golang ver= "1.19.1" cd $HOME wget "https://golang.org/dl/go $ver .linux-amd64.tar.gz" sudo rm -rf /usr/local/go sudo tar -C /usr /local -xzf "go $ver .linux-amd64.tar.gz" rm "go $ver .linux-amd64.tar.gz" 将 /usr/local/go/bin 目录添加到 $PATH: echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile source $HOME/.bash_profile 检查是否正确安装了Golang版本: go version 三、安装 Celestia 节点 通过执行以下命令安装带有 Mocha 测试网版本 (v0.11.0) 的 celestia-node 文件: 1、安装 Celestia 应用程序 cd $HOME rm -rf celestia-app git clone https://github.com/celestiaorg/celestia-app.git cd celestia-app/ APP_VERSION=v0.11.0 git checkout tags/$APP_VERSION -b $APP_VERSION make install 验证文件是否正常工作,并使用以下命令检查版本: celestia-appd --help 2、设置 P2P 网络 cd $HOME rm -rf networks git clone https://github.com/celestiaorg/networks.git 3、配置并启动应用程序 初始化网络,选择一个描述节点的“节点名称” celestia-appd init "full-cumulo" --chain-id mocha 4、下载genesis cp $HOME /networks/mocha/genesis.json $HOME /.celestia-app/config 5、设置seeds 和 peers Peers PERSISTENT_PEERS=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/mocha/peers.txt | tr -d '\n' ) echo $PERSISTENT_PEERS sed -i.bak -e "s/ ^persistent_peers *=.*/persistent_peers = \" $PERSISTENT_PEERS \"/" $HOME /.celestia-app/config/config.toml 在这里可以找到更多Peers: 6、配置pruning PRUNING= "custom" PRUNING_KEEP_RECENT= "100" PRUNING_INTERVAL= "10" sed -i -e "s/^pruning *=.*/pruning = \" $PRUNING \"/" $HOME /.celestia-app/config/ app.toml sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \ \" $ PRUNING_KEEP_RECENT \"/" $HOME /.celestia-app/config/app.toml sed -i -e "s/^pruning-interval *=.*/pruning-interval = \ \ " $PRUNING_INTERVAL \"/" $HOME /.celestia-app/config/app.toml 7、清理旧数据 celestia-appd tendermint unsafe-reset-all --home $HOME /.celestia-app 四、同步快照(可选) 可以通过下载最近的快照,来快速同步 Celestia 全节点: cd $HOME rm -rf ~/.celestia-app/data mkdir -p ~/.celestia-app/data SNAP_NAME=$(curl -s https://snaps.qubelabs.io/celestia/ | \ egrep -o " >mocha.*tar" | tr -d ">" ) wget -O - https://snaps.qubelabs.io/celestia/ ${SNAP_NAME} | tar xf - \ -C ~/.celestia-app/data/ 为 RPC 端点配置 可以将全节点配置为公共 RPC 端点,并监听来自数据可用性节点的任何连接,以便在此处为数据可用性 API 的请求提供服务。 EXTERNAL_ADDRESS=$(wget -qO- eth0.me) sed -i.bak -e "s/^external-address = \"\"/external-address = \"$EXTERNAL_ADDRESS:26656\"/" $HOME/.celestia-app/config/config.toml sed -i 's#"tcp://127.0.0.1:26657"#"tcp://127.0.0.1:26657"#g' ~/.celestia-app/config/config.toml 五、SystemD 服务 1、创建服务文件 sudo tee <<EOF >/dev/null /etc/systemd/system/celestia-appd.service [Unit] Description=celestia-appd Cosmos daemon After=network-online.target [Service] User=$USER ExecStart=$HOME /go/bin/celestia-appd start Restart=on-failure RestartSec=3 LimitNOFILE=4096 [Install] WantedBy=multi-user.target EOF 2、启用服务并检查日志 sudo systemctl daemon-reload sudo systemctl enable celestia-appd sudo systemctl restart celestia-appd sudo journalctl -u celestia-appd -f 六、SystemD 命令 1、停止服务 sudo systemctl stop celestia-appd 2、启动服务 sudo systemctl start celestia - appd 3、重启服务 sudo systemctl restart celestia-appd 4、检查日志 sudo journalctl -u celestia-appd -f 5、检查状态 sudo systemctl status celestia-appd 七、节点信息 1、同步信息 celestia-appd status 2>&1 | jq .SyncInfo 使用false,节点将指示它已同步: 2、节点信息 celestia-appd status 2>&1 | jq .NodeInfo 3、获取peers echo $(celestia-appd tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.celestia-appd/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//') 八、官方链接 网站 Celestia: https: //celestia.org/ 推特:https : //twitter.com/CelestiaOrg GitHub : https://github.com/celestiaorg/ 电报: https: //t.me/CelestiaCommunity 红迪网: https: //www.reddit.com/r/CelestiaNetwork/ 博客: https: //blog.celestia.org/ YouTube:https://www.youtube.com/channel/UCLlvAEzXBFZ-P3zS6BF2Bjg 论坛: https: //forum.celestia.org/ 以上就是今天全部内容,更多信息请注意: 加密狗推特:https://twitter.com/JiamigouCn 电报:https://t.me/JIAMIGOU002 ## Publication Information - [nishishui](https://paragraph.com/@nishishui/): Publication homepage - [All Posts](https://paragraph.com/@nishishui/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@nishishui): Subscribe to updates