BSC全节点搭建实录,附详细攻略

服务器选择:

使用的是AWS的i3en.2xlarge

8核64G 2X2.2TB NVME

最好还是使用NVME本地硬盘,否则同步区块真的很慢。

系统:centos 8.0

1.安装wget和git

yum install wget
yum install git

2.安装最新版本的go 最新下载地址

wget https://golang.org/dl/go1.17.3.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.3.linux-amd64.tar.gz

3.设置

将中间的语句插入到文件末尾,之后使文件生效

vim /etc/profile
export PATH=$PATH:/usr/local/go/bin
source /etc/profile

使用go version确认安装正确

4.安装BSC版本的geth

有可能需要提前安装gcc

git clone https://github.com/binance-chain/bsc
cd bsc
make geth

配置路径

export PATH=$PATH:/root/bsc/build/bin

使用geth version确认安装正确

5.配置创世区块

wget https://github.com/binance-chain/bsc/releases/download/v1.1.3/mainnet.zip
unzip mainnet.zip
geth --datadir node init genesis.json

6.下载BSC 快照

GitHub - bnb-chain/bsc-snapshotsContribute to bnb-chain/bsc-snapshots development by creating an account on GitHub.https://github.com/bnb-chain/bsc-snapshots大概700G左右 解压完成800G 注意保证足够的硬盘空间 (2021年11月数据)

nohup wget -O geth.tar.gz -t -c "https://tf-dex-prod-public-snapshot-site3.s3.amazonaws.com/geth-20211110.tar.gz?AWSAccessKeyId=AKIAYINE6SBQPUZDDRRO&Signature=DgVUCkFC0rjURF2FeuMj8m5MG%2Bc%3D&Expires=1639174249" &

下载完成后解压 并移动chaindata 和 triecache 到./bsc/node/geth/ 文件夹下

mkdir kz
nohup tar zxvf geth.tar.gz -C /root/kz &
mv /root/kz/server/data-seed/geth/chaindata /root/bsc/node/geth
mv /root/kz/server/data-seed/geth/triecache /root/bsc/node/geth

7.启动节点

nohup geth  --config /root/bsc/config.toml --datadir /root/bsc/node  --cache 48000 --rpc.allow-unprotected-txs --txlookuplimit 0 --diffsync &

最后可以根据机器配置修改config.toml文件,增加节点来加快同步速度

猜你喜欢

转载自blog.csdn.net/miluir/article/details/129883027