# StaFiHub设置指南 **Published by:** [shiyunfang](https://paragraph.com/@shiyunfang/) **Published on:** 2022-08-05 **URL:** https://paragraph.com/@shiyunfang/stafihub ## Content 系统要求:注意:我认为您应该通过在下面进行咕噜声和索引设置将其安装在免费服务器上 Stafihub tesnet - 2 位与会者首先删除了他们的文件: sudo systemctl stop stafihubd && \ sudo systemctl disable stafihubd && \ rm /etc/systemd/system/stafihubd.service && \ sudo systemctl daemon-reload && \ cd $HOME && \ rm -rf .stafihub stafihub && \ rm -rf $(which stafihubd) 开始了: 我们进入根目录: cd /root 我们正在进行系统更新: sudo apt update && sudo apt upgrade -y 我们正在安装库: sudo apt install make clang pkg-config libssl-dev build-essential git jq ncdu bsdmainutils -y < "/dev/null" 我们正在安装 Go: cd $HOME wget -O go1.18.2.linux-amd64.tar.gz https://go.dev/dl/go1.18.2.linux-amd64.tar.gz rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.2.linux-amd64.tar.gz && rm go1.18.2.linux-amd64.tar.gz echo 'export GOROOT=/usr/local/go' >> $HOME/.bashrc echo 'export GOPATH=$HOME/go' >> $HOME/.bashrc echo 'export GO111MODULE=on' >> $HOME/.bashrc echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bashrc && . $HOME/.bashrc go version 我们克隆 Stafi 的 github 文件 git clone --branch public-testnet-v3 https://github.com/stafihub/stafihub 设置: cd $HOME/stafihub && make install 初始化我的进程,在nodename中输入你的名字 stafihubd init NodeName --chain-id stafihub-public-testnet-3 我们下载 Genesis 文件: wget -O $HOME/.stafihub/config/genesis.json "https://raw.githubusercontent.com/stafihub/network/main/testnets/stafihub-public-testnet-3/genesis.json" 我们为节点进行必要的配置: sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.01ufis\"/" $HOME/.stafihub/config/app.toml sed -i '/\[grpc\]/{:a;n;/enabled/s/false/true/;Ta};/\[api\]/{:a;n;/enable/s/false/true/;Ta;}' $HOME/.stafihub/config/app.toml PEERS="6e9d988bf9812b02c46dcec474591bd10f81916f@45.94.58.160:26656,06c57407aea673fca396b01581a2d92957d48c4a@149.102.143.60:26656,5a6d8e1904c88c9f72d35df63b15d14504aaf030@164.92.159.170:26656,5e88d0d6866cd2f386e885de6eb0a1e3bd4f45c5@38.242.237.130:26656,1eaff7a3defa35de2b29f28d4729317d783f606c@149.102.139.101:26656,724430a2cf42b94f5da6b24d4741c7418fefa24e@194.60.201.153:26656,aae1ac9ef12897d7dc8755240cbdc41ee1171a55@38.242.215.200:26656" sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.stafihub/config/config.toml 我们打开修剪。(减少磁盘使用 - 增加 cpu 和 ram 使用)(个人偏好) pruning="custom" pruning_keep_recent="100" pruning_keep_every="0" pruning_interval="50" sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.stafihub/config/app.toml sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.stafihub/config/app.toml sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.stafihub/config/app.toml sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.stafihub/config/app.toml 关闭索引器(减少磁盘使用)(个人喜好) indexer="null" sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.stafihub/config/config.toml 我们创建一个服务文件并启动我们的节点 echo "[Unit] Description=StaFiHub Node After=network.target [Service] User=$USER Type=simple ExecStart=$(which stafihubd) start Restart=on-failure LimitNOFILE=65535 [Install] WantedBy=multi-user.target" > $HOME/stafihubd.service sudo mv $HOME/stafihubd.service /etc/systemd/system sudo tee <<EOF >/dev/null /etc/systemd/journald.conf Storage=persistent EOF sudo systemctl restart systemd-journald sudo systemctl daemon-reload sudo systemctl enable stafihubd sudo systemctl restart stafihubd 创建一个钱包。在 walletName 字段中,输入您自己的钱包名称: stafihubd keys add walletName 如果您之前加入过,请恢复: stafihubd keys add walletName --recover 处理钱包后的水龙头:https ://discord.gg/tz6USZWX 注意:peer 列表是最新的,我们在 2 台服务器上尝试过,最多需要 10-15 分钟,即使您无法匹配,请留出一些时间。 匹配命令,当你输入这个命令时,它应该在底部写上false,例如: stafihubd status 2>&1 | jq .SyncInfo 它目前是真的: 当它匹配时:你会得到这样的输出。 创建验证器: stafihubd tx staking create-validator \ --moniker="NodeName" \ --amount=48885000ufis \ --gas auto \ --fees=5000ufis \ --pubkey=$(stafihubd tendermint show-validator) \ --chain-id=stafihub-public-testnet-3 \ --commission-max-change-rate=0.01 \ --commission-max-rate=0.20 \ --commission-rate=0.10 \ --min-self-delegation=1 \ --from=WalletName \ --yes 创建完成后,会出现这样的输出,复制 tx 哈希并在资源管理器中搜索,它应该说成功。 ## Publication Information - [shiyunfang](https://paragraph.com/@shiyunfang/): Publication homepage - [All Posts](https://paragraph.com/@shiyunfang/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@shiyunfang): Subscribe to updates