Skip to content

Commit

Permalink
修改orderer的配置文件。
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadigan committed Jul 13, 2018
1 parent 83c1334 commit 3cef3f1
Show file tree
Hide file tree
Showing 72 changed files with 93 additions and 28 deletions.
71 changes: 68 additions & 3 deletions deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,80 @@ mv ./bin/* /root/go/bin/
```

## ca-server配置
这一节的操作都在ca服务器上完成

caserver的管理员账户密码在fangtu/config/docker-compose-caserver.yaml中指定了,请在第一次启动caserver的容器之前进行修改。否则只能通过ca-client进行修改。默认的caserver的管理员账户为==admin== ,密码为 ==caserver==。
### 启动ca服务

启动ca-server容器,在/root/workspaces/下执行操作
将我们需要的配置文件拷出来

```
docker-compose -f ./fangtu/config/docker-compose-caserver.yaml up -d
root@fabric-60-21:~/workspaces# cp -r ./fangtu/ca-server ./
```

caserver的管理员账户密码在./ca-server/docker-compose-caserver.yaml中指定了,请在第一次启动caserver的容器之前进行修改。否则只能通过ca-client进行修改。默认的caserver的管理员账户为==admin== ,密码为 ==caserver==。

启动ca-server容器,在```/root/workspaces/ca-server/```下执行操作

```
root@fabric-60-21:~/workspaces/ca-server# docker-compose -f docker-compose-caserver.yaml up -d
```

如果报错,请删除之前启动的名为fabric-ca-server的容器

启动成功之后 ```/root/workspaces/ca-server/fabric-ca-server/```下就是caserver的配置文件以及数据库以及msp。

利用我们ca服务默认管理员账户admin和密码caserver生成admin账户的凭证

```
root@fabric-60-21:~/workspaces/ca-server# fabric-ca-client enroll -u http://admin:[email protected]:7054 -H ./fabric-ca-server/admin
```
### 删除默认的组织结构
下面的命令中的-H参数代表我们连接ca服务所使用的用户

可以看到初始时联盟组织结构如下:

```
root@fabric-60-21:~/workspaces/ca-server# fabric-ca-client -H ./fabric-ca-server/admin affiliation list
affiliation: .
affiliation: org2
affiliation: org2.department1
affiliation: org1
affiliation: org1.department1
affiliation: org1.department2
```

我们现在要删除这些组织结构,然后创建我们自己的组织

```
root@fabric-60-21:~/workspaces/ca-server# fabric-ca-client -H ./fabric-ca-server/admin affiliation remove --force org1
```
```
root@fabric-60-21:~/workspaces/ca-server# fabric-ca-client -H ./fabric-ca-server/admin affiliation remove --force org2
```
### 创建自己的组织
创建自己的组织

```
root@fabric-60-21:~/workspaces/ca-server# fabric-ca-client -H ./fabric-ca-server/admin affiliation add com
```
```
root@fabric-60-21:~/workspaces/ca-server# fabric-ca-client -H ./fabric-ca-server/admin affiliation add com.mederahealth
```
```
root@fabric-60-21:~/workspaces/ca-server# fabric-ca-client -H ./fabric-ca-server/admin affiliation add com.mederahealth.yiyuan
```
```
root@fabric-60-21:~/workspaces/ca-server# fabric-ca-client -H ./fabric-ca-server/admin affiliation add com.mederahealth.shaoyifu
```
现在的组织结构如下

```
root@fabric-60-21:~/workspaces/ca-server# fabric-ca-client -H ./fabric-ca-server/admin affiliation list
affiliation: com
affiliation: com.mederahealth
affiliation: com.mederahealth.shaoyifu
affiliation: com.mederahealth.yiyuan
```



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ version: '2'

services:

orderer.example.com:
container_name: orderer.example.com
orderer.mederahealth.com:
container_name: orderer.mederahealth.com
image: hyperledger/fabric-orderer:x86_64-1.1.0
environment:
- ORDERER_GENERAL_LOGLEVEL=INFO
Expand All @@ -28,7 +28,7 @@ services:
- ../channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ../crypto-config/orderer.example.com/msp:/var/hyperledger/orderer/msp
- ../crypto-config/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
- orderer.example.com:/var/hyperledger/production/orderer
- orderer.mederahealth.com:/var/hyperledger/production/orderer
ports:
- 7050:7050

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions orderer.mederahealth.com/docker-compose-Orderer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '2'

volumes:
orderer.mederahealth.com:

networks:
fangtu:


services:

orderer.example.com:
extends:
file: base/docker-compose-base.yaml
service: orderer.mederahealth.com
container_name: orderer.mederahealth.com
networks:
- fangtu
extra_hosts:
- "orderer.mederahealth.com:10.214.50.115"
- "peer0.org1.mederahealth.com:10.214.50.115"
- "peer1.org1.mederahealth.com:10.214.50.68"
22 changes: 0 additions & 22 deletions orderer/docker-compose-Orderer.yaml

This file was deleted.

0 comments on commit 3cef3f1

Please sign in to comment.