From 337ffbda67d95200acd325ba87d1423f8f5abdfa Mon Sep 17 00:00:00 2001 From: bxq2011hust Date: Fri, 18 Aug 2017 12:51:48 +0800 Subject: [PATCH] update README --- docker/README.md | 16 ++++++++-------- docker/scripts/genConfig.sh | 9 ++++----- docker/scripts/install-docker.sh | 0 docker/scripts/start_bcos_docker.sh | 0 4 files changed, 12 insertions(+), 13 deletions(-) mode change 100644 => 100755 docker/scripts/genConfig.sh mode change 100644 => 100755 docker/scripts/install-docker.sh mode change 100644 => 100755 docker/scripts/start_bcos_docker.sh diff --git a/docker/README.md b/docker/README.md index afce533efd..ca4fadfa15 100644 --- a/docker/README.md +++ b/docker/README.md @@ -8,7 +8,7 @@ - [2. 多节点网络](#2-多节点网络) - [2.1 配置系统合约](#21-配置系统合约) - [2.2 生成新节点配置文件](#22-生成新节点配置文件) - - [2.3 新加节点入网](#23-新加节点入网) + - [2.3 新节点入网](#23-新节点入网) - [2.4 查看网络状态](#24-查看网络状态) @@ -20,7 +20,7 @@ ### 1.1 生成配置文件与启动容器 ```bash -$ cd bcos/docker && chmod +x scripts/genConfig.sh && chmod +x scripts/start_bcos_docker.sh +$ cd bcos/docker # 产生配置文件位于文件夹node-0 $ ./scripts/genConfig.sh # 启动容器 @@ -75,14 +75,15 @@ $ cd bcos/docker $ ./scripts/genConfig.sh 1 node-0 ``` -### 2.3 新加节点入网 +### 2.3 新节点入网 ```bash $ cd bcos/systemcontractv2 -# 新加节点信息写入合约 +# 新加节点node-1信息写入合约 $ babel-node tool.js NodeAction registerNode ../docker/node-1/node.json -# 启动新加入节点,参数为新节点配置文件完整路径 -$ ../docker/scripts/start_bcos_docker.sh $PWD/node-1 + +# 启动新加入节点node-1,参数为新节点配置文件完整路径 +$ ../docker/scripts/start_bcos_docker.sh $PWD/../docker/node-1 # 要加入更多节点只需要重复步骤2.2-2.3,启动新节点时参数改为新节点配置文件路径即可 ``` @@ -114,5 +115,4 @@ Host:172.17.0.1:53301 [Docker-Install]:https://docs.docker.com/engine/installation/ [official mirror]:https://docs.docker.com/registry/recipes/mirror/#configure-the-docker-daemon [docker-accelerate]:https://yq.aliyun.com/articles/29941?spm=5176.100239.blogcont7695.18.jyYdbj -[bcos-manual]:https://github.com/bcosorg/bcos/blob/master/doc/manual/manual.md -[bcos-docker]:https://hub.docker.com/r/bcosorg/bcos/ \ No newline at end of file +[bcos-docker]:https://hub.docker.com/r/bcosorg/bcos/ diff --git a/docker/scripts/genConfig.sh b/docker/scripts/genConfig.sh old mode 100644 new mode 100755 index 4ec1f415da..732ea9772b --- a/docker/scripts/genConfig.sh +++ b/docker/scripts/genConfig.sh @@ -30,11 +30,6 @@ genConfig() return -1 fi - port=${idx} - if [ ${idx} -lt 10 ]; then - port=`printf "%02d" ${idx}` - fi - output=$PWD/node-${idx} while ([ ${idx} -gt 0 ] && [ -d ${output} ]); do @@ -44,6 +39,10 @@ genConfig() if [ ! -d ${output} ]; then mkdir ${output} fi + port=${idx} + if [ ${idx} -lt 10 ]; then + port=`printf "%02d" ${idx}` + fi echo "------generate node-${idx}------" if ! id -nG $(whoami)|grep -qw "docker"; then SUDO='sudo'; else SUDO=''; fi $SUDO docker run -it --rm -v $output:/nodedata ${dockerImage} bcoseth --gennetworkrlp /nodedata/network.rlp diff --git a/docker/scripts/install-docker.sh b/docker/scripts/install-docker.sh old mode 100644 new mode 100755 diff --git a/docker/scripts/start_bcos_docker.sh b/docker/scripts/start_bcos_docker.sh old mode 100644 new mode 100755