My docker-compose.yml file for fabric-orderer deployment:
fabric-orderer:
image: hyperledger/fabric-orderer
container_name: fabric-orderer1
environment:
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_BOOTSTRAPMETHOD=file
- ORDERER_GENERAL_BOOTSTRAPFILE=/mnt/b/Desktop/HFForMastersWork/genesis-blocks/genesis1.block
- ORDERER_GENERAL_LOCALMSPDIR=/mnt/b/Desktop/HFForMastersWork/organizations/ordererOrgs/orderer1/msp
- ORDERER_GENERAL_LOCALMSPID=orderer1MSP
command: orderer
ports:
- 7050:7050
volumes:
- ./genesis.block:/mnt/b/Desktop/HFForMastersWork/genesis-blocks/genesis1.block
I always receive next error:
fabric-orderer1 | 2021-07-02 10:38:03.671 UTC [orderer.common.server] loadLocalMSP -> PANI 003 Failed to get local msp config: could not load a valid signer certificate from directory /mnt/b/Desktop/HFForMastersWork/organizations/ordererOrgs/orderer1/msp/signcerts: stat /mnt/b/Desktop/HFForMastersWork/organizations/ordererOrgs/orderer1/msp/signcerts: no such file or directory
fabric-orderer1 | panic: Failed to get local msp config: could not load a valid signer certificate from directory /mnt/b/Desktop/HFForMastersWork/organizations/ordererOrgs/orderer1/msp/signcerts: stat /mnt/b/Desktop/HFForMastersWork/organizations/ordererOrgs/orderer1/msp/signcerts: no such file or directory
But I checked all paths and all of them correct. Help me, please. Where is my error?
Related
I'm starting on a fresh system to deploy a simple docker-compose with swag and authelia. Previously I've just included my "secrets" in the .env file or directly in authelia configuration file, but I'm trying to employee some best practices here and properly hide the secrets using docker secrets. However, when starting up my containers, authelia is complaining about permission denied when trying to access.
In the different guides I've looked at, none of them mention permissions on anything other than the secrets directory/files to be root owned and 600 permissions.
My docker directory is in ~/docker with the secrets in ~/docker/secrets. The secrets directory is root owned with 600 permissions. My docker directories is owned by uid 1100:1100, and in my docker compose, I have the following docker-compose (slightly edited for public):
version: "3.9"
secrets:
authelia_duo_api_secret_key:
file: $DOCKERSECRETS/authelia_duo_api_secret_key
authelia_jwt_secret:
file: $DOCKERSECRETS/authelia_jwt_secret
authelia_notifier_smtp_password:
file: $DOCKERSECRETS/authelia_notifier_smtp_password
authelia_session_secret:
file: $DOCKERSECRETS/authelia_session_secret
authelia_storage_encryption_key:
file: $DOCKERSECRETS/authelia_storage_encryption_key
x-environment: &default-env
TZ: $TZ
PUID: $PUID
PGID: $PGID
services:
swag:
image: ghcr.io/linuxserver/swag
container_name: swag
cap_add:
- NET_ADMIN
environment:
<<: *default-env
URL: $DOMAINNAME
SUBDOMAINS: wildcard
VALIDATION: dns
CERTPROVIDER: zerossl #optional
DNSPLUGIN: cloudflare #optional
EMAIL: <edit>
DOCKER_MODS: linuxserver/mods:swag-dashboard
volumes:
- $DOCKERDIR/appdata/swag:/config
ports:
- 443:443
restart: unless-stopped
authelia:
image: ghcr.io/authelia/authelia:latest
container_name: authelia
restart: unless-stopped
volumes:
- $DOCKERDIR/appdata/authelia:/config
user: "1100:1100"
secrets:
- authelia_jwt_secret
- authelia_session_secret
- authelia_notifier_smtp_password
- authelia_duo_api_secret_key
- authelia_storage_encryption_key
environment:
AUTHELIA_JWT_SECRET_FILE: /run/secrets/authelia_jwt_secret
AUTHELIA_SESSION_SECRET_FILE: /run/secrets/authelia_session_secret
AUTHELIA_NOTIFIER_SMTP_PASSWORD_FILE: /run/secrets/authelia_notifier_smtp_password
AUTHELIA_DUO_API_SECRET_KEY_FILE: /run/secrets/authelia_duo_api_secret_key
AUTHELIA_STORAGE_ENCRYPTION_KEY_FILE: /run/secrets/authelia_storage_encryption_key
And the errors I'm getting in my log are:
authelia | 2022-07-28T23:45:05.872818847Z time="2022-07-28T21:15:05-02:30" level=error msg="Configuration: secrets: error loading secret path /run/secrets/authelia_session_secret into key 'session.secret': open /run/secrets/authelia_session_secret: permission denied"
authelia | 2022-07-28T23:45:05.872844527Z time="2022-07-28T21:15:05-02:30" level=error msg="Configuration: secrets: error loading secret path /run/secrets/authelia_jwt_secret into key 'jwt_secret': open /run/secrets/authelia_jwt_secret: permission denied"
authelia | 2022-07-28T23:45:05.872847757Z time="2022-07-28T21:15:05-02:30" level=error msg="Configuration: secrets: error loading secret path /run/secrets/authelia_duo_api_secret_key into key 'duo_api.secret_key': open /run/secrets/authelia_duo_api_secret_key: permission denied"
authelia | 2022-07-28T23:45:05.872850957Z time="2022-07-28T21:15:05-02:30" level=error msg="Configuration: secrets: error loading secret path /run/secrets/authelia_storage_encryption_key into key 'storage.encryption_key': open /run/secrets/authelia_storage_encryption_key: permission denied"
authelia | 2022-07-28T23:45:05.872853157Z time="2022-07-28T21:15:05-02:30" level=error msg="Configuration: secrets: error loading secret path /run/secrets/authelia_notifier_smtp_password into key 'notifier.smtp.password': open /run/secrets/authelia_notifier_smtp_password: permission denied"
authelia | 2022-07-28T23:45:05.872855307Z time="2022-07-28T21:15:05-02:30" level=error msg="Configuration: option 'jwt_secret' is required"
authelia | 2022-07-28T23:45:05.872857277Z time="2022-07-28T21:15:05-02:30" level=error msg="Configuration: duo_api: option 'secret_key' is required when duo is enabled but it is missing"
authelia | 2022-07-28T23:45:05.872859417Z time="2022-07-28T21:15:05-02:30" level=error msg="Configuration: storage: option 'encryption_key' is required"
authelia | 2022-07-28T23:45:05.872861397Z time="2022-07-28T21:15:05-02:30" level=fatal msg="Can't continue due to the errors loading the configuration"
I'm sure I'm missing something simple here. Does everything have to be run as root in order to access the secrets? Does that mean changing all my docker directory in my home folder to root, just to hide credentials? I'm a little confused by this, any help would be greatly appreciated.
I had similar permissions errors which i could get rid of by using docker volumes. I oriented myself on this example here.
I need to configure caddy staging in a project with docker
I have the following caddy configuration in production.yml:
caddy:
build:
context: .
dockerfile: ./compose/production/caddy/Dockerfile
image: demo_production_caddy
depends_on:
- django
volumes:
- production_caddy:/home/demo/.caddy
env_file:
- ./.envs/.production/.caddy
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
My caddyFile
my-domain.com www.my-domain.com {
proxy / django:5000 {
transparent
}
tls acu.salta#gmail.com {
ca https://acme-staging-v02.api.letsencrypt.org/directory
}
Caddy's response:
caddy_1 | 2020/02/09 14:14:29 [INFO][my-domain.com] acme: Obtaining bundled SAN certificate
caddy_1 | 2020/02/09 14:14:30 [INFO][my-domain.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/38002395
caddy_1 | 2020/02/09 14:14:30 [] failed to get certificate: acme: Error 405 - urn:ietf:params:acme:error:malformed - Method not allowed
caddy_1 | exit status 1
demo_caddy_1 exited with code 1
Does anyone know what the problem is?
I'm trying to setup a network of 2 organizations each having two peers. A 3rd organisation having 2 orderer nodes with kakfa-zookeeper ensemble with 4 kafka and 3 zookeeper nodes.
Below is the relevant part of my crypto-config.yaml file:
OrdererOrgs:
- Name: Orderer
Domain: ordererOrg.example.com
Template:
Count: 2
Below is the relevant part of my configtx.yaml file:
- &OrdererOrg
Name: OrdererOrg
ID: OrdererMSP
MSPDir: crypto-config/ordererOrganizations/ordererOrg.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Writers:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Admins:
Type: Signature
Rule: "OR('OrdererMSP.admin')"
.................
Orderer: &OrdererDefaults
OrdererType: kafka
Addresses:
- orderer0.ordererOrg.example.com:7050
- orderer1.ordererOrg.example.com:7040
BatchTimeout: 2s
BatchSize:
MaxMessageCount: 10
AbsoluteMaxBytes: 99 MB
PreferredMaxBytes: 512 KB
Kafka:
Brokers:
- kafka0.ordererOrg.example.com:9092
- kafka1.ordererOrg.example.com:9092
- kafka2.ordererOrg.example.com:9092
- kafka3.ordererOrg.example.com:9092
...............
Below is the relevant part of my Docker base file:
zookeeper:
image: hyperledger/fabric-zookeeper
environment:
- ZOO_SERVERS=server.1=zookeeper0.ordererOrg.example.com:2888:3888 server.2=zookeeper1.ordererOrg.example.com:2888:3888 server.3=zookeeper2.ordererOrg.example.com:2888:3888
restart: always
kafka:
image: hyperledger/fabric-kafka
restart: always
environment:
- KAFKA_MESSAGE_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
- KAFKA_REPLICA_FETCH_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
- KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
- KAFKA_ZOOKEEPER_CONNECT=zookeeper0.ordererOrg.example.com:2181,zookeeper1.ordererOrg.example.com:2181,zookeeper2.ordererOrg.example.com:2181
Below is the relevant part of my Docker Compose file:
zookeeper0.ordererOrg. example.com:
container_name: zookeeper0.ordererOrg.example.com
extends:
file: base/kafka-base.yaml
service: zookeeper
environment:
- ZOO_MY_ID=1
ports:
- '2181:2181'
- '2888:2888'
- '3888:3888'
networks:
- byfn
kafka0.ordererOrg.example.com:
container_name: kafka0.ordererOrgvodworks.example.com
extends:
file: base/kafka-base.yaml
service: kafka
depends_on:
- zookeeper0.ordererOrg.example.com
- zookeeper1.ordererOrg.example.com
- zookeeper2.ordererOrg.example.com
environment:
- KAFKA_BROKER_ID=0
ports:
- '9092:9092'
- '9093:9093'
networks:
- byfn
-----------------------
Note: The same structure is being followed for:
- zookeeper1.ordererOrg. example.com
- zookeeper2.ordererOrg. example.com
And
- kafka1.ordererOrg.example.com
- kafka2.ordererOrg.example.com
- kafka3.ordererOrg.example.com
When I run the network start command I get the following error messages:
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid
responses from any peers. Response from attempted peer comms was an
error: Error: REQUEST_TIMEOUT
And when I run the same network start command again, I get the following:
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid
responses from any peers. Response from attempted peer comms was an
error: Error: chaincode registration failed: timeout expired while
starting chaincode tt_poc:0.0.1 for transaction
And images files are also not being created against the chaincode (BNA file) as you can see the ccenv containers and orderer logs in the image below:
And I get the following logs as well on console after peer channel create command, though channel gets created successfully:
2019-03-25 15:20:34.567 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and rderer connections initialized
2019-03-25 15:20:34.956 UTC [cli.common] readBlock -> INFO 002 Got status: &{SERVICE_UNAVAILABLE}
I tried to provide maximum information but still please let me know if you require logs of any other container as well. Thanks for your time.
I finally able to resolve this issue. There was nothing wrong with these YAML configurations. The issue was with the docker configurations that It was lacking in resources and the strange thing is that I didn't get any resources related error in any container logs file. So, I just increased CPUs and Memory settings in the docker advanced configurations like below:
And after these configurational changes, my network started successfully and working properly.
Thanks to my colleague #Rafiq who help me in sorting out this issue.
I am trying to instantiate an installed chaincode using the "Peer Chaincode Instantiate" command (as below). On execution of the command, I am receiving the following error message:
Command to instantiate chaincode:
peer chaincode instantiate -o orderer.proofofownership.com:7050 --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/proofofownership.com/orderers/orderer.proofofownership.com/msp/tlscacerts/tlsca.proofofownership.com-cert.pem -C dmanddis -n CreateDiamond -v 1.0 -c '{"Args":[]}' -P "OR ('DiamondManufacturerMSP.peer','DistributorMSP.peer')"
Error Message received:
Error: Error endorsing chaincode: rpc error: code = Unknown desc = timeout expired while starting chaincode CreateDiamond:1.0(networkid:dev,peerid:peer0.dm.proofofownership.com,tx:1a96ecc8763e214ee543ecefe214df6025f8e98f2449f2b7877d04655ddadb49)
I tried rectifying this issue by adding the following attributes in "peer-base.yaml file"
- CORE_CHAINCODE_EXECUTETIMEOUT=300s
- CORE_CHAINCODE_DEPLOYTIMEOUT=300s
Although, I am still receiving this particular error.
Following are my docker container configurations:
peer-base.yaml File:
services:
peer-base:
image: hyperledger/fabric-peer:x86_64-1.1.0
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
# the following setting starts chaincode containers on the same
# bridge network as the peers
# https://docs.docker.com/compose/networking/
#- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=proof_of_ownership_pow
#- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=pow
#- CORE_LOGGING_LEVEL=INFO
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_TLS_ENABLED=true
- CORE_CHAINCODE_EXECUTETIMEOUT=300s
- CORE_CHAINCODE_DEPLOYTIMEOUT=300s
#- CORE_PEER_TLS_ENABLED=false
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: peer node start
cli - container configuration in "docker-compose-cli.yaml" file:
cli:
container_name: cli
image: hyperledger/fabric-tools:x86_64-1.1.0
tty: true
stdin_open: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
#- CORE_LOGGING_LEVEL=INFO
- CORE_PEER_ID=cli
- CORE_PEER_ADDRESS=peer0.dm.proofofownership.com:7051
- CORE_PEER_LOCALMSPID=DiamondManufacturerMSP
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/dm.proofofownership.com/peers/peer0.dm.proofofownership.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/dm.proofofownership.com/peers/peer0.dm.proofofownership.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/dm.proofofownership.com/peers/peer0.dm.proofofownership.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/dm.proofofownership.com/users/Admin#dm.proofofownership.com/msp
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.dm.proofofownership.com:7052
#- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=host
#- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=pow
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: /bin/bash
volumes:
- /var/run/:/host/var/run/
#- ./../chaincode/:/opt/gopath/src/github.com/chaincode
#- ./chaincode/CreateDiamond/go:/opt/gopath/src/github.com/chaincode/
- ./chaincode/CreateDiamond:/opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode/
- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
depends_on:
- orderer.proofofownership.com
- peer0.dm.proofofownership.com
- peer1.dm.proofofownership.com
- peer0.dist.proofofownership.com
- peer1.dist.proofofownership.com
#network_mode: host
networks:
- pow
peer configuration in "docker-compose-base.yaml" file:
peer0.dm.proofofownership.com:
container_name: peer0.dm.proofofownership.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.dm.proofofownership.com
#- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/dm.proofofownership.com/users/Admin#dm.proofofownership.com/msp
#- CORE_PEER_MSPCONFIGPATH=/home/john/Proof-Of-Ownership/crypto-config/peerOrganizations/dm.proofofownership.com/users/Admin#dm.proofofownership.com/msp
- CORE_PEER_ADDRESS=peer0.dm.proofofownership.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.dm.proofofownership.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.dm.proofofownership.com:7051
- CORE_PEER_LOCALMSPID=DiamondManufacturerMSP
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.dm.proofofownership.com:7052
#- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/dm.proofofownership.com/peers/peer0.dm.proofofownership.com/tls/ca.crt
#- CORE_PEER_TLS_ROOTCERT_FILE=/home/john/Proof-Of-Ownership/crypto-config/peerOrganizations/dm.proofofownership.com/peers/peer0.dm.proofofownership.com/tls/ca.crt
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/dm.proofofownership.com/peers/peer0.dm.proofofownership.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/dm.proofofownership.com/peers/peer0.dm.proofofownership.com/tls:/etc/hyperledger/fabric/tls
- peer0.dm.proofofownership.com:/var/hyperledger/production
ports:
- 7051:7051
- 7053:7053
Orderer Configuration in "docker-compose-base.yaml" file:
orderer.proofofownership.com:
container_name: orderer.proofofownership.com
image: hyperledger/fabric-orderer:x86_64-1.1.0
environment:
# CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE Newly Added
#- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=proof_of_ownership_pow
#- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=pow
- ORDERER_GENERAL_LOGLEVEL=DEBUG
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
#- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
# enabled TLS
- ORDERER_GENERAL_TLS_ENABLED=true
#- ORDERER_GENERAL_TLS_ENABLED=false
- 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]
# New Addition
- CONFIGTX_ORDERER_ORDERERTYPE=solo
- CONFIGTX_ORDERER_BATCHSIZE_MAXMESSAGECOUNT=10
- CONFIGTX_ORDERER_BATCHTIMEOUT=2s
- CONFIGTX_ORDERER_ADDRESSES=[127.0.0.1:7050]
#working_dir: /opt/gopath/src/github.com/hyperledger/fabric
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
command: orderer
volumes:
- ../channel-artifacts/genesis.block:/var/hyperledger/orderer/genesis.block
- ../crypto-config/ordererOrganizations/proofofownership.com/orderers/orderer.proofofownership.com/msp:/var/hyperledger/orderer/msp
- ../crypto-config/ordererOrganizations/proofofownership.com/orderers/orderer.proofofownership.com/tls/:/var/hyperledger/orderer/tls
- orderer.proofofownership.com:/var/hyperledger/production/orderer
ports:
- 7050:7050
I also reviewed the peer's docker container logs (using docker logs ) and received the following logs:
Launch -> ERRO 3eb launchAndWaitForRegister failed: timeout expired while starting chaincode CreateDiamond:1.0(networkid:dev,peerid:peer0.dm.proofofownership.com,tx:cc34a20176d7f09e1537b039f3340450e08f6447bf16965324655e72a2a58623)
2018-08-01 12:59:08.739 UTC [endorser] simulateProposal -> ERRO 3ed [dmanddis][cc34a201] failed to invoke chaincode name:"lscc" , error: timeout expired while starting chaincode CreateDiamond:1.0(networkid:dev,peerid:peer0.dm.proofofownership.com,tx:cc34a20176d7f09e1537b039f3340450e08f6447bf16965324655e72a2a58623)
Following logs were received on installing chaincode:
2018-08-03 09:44:55.822 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-08-03 09:44:55.822 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-08-03 09:44:55.822 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2018-08-03 09:44:55.822 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2018-08-03 09:44:55.822 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2018-08-03 09:44:58.270 UTC [golang-platform] getCodeFromFS -> DEBU 006 getCodeFromFS github.com/hyperledger/fabric/peer/chaincode
2018-08-03 09:45:02.089 UTC [golang-platform] func1 -> DEBU 007 Discarding GOROOT package bytes
2018-08-03 09:45:02.089 UTC [golang-platform] func1 -> DEBU 008 Discarding GOROOT package encoding/json
2018-08-03 09:45:02.089 UTC [golang-platform] func1 -> DEBU 009 Discarding GOROOT package fmt
2018-08-03 09:45:02.090 UTC [golang-platform] func1 -> DEBU 00a Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim
2018-08-03 09:45:02.090 UTC [golang-platform] func1 -> DEBU 00b Discarding provided package github.com/hyperledger/fabric/protos/peer
2018-08-03 09:45:02.090 UTC [golang-platform] func1 -> DEBU 00c Discarding GOROOT package strconv
2018-08-03 09:45:02.090 UTC [golang-platform] func1 -> DEBU 00d skipping dir: /opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode/go
2018-08-03 09:45:02.090 UTC [golang-platform] GetDeploymentPayload -> DEBU 00e done
2018-08-03 09:45:02.090 UTC [container] WriteFileToPackage -> DEBU 00f Writing file to tarball: src/github.com/hyperledger/fabric/peer/chaincode/CreateDiamond.go
2018-08-03 09:45:02.122 UTC [msp/identity] Sign -> DEBU 010 Sign: plaintext: 0AE3070A5B08031A0B089EC890DB0510...EC7BFE1B0000FFFFEE433C37001C0000
2018-08-03 09:45:02.122 UTC [msp/identity] Sign -> DEBU 011 Sign: digest: E5160DE95DB096379967D959FA71E692F098983F443378600943EA5D7265A82C
2018-08-03 09:45:02.230 UTC [chaincodeCmd] install -> DEBU 012 Installed remotely response:<status:200 payload:"OK" >
2018-08-03 09:45:02.230 UTC [main] main -> INFO 013 Exiting.....
In the peer configuration, you specified a different port for the chaincode endpoint than the peer adress (chaincode endpoint port 7052, peer adress on port 7051):
CORE_PEER_CHAINCODELISTENADDRESS=peer0.dm.proofofownership.com:7052
But this port is not exposed. Please add this to your peer port configuration:
- 7052:7052
It is likely that your chaincode is failing on start-up. You might want to try using the development mode tutorial approach to debug your chaincode. It is possible that the chaincode process is failing. By executing from within the container, you can view the logs to see what might not be working for you.
The devmode tutorial is here . You will simply need to replace the tutorial's chaincode with your own.
I'm trying to test the latest version of Hyperledger Fabric, the v1 in incubation. I have an issue with the latest version of Hyperledger Fabric.
I'm following the instructions here to install Fabric:
https://hyperledger-fabric.readthedocs.io/en/latest/asset_setup/
I'm using Docker to spawn network entities & create/join a channel :
sudo docker --version
Docker version 1.13.1, build 092cba3
sudo docker-compose --version
docker-compose version 1.11.2, build dfed245
When I'm performing :
sudo docker-compose -f docker-compose-gettingstarted.yml up
My five containers are running :
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f1b6d6128d43 sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0 "sh -c './channel_..." 21 minutes ago Up About a minute cli
8f9df755c160 sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0 "peer node start -..." 21 minutes ago Up About a minute 0.0.0.0:8056->7051/tcp peer2
2de6ee624d28 sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0 "peer node start -..." 21 minutes ago Up About a minute 0.0.0.0:8055->7051/tcp peer1
31ac53b6e5db sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0 "peer node start -..." 21 minutes ago Up About a minute 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer0
d98fc2a8652f sfhackfest22017/fabric-ca:x86_64-0.7.0-snapshot-6294c57 "sh -c 'sleep 10; ..." 21 minutes ago Up About a minute 0.0.0.0:8054->7054/tcp ca
07dcfceb86cc sfhackfest22017/fabric-orderer:x86_64-0.7.0-snapshot-c7b3fe0 "orderer" 21 minutes ago Up About a minute 0.0.0.0:8050->7050/tcp orderer
but I get this error on the last line :
2017-03-01 14:55:32.183 UTC [msp] newIdentity -> INFO 016 Creating identity instance for ID &{DEFAULT IDENTITY}
cli | 2017-03-01 14:55:32.270 UTC [peer] GetManagerForChain -> INFO 017 Created new msp manager for chain testchainid
cli | 2017-03-01 14:55:32.270 UTC [msp] Setup -> INFO 018 Setting up the MSP manager (1 msps)
cli | 2017-03-01 14:55:32.270 UTC [msp] Setup -> INFO 019 Setting up MSP
cli | 2017-03-01 14:55:32.270 UTC [msp] NewBccspMsp -> INFO 01a Creating BCCSP-based MSP instance
cli | 2017-03-01 14:55:32.270 UTC [msp] Setup -> INFO 01b Setting up MSP instance DEFAULT
cli | 2017-03-01 14:55:32.270 UTC [msp] newIdentity -> INFO 01c Creating identity instance for ID &{DEFAULT IDENTITY}
cli | 2017-03-01 14:55:32.270 UTC [msp] newIdentity -> INFO 01d Creating identity instance for ID &{DEFAULT IDENTITY}
cli | 2017-03-01 14:55:32.271 UTC [msp] newIdentity -> INFO 01e Creating identity instance for ID &{DEFAULT IDENTITY}
cli | 2017-03-01 14:55:32.271 UTC [msp] newIdentity -> INFO 01f Creating identity instance for ID &{DEFAULT IDENTITY}
cli | 2017-03-01 14:55:32.275 UTC [msp] newIdentity -> INFO 020 Creating identity instance for ID &{DEFAULT IDENTITY}
cli | 2017-03-01 14:55:32.275 UTC [msp] newIdentity -> INFO 021 Creating identity instance for ID &{DEFAULT IDENTITY}
cli | 2017-03-01 14:55:32.275 UTC [msp] newIdentity -> INFO 022 Creating identity instance for ID &{DEFAULT IDENTITY}
cli | 2017-03-01 14:55:32.275 UTC [msp] Setup -> INFO 023 MSP manager setup complete, setup 1 msps
cli | 2017-03-01 14:55:32.275 UTC [logging] InitFromViper -> DEBU 024 Setting default logging level to DEBUG for command 'channel'
cli | 2017-03-01 14:55:32.275 UTC [peer] GetLocalMSP -> INFO 025 Returning existing local MSP
cli | 2017-03-01 14:55:32.275 UTC [msp] GetDefaultSigningIdentity -> INFO 026 Obtaining default signing identity
cli | Error: Error getting broadcast client: Error connecting to orderer:7050 due to grpc: timed out when dialing
How can I fix it ?
And when I perform :
sudo docker exec -it cli bash
[sudo] Mot de passe de blockchain :
root#f1b6d6128d43:/opt/gopath/src/github.com/hyperledger/fabric/peer# cat results.txt
ERROR on CHANNEL CREATION
Here is my Docker_compose.yml :
version: '2'
networks:
bridge:
services:
ccenv_latest:
container_name: ccenv_latest
build: ./ccenv
image: hyperledger/fabric-ccenv:latest
volumes:
- ./ccenv:/opt/gopath/src/github.com/hyperledger/fabric/orderer/ccenv
ccenv_snapshot:
container_name: ccenv_snapshot
build: ./ccenv
image: hyperledger/fabric-ccenv:x86_64-0.7.0-snapshot-c7b3fe0
volumes:
- ./ccenv:/opt/gopath/src/github.com/hyperledger/fabric/orderer/ccenv
ca:
image: sfhackfest22017/fabric-ca:x86_64-0.7.0-snapshot-6294c57
ports:
- 8054:7054
environment:
- CA_CERTIFICATE=peerOrg0_cert.pem
- CA_KEY_CERTIFICATE=peerOrg0_pk.pem
volumes:
- ./tmp/ca:/.fabric-ca
command: sh -c 'sleep 10; fabric-ca server start -ca /.fabric-ca/$$CA_CERTIFICATE -ca-key /.fabric-ca/$$CA_KEY_CERTIFICATE -config /etc/hyperledger/fabric-ca/server-config.json -address "0.0.0.0"'
container_name: ca
orderer:
container_name: orderer
image: sfhackfest22017/fabric-orderer:x86_64-0.7.0-snapshot-c7b3fe0
environment:
- ORDERER_GENERAL_LEDGERTYPE=ram
- ORDERER_GENERAL_BATCHTIMEOUT=10s
- ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT=10
- ORDERER_GENERAL_MAXWINDOWSIZE=1000
- ORDERER_GENERAL_ORDERERTYPE=solo
- ORDERER_GENERAL_LOGLEVEL=debug
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_LISTENPORT=7050
- ORDERER_RAMLEDGER_HISTORY_SIZE=100
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
command: orderer
ports:
- 8050:7050
networks:
- bridge
peer0:
container_name: peer0
image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_NETWORKID=peer0
- CORE_NEXT=true
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_PEER_ID=peer0
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
- CORE_PEER_GOSSIP_ORGLEADER=true
- CORE_PEER_GOSSIP_IGNORESECURITY=true
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: peer node start --peer-defaultchain=false
ports:
- 8051:7051
- 8053:7053
links:
- orderer:orderer
volumes:
- /var/run/:/host/var/run/
- ./tmp/peer0:/etc/hyperledger/fabric/msp/sampleconfig
networks:
- bridge
peer1:
container_name: peer1
image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_NETWORKID=peer0
- CORE_NEXT=true
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_PEER_ID=peer1
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
- CORE_PEER_GOSSIP_ORGLEADER=true
- CORE_PEER_GOSSIP_IGNORESECURITY=true
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
ports:
- 8055:7051
command: peer node start --peer-defaultchain=false
links:
- orderer:orderer
- peer0:peer0
volumes:
- /var/run/:/host/var/run/
- ./tmp/peer1:/etc/hyperledger/fabric/msp/sampleconfig
networks:
- bridge
peer2:
container_name: peer2
image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_NETWORKID=peer0
- CORE_NEXT=true
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_PEER_ID=peer2
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
- CORE_PEER_GOSSIP_ORGLEADER=true
- CORE_PEER_GOSSIP_IGNORESECURITY=true
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
ports:
- 8056:7051
command: peer node start --peer-defaultchain=false
links:
- orderer:orderer
- peer0:peer0
- peer1:peer1
volumes:
- /var/run/:/host/var/run/
- ./tmp/peer2:/etc/hyperledger/fabric/msp/sampleconfig
networks:
- bridge
cli:
container_name: cli
image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
tty: true
environment:
- GOPATH=/opt/gopath
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_NEXT=true
- CORE_PEER_ID=cli
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
- CORE_PEER_ADDRESS=peer0:7051
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: sh -c './channel_test.sh; sleep 10000'
# command: /bin/sh
links:
- orderer:orderer
- peer0:peer0
- peer1:peer1
- peer2:peer2
volumes:
- /var/run/:/host/var/run/
#in the "- <HOST>:/opt/gopath/src/github.com/hyperledger/fabric/examples/" mapping below, the HOST part
#should be modified to the path on the host. This will work as is in the Vagrant environment
- ./src/github.com/example_cc/example_cc.go:/opt/gopath/src/github.com/hyperledger/fabric/examples/example_cc.go
- ./tmp/peer3:/etc/hyperledger/fabric/msp/sampleconfig
- ./channel_test.sh:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel_test.sh
networks:
- bridge
And this is my channel_test.sh :
#!/bin/sh
# find address of peer0 in your network
PEER0_IP_ADDRESS=`perl -e 'use Socket; $a = inet_ntoa(inet_aton("peer0")); print "$a\n";'`
# create an anchor file
cat<<EOF>anchorPeer.txt
$PEER0_IP_ADDRESS
7051
-----BEGIN CERTIFICATE-----
MIICjDCCAjKgAwIBAgIUBEVwsSx0TmqdbzNwleNBBzoIT0wwCgYIKoZIzj0EAwIw
fzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNh
biBGcmFuY2lzY28xHzAdBgNVBAoTFkludGVybmV0IFdpZGdldHMsIEluYy4xDDAK
BgNVBAsTA1dXVzEUMBIGA1UEAxMLZXhhbXBsZS5jb20wHhcNMTYxMTExMTcwNzAw
WhcNMTcxMTExMTcwNzAwWjBjMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGgg
Q2Fyb2xpbmExEDAOBgNVBAcTB1JhbGVpZ2gxGzAZBgNVBAoTEkh5cGVybGVkZ2Vy
IEZhYnJpYzEMMAoGA1UECxMDQ09QMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE
HBuKsAO43hs4JGpFfiGMkB/xsILTsOvmN2WmwpsPHZNL6w8HWe3xCPQtdG/XJJvZ
+C756KEsUBM3yw5PTfku8qOBpzCBpDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYw
FAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFOFC
dcUZ4es3ltiCgAVDoyLfVpPIMB8GA1UdIwQYMBaAFBdnQj2qnoI/xMUdn1vDmdG1
nEgQMCUGA1UdEQQeMByCCm15aG9zdC5jb22CDnd3dy5teWhvc3QuY29tMAoGCCqG
SM49BAMCA0gAMEUCIDf9Hbl4xn3z4EwNKmilM9lX2Fq4jWpAaRVB97OmVEeyAiEA
25aDPQHGGq2AvhKT0wvt08cX1GTGCIbfmuLpMwKQj38=
-----END CERTIFICATE-----
EOF
#create
echo "Creating channel on Orderer"
CORE_PEER_GOSSIP_IGNORESECURITY=true CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1 -a anchorPeer.txt >>log.txt 2>&1
cat log.txt
grep -q "Exiting" log.txt
if [ $? -ne 0 ]; then
echo "ERROR on CHANNEL CREATION" >> results.txt
exit 1
fi
echo "SUCCESSFUL CHANNEL CREATION" >> results.txt
sleep 5
TOTAL_PEERS=3
i=0
while test $i -lt $TOTAL_PEERS
do
echo "###################################### Joining peer$i"
CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 CORE_PEER_ADDRESS=peer$i:7051 peer channel join -b myc1.block >>log.txt 2>&1
cat log.txt
echo '-------------------------------------------------'
grep -q "Join Result: " log.txt
if [ $? -ne 0 ]; then
echo "ERROR on JOIN CHANNEL" >> results.txt
exit 1
fi
echo "SUCCESSFUL JOIN CHANNEL on PEER$i" >> results.txt
echo "SUCCESSFUL JOIN CHANNEL on PEER$i"
i=$((i+1))
sleep 10
done
echo "Peer0 , Peer1 and Peer2 are added to the channel myc1"
cat log.txt
exit 0
i faced similar problem and found it’s DNS issue then corrected at "hosts" file. the cause is the hostname “orderer". FYR.
What OS you are using? I had the same issue running this getting started guide with VirtualBox running Ubuntu 16.04 LTS on Windows 7. After that I tried installing Ubuntu side-by-side with Windows and it worked from the first shot.
May be because of docker containers are in the different container .
If the new organization in the different network the peers can not communicate with Orderer which is in the other network.
check the networks : docker network ls