I am trying to set up a sample hyperledger fabric environment with an orderer and 2 peers. I am not using docker approach instead I am running the actual executable itself.
Orderer and 2 peer nodes started successfully. However, channel creation fails with the following error. Any help would be greatly appreciated.
Error on the orderer window
> 2017-08-17 07:28:22.338 IST [orderer/common/deliver] Handle -> WARN
> 029 Error reading from stream: rpc error: code = Canceled desc =
> context canceled 2017-08-17 07:31:08.044 IST [common/config/channel]
> CommitProposals -> WARN 02a Current configuration has no policy
> '/Channel/Application/Readers', this will likely cause problems in
> production systems 2017-08-17 07:31:08.050 IST [common/config/channel]
> CommitProposals -> WARN 02b Current configuration has no policy
> '/Channel/Application/Writers', this will likely cause problems in
> production systems 2017-08-17 07:31:08.050 IST [common/config/channel]
> CommitProposals -> WARN 02c Current configuration has no policy
> '/Channel/Application/Admins', this will likely cause problems in
> production systems 2017-08-17 07:31:08.051 IST [cauthdsl] func2 ->
> ERRO 02d Principal deserialization failure (The supplied identity is
> not valid, Verify() returned x509: certificate signed by unknown
> authority) for identity
> 0a07506565724f726712e7052d2d2d2d2d424547494e202d2d2d2d2d0a4d494943427a43434161326741774942416749514e303434797750356c6d6c3477613379723836355a6a414b42676771686b6a4f50515144416a426e4d5173770a435159445651514745774a56557a45544d4245474131554543424d4b5132467361575a76636d3570595445574d4251474131554542784d4e5532467549455a790a5957356a61584e6a627a45544d4245474131554543684d4b593246795a6d46344c6d4e76625445574d4251474131554541784d4e59324575593246795a6d46340a4c6d4e7662544165467730784e7a41344d5459784e7a41344e445261467730794e7a41344d5451784e7a41344e4452614d465578437a414a42674e56424159540a416c56544d524d77455159445651514945777044595778705a6d3979626d6c684d52597746415944565151484577315459573467526e4a68626d4e7063324e760a4d526b774677594456515144444242425a473170626b426a59584a6d59586775593239744d466b77457759484b6f5a497a6a3043415159494b6f5a497a6a30440a4151634451674145743046756e6d577635336b6366417846785953784c44565164324d336b6d586345714b556c77507a6a444a544b626c4265317931376b39380a4c64384f2f57374c777a71394b374f563957394a3765367962736b44324b4e4e4d45737744675944565230504151482f42415144416765414d417747413155640a457745422f7751434d4141774b7759445652306a42435177496f4167445a62512f58784241523253396670326b64587a78546a666c35685055724958376635460a664d446d6b4f7377436759494b6f5a497a6a304541774944534141775251496841507a303051514962515769727a467962357978736a3168384d6a316a37482b0a333971735171445438387a684169426a6776705a777675764947456b6a624a75697663574b3172476f36416b314430362f7445527a59383538513d3d0a2d2d2d2d2d454e44202d2d2d2d2d0a
> 2017-08-17 07:31:08.052 IST [orderer/common/broadcast] Handle -> WARN
> 02e [channel: testing] Rejecting broadcast of config message because
> of error: Error authorizing update: Error validating DeltaSet: Policy
> for [Groups] /Channel/Application not satisfied: Failed to reach
> implicit threshold of 1 sub-policies, required 1 remaining 2017-08-17
> 07:31:08.063 IST [orderer/common/deliver] Handle -> WARN 02f Error
> reading from stream: rpc error: code = Canceled desc = context
> canceled
Value of ORDERER_TLS
ORDERER_TLS="--tls true--cafile /opt/gopath/src/github.com/hyperledger/fabric/sampleconfig/tls/ca.crt"
Error while creating the channel
node1#ubuntu:/opt/gopath/src/github.com/hyperledger/fabric/build/bin$ peer channel create $ORDERER_TLS -f /home/node1/Downloads/fabricDeployment-master/testing.tx -c testing -o node1.honda.com:7050 --logging-level DEBUG -v
2017-08-17 07:28:21.953 IST [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2017-08-17 07:28:21.953 IST [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2017-08-17 07:28:21.996 IST [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2017-08-17 07:28:22.014 IST [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2017-08-17 07:28:22.019 IST [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2017-08-17 07:28:22.019 IST [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2017-08-17 07:28:22.019 IST [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2017-08-17 07:28:22.019 IST [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0AF3050A07506565724F726712E7052D...69636174696F6E2F41646D696E731801
2017-08-17 07:28:22.019 IST [msp/identity] Sign -> DEBU 009 Sign: digest: 63EBD4B3B350685B39A0C8E8E216EFCB3D4C3C82F74B6FA2638D2A7974EB1E74
2017-08-17 07:28:22.020 IST [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2017-08-17 07:28:22.020 IST [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2017-08-17 07:28:22.020 IST [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2017-08-17 07:28:22.020 IST [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2017-08-17 07:28:22.020 IST [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AA6060A1108021A0608BEF0D3CC0522...1A843140B4B661FA8CBCB3170133AC2B
2017-08-17 07:28:22.020 IST [msp/identity] Sign -> DEBU 00f Sign: digest: EB039E58FB665150B556394FD464155BBB349CEBB591A578DE402789465EDA84
Error: Got unexpected status: BAD_REQUEST -- Error authorizing update: Error validating DeltaSet: Policy for [Groups] /Channel/Application not satisfied: Failed to reach implicit threshold of 1 sub-policies, required 1 remaining
Usage:
peer channel create [flags]
Flags:
-c, --channelID string In case of a newChain command, the channel ID to create.
-f, --file string Configuration transaction file generated by a tool such as configtxgen for submitting to orderer
-t, --timeout int Channel creation timeout (default 5)
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--logging-level string Default logging level and overrides, see core.yaml for full syntax
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer.
--test.coverprofile string Done (default "coverage.cov")
--tls Use TLS when communicating with the orderer endpoint
-v, --version Display current version of fabric peer server
Edit Start
Thank you for your reply Yacovm. I am still facing the same issue.
In fact, I am using your github code to try this sample. The script was awesome and easy to understand
Let me quickly brief about the current set up I have.
Environment
3 nodes running - Ubuntu 16
> **Node1 Details** Hostname : node1 Domain name : honda.com User1 : node1 User2 : Admin
>
> **Node2 Details** Hostname : node2 Domain name : carfax.com User1 : node2 User2 : Admin
>
> **Node3 Details** Hostname : node3 Domain name : carfax.com User1 : node3 User2 : Admin
Step 1 :
Downloaded the Fabric source in all 3 machines and ran “make” – Everything was successful
Source is present in the following path : /opt/gopath/src/github.com/hyperledger/fabric
Step 2 :
Downloaded fabricDeployment-master /home/node1/Downloads/fabricDeployment-master in node1 machine
From node1 machine,
I am running the following ( I am using the deploy.sh provided in github with slight changes )
[[ -z $GOPATH ]] && (echo "Environment variable GOPATH isn't set!"; exit 1)
FABRIC=$GOPATH/src/github.com/hyperledger/fabric
[[ -d "$FABRIC" ]] || (echo "Directory $FABRIC doesn't exist!"; exit 1)
for file in configtxgen peer cryptogen; do
[[ -f $file ]] && continue
binary=$FABRIC/build/bin/$file
[[ ! -f $binary ]] && ( cd $FABRIC ; make $file)
cp $binary $file && continue
done
for file in configtxgen peer cryptogen; do
[[ ! -f $file ]] && echo "$file isn't found, aborting!" && exit 1
done
. config.sh
bootPeer=$(echo ${peers} | awk '{print $1}')
anchorPeer=$(echo ${peers} | awk '{print $1}')
PROPAGATEPEERNUM=${PROPAGATEPEERNUM:-3}
i=0
for p in $orderer $peers ; do
echo "Making Directory structure for $p"
mkdir -p $p/sampleconfig/crypto
mkdir -p $p/sampleconfig/tls
ip=$(getIP $p)
echo "${p}'s ip address is ${ip}"
orgLeader=false
bootstrap=$anchorPeer:7051
if [[ $i -eq 1 ]];then
orgLeader=true
fi
(( i += 1 ))
echo "Creating core.yaml from core.yaml.template for $p"
cat core.yaml.template | sed "s/PROPAGATEPEERNUM/${PROPAGATEPEERNUM}/ ; s/PEERID/$p/ ; s/ADDRESS/$p/ ; s/ORGLEADER/$orgLeader/ ; s/BOOTSTRAP/$bootPeer:7051/ ; s/TLS_CERT/$p.carfax.com-cert.pem/" > $p/sampleconfig/core.yaml
done
echo "Creating configtx.yaml from configtx.yaml.template with ANCHOR_PEER_IP & ORDERER_IP"
cat configtx.yaml.template | sed "s/ANCHOR_PEER_IP/$anchorpeer/ ; s/ORDERER_IP/$orderer/" > configtx.yaml
echo "Creating crypto-config.yml from crypto-config.yml.template with ORDERER_IP and adding hostname node2 & node3"
cat crypto-config.yml.template | sed "s/ORDERER_IP/$orderer/" > crypto-config.yml
for p in $peers ; do
echo " - Hostname: $p" >> crypto-config.yml
done
cat << EOF >> crypto-config.yml
Users:
Count: 1
EOF
./cryptogen generate --config crypto-config.yml
./configtxgen -profile Genesis -outputBlock genesis.block -channelID system
./configtxgen -profile Channels -outputCreateChannelTx yacov.tx -channelID yacov
./configtxgen -profile Channels -outputAnchorPeersUpdate OrdererOrganchors.tx -channelID yacov -asOrg PeerOrg
mv genesis.block node1/sampleconfig/
cp orderer.yaml node1/sampleconfig/
cp -r crypto-config/ordererOrganizations/honda.com/orderers/node1.honda.com/msp/* node1/sampleconfig/crypto
cp -r crypto-config/ordererOrganizations/honda.com/orderers/node1.honda.com/tls/* node1/sampleconfig/tls
cp -r crypto-config/peerOrganizations/carfax.com/peers/node2.carfax.com/msp/* node2/sampleconfig/crypto
cp -r crypto-config/peerOrganizations/carfax.com/peers/node2.carfax.com/tls/* node2/sampleconfig/tls/
cp -r crypto-config/peerOrganizations/carfax.com/peers/node3.carfax.com/msp/* node3/sampleconfig/crypto
cp -r crypto-config/peerOrganizations/carfax.com/peers/node3.carfax.com/tls/* node3/sampleconfig/tls/
echo "Deploying configuration - Moving configurations to respective machines"
scp -r node1/sampleconfig/* node1#node1:/opt/gopath/src/github.com/hyperledger/fabric/sampleconfig/
scp -r node2/sampleconfig/* node2#node2:/opt/gopath/src/github.com/hyperledger/fabric/sampleconfig/
scp -r node3/sampleconfig/* node3#node3:/opt/gopath/src/github.com/hyperledger/fabric/sampleconfig/
Step 3 :
Resulting crypto-config.yaml
OrdererOrgs:
- Name: Org0
Domain: honda.com
PeerOrgs:
- Name: Org1
Domain: carfax.com
- Hostname: node2
- Hostname: node3
Users:
Count: 1
Resulting crypto-config.yaml
Profiles:
Genesis:
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Consortiums:
SampleConsortium:
Organizations:
- *PeerOrg
Channels:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *PeerOrg
Organizations:
- &OrdererOrg
Name: OrdererOrg
ID: OrdererOrg
MSPDir: crypto-config/ordererOrganizations/honda.com/msp
AdminPrincipal: Role.ADMIN
- &PeerOrg
Name: PeerOrg
ID: PeerOrg
MSPDir: crypto-config/peerOrganizations/carfax.com/msp
AdminPrincipal: Role.ADMIN
AnchorPeers:
- Host: node2
Port: 7051
Orderer: &OrdererDefaults
OrdererType: solo
Addresses:
- node1:7050
BatchTimeout: 1ms
BatchSize:
MaxMessageCount: 10
AbsoluteMaxBytes: 99 MB
PreferredMaxBytes: 512 KB
MaxChannels: 0
Kafka:
Brokers:
- 127.0.0.1:9092
Organizations:
Application: &ApplicationDefault
s
Step 4 :
Starting orderer from node1 as node1 user
Starting peer1 from node2 as node2 user
Starting peer2 from node3 as node3 user
Till here things work fine
Step 5 : Channel Creation
From node1 as node1 user, running the following commands
node1#ubuntu:~/Downloads/fabricDeployment-master$ pwd
/home/node1/Downloads/fabricDeployment-master
export FABRIC=$GOPATH/src/github.com/hyperledger/fabric
export ORDERER_TLS="--tls true --cafile `pwd`/crypto-config/ordererOrganizations/honda.com/orderers/node1.honda.com/tls/ca.crt"
export CORE_PEER_TLS_ROOTCERT_FILE=`pwd`/crypto-config/peerOrganizations/carfax.com/peers/node2.carfax.com/tls/ca.crt
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_MSPCONFIGPATH=`pwd`/crypto-config/peerOrganizations/carfax.com/users/Admin#carfax.com/msp
export CORE_PEER_LOCALMSPID=PeerOrg
/opt/gopath/src/github.com/hyperledger/fabric/build/bin/peer channel create $ORDERER_TLS -f yacov.tx -c yacov -o node1:7050
Contents of configtx.yaml
---
Profiles:
Genesis:
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Consortiums:
SampleConsortium:
Organizations:
- *PeerOrg
Channels:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *PeerOrg
Organizations:
- &OrdererOrg
Name: OrdererOrg
ID: OrdererOrg
MSPDir: crypto-config/ordererOrganizations/honda.com/msp
AdminPrincipal: Role.ADMIN
- &PeerOrg
Name: PeerOrg
ID: PeerOrg
MSPDir: crypto-config/peerOrganizations/carfax.com/msp
AdminPrincipal: Role.ADMIN
AnchorPeers:
- Host:
Port: 7051
Orderer: &OrdererDefaults
OrdererType: solo
Addresses:
- node1:7050
BatchTimeout: 1ms
BatchSize:
MaxMessageCount: 10
AbsoluteMaxBytes: 99 MB
PreferredMaxBytes: 512 KB
MaxChannels: 0
Kafka:
Brokers:
- 127.0.0.1:9092
Organizations:
Application: &ApplicationDefaults
Organizations:
Output of command line statements when executing Genesis Block
2017-08-18 16:50:37.015 IST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2017-08-18 16:50:37.175 IST [common/tools/configtxgen] doOutputBlock -> INFO 002 Generating genesis block
2017-08-18 16:50:37.179 IST [common/tools/configtxgen] doOutputBlock -> INFO 003 Writing genesis block
Output of Genesis Block
<1.{��������G<&�����n��ix*s!�0
�0
�0
t
����"system*#d6a8b389f09cd34562dda9af564c11bd28fed0ae9c42070f11a56c678b19e704h�N�b����S���>%��_bٮ�/
�/�/�
Consortiums��
SampleConsortium��
PeerOrg��
MSP���
PeerOrg�-----BEGIN CERTIFICATE-----
MIICKzCCAdGgAwIBAgIQCxUbHYlT+2GRvjnArG6gZjAKBggqhkjOPQQDAjBnMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
YW5jaXNjbzETMBEGA1UEChMKY2FyZmF4LmNvbTEWMBQGA1UEAxMNY2EuY2FyZmF4
LmNvbTAeFw0xNzA4MTgxMTIwMzZaFw0yNzA4MTYxMTIwMzZaMGcxCzAJBgNVBAYT
AlVTMRMwEQYDVQQIEwp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erOrgAdmins"0
Writers%
PeerOrgAdmins*Admins#
ChannelCreationPolicy'
Admins/Channel/Orderer/Admins*/Channel/Orderer/Admins"
AdminsAdmins*/Channel/Orderer/Admins�
Orderer��
OrdererOrg��
MSP���
OrdererOrg�-----BEGIN CERTIFICATE-----
MIICJzCCAc6gAwIBAgIRAIMBXTi8vzqOVhQiXB+ovQMwCgYIKoZIzj0EAwIwZTEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xEjAQBgNVBAoTCWhvbmRhLmNvbTEVMBMGA1UEAxMMY2EuaG9uZGEu
Y29tMB4XDTE3MDgxODExMjAzNloXDTI3MDgxNjExMjAzNlowZTELMAkGA1UEBhMC
VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28x
EjAQBgNVBAoTCWhvbmRhLmNvbTEVMBMGA1UEAxMMY2EuaG9uZGEuY29tMFkwEwYH
KoZIzj0CAQYIKoZIzj0DAQcDQgAEm3VY12jlinzimYav4K39anZGIyd7DrygL7fV
b57S7tpvwTXWfGNt58tDBf584w1Bw7Yr6M3unJjWfNj7VaLwd6NfMF0wDgYDVR0P
AQH/BAQDAgGmMA8GA1UdJQQIMAYGBFUdJQAwDwYDVR0TAQH/BAUwAwEB/zApBgNV
HQ4EIgQgMfMrGCUNqJqCehc2xsAYVyWqVTV3jYDcnmkyBhtFSGcwCgYIKoZIzj0E
AwIDRwAwRAIgMrdpDfMnULyS2dMtjfdWGAXPxDj4URM0nelcSjOpmAoCIB24mFvn
C34fP8icL0QVIOf+mPin2jD4HgsDP58dDFtu
-----END CERTIFICATE-----
"�-----BEGIN CERTIFICATE-----
MIICBDCCAaqgAwIBAgIQOHnvuaxK4NLP1+Qb7OIm+DAKBggqhkjOPQQDAjBlMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuI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hLDOMH7h39Ih2ivixOlg+n
OI7+mF0GQrG8f2qop4gSaZQwtVIj5MpzTBcKqaa0l0k8FDdlobDtJ94QVKNfMF0w
DgYDVR0PAQH/BAQDAgGmMA8GA1UdJQQIMAYGBFUdJQAwDwYDVR0TAQH/BAUwAwEB
/zApBgNVHQ4EIgQgxL6aI6nufoznFDDukcIWHhrAYIrNu7tNFYfHsoxgX0IwCgYI
KoZIzj0EAwIDSAAwRQIhAJ5fLjps0Fq0r0l0Vfi1/35TMYgo9/6rNRkjnCZ3xPEV
AiAVbQba7Pg9s8Ej6ok2zta1biohj5+k/flDM5KXM1NfOg==
-----END CERTIFICATE-----
Admins"4
Admins*
OrdererOrgAdmins"3
Readers(
OrdererOrgAdmins"3
Writers(
OrdererOrgAdmins*Admins!
ConsensusType
soloAdmins"
BatchSize
���1�� Admins
BatchTimeout
1msAdmins
ChannelRestrictionsAdmins"*
ockValidation
WritersAdmins""
aders
ReadersAdmins""
iters
WritersAdmins""
Admins
AdminsAdmins*Admins&
HashingAlgorithm
SHA256Admins-
BlockDataHashingStructure����Admins;
OrdererAddresses'
node1:7050/Channel/Orderer/Admins""
aders
ReadersAdmins""
iters
WritersAdmins""
Admins
AdminsAdmins*Admins
Error: Got unexpected status: BAD_REQUEST -- Error authorizing update: Error validating DeltaSet: Policy for [Groups] /Channel/Application not satisfied: Failed to reach implicit threshold of 1 sub-policies, required 1 remaining
This usually indicates that the signer of the channel creation transaction does not have admin rights for one of the consortium orgs, however, it may indicate a failure for a number of other reasons.
Unfortunately, the error must be somewhat cryptic, to avoid leaking information about consortium or channel membership. To get the underlying cause, you will need to check the orderer logs. If it is not already set, you will want to turn the log level up to debug in orderer.yaml or alternately by setting FABRIC_LOGGING_SPEC=debug (or for versions of Fabric prior to v1.4.x ORDERER_GENERAL_LOGLEVEL=debug) before starting the orderer. In your orderer logs, you will see the same error text as output by the peer client, but in the preceding lines you will see additional causes for your error.
The most common reasons are:
The identity is not in the list of admins for the org.
The identity's certificate is not validly signed by the org CA chain.
The identity's org is not known to the orderer.
Some other unlikely possibilities because you are using the peer binary and not custom code:
The signature does not match the identity or signed bytes.
The identity is malformed.
Assuming that the cause is not obvious from the orderer logs, if you post them here, I'd be happy to help diagnose them.
Oh, and as a helpful tip. You may see a more human readable version of your genesisblock by using configtxgen -inspectBlock <genesis.block>.
Edit: Looking back a the top of your post I see this output in the orderer log:
ERRO 02d Principal deserialization failure (The supplied identity is
not valid, Verify() returned x509: certificate signed by unknown
authority) for identity
This would indicate that the certificate claims to be issued by a CA, but is not signed by the CA the orderer knows about (error type 2 above). This would commonly happen if you bootstrapped the orderer, then regenerated the crypto material for your environment without removing the orderer's storage directory.
It's important to remember that the ORDERER_GENERAL_BOOTSTRAPFILE (or prior to v2.0.0 ORDERER_GENERAL_GENESISFILE) is only read if the system is not already bootstrapped, so changing the genesis block for the orderer will have no affect unless the orderer storage is also deleted.
This has nothing to do with TLS, since the request has reached the orderer.
Have it been a TLS issue - you wouln't have gotten the following error:
Error: Got unexpected status: BAD_REQUEST -- Error authorizing update:
Error validating DeltaSet: Policy for [Groups] /Channel/Application
not satisfied: Failed to reach implicit threshold of 1 sub-policies,
required 1 remaining
Now, the error basically means that you tried to send a transaction for channel creation, but the transaction was signed by a user (a client certificate) that isn't a channel admin.
You need to prefix the command with something similar to this:
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp
Below solution worked for me.
Go inside your peer docker container. Go to /etc/hyperledger/msp/users/Admin#org1.example.com/msp and run export CORE_PEER_MSPCONFIGPATH=$PWD
Run your peer channel create command again with appropriate flags.
in my case, it was some missing entries in the docker-compose file for orderer:
ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt] was changed to ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt, /etc/hyperledger/crypto/peerORG1/tls/ca.crt, /etc/hyperledger/crypto/peerORG2/tls/ca.crt, /etc/hyperledger/crypto/peerORG3/tls/ca.crt] and then it worked.
so that's something you might want to check, especially if you have a customized setup.
In my case, the only thing that was missing was to define the CORE_PEER_MSPCONFIGPATH correctly.
Using fabric 1.1
Hope it will help others.
Related
I've configured a docker w rabbitmq, copied the certs from tls-gen there, stop/started and I can only get the connection established and a server reset right after sending a TLS Client Hello. No useful message from ssl. Logs all empty. Troubleshoot TLS guide didn't help. Thanks for any help.
docker run -d -it --hostname=[REDACTED] -e RABBITMQ_LOGS=/var/log/rabbitmq/ -e RABBITMQ_SASL_LOGS=/var/log/rabbitmq/ -e RABBITMQ_DEFAULT_USER=[REDACTED] -e RABBITMQ_DEFAULT_PASS=[REDACTED] --name rabbitmq1 -p [REDACTED]:5672 -p [REDACTED]:15672 -v /scratch/databases/rabbitmq/var/lib/rabbitmq:/var/lib/rabbitmq rabbitmq:3-management
docker cp tls-gen/basic/result/ca_certificate.pem rabbitmq1:/etc/rabbitmq/
docker cp tls-gen/basic/result/server_key.pem rabbitmq1:/etc/rabbitmq/
docker cp tls-gen/basic/result/server_certificate.pem rabbitmq1:/etc/rabbitmq/
docker exec -it rabbitmq1 /bin/bash -c "cd /etc/rabbitmq;chown rabbitmq:rabbitmq *.pem"
docker cp rabbitmq.conf rabbitmq1:/etc/rabbitmq/
docker exec -it rabbitmq1 /bin/bash -c "cd /etc/rabbitmq;chown rabbitmq:rabbitmq rabbitmq.conf"
I was sure to restart the container so the changes were applied. Also double checked cert permissions.
docker:/etc/rabbitmq/
-rw-rw-r--. 1 rabbitmq rabbitmq 1.2K Nov 22 02:29 ca_certificate.pem
drwxrwxrwx. 1 rabbitmq rabbitmq 61 Nov 6 01:51 conf.d
-rw-r--r--. 1 root root 71 Nov 22 07:34 enabled_plugins
-rw-r--r--. 1 rabbitmq rabbitmq 578 Nov 22 07:34 rabbitmq.conf
-rw-rw-r--. 1 rabbitmq rabbitmq 1.3K Nov 22 02:29 server_certificate.pem
-rw-------. 1 rabbitmq rabbitmq 1.9K Nov 22 02:29 server_key.pem
Redirected logs here knowing that the container start env variables should overide. Either way, logs seemed empty.
/etc/rabbitmq/rabbitmq.conf
loopback_users.guest = false
# listeners.tcp.default = 5672
management.tcp.port = 15672
listeners.tcp = none
listeners.ssl.default = 5671
ssl_options.cacertfile = /etc/rabbitmq/ca_certificate.pem
ssl_options.certfile = /etc/rabbitmq/server_certificate.pem
ssl_options.keyfile = /etc/rabbitmq/server_key.pem
ssl_options.verify = verify_peer
ssl_options.fail_if_no_peer_cert = false
ssl_options.password = [REDACTED]
log.dir = /tmp/
log.file = r.log
log.file.level = debug
Tried multiple configurations for context.options to no avail.
receive.py (python)
#!/usr/bin/env python
import ssl, pika, sys, os
import traceback
from pika.credentials import ExternalCredentials
def main():
connection = None
credentials = pika.PlainCredentials('[REDACTED]', '[REDACTED]')
context = ssl.create_default_context(cafile="tls-gen/basic/result/ca_certificate.pem")
context.load_cert_chain("tls-gen/basic/result/client_certificate.pem", "tls-gen/basic/result/client_key.pem")
#context.options = dict(ssl_version=ssl.PROTOCOL_TLSv1, cert_reqs=ssl.CERT_REQUIRED)
ssl_options = pika.SSLOptions(context, "[REDACTED]")
#ssl_options = pika.SSLOptions(ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT), "local")
#ssl_options = pika.SSLOptions(ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER), "localhost")
#ssl_options = ssl_options | pika.SSLOptions(ssl.SSLContext(ssl.PROTOCOL_TLSv1_2), "[REDACTED]")
try:
connection = pika.BlockingConnection(pika.ConnectionParameters(host='[REDACTED]',
port=[REDACTED],
virtual_host='/',
ssl_options = ssl_options)),
credentials=credentials))
#credentials=ExternalCredentials()))
except Exception as e:
exc_type, _, exc_tb = sys.exc_info()
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
print("receive: ({0}) {1} {2} {3}".format(str(e), exc_type, fname, exc_tb.tb_lineno))
traceback.print_exc()
sys.exit(1)
channel = connection.channel()
channel.queue_declare(queue='hello')
def callback(ch, method, properties, body):
print(" [x] Received %r" % body)
channel.basic_consume(queue='hello', on_message_callback=callback, auto_ack=True)
print(' [*] Waiting for messages. To exit press CTRL+C')
channel.start_consuming()
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
print('Interrupted')
try:
sys.exit(0)
except SystemExit:
os._exit(0)
A wrong PEM password here generates a very different message, I'm sure I'm using the right one.
python3 receive.py
Enter PEM pass phrase:
receive: ([Errno 104] Connection reset by peer) <class 'ConnectionResetError'> receive.py 18
Traceback (most recent call last):
File "receive.py", line 18, in main
connection = pika.BlockingConnection(pika.ConnectionParameters(host='[REDACTED]',
File "[REDACTED]/rabbitmq/pika/venv/lib/python3.8/site-packages/pika/adapters/blocking_connection.py", line 359, in __init__
self._impl = self._create_connection(parameters, _impl_class)
File "[REDACTED]/rabbitmq/pika/venv/lib/python3.8/site-packages/pika/adapters/blocking_connection.py", line 450, in _create_connection
raise self._reap_last_connection_workflow_error(error)
File "[REDACTED]/rabbitmq/pika/venv/lib/python3.8/site-packages/pika/adapters/utils/io_services_utils.py", line 636, in _do_ssl_handshake
self._sock.do_handshake()
File "/usr/local/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer
It looks like openssl likes the connection.
openssl s_client -connect localhost:5671
CONNECTED(00000003)
Can't use SSL_get_servername
depth=1 CN = TLSGenSelfSignedtRootCA, L = $$$$
verify error:num=19:self signed certificate in certificate chain
verify return:1
depth=0 CN = [REDACTED], O = server
verify return:1
---
Certificate chain
0 s:CN = [REDACTED], O = server
i:CN = TLSGenSelfSignedtRootCA, L = $$$$
1 s:CN = TLSGenSelfSignedtRootCA, L = $$$$
i:CN = TLSGenSelfSignedtRootCA, L = $$$$
---
Server certificate
-----BEGIN CERTIFICATE-----
[REDACTED]
-----END CERTIFICATE-----
subject=CN = [REDACTED], O = server
issuer=CN = TLSGenSelfSignedtRootCA, L = $$$$
---
Acceptable client certificate CA names
CN = TLSGenSelfSignedtRootCA, L = $$$$
Client Certificate Types: ECDSA sign, RSA sign, DSA sign
Requested Signature Algorithms: ECDSA+SHA512:RSA+SHA512:ECDSA+SHA384:RSA+SHA384:ECDSA+SHA256:RSA+SHA256:ECDSA+SHA224:RSA+SHA224:ECDSA+SHA1:RSA+SHA1:DSA+SHA1
Shared Requested Signature Algorithms: ECDSA+SHA512:RSA+SHA512:ECDSA+SHA384:RSA+SHA384:ECDSA+SHA256:RSA+SHA256:ECDSA+SHA224:RSA+SHA224:ECDSA+SHA1:RSA+SHA1:DSA+SHA1
Peer signing digest: SHA256
Peer signature type: RSA
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 2338 bytes and written 431 bytes
Verification error: self signed certificate in certificate chain
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES256-GCM-SHA384
Session-ID: [REDACTED]
Session-ID-ctx:
Master-Key: [REDACTED]
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1606031943
Timeout : 7200 (sec)
Verify return code: 19 (self signed certificate in certificate chain)
Extended master secret: no
---
closed
here the steps I took to fix this:
Get rid of the docker and install a local rabbitmq on mac for debugging this configuration. For some reason, the rabbitmq docker wasn't logging anything;
I've added a real valid letsencrypt certificate to the server;
first error I saw in the client after that was the following:
ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1076)
This is because verify_peer is enabled, in that case we needed to bundle the ca_certificate.pem from tls-gen/basic/result/ca_certificate.pem to the chain.pem
cat ../tls-gen/basic/result/ca_certificate.pem chain.pem > chain_bundle.pem
rabbitmq.conf
...
ssl_options.cacertfile = /usr/local/etc/rabbitmq/chain_bundle.pem # <- bundled w self signed cert
ssl_options.certfile = /usr/local/etc/rabbitmq/cert.pem
ssl_options.keyfile = /usr/local/etc/rabbitmq/privkey.pem
...
after that, a different error on pika showed:
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)
That's because pika didn't like tls-gen/basic/result/ca_certificate.pem, instead, I used venv//lib/python3.7/site-packages/certifi/cacert.pem after installing pip install certifi.
Later on, I bundled tls-gen/basic/result/ca_certificate.pem + venv//lib/python3.7/site-packages/certifi/cacert.pem, and added a password to context.load_cert_chain
Wireshark shows messages fully encrypted, now I just need to deploy.
EDIT:
I was able to run it via docker after re-trying the configuration that worked:
#/bin/bash
docker run -d -it --hostname=\
-e RABBITMQ_LOGS=/tmp/log\
-e RABBITMQ_DEFAULT_USER=\
-e RABBITMQ_DEFAULT_PASS=\
-e RABBITMQ_SSL_CACERTFILE=/cert/chain_bundle2.pem \
-e RABBITMQ_SSL_CERTFILE=/cert/cert.pem\
-e RABBITMQ_SSL_KEYFILE=/cert/privkey.pem\
-e RABBITMQ_SSL_FAIL_IF_NO_PEER_CERT=true\
-e RABBITMQ_SSL_VERIFY=verify_peer\
--name rabbitmq1-verifypeer -p ... :5671 -p ... :15672\
-v ... /rabbitmq/var/log:/tmp/log\
-v ... /rabbitmq/var/lib/rabbitmq:/var/lib/rabbitmq\
-v ... /cert/:/cert/ rabbitmq:3.8.9-management
I try this toutorial https://github.com/grepruby/ERC20-Token-On-Hyperledger
node: v8.11.4
go: go1.12.6 darwin/amd64
hyperledgerfabric: ? (maybe 1.2.1)
Python3.4
When './buildERC20TokenNetwork.sh up' command executed, the error occur.
Error: failed to create deliver client: orderer client failed to connect to orderer.techracers.com:7050: failed to create new connection: context deadline exceeded
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
detail
./buildERC20TokenNetwork.sh up
Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] Y
proceeding ...
./buildERC20TokenNetwork.sh: line 46: /Users/ogasawara/hyperledger-fabric/ERC20-Token-On-Hyperledger/network/../bin/configtxlator: cannot execute binary file
LOCAL_VERSION=
DOCKER_IMAGE_VERSION=1.2.1
=================== WARNING ===================
Local fabric binaries and docker images are
out of sync. This may cause problems.
===============================================
peer1.org2.techracers.com is up-to-date
Starting orderer.techracers.com ...
peer0.org2.techracers.com is up-to-date
peer1.org1.techracers.com is up-to-date
Starting orderer.techracers.com ... done
cli is up-to-date
____ _____ _ ____ _____
/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|
Channel name : mychannel
Creating channel...
+ peer channel create -o orderer.techracers.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/techracers.com/orderers/orderer.techracers.com/msp/tlscacerts/tlsca.techracers.com-cert.pem
+ res=1
+ set +x
Error: failed to create deliver client: orderer client failed to connect to orderer.techracers.com:7050: failed to create new connection: context deadline exceeded
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
ERROR !!!! Test failed
Docker container "orderer.techracers.com" is Exited, that causes the connection failer.
I checked docker cantainer log.
initializeLocalMsp -> CRIT 002 Failed to initialize local MSP: could not load a valid signer certificate from directory /var/hyperledger/orderer/msp/signcerts: stat /var/hyperledger/orderer/msp/signcerts: no such file or directory
How can I up the container "orderer.techracers.com" ?
It looks like the real error is further up:
./buildERC20TokenNetwork.sh: line 46: /Users/ogasawara/hyperledger-fabric/ERC20-Token-On-Hyperledger/network/../bin/configtxlator: cannot execute binary file
So either you do not have the binaries installed or they are not where they are expected.
(I would guess that the error you are seeing with the orderer is because the config hasn't been properly set up beforehand.)
Fabric 1.2.1 is quite dated now, you might be better starting off with Fabric 1.4 and working with the samples that come with Fabric and the standard documentation.
I am trying to deploy chaincode using the chain code for developers tutorial "http://hyperledger-fabric.readthedocs.io/en/latest/chaincode4ade.html". I was able to complete the steps till Terminal 2 but get an Error in the command "docker exec -it cli bash" for Terminal 3.
Output for Terminal 1:
[]Received message REGISTER from shim
peer | 2017-08-22 23:29:26.025 UTC [chaincode] HandleMessage -> DEBU 1a9 []Fabric side Handling ChaincodeMessage of type: REGISTER in state created
peer | 2017-08-22 23:29:26.025 UTC [chaincode] beforeRegisterEvent -> DEBU 1aa Received REGISTER in state created
peer | 2017-08-22 23:29:26.025 UTC [chaincode] registerHandler -> DEBU 1ab registered handler complete for chaincode mycc:0
peer | 2017-08-22 23:29:26.025 UTC [chaincode] beforeRegisterEvent -> DEBU 1ac Got REGISTER for chaincodeID = name:"mycc:0" , sending back REGISTERED
peer | 2017-08-22 23:29:26.025 UTC [chaincode] notifyDuringStartup -> DEBU 1ad nothing to notify (dev mode ?)
peer | 2017-08-22 23:29:26.025 UTC [chaincode] notifyDuringStartup -> DEBU 1ae sending READY
peer | 2017-08-22 23:29:26.025 UTC [chaincode] processStream -> DEBU 1af []Move state message READY
peer | 2017-08-22 23:29:26.025 UTC [chaincode] HandleMessage -> DEBU 1b0 []Fabric side Handling ChaincodeMessage of type: READY in state established
peer | 2017-08-22 23:29:26.026 UTC [chaincode] enterReadyState -> DEBU 1b1 []Entered state ready
peer | 2017-08-22 23:29:26.026 UTC [chaincode] notify -> DEBU 1b2 notifier Txid: does not exist
peer | 2017-08-22 23:29:26.026 UTC [chaincode] processStream -> DEBU 1b3 []sending state message READY
Output for Terminal 2:
CORE_PEER_ADDRESS=peer:7051 CORE_CHAINCODE_ID_NAME=mycc:0 ./sacc
2017-08-22 23:29:26.020 UTC [shim] SetupChaincodeLogging -> INFO 001 Chaincode log level not provided; defaulting to: INFO
2017-08-22 23:29:26.020 UTC [shim] SetupChaincodeLogging -> INFO 002 Chaincode (build level: ) starting up ...
Output for Terminal 3:
docker exec -it cli bash
Error response from daemon: Container 37efeab8d4930060c9de46d3bab9ab1ab034781be26b4a5176b80b54d6c1180b is not running
I couldn't find any resolution for this. Can anyone help me? I am using MacOS X.
I uncommented the line "command: /bin/bash -c './script.sh'" in the yaml file.
Output for docker ps after terminal 1:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
befcf58f4b59 hyperledger/fabric-ccenv "/bin/bash -c 'sle..." 21 seconds ago Up 20 seconds chaincode
3129dac3e13b hyperledger/fabric-peer "peer node start -..." 21 seconds ago Up 20 seconds 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer
56a92979e7cb hyperledger/fabric-orderer "orderer" 22 seconds ago Up 21 seconds 0.0.0.0:7050->7050/tcp orderer
Output for docker ps after terminal 2:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
befcf58f4b59 hyperledger/fabric-ccenv "/bin/bash -c 'sle..." 2 minutes ago Up 2 minutes chaincode
3129dac3e13b hyperledger/fabric-peer "peer node start -..." 2 minutes ago Up 2 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer
56a92979e7cb hyperledger/fabric-orderer "orderer" 2 minutes ago Up 2 minutes 0.0.0.0:7050->7050/tcp orderer
Cli Error while running .yaml file:
Returning dummy reject all policy because Admins could not be found in /Application/Admins
orderer | 2017-08-23 23:09:50.644 UTC [policies] GetPolicy -> DEBU 154 Returning policy Readers for evaluation
orderer | 2017-08-23 23:09:50.644 UTC [policies] GetPolicy -> DEBU 155 Returning dummy reject all policy because Readers could not be found in /Application/Readers
orderer | 2017-08-23 23:09:50.644 UTC [policies] GetPolicy -> DEBU 156 Returning policy Writers for evaluation
orderer | 2017-08-23 23:09:50.645 UTC [policies] GetPolicy -> DEBU 157 Returning dummy reject all policy because Writers could not be found in /Application/Writers
orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 158 Adding to config map: [Groups] /Channel
orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 159 Adding to config map: [Groups] /Channel/Application
orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 15a Adding to config map: [Groups] /Channel/Application/SampleOrg
cli | Error: Got unexpected status: BAD_REQUEST
orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 15b Adding to config map: [Values] /Channel/Consortium
orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 15c Adding to config map: [Groups] /Channel
cli | Usage:
cli | peer channel create [flags]
cli |
cli | Flags:
orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 15d Adding to config map: [Groups] /Channel/Application
cli | -c, --channelID string In case of a newChain command, the channel ID to create.
orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 15e Adding to config map: [Groups] /Channel/Application/SampleOrg
cli | -f, --file string Configuration transaction file generated by a tool such as configtxgen for submitting to orderer
orderer | 2017-08-23 23:09:50.646 UTC [common/configtx] addToMap -> DEBU 15f Adding to config map: [Policy] /Channel/Application/Admins
cli | -t, --timeout int Channel creation timeout (default 5)
cli |
cli | Global Flags:
cli | --cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
cli | --logging-level string Default logging level and overrides, see core.yaml for full syntax
cli | -o, --orderer string Ordering service endpoint
orderer | 2017-08-23 23:09:50.646 UTC [common/configtx] addToMap -> DEBU 160 Adding to config map: [Policy] /Channel/Application/Writers
cli | --test.coverprofile string Done (default "coverage.cov")
cli | --tls Use TLS when communicating with the orderer endpoint
cli | -v, --version Display current version of fabric peer server
cli |
orderer | 2017-08-23 23:09:50.646 UTC [common/configtx] addToMap -> DEBU 161 Adding to config map: [Policy] /Channel/Application/Readers
orderer | 2017-08-23 23:09:50.646 UTC [common/configtx] addToMap -> DEBU 162 Adding to config map: [Values] /Channel/Consortium
orderer | 2017-08-23 23:09:50.646 UTC [orderer/common/broadcast] Handle -> WARN 163 Rejecting CONFIG_UPDATE because: Error authorizing update: Error validating DeltaSet: invalid mod_policy for element [Policy] /Channel/Application/Writers: mod_policy not set
orderer | 2017-08-23 23:09:50.646 UTC [orderer/main] func1 -> DEBU 164 Closing Broadcast stream
orderer | 2017-08-23 23:09:50.648 UTC [orderer/common/deliver] Handle -> WARN 165 Error reading from stream: rpc error: code = Canceled desc = context canceled
orderer | 2017-08-23 23:09:50.649 UTC [orderer/main] func1 -> DEBU 166 Closing Deliver stream
I was able to solve this by commenting out the line "command: /bin/bash -c './script.sh'" in the "fabric-samples/chaincode-docker-devmode/docker-compose-simple.yaml" file.
I'd read how this https://jira.hyperledger.org/browse/FAB-5309 resolves, looks like the problem is with the chaincode-docker-devmode's artifacts
p.s. just update the fabric to 1.0.2 and pull the new fabric-samples repo, start the new containers, voila!
best
nas
I am following hyperledger fabric tutorial, and am having trouble registering my chaincode and possibly starting the docker image:
https://www.ibm.com/developerworks/library/j-chaincode-for-java-developers/
The following is the error I am getting when I try to register my chaincode:
$ ./Example
Hello world! starting [Ljava.lang.String;#5fd0d5ae
May 10, 2017 9:40:34 PM example.Example main
INFO: starting
May 10, 2017 9:40:34 PM io.grpc.internal.TransportSet$1 call
INFO: Created transport io.grpc.netty.NettyClientTransport#7269e694(/127.0.0.1:7051) for /127.0.0.1:7051
May 10, 2017 9:40:36 PM io.grpc.internal.TransportSet$TransportListener transportShutdown
INFO: Transport io.grpc.netty.NettyClientTransport#7269e694(/127.0.0.1:7051) for /127.0.0.1:7051 is being shutdown
May 10, 2017 9:40:36 PM io.grpc.internal.TransportSet$TransportListener transportTerminated
INFO: Transport io.grpc.netty.NettyClientTransport#7269e694(/127.0.0.1:7051) for /127.0.0.1:7051 is terminated
May 10, 2017 9:40:36 PM org.hyperledger.java.shim.ChaincodeBase$1 onError
SEVERE: Unable to connect to peer server: UNAVAILABLE
My blockchain network via docker is up and running, but the last log message is different than the expected log message (It says Connected to: [], which I assume is a null):
05:47:30.205 [peer] chatWithSomePeers -> DEBU 02f Starting up the first peer of a new network
05:47:30.205 [nodeCmd] serve -> INFO 030 Starting peer with ID=name:"vp0" , network ID=dev, address=172.17.0.3:7051, rootnodes=, validator=true
05:47:30.206 [consensus/statetransfer] verifyAndRecoverBlockchain -> DEBU 031 Validating existing blockchain, highest validated block is 0, valid through 0
05:47:30.206 [consensus/statetransfer] blockThread -> INFO 032 Validated blockchain to the genesis block
05:47:30.206 [consensus/handler] 1 -> DEBU 033 Starting up message thread for consenter
05:47:30.207 [peer] ensureConnected -> DEBU 034 Starting Peer reconnect service (touch service), with period = 6s
05:47:30.207 [rest] StartOpenchainRESTServer -> INFO 035 Initializing the REST service on 0.0.0.0:7050, TLS is disabled.
05:47:36.209 [peer] ensureConnected -> DEBU 036 Touch service indicates no dropped connections
05:47:36.209 [peer] ensureConnected -> DEBU 037 Connected to: []
05:47:36.209 [peer] ensureConnected -> DEBU 038 Discovery knows about: []
When I check for containers that are running docker shows me both of them are up, see below:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7dec77752d52 hyperledger/fabric-peer "sh -c 'sleep 5; peer" 20 minutes ago Up 20 minutes 0.0.0.0:7050-7051->7050-7051/tcp, 0.0.0.0:7053->7053/tcp blockchain_vp0_1
ac91e9bc1b0e hyperledger/fabric-membersrvc "membersrvc" 24 hours ago Up 20 minutes 0.0.0.0:7054->7054/tcp blockchain_membersrvc_1
The following git command was used:
git clone https://github.com/hyperledger/fabric.git -b v0.6
I copied and pasted the exact values for the docker-compose.yml, see below:
membersrvc:
image: hyperledger/fabric-membersrvc
ports:
- "7054:7054"
command: membersrvc
vp0:
image: hyperledger/fabric-peer
ports:
- "7050:7050"
- "7051:7051"
- "7053:7053"
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_ID=vp0
- CORE_PEER_PKI_ECA_PADDR=membersrvc:7054
- CORE_PEER_PKI_TCA_PADDR=membersrvc:7054
- CORE_PEER_PKI_TLSCA_PADDR=membersrvc:7054
- CORE_SECURITY_ENABLED=false
- CORE_SECURITY_ENROLLID=test_vp0
- CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT
links:
- membersrvc
command: sh -c "sleep 5; peer node start --peer-chaincodedev"
Is there something I am missing here? Any help is appreciated, thank you.
Seems you are working on Windows environment and did everything right except not defined any port forwarding into Oracle VM virtual box. you will have to configure
Oracle VM VirtualBox Manager - > Setting - > Network -> Advance - > port forwarding -- and define as per attached image, run and enjoy.... enter image description here
Happy Coding!
I'm trying to setup simple blockchain network with Hyperledger fabric v1.0 on 2 instances.
My scenario
Instance A: Orderer and Peer0
Instance B: Peer1
I basically followed the "Use the native binaries" section of "Getting Started" page.
What I tried is I started 1 orderer and 1 peer on instanceA.
I installed, instantiated, invoked and made a query the example chaincode.
Then I started 1 peer on instanceB.
I could let peer1 on instanceB join my channel from instanceA. I could install the chaincode on peer1 from instanceA.
But I could not execute query peer1 from instanceA.
I can see at least chaincode installed on instanceB.
Error message is:
Error: Error endorsing query: rpc error: code = 2 desc = failed to obtain cds for mycc - transaction not found mycc/mychannel1
Below are commands I tried...
[InstanceA terminal1] 1. generate orderer.block
$ configtxgen -profile SampleSingleMSPSolo -outputBlock orderer.block
[InstanceA terminal2] 2. start orderer
$ CORE_PEER_LOCALMSPID=DEFAULT CORE_LOGGING_LEVEL=DEBUG ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 ORDERER_GENERAL_GENESISMETHOD=file ORDERER_GENERAL_GENESISFILE=./orderer.block
2017-04-08 23:38:41.562 UTC [orderer/multichain] NewManagerImpl -> INFO 001 Starting with system channel testchainid and orderer type solo
2017-04-08 23:38:41.562 UTC [orderer/main] NewServer -> INFO 002 Starting orderer
2017-04-08 23:38:41.562 UTC [orderer/main] main -> INFO 003 Beginning to serve requests
2017-04-08 23:39:39.881 UTC [orderer/multichain] newChain -> INFO 004 Created and starting new chain mychannel1
[InstanceA terminal1] 3. generate channel.tx
$ configtxgen -profile SampleSingleMSPSolo -outputCreateChannelTx channel.tx -channelID mychannel1
[InstanceA terminal3] 4. start peer0
$ CORE_PEER_GOSSIP_EXTERNALENDPOINT=127.0.0.1:7051 CORE_LOGGING_LEVEL=DEBUG CORE_PEER_LOCALMSPID=DEFAULT peer node start --peer-defaultchain=false
[InstanceA terminal1] 5. Create Channel
$ CORE_PEER_LOCALMSPID=DEFAULT peer channel create -o 127.0.0.1:7050 -c mychannel1 -f channel.tx
[InstanceA terminal1] 6. Join peer0 to mychannel1
$ CORE_PEER_LOCALMSPID=DEFAULT peer channel join -b mychannel1.block
Peer joined the channel!
2017-04-08 23:39:54.463 UTC [main] main -> INFO 001 Exiting.....
[InstanceA terminal1] 7. Install a chaincode
$ CORE_PEER_LOCALMSPID=DEFAULT peer chaincode install -o 127.0.0.1:7050 -n mycc -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
ncode/go/chaincode_example02
2017-04-08 23:40:05.744 UTC [golang-platform] writeGopathSrc -> INFO 001 rootDirectory = /home/kouohhashi/work/src
2017-04-08 23:40:05.744 UTC [container] WriteFolderToTarPackage -> INFO 002 rootDirectory = /home/kouohhashi/work/src
2017-04-08 23:40:36.242 UTC [main] main -> INFO 003 Exiting.....
[InstanceA terminal1] 7. Instantiate the chaincode
$ CORE_PEER_ADDRESS=127.0.0.1:7051 CORE_PEER_LOCALMSPID=DEFAULT peer chaincode instantiate -o 127.0.0.1:7050 -C mychannel1 -n mycc -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args":["init","a", "100", "b","200"]}'
1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args":["init","a", "100", "b","200"]}'
2017-04-08 23:40:39.892 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2017-04-08 23:40:39.893 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2017-04-08 23:40:42.194 UTC [main] main -> INFO 003 Exiting.....
[InstanceA terminal1] 8. Invoke and query a command
$ CORE_PEER_ADDRESS=127.0.0.1:7051 peer chaincode invoke -o 127.0.0.1:7050 -C mychannel1 -n mycc -c '{"Args":["invoke","a","b","10"]}'
$ CORE_PEER_ADDRESS=127.0.0.1:7051 peer chaincode query -o 127.0.0.1:7050 -C mychannel1 -n mycc -c '{"Args":["query","a"]}'
Query Result: 90
2017-04-08 23:40:51.664 UTC [main] main -> INFO 001 Exiting.....
[InstanceB terminal1] 9. Create peer1 on instanceB
$ CORE_PEER_MSPCONFIGPATH=/home/kouohhashi/work/src/github.com/hyperledger/fabric/msp/sampleconfig CORE_PEER_GOSSIP_EXTERNALENDPOINT=instanceB:7051 CORE_LOGGING_LEVEL=DEBUG CORE_PEER_LOCALMSPID=DEFAULT peer node start --peer-defaultchain=false
[InstanceA terminal1] 10. Join peer1 on instance B to mychannel1 from instanceA
$ CORE_PEER_LOCALMSPID=DEFAULT CORE_PEER_ADDRESS=instanceB:7051 peer channel join -b mychannel1.block
Peer joined the channel!
2017-04-08 23:42:14.799 UTC [main] main -> INFO 001 Exiting.....
[InstanceA terminal1] 11. Install chaincode on peer1 on instanceB from instance A
$ CORE_PEER_LOCALMSPID=DEFAULT CORE_PEER_ADDRESS=instanceB:7051 peer chaincode install -o 127.0.0.1:7050 -n mycc -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2017-04-08 23:42:23.166 UTC [golang-platform] writeGopathSrc -> INFO 001 rootDirectory = /home/kouohhashi/work/src
2017-04-08 23:42:23.166 UTC [container] WriteFolderToTarPackage -> INFO 002 rootDirectory = /home/kouohhashi/work/src
2017-04-08 23:42:39.191 UTC [main] main -> INFO 003 Exiting.....
[InstanceA terminal1] 12. Query peer1 from instanceA
$ CORE_PEER_ADDRESS=instanceB:7051 peer chaincode query -o 127.0.0.1:7050 -C mychannel1 -n mycc -c '{"Args":["query","a"]}'
I got errors like below. But I can see at least mycc chaincode on
instnceB and peer join command was completed successfully.
Error: Error endorsing query: rpc error: code = 2 desc = failed to obtain cds for mycc - transaction not found mycc/mychannel1
I'm using 2 ubuntu16.04 instances and not using docker or vagrant at all. I compiled binaries by make native.
Peer1 on instanceB may not connect orderer on instanceA because I saw the error log on peer1.
2017-04-08 23:42:14.903 UTC [deliveryClient] NewDeliverService -> ERRO 286 Cannot dial to 0.0.0.0:7050, because of grpc: timed out when dialing
Looks like peer1 tried to connect 0.0.0.0 instead of instanceA.
By the way I changed the Name of Organizations to DEFAULT from SampleOrg because I got errors like below otherwise.
2017-04-08 05:17:57.919 UTC [gossip/service] configUpdated -> ERRO 25e Tried joining channel mychannel1 but our org( DEFAULT ), isn't among the orgs of the channel: [SampleOrg] , aborting.
I think this may be because peer1 on instanceB was not linked to orderder on instanceA or transaction made by peer0 was not completed and reflected on instanceB. But I have no idea how to dig in...
Please give me help.
Thanks.
I finally solved my problem.
I turned out to be simple.
The solution was changing addresses of the orderer from 127.0.0.1:7050 to (IP Address of InstanceA):7050
common/configtx/tool/configtx.yaml
Orderer: &OrdererDefaults
# Orderer Type: The orderer implementation to start.
# Available types are "solo" and "kafka".
OrdererType: solo
Addresses:
# - 127.0.0.1:7050
- <IP Address of InstanceA>:7050
By doing this, Peer1 on instanceB start connecting orderer on instanceA.
It looks like "CORE_PEER_COMMITTER_LEDGER_ORDERER environmental parameter" and "-o option" were not used anymore or overwritten by configtx.yaml.