Skip to content

Commit

Permalink
Fixes errors in channel_test.sh
Browse files Browse the repository at this point in the history
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 <sean@d20tech.com>
Signed-off-by: Ramesh babu <rameshbabu.thoomu@gmail.com>
  • Loading branch information
d20tech authored and rameshthoomu committed Feb 13, 2017
1 parent d64dee9 commit 8ec1783
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
27 changes: 26 additions & 1 deletion examples/sfhackfest/channel_test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
#!/bin/sh

# find address of peer0 in your network
PEER0_IP_ADDRESS=`perl -e 'use Socket; $a = inet_ntoa(inet_aton("peer0")); print "$a\n";'`

# create an anchor file
cat<<EOF>anchorPeer.txt
$PEER0_IP_ADDRESS
7051
-----BEGIN CERTIFICATE-----
MIICjDCCAjKgAwIBAgIUBEVwsSx0TmqdbzNwleNBBzoIT0wwCgYIKoZIzj0EAwIw
fzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNh
biBGcmFuY2lzY28xHzAdBgNVBAoTFkludGVybmV0IFdpZGdldHMsIEluYy4xDDAK
BgNVBAsTA1dXVzEUMBIGA1UEAxMLZXhhbXBsZS5jb20wHhcNMTYxMTExMTcwNzAw
WhcNMTcxMTExMTcwNzAwWjBjMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGgg
Q2Fyb2xpbmExEDAOBgNVBAcTB1JhbGVpZ2gxGzAZBgNVBAoTEkh5cGVybGVkZ2Vy
IEZhYnJpYzEMMAoGA1UECxMDQ09QMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE
HBuKsAO43hs4JGpFfiGMkB/xsILTsOvmN2WmwpsPHZNL6w8HWe3xCPQtdG/XJJvZ
+C756KEsUBM3yw5PTfku8qOBpzCBpDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYw
FAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFOFC
dcUZ4es3ltiCgAVDoyLfVpPIMB8GA1UdIwQYMBaAFBdnQj2qnoI/xMUdn1vDmdG1
nEgQMCUGA1UdEQQeMByCCm15aG9zdC5jb22CDnd3dy5teWhvc3QuY29tMAoGCCqG
SM49BAMCA0gAMEUCIDf9Hbl4xn3z4EwNKmilM9lX2Fq4jWpAaRVB97OmVEeyAiEA
25aDPQHGGq2AvhKT0wvt08cX1GTGCIbfmuLpMwKQj38=
-----END CERTIFICATE-----
EOF
#create
echo "Creating channel on Orderer"
CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1 >>log.txt 2>&1
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
cat log.txt
grep -q "Exiting" log.txt
if [ $? -ne 0 ]; then
Expand Down
6 changes: 3 additions & 3 deletions examples/sfhackfest/docker-compose-gettingstarted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ services:
- ORDERER_GENERAL_LISTENPORT=7050
- ORDERER_RAMLEDGER_HISTORY_SIZE=100
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
volumes:
- ./tmp/orderer:/etc/hyperledger/fabric/orderer
command: orderer
ports:
- 8050:7050
Expand All @@ -70,6 +68,8 @@ services:
- CORE_PEER_GOSSIP_IGNORESECURITY=true

working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer

command: peer node start --peer-defaultchain=false
ports:
- 8051:7051
- 8053:7053
Expand Down Expand Up @@ -166,7 +166,7 @@ services:
#in the "- <HOST>:/opt/gopath/src/github.com/hyperledger/fabric/examples/" mapping below, the HOST part
#should be modified to the path on the host. This will work as is in the Vagrant environment
- ./src/github.com/example_cc/example_cc.go:/opt/gopath/src/github.com/hyperledger/fabric/examples/example_cc.go
- ./tmp/peer3/:/etc/hyperledger/fabric/msp/sampleconfig
- ./tmp/peer3:/etc/hyperledger/fabric/msp/sampleconfig
- ./channel_test.sh:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel_test.sh
networks:
- bridge
Binary file modified examples/sfhackfest/sfhackfest.tar.gz
Binary file not shown.

0 comments on commit 8ec1783

Please sign in to comment.