快捷搜索:  汽车  科技

chain生态链(架构开发环境准备)

chain生态链(架构开发环境准备)打开对应的 MSI 文件进行安装tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz 将 /usr/local/go/bin 目录添加至 PATH 环境变量,并设置 GOPATH 环境变量export PATH=$PATH:/usr/local/go/bin export GOPATH=~/gopath Windows 安装操作系统包名Windowsgo1.9.2.windows-amd64.msiLinuxgo1.9.2.linux-amd64.tar.gzMacgo1.9.2.darwin-amd64.tar.gzLinux/Mac 安装以 Linux 为例

开发环境准备
  • 开发环境准备
  • 1 开发环境安装
  • 1.1 Go 环境安装
  • Linux/Mac 安装
  • Windows 安装
  • 1.2 Git 环境安装
  • 在 Linux 上安装
  • 在 Windows 上安装
  • 在 Mac 上安装
  • 1.3 IDE 安装
  • LiteIDE
  • VSCode
  • GoLand
  • 2 代码下载
  • 3 环境配置
  • 3.1 本地环境配置
  • 3.2 测试链配置
  • 3.3 主链配置
  • 3.4 平行链配置
  • 3.4.1 配置文件
  • 3.4.2 chain33链环境
  • 3.4.3 运行主链/平行链节点
  • 3.4.4 cli命令演示
  • 4 使用Docker单机部署4节点
  • 4.1 Docker安装
  • 4.2 安装docker-compose
  • 4.3 下载chain33程序
  • 4.4 配置Dockerfile
  • 4.5 配置docker-compose.yml文件
  • 4.6 编写启动脚本docker-compose.sh
  • 4.7 启动环境
  • 4.8 检查container启动情况
  • 4.9 环境检查

1 开发环境安装

1.1 Go 环境安装

Go 语言安装包下载地址: https://golang.google.cn/dl/

推荐安装版本为1.9.2,各种操作系统对应的包名:

操作系统包名Windowsgo1.9.2.windows-amd64.msiLinuxgo1.9.2.linux-amd64.tar.gzMacgo1.9.2.darwin-amd64.tar.gz

Linux/Mac 安装

以 Linux 为例

  • 下载二进制包:go1.9.2.linux-amd64.tar.gz
  • 将下载的二进制包解压至 /usr/local 目录

tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz

  • 将 /usr/local/go/bin 目录添加至 PATH 环境变量,并设置 GOPATH 环境变量

export PATH=$PATH:/usr/local/go/bin export GOPATH=~/gopath

Windows 安装

打开对应的 MSI 文件进行安装

默认安装在 c:\Go 目录,将 c:\Go\bin 目录添加至 PATH 环境变量

同时设置 GOPATH 环境变量,如 D:\gopath

1.2 Git 环境安装

安装 Git 最新版本,目前是 2.19.1

在 Linux 上安装

使用 Linux 发行版包含的基础软件包管理工具来安装

基于 Fedora 的发行版使用 yum

sudo yum install git

基于 Debian 的发行版使用 apt-get

sudo apt-get install git

在 Windows 上安装

打开 Git 官方下载地址 http://git-scm.com/download/win,下载会自动开始,下载完再手动安装

在 Mac 上安装

打开 Git 官方下载地址 http://git-scm.com/download/mac,下载并安装

1.3 IDE 安装

LiteIDE

LiteIDE 是一款开源、跨平台的轻量级 Go 语言集成开发环境

安装包下载地址:https://sourceforge.net/projects/liteide/files

根据操作系统选择相应的安装包,解压即可完成安装

VSCode

VSCode 是一款开源、跨平台的轻量级代码编辑器,集成 Go 语言开发插件

安装包下载地址:https://code.visualstudio.com/Download

根据操作系统选择相应的安装包进行安装

安装 Go 语言插件

在 VSCode 界面中,使用快捷键 Ctrl Shift x 打开扩展命令面板,输入 go 进行搜索,然后选择 “Go for Visual Studio Code” 插件进行安装

打开菜单项 文件->首选项->设置,打开 settins.json 文件修改用户设置,可以设置 Go 常用的配置

{ "go.goroot": "D:\\Go" "go.gopath": "D:\\gopath" }

GoLand

GoLand 是由 JetBrains 公司旨在为 Go 开发者提供的一个符合人体工程学的商业 IDE,是收费软件

官网下载地址:https://www.jetbrains.com/go/

2 代码下载

使用 Git 命令下载代码到本地,以 Linux 为例

mkdir -p $GOPATH/src/github.com/33cn git clone https://github.com/33cn/chain33.git $GOPATH/src/github.com/33cn/ git clone https://github.com/33cn/plugin.git $GOPATH/src/github.com/33cn/

可以切换到主干分支

cd $GOPATH/src/github.com/33cn/plugin git checkout master

3 环境配置

Chain33 运行环境由其配置文件定制,可以参考代码中的配置文件 cmd/chain33/chain33.toml,下面列举常用的环境配置

3.1 本地环境配置

本地环境指 Chain33 运行在本地私有网络里 ,仅用于本地测试

下面介绍搭建一个私有的 Chain33 区块链网络

chain生态链(架构开发环境准备)(1)

首先修改配置文件,3个节点的配置文件相同,这里仅说明与 cmd/chain33/chain33.toml 不同的地方

# 本节点接入本地私有网络 Title="local" [p2p] # 本地私有网络中的节点信息 seeds=["10.0.2.11:13802" "10.0.2.12:13802" "10.0.2.13:13802"] # 是否将系统内置的节点加入seeds列表 innerSeedEnable=false # 是否将官方github上的节点加入seeds列表 useGithub=false [consensus] # 创世地址修改为私有地址 genesis="1CbEVT9RnM5oZhWMj4fxUrJX94VtRotzvs" # 仅保留这一项,其他全部删除 [[consensus.sub.ticket.genesis]] minerAddr="1CbEVT9RnM5oZhWMj4fxUrJX94VtRotzvs" returnAddr="1CbEVT9RnM5oZhWMj4fxUrJX94VtRotzvs"

然后在三个节点上启动 Chain33

nohup ./chain33 -f chain33.toml &> console.out&

3.2 测试链配置

测试链指 BTY 测试网络,区块交易查询网址:https://testnet.bityuan.com

配置文件为 cmd/chain33/chain33.toml

Title="chain33" # 接入测试链 TestNet=true

3.3 主链配置

主链指 BTY 公有网络,区块交易查询网址:https://mainnet.bityuan.com

配置文件为 cmd/chain33/bityuan.toml

# 接入主链 Title="bityuan"

3.4 平行链配置

3.4.1 配置文件

平行链依附于主链,平行链节点需要连接主链节点,其中主链节点上 isRecordBlockSequence 配置项需要设置

下面是主链节点的配置,仅说明与 cmd/chain33/bityuan.toml 不同的地方

[blockchain] # 是否存储 block sequence isRecordBlockSequence=true

下面是平行链节点的配置,仅说明与 cmd/chain33/bityuan.toml 不同的地方

# 平行链名字,只能修改 fzmtest 所在的位置 Title="user.p.fzmtest." [blockchain] dbPath="paradatadir" # 是否为平行链 isParaChain=true [p2p] # 关闭P2P模块 enable=false # 重写共识模块配置 [consensus] name="para" minerstart=false # 此处IP改成实际的地址 ParaRemoteGrpcClient = "localhost:8802" # 指定从主链某高度的区块开始同步,如果部署多个平行链节点,两份配置文件中的高度一定要保持一致。 # 建议配置,可以配成比当前主链高度略小,通过区块链浏览器查看当前主网高度 # https://mainnet.bityuan.com/all/index # 比如当前是284110 这边配置可以配成 284100 不建议配差别很大,这样会产生很多无意义的空区块 startHeight=0 # 打包时间间隔,单位秒 writeBlockSeconds=2 # 主链每隔几个没有相关交易的区块,平行链上打包空区块 emptyBlockInterval=50 # 等待平行链共识消息在主链上链并成功的块数,超出会重发共识消息,最小是2 waitBlocks4CommitMsg=2 genesis="14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"

3.4.2 chain33链环境

  • 搭建最简易的平行链需要两个节点(可以起多个VM),例如节点A(IP: 192.168.0.104)和节点B(IP: 192.168.0.159),节点A是主链节点,作用是链接主链网络和平行链节点。节点B是平行链节点,用于从节点A请求主网中的区块,并将属于本平行链的交易取出,在平行链上打包并执行。
  • 节点A和节点B用到的端口是8801,8802,8901,8902,13802,保证这些端口能被正常访问
  • 主链节点(节点A):8801,8802,13802端口
  • 8801: jsonRpc服务端口
  • 8802: grpc服务端口
  • 13802: 节点与节点之间P2P服务端口
  • 平行链节点(节点B):8901, 8902端口
  • 8901: jsonRpc服务端口
  • 8902: grpc服务端口

chain生态链(架构开发环境准备)(2)

3.4.3 运行主链/平行链节点


运行主链节点

步骤一:下载编译好的主链程序,并解压到主链A节点目录下

步骤二:启动进程命令

nohup ./chain33 -f chain33.bty.toml >> bty.out&

步骤三:检查同步情况

root@ubuntu055-1:/home/lcj1# ./chain33-cli net is_sync true

步骤四:查看主链网络信息

root@ubuntu055-3:/home/lcj0# ./chain33-cli net peer_info { "peers": [ { "addr": "192.168.0.104" "port": 13802 "name": "02df13954f1f8732295a02b552673b04aeea04eb3843a621f4c90f64efc05896ea" "mempoolSize": 0 "self": true "header": { "version": 0 "parentHash": "0x5ec3c1f9bb1f7c5fc213f83266266723fa40d11eacd9164a92dec225cd95d440" "txHash": "0xc73f1f2c809257d0222b16198c6d85d74e25d6d9ab72a2c99e88922f234d6a00" "stateHash": "0x6d29c939e6c1002ce06c3c32ded6cead08dd4cd67218ede45b4936e10d8ac84d" "height": 643 "blockTime": 1542163168 "txCount": 1 "hash": "0xd035c763d267d9070fa2e4d921dc03150897ed7c977d0abc34ae1c2768ab039a" "difficulty": 0 } } ] }


运行平行链节点

步骤一:下载编译好的平行链程序,并解压到平行链B节点目录下 修改配置文件

修改chain33.para.toml, 只修改以下两项:

mainnetJrpcAddr修改成实际的主链节点A的IP地址,此配置作用是,当app往平行链发送交易的时候。 平行链会向主链节点A的8801端口转发这笔交易

mainnetJrpcAddr=http://192.168.0.104:8801

ParaRemoteGrpcClient修改成实际的主链节点A的IP地址,此配置作用是,平行链会向主链节点A的8802端口请求区块

ParaRemoteGrpcClient = “192.168.0.1:8802”

步骤二:启动进程命令

nohup ./chain33 -f chain33.para.toml >> para.out&

步骤三:检查同步情况

./chain33-cli net is_sync true

3.4.4 cli命令演示

  • 可以使用chain33的cli调试命令来操作相关接口,快速入门

Available Commands: account Account management block Get block header or body info bty Construct BTY transactions close Close chain33 coins Construct system coins transactions config Configuration evm EVM contracts operation exec Executor operation help Help about any command mempool Mempool management net Net operation privacy Privacy transaction management relay Cross chain relay management retrieve Wallet retrieve operation seed Seed management send Send transaction in one move stat Coin statistic ticket Ticket management token Token management trade Token trade management tx Transaction management version Get node version wallet Wallet management

  • 限于篇幅这里只演示部分命令
  • 创建钱包,种子一定要保存,请勿泄露给他人
  • step1:创建种子

root@ubuntu055-3:/home/lcj0# ./chain33-cli seed generate -l 0 { "seed": "page patch story blouse ill sense despair mail praise prosper session among offer cheese wood" }


step2:保存种子,创建钱包时-p后面是钱包对应的密码


root@ubuntu055-3:/home/lcj0# ./chain33-cli seed save -p 33 -s "page patch story blouse ill sense despair mail praise prosper session among offer cheese wood" { "isOK": true "msg": "" }


  • 查看钱包状态

root@ubuntu055-3:/home/lcj0# ./chain33-cli wallet status { "isWalletLock": false "isAutoMining": false "isHasSeed": true "isTicketLock": true }

  • 解锁钱包,—p后面的密码为上面创建钱包时设置的密码

root@ubuntu055-3:/home/lcj0# ./chain33-cli wallet unlock -p 33 { "isOK": true "msg": "" }

  • 创建账户地址,其中-l后面是标签label

root@ubuntu055-3:/home/lcj0# ./chain33-cli account create -l test { "acc": { "balance": "0.0000" "frozen": "0.0000" "addr": "1HEuPSPCk9ZvyBzsp5e9y5nvySs2Qxijek" } "label": "test" }

  • 地址余额查询,其中-a 查询地址 -e 执行器合约,下面是查看coins合约的余额命令

root@ubuntu055-3:/home/lcj0# ./chain33-cli account balance -a 15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM -e coins { "balance": "500.0590" "frozen": "0.0000" "addr": "15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM" }

  • 钱包私钥的导出,-a 钱包中账户地址

root@ubuntu055-3:/home/lcj0# ./chain33-cli account dump_key -a 15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM { "data": "0x1d265f4dbb202b4fc5e24ffdc96852a6e0834dbee7eb4eebd476b171f7cb0baa" }


  • 钱包私钥导入,-k 地址对应的私钥 -l 账户标签

root@ubuntu055-3:/home/lcj0# ./chain33-cli account import_key -k 0x1d265f4dbb202b4fc5e24ffdc96852a6e0834dbee7eb4eebd476b171f7cb0baa -l test222 { "acc": { "balance": "500.0590" "frozen": "0.0000" "addr": "15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM" } "label": "test222" }

  • bty send_exec 构建指定地址向指定执行器转账的交易

step1:构造交易,-t “转币目的账户”,-a “转账amount”,-n “note记录”,返回一串需要签名的hash

root@ubuntu055-3:/home/lcj0# ./chain33-cli bty transfer -t 1HEuPSPCk9ZvyBzsp5e9y5nvySs2Qxijek -n "bty transfer to " -a 1 0a05636f696e73123f18010a3b1080c2d72f1a10627479207472616e7366657220746f20222231484575505350436b395a7679427a737035653979356e76795373325178696a656b20a08d0630b6bde8c09df69dfb523a2231484575505350436b395a7679427a737035653979356e76795373325178696a656b

step2:签名交易,-a “签名账户-转入方” -d “未签名交易的字符串” -a “签名地址”/-k “签名私钥” -e “超时时间(默认为120秒)”,返回一串已签名但是需要发送到链上的hash

root@ubuntu055-3:/home/lcj0# ./chain33-cli wallet sign -a 15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM -d 0a05636f696e73123f18010a3b1080c2d72f1a10627479207472616e7366657220746f20222231484575505350436b395a7679427a737035653979356e76795373325178696a656b20a08d0630b6bde8c09df69dfb523a2231484575505350436b395a7679427a737035653979356e76795373325178696a656b 0a05636f696e73123f18010a3b1080c2d72f1a10627479207472616e7366657220746f20222231484575505350436b395a7679427a737035653979356e76795373325178696a656b1a6d08011221024e8bcbc6bc079df8f12de07cfd5ea002c425b665c86da19257af8d35ac0c55631a4630440220567a97dde98ee4ea6afb6bd96ed212976f632dbba82286d9fcd33c4b38f4d2e702206b012ed3b0d60cf518d33d632ab07f5fbbbae7a9559416d7e523e67ed865c39a20a08d06288eaa85df0530b6bde8c09df69dfb523a2231484575505350436b395a7679427a737035653979356e76795373325178696a656b


step3:发送交易,-d “签名完返回的hash串”

root@ubuntu055-3:/home/lcj0# ./chain33-cli wallet send -d 0a05636f696e73123f18010a3b1080c2d72f1a10627479207472616e7366657220746f20222231484575505350436b395a7679427a737035653979356e76795373325178696a656b1a6d08011221024e8bcbc6bc079df8f12de07cfd5ea002c425b665c86da19257af8d35ac0c55631a4630440220567a97dde98ee4ea6afb6bd96ed212976f632dbba82286d9fcd33c4b38f4d2e702206b012ed3b0d60cf518d33d632ab07f5fbbbae7a9559416d7e523e67ed865c39a20a08d06288eaa85df0530b6bde8c09df69dfb523a2231484575505350436b395a7679427a737035653979356e76795373325178696a656b 0x87484aaa79e7116783ebda48ff86a1f54386835908eb2c03a942b552a46132fe

step4:根据交易hash查询具体的交易信息

root@ubuntu055-3:/home/lcj0# ./chain33-cli tx query -s 0x87484aaa79e7116783ebda48ff86a1f54386835908eb2c03a942b552a46132fe { "tx": { "execer": "coins" "payload": { "Value": { "Transfer": { "amount": 100000000 "note": "bty transfer to " "to": "1HEuPSPCk9ZvyBzsp5e9y5nvySs2Qxijek" } } "ty": 1 } "rawpayload": "0x18010a3b1080c2d72f1a10627479207472616e7366657220746f20222231484575505350436b395a7679427a737035653979356e76795373325178696a656b" "signature": { "ty": 1 "pubkey": "0x024e8bcbc6bc079df8f12de07cfd5ea002c425b665c86da19257af8d35ac0c5563" "signature": "0x30440220567a97dde98ee4ea6afb6bd96ed212976f632dbba82286d9fcd33c4b38f4d2e702206b012ed3b0d60cf518d33d632ab07f5fbbbae7a9559416d7e523e67ed865c39a" } "fee": "0.0010" "expire": 1541494030 "nonce": 5978097161099419318 "to": "1HEuPSPCk9ZvyBzsp5e9y5nvySs2Qxijek" "from": "15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM" } "receipt": { "ty": 2 "tyname": "ExecOk" "logs": [ { "ty": 2 "tyname": "LogFee" "log": { "prev": { "currency": 0 "balance": "50005900000" "frozen": "0" "addr": "15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM" } "current": { "currency": 0 "balance": "50005800000" "frozen": "0" "addr": "15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM" } } "rawlog": "0x0a2b10e0f5d5a4ba01222231356e6e3444327070556a38746d794866646d38673445767471704259555337444d122b10c0e8cfa4ba01222231356e6e3444327070556a38746d794866646d38673445767471704259555337444d" } { "ty": 3 "tyname": "LogTransfer" "log": { "prev": { "currency": 0 "balance": "50005800000" "frozen": "0" "addr": "15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM" } "current": { "currency": 0 "balance": "49905800000" "frozen": "0" "addr": "15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM" } } "rawlog": "0x0a2b10c0e8cfa4ba01222231356e6e3444327070556a38746d794866646d38673445767471704259555337444d122b10c0a6f8f4b901222231356e6e3444327070556a38746d794866646d38673445767471704259555337444d" } { "ty": 3 "tyname": "LogTransfer" "log": { "prev": { "currency": 0 "balance": "0" "frozen": "0" "addr": "1HEuPSPCk9ZvyBzsp5e9y5nvySs2Qxijek" } "current": { "currency": 0 "balance": "100000000" "frozen": "0" "addr": "1HEuPSPCk9ZvyBzsp5e9y5nvySs2Qxijek" } } "rawlog": "0x0a24222231484575505350436b395a7679427a737035653979356e76795373325178696a656b12291080c2d72f222231484575505350436b395a7679427a737035653979356e76795373325178696a656b" } ] } "height": 4751 "index": 0 "blocktime": 1541493930 "amount": "1.0000" "fromaddr": "15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM" "actionname": "transfer" }

4 使用Docker单机部署4节点

以下操作基于ubuntu16.04

4.1 Docker安装

curl -fsSL https://get.docker.com/ | sh

版本验证:

docker -v Docker version 17.11.0-ce build 1caf76c

4.2 安装docker-compose

curl -L https://get.daocloud.io/docker/compose/releases/download/1.21.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod x /usr/local/bin/docker-compose

4.3 下载chain33程序

wget https://github.com/33cn/plugin/releases/download/6.0.0/chain33_6.0.0_linux.tar.gz tar -zxvf chain33_6.0.0_linux.tar.gz

4.4 配置Dockerfile

FROM ubuntu:16.04 WORKDIR /root COPY chain33 chain33 COPY chain33-cli chain33-cli COPY chain33.toml ./ CMD ["/root/chain33" "-f" "/root/chain33.toml"]

4.5 配置docker-compose.yml文件

version: '3' services: chain33: build: context: . chain32: build: context: . chain31: build: context: . chain30: build: context: .

4.6 编写启动脚本docker-compose.sh

#!/usr/bin/env bash set -e set -o pipefail # os: ubuntu16.04 x64 PWD=$(cd "$(dirname "$0")" && pwd) export PATH="$PWD:$PATH" NODE3="${1}_chain33_1" CLI="docker exec ${NODE3} /root/chain33-cli" NODE2="${1}_chain32_1" NODE1="${1}_chain31_1" NODE4="${1}_chain30_1" containers=("${NODE1}" "${NODE2}" "${NODE3}" "${NODE4}") sedfix="" if [ "$(uname)" == "Darwin" ]; then sedfix=".bak" fi function init() { # update test environment sed -i $sedfix 's/^Title.*/Title="local"/g' chain33.toml sed -i $sedfix 's/^TestNet=.*/#TestNet=true/g' chain33.toml sed -i $sedfix 's/^FixTime=.*/#FixTime=false/g' chain33.toml # p2p sed -i $sedfix 's/^seeds=.*/seeds=["chain33:13802" "chain32:13802" "chain31:13802" "chain30:13802"]/g' chain33.toml sed -i $sedfix '0 /^enable=.*/s//enable=true/' chain33.toml sed -i $sedfix 's/^isSeed=.*/isSeed=true/g' chain33.toml sed -i $sedfix 's/^innerSeedEnable=.*/innerSeedEnable=false/g' chain33.toml sed -i $sedfix 's/^useGithub=.*/useGithub=false/g' chain33.toml # rpc sed -i $sedfix 's/^jrpcBindAddr=.*/jrpcBindAddr="0.0.0.0:8801"/g' chain33.toml sed -i $sedfix 's/^grpcBindAddr=.*/grpcBindAddr="0.0.0.0:8802"/g' chain33.toml sed -i $sedfix 's/^whitelist=.*/whitelist=["localhost" "127.0.0.1" "0.0.0.0"]/g' chain33.toml # consensus sed -i $sedfix 's/^name="ticket"/name="solo"/g' chain33.toml sed -i $sedfix '/^minerstart=true/a[consensus.sub.solo]' chain33.toml sed -i $sedfix 's/^genesis=.*/genesis="1CbEVT9RnM5oZhWMj4fxUrJX94VtRotzvs"/g' chain33.toml } function start() { # docker-compose ps docker-compose ps # remove exsit container docker-compose down # create and run docker-compose container docker-compose -f docker-compose.yml up --build -d local SLEEP=10 echo "=========== sleep ${SLEEP}s =============" sleep ${SLEEP} docker-compose ps } function main() { echo "================main begin======================" init start echo "================main end========================" } # run script main

文件目录结构如下:

root@ubuntu054:/data/solo# ls chain33 chain33-cli chain33.toml docker-compose.sh docker-compose.yml Dockerfile

4.7 启动环境

执行

./docker-compose.sh

4.8 检查container启动情况

root@ubuntu054:/data/solo# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3484b6eb112d solo_chain32 "/root/chain33 -f /r…" 14 minutes ago Up 14 minutes solo_chain32_1 1c3cda51d636 solo_chain31 "/root/chain33 -f /r…" 14 minutes ago Up 14 minutes solo_chain31_1 0616f1a12413 solo_chain33 "/root/chain33 -f /r…" 14 minutes ago Up 14 minutes solo_chain33_1 bb5bd85e38b7 solo_chain30 "/root/chain33 -f /r…" 14 minutes ago Up 14 minutes solo_chain30_1

4.9 环境检查

查看同步状态

root@ubuntu054:/data/solo# docker exec solo_chain32_1 /root/chain33-cli net is_sync true

查看peer-info

root@ubuntu054:/data/solo# docker exec solo_chain32_1 /root/chain33-cli net peer_info { "peers": [ { "addr": "172.19.0.4" "port": 13802 "name": "02204102b9dd74a14f71a151a4626038f60e2fe3f23b3fcdc865913d594d74b579" "mempoolSize": 0 "self": false "header": { "version": 0 "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" "txHash": "0x22db70a26130f2fe4758fd65bf016949c1c46f5642b4a556f8a0ff7a41350898" "stateHash": "0xeb240fe1248028e9c7271ae2838ea3970bb880031764c8154c8bce2d16262cb7" "height": 0 "blockTime": 1514533394 "txCount": 1 "hash": "0xc8799befacd9709a5f4dfa68d6fd53a37ccce83352997a132adfed7f46747757" "difficulty": 0 } } { "addr": "172.19.0.3" "port": 13802 "name": "0284e9e17e200cf7d5dd2ff6c81dbf6ef0ccf85418db494c654dfb6de9b863457c" "mempoolSize": 0 "self": false "header": { "version": 0 "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" "txHash": "0x22db70a26130f2fe4758fd65bf016949c1c46f5642b4a556f8a0ff7a41350898" "stateHash": "0xeb240fe1248028e9c7271ae2838ea3970bb880031764c8154c8bce2d16262cb7" "height": 0 "blockTime": 1514533394 "txCount": 1 "hash": "0xc8799befacd9709a5f4dfa68d6fd53a37ccce83352997a132adfed7f46747757" "difficulty": 0 } } { "addr": "172.19.0.2" "port": 13802 "name": "02493c1f49dc139e38cd4180b231e0305b12506b0c5831032da9e0ac4e90996ee3" "mempoolSize": 0 "self": false "header": { "version": 0 "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" "txHash": "0x22db70a26130f2fe4758fd65bf016949c1c46f5642b4a556f8a0ff7a41350898" "stateHash": "0xeb240fe1248028e9c7271ae2838ea3970bb880031764c8154c8bce2d16262cb7" "height": 0 "blockTime": 1514533394 "txCount": 1 "hash": "0xc8799befacd9709a5f4dfa68d6fd53a37ccce83352997a132adfed7f46747757" "difficulty": 0 } } { "addr": "172.19.0.5" "port": 13802 "name": "033571c89f018e0c7acb410d4589ee3a6876162ded94b398eee61ba0f42a1a78ea" "mempoolSize": 0 "self": true "header": { "version": 0 "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" "txHash": "0x22db70a26130f2fe4758fd65bf016949c1c46f5642b4a556f8a0ff7a41350898" "stateHash": "0xeb240fe1248028e9c7271ae2838ea3970bb880031764c8154c8bce2d16262cb7" "height": 0 "blockTime": 1514533394 "txCount": 1 "hash": "0xc8799befacd9709a5f4dfa68d6fd53a37ccce83352997a132adfed7f46747757" "difficulty": 0 } } ] }

猜您喜欢: