1. 打开官方文档
https://docs.bnbchain.org/docs/validator/fullnode
2. 创建文件夹
sudo su
mkdir bsc && cd bsc
mkdir download
mkdir node
3. 下载bsc客户端可执行程序
cd bsc/download
wget $(curl -s https://api.github.com/repos/bnb-chain/bsc/releases/latest |grep browser_ |grep geth_linux |cut -d\" -f4)
chmod o+x geth_linux
4. 下载解压配置文件
cd bsc/download
wget $(curl -s https://api.github.com/repos/bnb-chain/bsc/releases/latest |grep browser_ |grep mainnet |cut -d\" -f4)
unzip mainnet.zip
5. 下载解压snapshot数据文件
官方文档:https://github.com/bnb-chain/bsc-snapshots
sudo amazon-linux-extras install epel
sudo yum install aria2
cd bsc/download
aria2c -o geth.tar.lz4 -s14 -x14 -k100M "https://download.bsc-snapshot.workers.dev/geth-20221008.tar.lz4" -o geth.tar.lz4
nohup tar -I lz4 -xvf geth.tar.lz4 &
6. 制作full node
cd bsc
mv download/server/data-seed/geth node/
mv download/config.toml .
mv download/genesis.json .
mv download/geth_linux .
7. 启动fullnode
./geth_linux --config ./config.toml --datadir ./node --diffsync --cache 8000 --rpc.allow-unprotected-txs --txlookuplimit 0
查看运行日志:
tail -20 bsc/node/bsc.log
8. 查看运行状态
启动以后会产生bsc/node/geth.ipc文件
./geth_linux attach node/geth.ipc
> eth.syncing
9. 查看运行进程,关闭进程
ps -aux | grep geth
关闭bsc
kill 进程id