Skip to content

Commit 3e38fb3

Browse files
committed
fix bug
1 parent cb37df2 commit 3e38fb3

11 files changed

+1861
-5
lines changed

doc/1.2.Fabric-CA1.0模块的搭建与使用.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,11 @@ Shell> cd ../fabric-ca-server
2424
Shell> go install #编译fabric-ca-client
2525
```
2626

27-
28-
29-
30-
3127
# 三、Fabric-CA的部署
3228

3329

3430

3531

36-
3732
# 四、Fabric-CA模块的基本操作
3833

3934

@@ -60,6 +55,26 @@ Shell> fabric-ca-client enroll -u http://epoint:*******@localhost:7054 #登陆
6055

6156
登陆成功后会发现在配置文件位置会有一个`MSP`文件夹,该文件夹中就是存放着登陆身份对应的身份管理信息
6257

58+
- 注册一个普通用户
59+
60+
```bash
61+
Shell> fabric-ca-client register --id.name city1user1 --id.type user --id.affiliation city1.peer0 --id.attrs 'hf.Revoker=true,foo=bar' -u http://epoint:epoint@localhost:7054 --id.secret epoint
62+
Shell> fabric-ca-client register --id.name city2user1 --id.type user --id.affiliation city2.peer0 --id.attrs 'hf.Revoker=true,foo=bar' -u http://epoint:epoint@localhost:7054 --id.secret epoint
63+
```
64+
65+
66+
67+
- 注册一个peer节点证书
68+
69+
```bash
70+
Shell> fabric-ca-client register --id.name city1peer0 --id.type peer --id.affiliation city1.peer0 --id.secret city1peer0
71+
Shell> fabric-ca-client register --id.name city2peer0 --id.type peer --id.affiliation city2.peer0 --id.secret city2peer0
72+
73+
```
74+
75+
76+
77+
6378

6479

6580

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash -
2+
#===============================================================================
3+
#
4+
# FILE: create_channel.sh
5+
#
6+
# USAGE: ./create_channel.sh
7+
#
8+
# DESCRIPTION: 实现向已有超级账本中创建一个通道用来进行账本的同步
9+
#
10+
# OPTIONS: ---
11+
# REQUIREMENTS: ---
12+
# BUGS: ---
13+
# NOTES: ---
14+
# AUTHOR: YOUR NAME (),
15+
# ORGANIZATION:
16+
# CREATED: 03/22/2018 16:14
17+
# REVISION: ---
18+
#===============================================================================
19+
20+
set -o nounset # Treat unset variables as an error
21+
22+
export CHANNELNAME=epointchannel
23+
export CORE_PEER_LOCALMSPID=city1MSP
24+
export CORE_PEER_MSPCONFIGPATH=/root/epoint-hyperledger/crypto-config/peerOrganizations/city1.epoint.com.cn/users/Admin@city1.epoint.com.cn/msp
25+
26+
27+
28+
peer channel create -o order1.epoint.com.cn:7050 -c ${CHANNELNAME} -f ./epointchannel.tx
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash -
2+
#===============================================================================
3+
#
4+
# FILE: peer0city1.epoint.com.cn_env.sh
5+
#
6+
# USAGE: ./peer0city1.epoint.com.cn_env.sh
7+
#
8+
# DESCRIPTION:
9+
#
10+
# OPTIONS: ---
11+
# REQUIREMENTS: ---
12+
# BUGS: ---
13+
# NOTES: ---
14+
# AUTHOR: YOUR NAME (),
15+
# ORGANIZATION:
16+
# CREATED: 03/22/2018 17:15
17+
# REVISION: ---
18+
#===============================================================================
19+
20+
set -o nounset # Treat unset variables as an error
21+
22+
23+
export CHANNELNAME=epointchannel
24+
export FABRIC_CFG_PATH=/root/epoint-hyperledger
25+
26+
27+
28+
export CORE_PEER_LOCALMSPID=city1MSP
29+
export CORE_PEER_ADDRESS=peer0.city1.epoint.com.cn:7051
30+
export CORE_PEER_MSPCONFIGPATH=/root/epoint-hyperledger/crypto-config/peerOrganizations/city1.epoint.com.cn/users/Admin@city1.epoint.com.cn/msp
31+
peer channel update -o order1.epoint.com.cn:7050 -c ${CHANNELNAME} -f ../city1.tx
32+
33+
34+
export CORE_PEER_LOCALMSPID=city2MSP
35+
export CORE_PEER_ADDRESS=peer0.city2.epoint.com.cn:7051
36+
export CORE_PEER_MSPCONFIGPATH=/root/epoint-hyperledger/crypto-config/peerOrganizations/city2.epoint.com.cn/users/Admin@city2.epoint.com.cn/msp
37+
peer channel update -o order1.epoint.com.cn:7050 -c ${CHANNELNAME} -f ../city2.tx
38+
39+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash -
2+
#===============================================================================
3+
#
4+
# FILE: peer0city1.epoint.com.cn_env.sh
5+
#
6+
# USAGE: ./peer0city1.epoint.com.cn_env.sh
7+
#
8+
# DESCRIPTION:
9+
#
10+
# OPTIONS: ---
11+
# REQUIREMENTS: ---
12+
# BUGS: ---
13+
# NOTES: ---
14+
# AUTHOR: YOUR NAME (),
15+
# ORGANIZATION:
16+
# CREATED: 03/22/2018 17:15
17+
# REVISION: ---
18+
#===============================================================================
19+
20+
set -o nounset # Treat unset variables as an error
21+
22+
23+
export CHANNELNAME=epointchannel
24+
export CORE_PEER_LOCALMSPID=city1MSP
25+
export FABRIC_CFG_PATH=/root/epoint-hyperledger
26+
27+
28+
29+
30+
export CORE_PEER_ADDRESS=peer0.city1.epoint.com.cn:7051
31+
export CORE_PEER_MSPCONFIGPATH=/root/epoint-hyperledger/crypto-config/peerOrganizations/city1.epoint.com.cn/users/Admin@city1.epoint.com.cn/msp
32+
peer channel join -b ../epointchannel.block
33+
34+
35+
36+
export CORE_PEER_ADDRESS=peer1.city1.epoint.com.cn:7051
37+
export CORE_PEER_MSPCONFIGPATH=/root/epoint-hyperledger/crypto-config/peerOrganizations/city1.epoint.com.cn/users/Admin@city1.epoint.com.cn/msp
38+
peer channel join -b ../epointchannel.block
39+
40+
41+
42+
export CORE_PEER_LOCALMSPID=city2MSP
43+
export CORE_PEER_ADDRESS=peer0.city2.epoint.com.cn:7051
44+
export CORE_PEER_MSPCONFIGPATH=/root/epoint-hyperledger/crypto-config/peerOrganizations/city2.epoint.com.cn/users/Admin@city2.epoint.com.cn/msp
45+
peer channel join -b ../epointchannel.block
46+
47+
48+
49+
export CORE_PEER_LOCALMSPID=city2MSP
50+
export CORE_PEER_ADDRESS=peer1.city2.epoint.com.cn:7051
51+
export CORE_PEER_MSPCONFIGPATH=/root/epoint-hyperledger/crypto-config/peerOrganizations/city2.epoint.com.cn/users/Admin@city2.epoint.com.cn/msp
52+
peer channel join -b ../epointchannel.block
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Copyright IBM Corp. All Rights Reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
---
7+
################################################################################
8+
#
9+
# Profile
10+
#
11+
# - Different configuration profiles may be encoded here to be specified
12+
# as parameters to the configtxgen tool
13+
#
14+
################################################################################
15+
Profiles:
16+
17+
TwoOrgsOrdererGenesis:
18+
Orderer:
19+
<<: *OrdererDefaults
20+
Organizations:
21+
- *OrdererOrg
22+
Consortiums:
23+
SampleConsortium:
24+
Organizations:
25+
- *Org1
26+
- *Org2
27+
TwoOrgsChannel:
28+
Consortium: SampleConsortium
29+
Application:
30+
<<: *ApplicationDefaults
31+
Organizations:
32+
- *Org1
33+
- *Org2
34+
35+
################################################################################
36+
#
37+
# Section: Organizations
38+
#
39+
# - This section defines the different organizational identities which will
40+
# be referenced later in the configuration.
41+
#
42+
################################################################################
43+
Organizations:
44+
45+
# SampleOrg defines an MSP using the sampleconfig. It should never be used
46+
# in production but may be used as a template for other definitions
47+
- &OrdererOrg
48+
# DefaultOrg defines the organization which is used in the sampleconfig
49+
# of the fabric.git development environment
50+
Name: OrdererOrg
51+
52+
# ID to load the MSP definition as
53+
ID: OrdererMSP
54+
55+
# MSPDir is the filesystem path which contains the MSP configuration
56+
MSPDir: crypto-config/ordererOrganizations/epoint.com.cn/msp
57+
58+
- &Org1
59+
# DefaultOrg defines the organization which is used in the sampleconfig
60+
# of the fabric.git development environment
61+
Name: city1
62+
63+
# ID to load the MSP definition as
64+
ID: city1MSP
65+
66+
MSPDir: crypto-config/peerOrganizations/city1.epoint.com.cn/msp
67+
68+
AnchorPeers:
69+
# AnchorPeers defines the location of peers which can be used
70+
# for cross org gossip communication. Note, this value is only
71+
# encoded in the genesis block in the Application section context
72+
- Host: peer0.city1.epoint.com.cn
73+
Port: 7051
74+
75+
- &Org2
76+
# DefaultOrg defines the organization which is used in the sampleconfig
77+
# of the fabric.git development environment
78+
Name: city2
79+
80+
# ID to load the MSP definition as
81+
ID: city2MSP
82+
83+
MSPDir: crypto-config/peerOrganizations/city2.epoint.com.cn/msp
84+
85+
AnchorPeers:
86+
# AnchorPeers defines the location of peers which can be used
87+
# for cross org gossip communication. Note, this value is only
88+
# encoded in the genesis block in the Application section context
89+
- Host: peer0.city2.epoint.com.cn
90+
Port: 7051
91+
92+
################################################################################
93+
#
94+
# SECTION: Orderer
95+
#
96+
# - This section defines the values to encode into a config transaction or
97+
# genesis block for orderer related parameters
98+
#
99+
################################################################################
100+
Orderer: &OrdererDefaults
101+
102+
# Orderer Type: The orderer implementation to start
103+
# Available types are "solo" and "kafka"
104+
OrdererType: solo
105+
106+
Addresses:
107+
- order1.epoint.com.cn:7050
108+
109+
# Batch Timeout: The amount of time to wait before creating a batch
110+
BatchTimeout: 2s
111+
112+
# Batch Size: Controls the number of messages batched into a block
113+
BatchSize:
114+
115+
# Max Message Count: The maximum number of messages to permit in a batch
116+
MaxMessageCount: 10
117+
118+
# Absolute Max Bytes: The absolute maximum number of bytes allowed for
119+
# the serialized messages in a batch.
120+
AbsoluteMaxBytes: 99 MB
121+
122+
# Preferred Max Bytes: The preferred maximum number of bytes allowed for
123+
# the serialized messages in a batch. A message larger than the preferred
124+
# max bytes will result in a batch larger than preferred max bytes.
125+
PreferredMaxBytes: 512 KB
126+
127+
Kafka:
128+
# Brokers: A list of Kafka brokers to which the orderer connects
129+
# NOTE: Use IP:port notation
130+
Brokers:
131+
- 127.0.0.1:9092
132+
133+
# Organizations is the list of orgs which are defined as participants on
134+
# the orderer side of the network
135+
Organizations:
136+
137+
################################################################################
138+
#
139+
# SECTION: Application
140+
#
141+
# - This section defines the values to encode into a config transaction or
142+
# genesis block for application related parameters
143+
#
144+
################################################################################
145+
Application: &ApplicationDefaults
146+
147+
# Organizations is the list of orgs which are defined as participants on
148+
# the application side of the network
149+
Organizations:

0 commit comments

Comments
 (0)