I'm getting the following error when trying to instantiate my chaincode. Im just trying to instantiate the fabcar chaincode on a peer running in kubernetes.
kubectl exec -n blockchain $PEER_POD -- bash -c 'CORE_PEER_MSPCONFIGPATH=$ADMIN_MSP_PATH peer chaincode instantiate -o ord1-hlf-ord.blockchain.svc.cluster.local:7050 -C mychannel -n mycc -l node -v 1.0 -c '{"Args":[""]}''
This then gives me the following error:
Error: chaincode argument error: invalid character 'A' looking for beginning of object key string
I think it has something to do with passing the constructor arguments with the command ('{"Args":[""]}') but I compare these to the command used in the startFabric.sh script and its the same format:
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp" cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n fabcar -l "$LANGUAGE" -v 1.0 -c '{"Args":[""]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
Scratching my head with this one, so would really appreciate if someone knew what the problem could be...
Fabric v1.2
Logs:
kubectl exec -n blockchain $PEER_POD -- bash -c 'CORE_PEER_MSPCONFIGPATH=$ADMIN_MSP_PATH peer chaincode instantiate -o ord1-hlf-ord.blockchain.svc.cluster.local:7050 -C mychannel -n mycc -l node -v 1.0 -c '{"Args":[""]}''
2018-10-23 15:22:14.570 UTC [viperutil] getKeysRecursively -> DEBU 001 Found map[string]interface{} value for peer.BCCSP
2018-10-23 15:22:14.571 UTC [viperutil] unmarshalJSON -> DEBU 002 Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
2018-10-23 15:22:14.571 UTC [viperutil] getKeysRecursively -> DEBU 003 Found real value for peer.BCCSP.Default setting to string SW
2018-10-23 15:22:14.571 UTC [viperutil] getKeysRecursively -> DEBU 004 Found map[string]interface{} value for peer.BCCSP.SW
2018-10-23 15:22:14.572 UTC [viperutil] unmarshalJSON -> DEBU 005 Unmarshal JSON: value is not a string: 256
2018-10-23 15:22:14.572 UTC [viperutil] getKeysRecursively -> DEBU 006 Found real value for peer.BCCSP.SW.Security setting to int 256
2018-10-23 15:22:14.572 UTC [viperutil] getKeysRecursively -> DEBU 007 Found map[string]interface{} value for peer.BCCSP.SW.FileKeyStore
2018-10-23 15:22:14.572 UTC [viperutil] unmarshalJSON -> DEBU 008 Unmarshal JSON: value cannot be unmarshalled: unexpected end of JSON input
2018-10-23 15:22:14.573 UTC [viperutil] getKeysRecursively -> DEBU 009 Found real value for peer.BCCSP.SW.FileKeyStore.KeyStore setting to string
2018-10-23 15:22:14.573 UTC [viperutil] unmarshalJSON -> DEBU 00a Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
2018-10-23 15:22:14.573 UTC [viperutil] getKeysRecursively -> DEBU 00b Found real value for peer.BCCSP.SW.Hash setting to string SHA2
2018-10-23 15:22:14.573 UTC [viperutil] getKeysRecursively -> DEBU 00c Found map[string]interface{} value for peer.BCCSP.PKCS11
2018-10-23 15:22:14.574 UTC [viperutil] unmarshalJSON -> DEBU 00d Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.574 UTC [viperutil] getKeysRecursively -> DEBU 00e Found real value for peer.BCCSP.PKCS11.Pin setting to <nil> <nil>
2018-10-23 15:22:14.574 UTC [viperutil] unmarshalJSON -> DEBU 00f Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.575 UTC [viperutil] getKeysRecursively -> DEBU 010 Found real value for peer.BCCSP.PKCS11.Hash setting to <nil> <nil>
2018-10-23 15:22:14.575 UTC [viperutil] unmarshalJSON -> DEBU 011 Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.575 UTC [viperutil] getKeysRecursively -> DEBU 012 Found real value for peer.BCCSP.PKCS11.Security setting to <nil> <nil>
2018-10-23 15:22:14.576 UTC [viperutil] getKeysRecursively -> DEBU 013 Found map[string]interface{} value for peer.BCCSP.PKCS11.FileKeyStore
2018-10-23 15:22:14.576 UTC [viperutil] unmarshalJSON -> DEBU 014 Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.576 UTC [viperutil] getKeysRecursively -> DEBU 015 Found real value for peer.BCCSP.PKCS11.FileKeyStore.KeyStore setting to <nil> <nil>
2018-10-23 15:22:14.576 UTC [viperutil] unmarshalJSON -> DEBU 016 Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.577 UTC [viperutil] getKeysRecursively -> DEBU 017 Found real value for peer.BCCSP.PKCS11.Library setting to <nil> <nil>
2018-10-23 15:22:14.577 UTC [viperutil] unmarshalJSON -> DEBU 018 Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.577 UTC [viperutil] getKeysRecursively -> DEBU 019 Found real value for peer.BCCSP.PKCS11.Label setting to <nil> <nil>
2018-10-23 15:22:14.578 UTC [viperutil] EnhancedExactUnmarshalKey -> DEBU 01a map[peer.BCCSP:map[Default:SW SW:map[Hash:SHA2 Security:256 FileKeyStore:map[KeyStore:]] PKCS11:map[Pin:<nil> Hash:<nil> Security:<nil> FileKeyStore:map[KeyStore:<nil>] Library:<nil> Label:<nil>]]]
2018-10-23 15:22:14.578 UTC [bccsp_sw] openKeyStore -> DEBU 01b KeyStore opened at [/var/hyperledger/admin_msp/keystore]...done
2018-10-23 15:22:14.578 UTC [bccsp] initBCCSP -> DEBU 01c Initialize BCCSP [SW]
2018-10-23 15:22:14.579 UTC [msp] getPemMaterialFromDir -> DEBU 01d Reading directory /var/hyperledger/admin_msp/signcerts
2018-10-23 15:22:14.579 UTC [msp] getPemMaterialFromDir -> DEBU 01e Inspecting file /var/hyperledger/admin_msp/signcerts/cert.pem
2018-10-23 15:22:14.579 UTC [msp] getPemMaterialFromDir -> DEBU 01f Reading directory /var/hyperledger/admin_msp/cacerts
2018-10-23 15:22:14.579 UTC [msp] getPemMaterialFromDir -> DEBU 020 Inspecting file /var/hyperledger/admin_msp/cacerts/blockaviation-services.pem
2018-10-23 15:22:14.580 UTC [msp] getPemMaterialFromDir -> DEBU 021 Reading directory /var/hyperledger/admin_msp/admincerts
2018-10-23 15:22:14.580 UTC [msp] getPemMaterialFromDir -> DEBU 022 Inspecting file /var/hyperledger/admin_msp/admincerts/cert.pem
2018-10-23 15:22:14.580 UTC [msp] getPemMaterialFromDir -> DEBU 023 Reading directory /var/hyperledger/admin_msp/intermediatecerts
2018-10-23 15:22:14.580 UTC [msp] getPemMaterialFromDir -> DEBU 024 Reading directory /var/hyperledger/admin_msp/tlscacerts
2018-10-23 15:22:14.580 UTC [msp] getMspConfig -> DEBU 025 TLS CA certs folder not found at [/var/hyperledger/admin_msp/tlsintermediatecerts]. Skipping and ignoring TLS intermediate CA folder. [stat /var/hyperledger/admin_msp/tlscacerts: no such file or directory]
2018-10-23 15:22:14.580 UTC [msp] getPemMaterialFromDir -> DEBU 026 Reading directory /var/hyperledger/admin_msp/crls
2018-10-23 15:22:14.581 UTC [msp] getMspConfig -> DEBU 027 crls folder not found at [/var/hyperledger/admin_msp/crls]. Skipping. [stat /var/hyperledger/admin_msp/crls: no such file or directory]
2018-10-23 15:22:14.581 UTC [msp] getMspConfig -> DEBU 028 MSP configuration file not found at [/var/hyperledger/admin_msp/config.yaml]: [stat /var/hyperledger/admin_msp/config.yaml: no such file or directory]
2018-10-23 15:22:14.581 UTC [msp] newBccspMsp -> DEBU 029 Creating BCCSP-based MSP instance
2018-10-23 15:22:14.581 UTC [msp] New -> DEBU 02a Creating Cache-MSP instance
2018-10-23 15:22:14.582 UTC [msp] loadLocaMSP -> DEBU 02b Created new local MSP
2018-10-23 15:22:14.582 UTC [msp] Setup -> DEBU 02c Setting up MSP instance BlockAviationMSP
2018-10-23 15:22:14.582 UTC [msp/identity] newIdentity -> DEBU 02d Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIIB9zCCAZ2gAwIBAgIUCE/wmCRC7YD+GhpuARvf2L/kf0AwCgYIKoZIzj0EAwIw
WDELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjEWMBQGA1UEChMNQmxvY2tB
dmlhdGlvbjETMBEGA1UECxMKQmxvY2tjaGFpbjELMAkGA1UEAxMCY2EwHhcNMTgx
MDEwMDkwNTAwWhcNMzMxMDA2MDkwNTAwWjBYMQswCQYDVQQGEwJJRTEPMA0GA1UE
CBMGRHVibGluMRYwFAYDVQQKEw1CbG9ja0F2aWF0aW9uMRMwEQYDVQQLEwpCbG9j
a2NoYWluMQswCQYDVQQDEwJjYTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABMTw
E+YnpUu1r9CwI59Hd1/kti4hLNBfmqeJeYQjswCImGjI+2T+0ppo6n1+PcRvwS5o
ngo2cx/xd5+HPTjh3aqjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG
AQH/AgEBMB0GA1UdDgQWBBTVE0UL2bC1lTxg0ALgzYUAPfvuyDAKBggqhkjOPQQD
AgNIADBFAiEAnOSGBJJvz8CeZWNU649XF9S7DKExrwMXnUbYP25qDoMCIFJJUlmP
Fcn5L1OUAFsOHl5yqlecHKTxw7cOSxajNv3n
-----END CERTIFICATE-----
2018-10-23 15:22:14.583 UTC [msp/identity] newIdentity -> DEBU 02e Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICqTCCAk+gAwIBAgIUche39/1Fn4Vr3QCrlTiApXyLSQQwCgYIKoZIzj0EAwIw
WDELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjEWMBQGA1UEChMNQmxvY2tB
dmlhdGlvbjETMBEGA1UECxMKQmxvY2tjaGFpbjELMAkGA1UEAxMCY2EwHhcNMTgx
MDEwMDkyNzAwWhcNMTkxMDEwMDkzMjAwWjBbMQswCQYDVQQGEwJJRTEPMA0GA1UE
CBMGRHVibGluMRYwFAYDVQQKEw1CbG9ja0F2aWF0aW9uMQ8wDQYDVQQLEwZjbGll
bnQxEjAQBgNVBAMTCW9yZy1hZG1pbjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
BElbCKujSewmoNGmPjysC3guQrtzG/zckAj5HsmScv8x9Cv75QTBllbfuOCbVobV
mIfizTsPL/fiJF7xpY+hNdijgfMwgfAwDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB
/wQCMAAwHQYDVR0OBBYEFKE14HVT0hEuCG+oLQxV1IcQZTq3MB8GA1UdIwQYMBaA
FNUTRQvZsLWVPGDQAuDNhQA9++7IMCMGA1UdEQQcMBqCGFNpbW9ucy1NYWNCb29r
LVByby5sb2NhbDBrBggqAwQFBgcIAQRfeyJhdHRycyI6eyJhZG1pbiI6InRydWUi
LCJoZi5BZmZpbGlhdGlvbiI6IiIsImhmLkVucm9sbG1lbnRJRCI6Im9yZy1hZG1p
biIsImhmLlR5cGUiOiJjbGllbnQifX0wCgYIKoZIzj0EAwIDSAAwRQIhALezaB2/
rNSKJHaDMo++yQJS3kWQTJnKe2WxWqpA2wEWAiAMM0BgXiV8Losu5quVGHi8F0pF
MRpjqst5LP+uaQu4rg==
-----END CERTIFICATE-----
2018-10-23 15:22:14.600 UTC [msp/identity] newIdentity -> DEBU 02f Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICqTCCAk+gAwIBAgIUche39/1Fn4Vr3QCrlTiApXyLSQQwCgYIKoZIzj0EAwIw
WDELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjEWMBQGA1UEChMNQmxvY2tB
dmlhdGlvbjETMBEGA1UECxMKQmxvY2tjaGFpbjELMAkGA1UEAxMCY2EwHhcNMTgx
MDEwMDkyNzAwWhcNMTkxMDEwMDkzMjAwWjBbMQswCQYDVQQGEwJJRTEPMA0GA1UE
CBMGRHVibGluMRYwFAYDVQQKEw1CbG9ja0F2aWF0aW9uMQ8wDQYDVQQLEwZjbGll
bnQxEjAQBgNVBAMTCW9yZy1hZG1pbjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
BElbCKujSewmoNGmPjysC3guQrtzG/zckAj5HsmScv8x9Cv75QTBllbfuOCbVobV
mIfizTsPL/fiJF7xpY+hNdijgfMwgfAwDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB
/wQCMAAwHQYDVR0OBBYEFKE14HVT0hEuCG+oLQxV1IcQZTq3MB8GA1UdIwQYMBaA
FNUTRQvZsLWVPGDQAuDNhQA9++7IMCMGA1UdEQQcMBqCGFNpbW9ucy1NYWNCb29r
LVByby5sb2NhbDBrBggqAwQFBgcIAQRfeyJhdHRycyI6eyJhZG1pbiI6InRydWUi
LCJoZi5BZmZpbGlhdGlvbiI6IiIsImhmLkVucm9sbG1lbnRJRCI6Im9yZy1hZG1p
biIsImhmLlR5cGUiOiJjbGllbnQifX0wCgYIKoZIzj0EAwIDSAAwRQIhALezaB2/
rNSKJHaDMo++yQJS3kWQTJnKe2WxWqpA2wEWAiAMM0BgXiV8Losu5quVGHi8F0pF
MRpjqst5LP+uaQu4rg==
-----END CERTIFICATE-----
2018-10-23 15:22:14.601 UTC [msp/identity] newIdentity -> DEBU 030 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICqTCCAk+gAwIBAgIUche39/1Fn4Vr3QCrlTiApXyLSQQwCgYIKoZIzj0EAwIw
WDELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjEWMBQGA1UEChMNQmxvY2tB
dmlhdGlvbjETMBEGA1UECxMKQmxvY2tjaGFpbjELMAkGA1UEAxMCY2EwHhcNMTgx
MDEwMDkyNzAwWhcNMTkxMDEwMDkzMjAwWjBbMQswCQYDVQQGEwJJRTEPMA0GA1UE
CBMGRHVibGluMRYwFAYDVQQKEw1CbG9ja0F2aWF0aW9uMQ8wDQYDVQQLEwZjbGll
bnQxEjAQBgNVBAMTCW9yZy1hZG1pbjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
BElbCKujSewmoNGmPjysC3guQrtzG/zckAj5HsmScv8x9Cv75QTBllbfuOCbVobV
mIfizTsPL/fiJF7xpY+hNdijgfMwgfAwDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB
/wQCMAAwHQYDVR0OBBYEFKE14HVT0hEuCG+oLQxV1IcQZTq3MB8GA1UdIwQYMBaA
FNUTRQvZsLWVPGDQAuDNhQA9++7IMCMGA1UdEQQcMBqCGFNpbW9ucy1NYWNCb29r
LVByby5sb2NhbDBrBggqAwQFBgcIAQRfeyJhdHRycyI6eyJhZG1pbiI6InRydWUi
LCJoZi5BZmZpbGlhdGlvbiI6IiIsImhmLkVucm9sbG1lbnRJRCI6Im9yZy1hZG1p
biIsImhmLlR5cGUiOiJjbGllbnQifX0wCgYIKoZIzj0EAwIDSAAwRQIhALezaB2/
rNSKJHaDMo++yQJS3kWQTJnKe2WxWqpA2wEWAiAMM0BgXiV8Losu5quVGHi8F0pF
MRpjqst5LP+uaQu4rg==
-----END CERTIFICATE-----
2018-10-23 15:22:14.601 UTC [msp] setupSigningIdentity -> DEBU 031 Signing identity expires at 2019-10-10 09:32:00 +0000 UTC
2018-10-23 15:22:14.601 UTC [msp] Validate -> DEBU 032 MSP BlockAviationMSP validating identity
2018-10-23 15:22:14.602 UTC [grpc] Printf -> DEBU 033 parsed scheme: ""
2018-10-23 15:22:14.603 UTC [grpc] Printf -> DEBU 034 scheme "" not registered, fallback to default scheme
2018-10-23 15:22:14.603 UTC [grpc] Printf -> DEBU 035 ccResolverWrapper: sending new addresses to cc: [{peer1-hlf-peer:7051 0 <nil>}]
2018-10-23 15:22:14.603 UTC [grpc] Printf -> DEBU 036 ClientConn switching balancer to "pick_first"
2018-10-23 15:22:14.603 UTC [grpc] Printf -> DEBU 037 pickfirstBalancer: HandleSubConnStateChange: 0xc4202110c0, CONNECTING
2018-10-23 15:22:14.606 UTC [grpc] Printf -> DEBU 038 pickfirstBalancer: HandleSubConnStateChange: 0xc4202110c0, READY
2018-10-23 15:22:14.607 UTC [grpc] Printf -> DEBU 039 parsed scheme: ""
2018-10-23 15:22:14.607 UTC [grpc] Printf -> DEBU 03a scheme "" not registered, fallback to default scheme
2018-10-23 15:22:14.607 UTC [grpc] Printf -> DEBU 03b ccResolverWrapper: sending new addresses to cc: [{peer1-hlf-peer:7051 0 <nil>}]
2018-10-23 15:22:14.607 UTC [grpc] Printf -> DEBU 03c ClientConn switching balancer to "pick_first"
2018-10-23 15:22:14.607 UTC [grpc] Printf -> DEBU 03d pickfirstBalancer: HandleSubConnStateChange: 0xc42052e630, CONNECTING
2018-10-23 15:22:14.609 UTC [grpc] Printf -> DEBU 03e pickfirstBalancer: HandleSubConnStateChange: 0xc42052e630, READY
2018-10-23 15:22:14.610 UTC [msp] GetDefaultSigningIdentity -> DEBU 03f Obtaining default signing identity
2018-10-23 15:22:14.610 UTC [grpc] Printf -> DEBU 040 parsed scheme: ""
2018-10-23 15:22:14.610 UTC [grpc] Printf -> DEBU 041 scheme "" not registered, fallback to default scheme
2018-10-23 15:22:14.610 UTC [grpc] Printf -> DEBU 042 ccResolverWrapper: sending new addresses to cc: [{ord1-hlf-ord.blockchain.svc.cluster.local:7050 0 <nil>}]
2018-10-23 15:22:14.610 UTC [grpc] Printf -> DEBU 043 ClientConn switching balancer to "pick_first"
2018-10-23 15:22:14.611 UTC [grpc] Printf -> DEBU 044 pickfirstBalancer: HandleSubConnStateChange: 0xc4200e9b70, CONNECTING
2018-10-23 15:22:14.625 UTC [grpc] Printf -> DEBU 045 pickfirstBalancer: HandleSubConnStateChange: 0xc4200e9b70, READY
2018-10-23 15:22:14.625 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 046 Using default escc
2018-10-23 15:22:14.626 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 047 Using default vscc
Error: chaincode argument error: invalid character 'A' looking for beginning of object key string
Usage:
peer chaincode instantiate [flags]
Flags:
-C, --channelID string The channel on which this command should be executed
--collections-config string The fully qualified path to the collection JSON file including the file name
--connectionProfile string Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-E, --escc string The name of the endorsement system chaincode to be used for this chaincode
-h, --help help for instantiate
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
--peerAddresses stringArray The addresses of the peers to connect to
-P, --policy string The endorsement policy associated to this chaincode
--tlsRootCertFiles stringArray If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flag
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
-V, --vscc string The name of the verification system chaincode to be used for this chaincode
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with the orderer endpoint
--connTimeout duration Timeout for client to connect (default 3s)
--keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer 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.
--tls Use TLS when communicating with the orderer endpoint
--transient string Transient map of arguments in JSON encoding
command terminated with exit code 1
Related
I'm trying to instantiate the code using fabric-tools. The peer runs on Container Optimized OS in Google Cloud. Install works (sorry maybe some parameters are not necessary):
docker exec -e \"CORE_PEER_LOCALMSPID=${ORGANIZATION^}MSP\" ^
-e \"CORE_PEER_MSPCONFIGPATH=/home/crypto/peerOrganizations/${ORGANIZATION}/users/Admin#${ORGANIZATION}/msp\" ^
-e \"CORE_PEER_TLS_CERT_FILE=/home/crypto/peerOrganizations/${ORGANIZATION}/peers/${PEER_NAME}.${ORGANIZATION}/tls/server.crt\" ^
-e \"CORE_PEER_TLS_KEY_FILE=/home/crypto/peerOrganizations/${ORGANIZATION}/peers/${PEER_NAME}.${ORGANIZATION}/tls/server.key\" ^
-e \"CORE_PEER_TLS_ROOTCERT_FILE=/home/crypto/peerOrganizations/${ORGANIZATION}/peers/${PEER_NAME}.${ORGANIZATION}/tls/ca.crt\" ^
-e \"CORE_PEER_ADDRESS=${PEER_NAME}:7051\" ^
-e \"CORE_PEER_CHAINCODEADDRESS=${PEER_NAME}:7052\" ^
$CLI peer chaincode install -n my-blockchain -v 0.0.3 -p //home//github.com//my-blockchain -l node
Instantiate fails:
docker exec -e \"CORE_PEER_LOCALMSPID=${ORGANIZATION^}MSP\" ^
-e \"CORE_PEER_MSPCONFIGPATH=/home/crypto/peerOrganizations/${ORGANIZATION}/users/Admin#${ORGANIZATION}/msp\" ^
-e \"CORE_PEER_TLS_CERT_FILE=/home/crypto/peerOrganizations/${ORGANIZATION}/peers/${PEER_NAME}.${ORGANIZATION}/tls/server.crt\" ^
-e \"CORE_PEER_TLS_KEY_FILE=/home/crypto/peerOrganizations/${ORGANIZATION}/peers/${PEER_NAME}.${ORGANIZATION}/tls/server.key\" ^
-e \"CORE_PEER_TLS_ROOTCERT_FILE=/home/crypto/peerOrganizations/${ORGANIZATION}/peers/${PEER_NAME}.${ORGANIZATION}/tls/ca.crt\" ^
-e \"CORE_PEER_ADDRESS=${PEER_NAME}:7051\" ^
-e \"CORE_PEER_CHAINCODEADDRESS=${PEER_NAME}:7052\" ^
$CLI peer chaincode instantiate -o orderer1:7050 -C my-channel -n my-blockchain ^
-l node -v 0.0.3 -c \"{\\\"Args\\\":[]}\" ^
-P \"OR ('Org1MSP.member')\" ^
--tls --cafile $TLS_CERT --keyfile $KEY_FILE --cafile $ORDERER_TLS_CERT -o orderer1:7050
with
2020-03-19 22:09:03.562 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2020-03-19 22:09:03.562 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "cp: cannot stat '/chaincode/input/src/.': No such file or directory
My CLI docker-compose file looks like that (/var/run stuff looks strange because I tried to make it work on Google COS where parts of the system are immutable):
version: '3'
networks:
my_net:
services:
cli-org1:
hostname: cli-org1
image: hyperledger/fabric-tools:1.4
tty: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- FABRIC_LOGGING_SPEC=info
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=hyperledger_my_net
- CORE_PEER_ID=peer0
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_MSPCONFIGPATH=/home/crypto/peerOrganizations/org1/users/Admin#org1/msp
- CORE_PEER_LOCALMSPID=Org1MSP
#peerOrganizations/org1/peers/peer0.org1/tls/server.crt
- CORE_PEER_TLS_CERT_FILE=/home/crypto/peerOrganizations/org1/peers/peer0.org1/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/home/crypto/peerOrganizations/org1/peers/peer0.org1/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/home/crypto/peerOrganizations/org1/peers/peer0.org1/tls/ca.crt
- CORE_PEER_ADDRESS=peer0:7051
- CORE_PEER_CHAINCODEADDRESS=peer0:7052
- CORE_CHAINCODE_KEEPALIVE=10
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: /bin/bash
volumes:
- ./var/cli_run/:/host/var/run/
- /var/run/docker.sock:/var/run/docker.sock
- /var/run/docker.sock:/host/run/var/docker.sock
- ./chaincode/:/home/github.com/
- ./crypto-config:/home/crypto/
extra_hosts:
- "orderer1:111.111.111.111"
- "peer0:111.111.111.111"
networks:
my_net:
aliases:
- cli-org1
This is how orderer logs look like:
2020-03-19 21:57:50.723 UTC [orderer.common.server] replicateDisabledChains -> DEBU 87d No inactive chains to try to replicate
2020-03-19 22:02:50.724 UTC [orderer.common.server] replicateDisabledChains -> DEBU 87e No inactive chains to try to replicate
2020-03-19 22:07:50.724 UTC [orderer.common.server] replicateDisabledChains -> DEBU 87f No inactive chains to try to replicate
2020-03-19 22:12:50.724 UTC [orderer.common.server] replicateDisabledChains -> DEBU 880 No inactive chains to try to replicate
2020-03-19 22:16:00.250 UTC [orderer.common.server] Broadcast -> DEBU 881 Starting new Broadcast handler
2020-03-19 22:16:00.250 UTC [orderer.common.broadcast] Handle -> DEBU 882 Starting new broadcast loop for 178.4.35.173:52041
2020-03-19 22:16:01.131 UTC [orderer.common.broadcast] Handle -> WARN 883 Error reading from 178.4.35.173:52041: rpc error: code = Canceled desc = context canceled
2020-03-19 22:16:01.131 UTC [orderer.common.server] func1 -> DEBU 884 Closing Broadcast stream
2020-03-19 22:16:01.131 UTC [comm.grpc.server] 1 -> INFO 885 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=178.4.35.173:52041 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=881.822921ms
2020-03-19 22:16:01.131 UTC [grpc] infof -> DEBU 886 transport: loopyWriter.run returning. connection error: desc = "transport is closing"
2020-03-19 22:17:50.724 UTC [orderer.common.server] replicateDisabledChains -> DEBU 887 No inactive chains to try to replicate
2020-03-19 22:19:26.918 UTC [orderer.common.server] Broadcast -> DEBU 888 Starting new Broadcast handler
2020-03-19 22:19:26.918 UTC [orderer.common.broadcast] Handle -> DEBU 889 Starting new broadcast loop for 178.4.35.173:52073
2020-03-19 22:19:27.780 UTC [grpc] infof -> DEBU 88a transport: loopyWriter.run returning. connection error: desc = "transport is closing"
2020-03-19 22:19:27.780 UTC [orderer.common.broadcast] Handle -> DEBU 88b Received EOF from 178.4.35.173:52073, hangup
2020-03-19 22:19:27.780 UTC [orderer.common.server] func1 -> DEBU 88c Closing Broadcast stream
2020-03-19 22:19:27.780 UTC [comm.grpc.server] 1 -> INFO 88d streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=178.4.35.173:52073 grpc.code=OK grpc.call_duration=861.76369ms
What could be the problem? For example where is this folder /chaincode/input/src/. is missing? On a host system? But because the root directory is immutable I cannot create /chaincode there.
The problem is simple and has at this point almost nothing to do with Hyperledger. I work under Windows but use Git Bash to automate some processes. Docker under Windows doesn't work good with Git Bash. Earlier I was running the installation inside my script like this:
COMMAND="docker exec -e \"CORE_PEER_LOCALMSPID=${ORGANIZATION^}MSP\" ^
-e \"CORE_PEER_MSPCONFIGPATH=/home/crypto/peerOrganizations/${ORGANIZATION}/users/Admin#${ORGANIZATION}/msp\" ^
-e \"CORE_PEER_TLS_CERT_FILE=/home/crypto/peerOrganizations/${ORGANIZATION}/peers/${PEER_NAME}.${ORGANIZATION}/tls/server.crt\" ^
-e \"CORE_PEER_TLS_KEY_FILE=/home/crypto/peerOrganizations/${ORGANIZATION}/peers/${PEER_NAME}.${ORGANIZATION}/tls/server.key\" ^
-e \"CORE_PEER_TLS_ROOTCERT_FILE=/home/crypto/peerOrganizations/${ORGANIZATION}/peers/${PEER_NAME}.${ORGANIZATION}/tls/ca.crt\" ^
-e \"CORE_PEER_ADDRESS=${PEER_NAME}:7051\" ^
-e \"CORE_PEER_CHAINCODEADDRESS=${PEER_NAME}:7052\" ^
$CLI peer chaincode install -n my-blockchain -v 0.0.3 -p //home//github.com//my-blockchain -l node"
cmd //c $COMMAND
Exactly this execution messed up "successful" chaincode installation. And made it impossible to instantiate the code later.
I replaced // with / in //home//github.com//my-blockchain, saved the whole command to a file, and executed it as follows:
echo "$COMMAND" > install.bat
cmd "//c install.bat"
After that everything works fine. However, since the installation had status 200, but no entries in CouchDB have been entered I find it a little bit incorrect.
I wish I could read the payload of a transaction and be able to extract information. I created a new entry in the ledger by invoking my chaincode's "createPerson" method
+ peer chaincode invoke -o orderer.example.com:7050 --waitForEvent --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n agrifood -c '{"Args":["createPerson","ADMIN0","GIACOMO","BAIAMONTE","06/04/1992"]}' --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
+ res=0
+ set +x
2020-02-04 16:11:07.796 UTC [chaincodeCmd] ClientWait -> INFO 001 txid [2a46c341d130e02df9b8c874cc7c91623c09b83d92d5058d73e04ec29dcc4ccb] committed with status (VALID) at peer0.org1.example.com:7051
2020-02-04 16:11:07.796 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 002 Chaincode invoke successful. result: status:200
From the cli I invoke the following command
peer chaincode query -C "mychannel" -n qscc -c '{"Args":["GetTransactionByID", "mychannel", "2a46c341d130e02df9b8c874cc7c91623c09b83d92d5058d73e04ec29dcc4ccb"]}'
And I get the following output
�
�
�
�
��������" mychannel*#2a46c341d130e02df9b8c874cc7c91623c09b83d92d5058d73e04ec29dcc4ccb:
agrifood�
�
Org1MSP�-----BEGIN CERTIFICATE-----
MIICKTCCAdCgAwIBAgIRALz/BhhCP8Nix7wdAENP2iAwCgYIKoZIzj0EAwIwczEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
Lm9yZzEuZXhhbXBsZS5jb20wHhcNMjAwMjA0MTYwNTAwWhcNMzAwMjAxMTYwNTAw
WjBrMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
U2FuIEZyYW5jaXNjbzEOMAwGA1UECxMFYWRtaW4xHzAdBgNVBAMMFkFkbWluQG9y
ZzEuZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAREshakyciI
ajGOcnSafW1VeQRyrU1daKt8T8ChxOczK7ZmqtStqMoTV6p0taG+gEt6h4izjASU
GZoAu8TBwDlco00wSzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADArBgNV
HSMEJDAigCDuZFnU+UUOj0124lRSe7mdb4T2tx+JONu/JEBM9xuySzAKBggqhkjO
PQQDAgNHADBEAiB96pv1IaZaUVEN8mA0Reu7FbMu1pG5MpYRyMrbeXVOAwIgaSGP
XLrsTVPkalB8TY2xDU6QRoavFc4BaUCaJqq1o3E=
-----END CERTIFICATE-----
sy��
�&\K��^�ZCA!��
�
�
�
Org1MSP�-----BEGIN CERTIFICATE-----
MIICKTCCAdCgAwIBAgIRALz/BhhCP8Nix7wdAENP2iAwCgYIKoZIzj0EAwIwczEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
Lm9yZzEuZXhhbXBsZS5jb20wHhcNMjAwMjA0MTYwNTAwWhcNMzAwMjAxMTYwNTAw
WjBrMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
U2FuIEZyYW5jaXNjbzEOMAwGA1UECxMFYWRtaW4xHzAdBgNVBAMMFkFkbWluQG9y
ZzEuZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAREshakyciI
ajGOcnSafW1VeQRyrU1daKt8T8ChxOczK7ZmqtStqMoTV6p0taG+gEt6h4izjASU
GZoAu8TBwDlco00wSzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADArBgNV
HSMEJDAigCDuZFnU+UUOj0124lRSe7mdb4T2tx+JONu/JEBM9xuySzAKBggqhkjO
PQQDAgNHADBEAiB96pv1IaZaUVEN8mA0Reu7FbMu1pG5MpYRyMrbeXVOAwIgaSGP
XLrsTVPkalB8TY2xDU6QRoavFc4BaUCaJqq1o3E=
-----END CERTIFICATE-----
sy��
�&\K��^�ZCA!��
J
H
F
agrifood�6
createPerson
ADMIN0
GIACOMO
BAIAMONTE
06/04/1992�
�
~��VM<o.
�S�B���j�#��� �
��
agrifood�
ADMIN0
LASTPERSON�
LASTPERSON�0�^
PERSON0�S{"issuer":"ADMIN0","name":"GIACOMO","surname":"BAIAMONTE","birthdate":"06/04/1992"}
lscc
agrifoo�agrifood�0.1�
�
Org1MSP�-----BEGIN CERTIFICATE-----
MIICJzCCAc6gAwIBAgIQf0eP9nAcSiuwM74L4SdqWDAKBggqhkjOPQQDAjBzMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
b3JnMS5leGFtcGxlLmNvbTAeFw0yMDAyMDQxNjA1MDBaFw0zMDAyMDExNjA1MDBa
MGoxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
YW4gRnJhbmNpc2NvMQ0wCwYDVQQLEwRwZWVyMR8wHQYDVQQDExZwZWVyMC5vcmcx
LmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEnWpcbxPA3Dt
bv5vmv8Rb9XkpFUGxLoe8Gm/GXgMIsEdYx9xm+B0TfSQhlex3+DsKxvO+mwfOy1R
XDlOUp6zT6NNMEswDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0j
BCQwIoAg7mRZ1PlFDo9NduJUUnu5nW+E9rcfiTjbvyRATPcbskswCgYIKoZIzj0E
AwIDRwAwRAIgV6UymH5EOJVn57/Q+PzNrTtl3kQthh9DRL9Z4Rd5/CkCIDgwhRbn
OCcot+ZMBe1l2TUJR30BSKSmnSfilMOYYpQy
-----END CERTIFICATE-----
G0E!��{��n n����u{���DFr� 4�ڨ &Y�f��'��ti�m:��9$��ܦr���S笕G0E!ۖ%��m�+!�l�k����A��O���cO/* $�w�a=B�����
��;�+I
u=N]��=D��
It seems that an incorrect encoding is used, the environment variable "LANG" of the cli is "en_US.UTF-8".
I believe that if the encoding was correct I could be able to parse some information such as the name of the method invoked by that transaction. Is it normal for the output to look like this? Are there other ways to read information from a transaction? Thanks in advance
I want to add a new orderer node in a running hyperledger-fabric network. I've used etcdraft as consensus between the orderers.
I've followed step by step process of this accepted answer. In step #15, it is mentioned that, I've to fetch the latest config block from the system channel and use this block as genesis block of the new ordering service.
So, I've copied the config block to the channel-artifacts folder [file name: config_block.pb] and then spin up a new container using a docker-compose.yaml file. As a reference I am posting the docker-compose.yaml file here:
version: '2'
volumes:
orderer6.example.com:
networks:
byfn:
services:
orderer6.example.com:
image: hyperledger/fabric-orderer:latest
environment:
- FABRIC_LOGGING_SPEC=INFO
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
# enabled TLS
- ORDERER_GENERAL_TLS_ENABLED=true
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
- ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
- ORDERER_KAFKA_VERBOSE=true
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
container_name: orderer6.example.com
networks:
- byfn
volumes:
- ./channel-artifacts/config_block.pb:/var/hyperledger/orderer/orderer.genesis.block
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer6.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer6.example.com/tls/:/var/hyperledger/orderer/tls
- orderer6.example.com:/var/hyperledger/production/orderer
ports:
- 13050:7050
Finally, I'm running the orderer service using:
docker-compose -f orderer6.yaml up
The container starts and after a few seconds it crashes. Log file of the container shows:
orderer6.example.com | 2020-01-07 09:03:12.363 UTC [orderer.common.cluster.replication] obtainStream -> INFO 03f Sending request for block [2] to orderer.example.com:7050
orderer6.example.com | 2020-01-07 09:03:12.365 UTC [orderer.common.cluster.replication] pullBlocks -> INFO 040 Got block [2] of size 47 KB from orderer.example.com:7050
orderer6.example.com | 2020-01-07 09:03:12.377 UTC [orderer.common.cluster] appendBlock -> PANI 041 Failed to write block [2]: unexpected Previous block hash. Expected PreviousHash = [1c99accab83de7a415061120831519badf4807c97a0195ab5f42bab979a7dc09], PreviousHash referred in the latest block= [37f11444fb0b1ca51419b5f1a95fab616d5179ed44a87716677f1b706c0b1854]
orderer6.example.com | panic: Failed to write block [2]: unexpected Previous block hash. Expected PreviousHash = [1c99accab83de7a415061120831519badf4807c97a0195ab5f42bab979a7dc09], PreviousHash referred in the latest block= [37f11444fb0b1ca51419b5f1a95fab616d5179ed44a87716677f1b706c0b1854]
orderer6.example.com |
orderer6.example.com | goroutine 1 [running]:
orderer6.example.com | github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc00014db80, 0x0, 0x0, 0x0)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:229 +0x546
orderer6.example.com | github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).log(0xc000010a58, 0xc00004ae04, 0x1548ed8, 0x1e, 0xc00030b458, 0x2, 0x2, 0x0, 0x0, 0x0)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0x101
orderer6.example.com | github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).Panicf(...)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159
orderer6.example.com | github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panicf(...)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/common/flogging/zap.go:74
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/cluster.(*Replicator).appendBlock(0xc000089bc0, 0xc0002e4a80, 0x16b8760, 0xc00068d0e0, 0xc000571f60, 0x10)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/cluster/replication.go:253 +0x283
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/cluster.(*Replicator).pullChannelBlocks(0xc000089bc0, 0xc000571f60, 0x10, 0xc00053e2a0, 0x3, 0x16b8760, 0xc00068d0e0, 0x0, 0x0)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/cluster/replication.go:221 +0xd8
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/cluster.(*Replicator).PullChannel(0xc000089bc0, 0xc000571f60, 0x10, 0x0, 0x0)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/cluster/replication.go:207 +0x411
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/cluster.(*Replicator).ReplicateChains(0xc000089bc0, 0xc00030ba88, 0x1, 0x1)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/cluster/replication.go:163 +0x3ed
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/server.(*replicationInitiator).replicateNeededChannels(0xc000214180, 0xc00011ce00)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/onboarding.go:102 +0x19a
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/server.(*replicationInitiator).replicateIfNeeded(0xc000214180, 0xc00011ce00)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/onboarding.go:48 +0x9a
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/server.Start(0x15309fe, 0x5, 0xc000394900)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:124 +0x11c8
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/server.Main()
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:91 +0x208
orderer6.example.com | main.main()
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/main.go:15 +0x20
orderer6.example.com exited with code 2
Details log of the orderer is in here.
What's the problem in my approach? I've used byfn network as my test bed by running:
./byfn up -o etcdraft
There is an issue with respect to the volumes being mount to the new orderer container. It is using an existing volume for the new orderer, because probably you kept pulling down the "byfn.sh" script and just used it again to up the network.
Go to the docker-compose file which is used to bring up the new orderer node. Check the volumes section at the top of the file as well as within the container definition where it is actually mounted:
volumes:
orderer6.example.com:
and
- orderer6.example.com:/var/hyperledger/production/orderer.
Change the name of the volume being created and mounted to completely new name. Every step mentioned in the official documentation just works fine thereafter.
./configtxgen mychannel.block > test3.json
2019-09-01 15:45:24.878 PKT [common/tools/configtxgen] main -> INFO 001 Loading configuration
2019-09-01 15:45:24.878 PKT [common/tools/configtxgen/localconfig] LoadTopLevel -> PANI 002 Error reading configuration: Unsupported Config Type ""
2019-09-01 15:45:24.878 PKT [common/tools/configtxgen] func1 -> PANI 003 Error reading configuration: Unsupported Config Type ""
panic: Error reading configuration: Unsupported Config Type "" [recovered]
panic: Error reading configuration: Unsupported Config Type ""
goroutine 1 [running]:
github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc42054e9a0, 0x0, 0x0, 0x0)
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go
Seems like you need mychannel.block as json format
Follow the steps below in order to get the result
One can decode this mychannel.block using protolator & configtxlator
Commands:
Step1: GOTO fabricsamples/bin ./configtxlator start
Step2: GOTO mychannel.block file location then issue below command
curl -X POST --data-binary #mychannel.block http://127.0.0.1:7059/protolator/decode/common.Block > mychannel.json
I have done the same for sample genesis.block check this
http://ideone.com/L1hcRX which contain genesis.block as json format
which contain all network information.
I have created a key, and created a subkey. With a subkey, I signed a file. Verification works. Revoked the key, verification does not hold. This is the expected behavior.
However, If I try to sign with the same subkey and verify it still works. What am I doing wrong? Here is what am I doing in full:
$ gpg --gen-key
$ gpg -k
/Users/mustafa/.gnupg/pubring.kbx
---------------------------------
pub rsa2048 2019-02-03 [SC] [expires: 2021-02-02]
5DD923FBCF6392A5CB366167D4C0627A07510C6C
uid [ultimate] Mustafa <mustafa91#gmail.com>
sub rsa2048 2019-02-03 [E] [expires: 2021-02-02]
Using edit key, add a subkey.
$ gpg --edit-key 5DD923FBCF6392A5CB366167D4C0627A07510C6C
sec rsa2048/D4C0627A07510C6C
created: 2019-02-03 expires: 2021-02-02 usage: SC
trust: ultimate validity: ultimate
ssb rsa2048/E058B91696C43666
created: 2019-02-03 expires: 2021-02-02 usage: E
gpg> addkey
sec rsa2048/D4C0627A07510C6C
created: 2019-02-03 expires: 2021-02-02 usage: SC
trust: ultimate validity: ultimate
ssb rsa2048/E058B91696C43666
created: 2019-02-03 expires: 2021-02-02 usage: E
ssb rsa2048/38616BDAE66E418C
created: 2019-02-03 expires: 2019-02-13 usage: S
[ultimate] (1). Mustafa <mustafa91#gmail.com>
gpg> q
Save changes? (y/N) y
Sign a file and verify it.
$ gpg --armor --detach-sign --default-key 38616BDAE66E418C test.txt
gpg: using "38616BDAE66E418C" as default secret key for signing
$ gpg --verify test.txt.asc test.txt
gpg: Signature made Sun Feb 3 21:49:43 2019 +03
gpg: using RSA key 485FC77FC73DA3B800C7F41538616BDAE66E418C
gpg: Good signature from "Mustafa <mustafa91#gmail.com>" [ultimate]
Revoke the key with message "This key is now in the hands of the enemy."
$ gpg --edit-key 5DD923FBCF6392A5CB366167D4C0627A07510C6C
gpg> key 2
sec rsa2048/D4C0627A07510C6C
created: 2019-02-03 expires: 2021-02-02 usage: SC
trust: ultimate validity: ultimate
ssb rsa2048/E058B91696C43666
created: 2019-02-03 expires: 2021-02-02 usage: E
ssb* rsa2048/38616BDAE66E418C
created: 2019-02-03 expires: 2019-02-13 usage: S
gpg> revkey
sec rsa2048/D4C0627A07510C6C
created: 2019-02-03 expires: 2021-02-02 usage: SC
trust: ultimate validity: ultimate
ssb rsa2048/E058B91696C43666
created: 2019-02-03 expires: 2021-02-02 usage: E
The following key was revoked on 2019-02-03 by RSA key D4C0627A07510C6C Mustafa <mustafa91#gmail.com>
ssb rsa2048/38616BDAE66E418C
created: 2019-02-03 revoked: 2019-02-03 usage: S
[ultimate] (1). Mustafa <mustafa91#gmail.com>
Try to verify the old signature and see it fails.
$ gpg --verify test.txt.asc test.txt
gpg: Signature made Sun Feb 3 21:49:43 2019 +03
gpg: using RSA key 485FC77FC73DA3B800C7F41538616BDAE66E418C
gpg: Good signature from "Mustafa <mustafa91#gmail.com>" [ultimate]
gpg: WARNING: This subkey has been revoked by its owner!
gpg: reason for revocation: Key has been compromised
gpg: revocation comment: This key is now in the hands of the enemy.
However, trying to sign with revoked key.
$ rm test.key.asc
$ gpg --armor --detach-sign --default-key 38616BDAE66E418C test.txt
gpg: using "38616BDAE66E418C" as default secret key for signing
Why does it not fail? How can it be verified?
$ gpg --verify test.txt.asc test.txt
gpg: Signature made Sun Feb 3 21:53:11 2019 +03
gpg: using RSA key 5DD923FBCF6392A5CB366167D4C0627A07510C6C
gpg: Good signature from "Mustafa <mustafa91#gmail.com>" [ultimate]
Look at your last two excerpts. Despite the fact that you specified the default signing key to be 38616BDAE66E418C, when you do the verify it reports having been signed with D4C0627A07510C6C.
If you utilize the -v verbose option of gpg, you will see that if the specified default key is revoked, it falls back to the next usable signing key.
To illustrate this, I recreated your scenario:
sec rsa2048/4E5CB15076F1318E
created: 2019-02-09 expires: 2021-02-08 usage: SC
trust: ultimate validity: ultimate
ssb rsa2048/3303CBB274AECA3B
created: 2019-02-09 expires: 2021-02-08 usage: E
The following key was revoked on 2019-02-09 by RSA key 4E5CB15076F1318E Herp Derp <herp#derp.com>
ssb rsa2048/8ABD3900E64E7972
created: 2019-02-09 revoked: 2019-02-09 usage: S
[ultimate] (1). Herp Derp <herp#derp.com>
Signing with subkey prior to revoking:
$ gpg -v --armor --detach-sign --default-key 8ABD3900E64E7972 test.txt
gpg: using pgp trust model
gpg: using "8ABD3900E64E7972" as default secret key for signing
gpg: using subkey 8ABD3900E64E7972 instead of primary key 4E5CB15076F1318E
gpg: writing to 'test.txt.asc'
gpg: RSA/SHA256 signature from: "8ABD3900E64E7972 Herp Derp <herp#derp.com>"
Signing with subkey after revoking:
$ gpg -v --armor --detach-sign --default-key 8ABD3900E64E7972 test.txt
gpg: Note: signature key 8ABD3900E64E7972 has been revoked
gpg: using pgp trust model
gpg: using "8ABD3900E64E7972" as default secret key for signing
gpg: Note: signature key 8ABD3900E64E7972 has been revoked
gpg: writing to 'test.txt.asc'
gpg: RSA/SHA256 signature from: "4E5CB15076F1318E Herp Derp <herp#derp.com>"
You can see that in the second example, gpg identifies the subkey as revoked and falls back to the primary key.