安装运行Bottos

区别:单节点一般用于在本地启动单个节点进行合约开发和测试等工作,并不与其他节点相连接,一般保留默认配置即可。多节点则是连接到Bottos主网或者测试网络。也可用于自己组成一个小的私有网络来使用。一般需要做一些基本的配置

启动单节点

  • 进入GOPATH所在目录
cd  ~/go/src/github.com/
  • 下载项目并解压
wget https://github.com/bottos-project/bottos/releases/download/tag_bottos3.2/bottos.tar.gz
tar zxvf bottos
cd bottos
  • 启动Bottos单节点
./bottos --delegate=bottos
  • --delegate:指定区块生产者的Account

如果返回如下信息说明节点启动成功

CommitBlock by p2p: lib: 1
InsertBlock: number:1, delegate:bottos, trxn:0, time=1537948299, hash: 566fb29ab982c128bf6c71297bc4e7d558e0f86ae89a7f3955ea46b04689fb5a, prevHash=caf2bae84f70412354211dd5028142eca6901b06b9a65dfbe9df065bcf56e291
CommitBlock by p2p: lib: 2
InsertBlock: number:2, delegate:bottos, trxn:0, time=1537948302, hash: 8abe6aef22249ab58d6c7cd3970f909571c4e818f3757d9de7d86870bfc7465b, prevHash=566fb29ab982c128bf6c71297bc4e7d558e0f86ae89a7f3955ea46b04689fb5a

连接到测试网络

将上述启动的单节点连接到Bottos测试网络。需要做如下配置。

修改config-testnet.toml文件

  • P2PServAddr:修改成当前节点的外网IP
P2PServAddr = "192.168.1.1"   // 修改成当前节点的外网IP

然后运行如下命令即可将当前节点连接到测试网络

:如果项目目录下有datadir缓存目录,我们首先需要运行如下命令删除缓存

rm -rf datadir

启动节点,连接到测试网络

./bottos --config="./config-testnet.toml" --genesis="./genesis-testnet.toml"

等一会儿如果出现大量如下打印信息,说明在自动同步区块.已经成功连接到了测试网络

CommitBlock by p2p: lib: 1
InsertBlock: number:1, delegate:bottos, trxn:0, time=1537888767, hash: 03f6c7aa72314be76902b6c2d4b86b7afbb07d2b4b4dec67caf6fc51e125e9ed, prevHash=98128aa21d634eda9cb0152314b06480d4c51b0bf18ea6d39f5189388e1bf4ee
CommitBlock by p2p: lib: 2
InsertBlock: number:2, delegate:bottos, trxn:0, time=1537888770, hash: c87a1c59aaa87f890169a1016931b3a9e539e72e475c0861623ed36fbd00c1b4, prevHash=03f6c7aa72314be76902b6c2d4b86b7afbb07d2b4b4dec67caf6fc51e125e9ed
CommitBlock by p2p: lib: 3
InsertBlock: number:3, delegate:bottos, trxn:0, time=1537888773, hash: 3bcf9ecf116891b226b2c6b31578d5f1ee867a75b667752286eeaf3d237e684b, prevHash=c87a1c59aaa87f890169a1016931b3a9e539e72e475c0861623ed36fbd00c1b4
CommitBlock by p2p: lib: 4

results matching ""

    No results matching ""