Skip to content

Commit 8ec1783

Browse files
d20techrameshthoomu
authored andcommitted
Fixes errors in channel_test.sh
Following the instructions in /docs/gettingstarted.md creates a fabric deployment that continuously logs errors related to security settings. These can be corrected by creating the channel with: 1. CORE_PEER_GOSSIP_IGNORESECURITY=true 2. An anchor file with the certificate associated with peer0 As the IP address of peer0 isn't known ahead of time, we need to generate the anchor file dynamically. This commit updates the script and the tarball referenced in the documentation. Change-Id: Id236c64f5c4ed98981ac33b16083765c2de23301 Signed-off-by: Sean Wellington <[email protected]> Signed-off-by: Ramesh babu <[email protected]>
1 parent d64dee9 commit 8ec1783

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

examples/sfhackfest/channel_test.sh

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
11
#!/bin/sh
22

3+
# find address of peer0 in your network
4+
PEER0_IP_ADDRESS=`perl -e 'use Socket; $a = inet_ntoa(inet_aton("peer0")); print "$a\n";'`
5+
6+
# create an anchor file
7+
cat<<EOF>anchorPeer.txt
8+
$PEER0_IP_ADDRESS
9+
7051
10+
-----BEGIN CERTIFICATE-----
11+
MIICjDCCAjKgAwIBAgIUBEVwsSx0TmqdbzNwleNBBzoIT0wwCgYIKoZIzj0EAwIw
12+
fzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNh
13+
biBGcmFuY2lzY28xHzAdBgNVBAoTFkludGVybmV0IFdpZGdldHMsIEluYy4xDDAK
14+
BgNVBAsTA1dXVzEUMBIGA1UEAxMLZXhhbXBsZS5jb20wHhcNMTYxMTExMTcwNzAw
15+
WhcNMTcxMTExMTcwNzAwWjBjMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGgg
16+
Q2Fyb2xpbmExEDAOBgNVBAcTB1JhbGVpZ2gxGzAZBgNVBAoTEkh5cGVybGVkZ2Vy
17+
IEZhYnJpYzEMMAoGA1UECxMDQ09QMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE
18+
HBuKsAO43hs4JGpFfiGMkB/xsILTsOvmN2WmwpsPHZNL6w8HWe3xCPQtdG/XJJvZ
19+
+C756KEsUBM3yw5PTfku8qOBpzCBpDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYw
20+
FAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFOFC
21+
dcUZ4es3ltiCgAVDoyLfVpPIMB8GA1UdIwQYMBaAFBdnQj2qnoI/xMUdn1vDmdG1
22+
nEgQMCUGA1UdEQQeMByCCm15aG9zdC5jb22CDnd3dy5teWhvc3QuY29tMAoGCCqG
23+
SM49BAMCA0gAMEUCIDf9Hbl4xn3z4EwNKmilM9lX2Fq4jWpAaRVB97OmVEeyAiEA
24+
25aDPQHGGq2AvhKT0wvt08cX1GTGCIbfmuLpMwKQj38=
25+
-----END CERTIFICATE-----
26+
EOF
27+
328
#create
429
echo "Creating channel on Orderer"
5-
CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1 >>log.txt 2>&1
30+
CORE_PEER_GOSSIP_IGNORESECURITY=true CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1 -a anchorPeer.txt >>log.txt 2>&1
631
cat log.txt
732
grep -q "Exiting" log.txt
833
if [ $? -ne 0 ]; then

examples/sfhackfest/docker-compose-gettingstarted.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ services:
4545
- ORDERER_GENERAL_LISTENPORT=7050
4646
- ORDERER_RAMLEDGER_HISTORY_SIZE=100
4747
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
48-
volumes:
49-
- ./tmp/orderer:/etc/hyperledger/fabric/orderer
5048
command: orderer
5149
ports:
5250
- 8050:7050
@@ -70,6 +68,8 @@ services:
7068
- CORE_PEER_GOSSIP_IGNORESECURITY=true
7169

7270
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
71+
72+
command: peer node start --peer-defaultchain=false
7373
ports:
7474
- 8051:7051
7575
- 8053:7053
@@ -166,7 +166,7 @@ services:
166166
#in the "- <HOST>:/opt/gopath/src/github.com/hyperledger/fabric/examples/" mapping below, the HOST part
167167
#should be modified to the path on the host. This will work as is in the Vagrant environment
168168
- ./src/github.com/example_cc/example_cc.go:/opt/gopath/src/github.com/hyperledger/fabric/examples/example_cc.go
169-
- ./tmp/peer3/:/etc/hyperledger/fabric/msp/sampleconfig
169+
- ./tmp/peer3:/etc/hyperledger/fabric/msp/sampleconfig
170170
- ./channel_test.sh:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel_test.sh
171171
networks:
172172
- bridge

examples/sfhackfest/sfhackfest.tar.gz

769 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)