Coder Social home page Coder Social logo

Comments (20)

baala912 avatar baala912 commented on August 16, 2024 3

Hi all, I was able to resolve this issue by changing the version of the docker image from 1.4.1 to 1.4 in docker-compose.yml. If you check the docker logs of the peer you can see that it fails because it is trying to pull a peer dependency but gets a 404 as the latest tag is no longer supported. I was able to get it working, and my docker-compose.yml looks like below. Hope it helps

version: '2'

networks:
  custom:

services:

  ca.org1.example.com:
    image: hyperledger/fabric-ca:1.4
    environment:
      - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
      - FABRIC_CA_SERVER_CA_NAME=ca-org1
      - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server/ca.org1.example.com-cert.pem
      - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server/26447f667024067fc5efbd2605f92b410dc2d0ce10408890949eb71ac7fbe2f9_sk
    ports:
      - "7054:7054"
    command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
    volumes:
      - ../network_resources/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server
    container_name: ca_peerOrg1
    networks:
      - custom

  ca.org2.example.com:
    image: hyperledger/fabric-ca:1.4
    environment:
      - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
      - FABRIC_CA_SERVER_CA_NAME=ca-org2
      - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server/ca.org2.example.com-cert.pem
      - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server/384b0c0e6faf5d2c256f1265a89aecde606e7577869e07f3e1b17ad318607413_sk
    ports:
      - "8054:7054"
    command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
    volumes:
      - ../network_resources/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server
    container_name: ca_peerOrg2
    networks:
      - custom

  orderer.example.com:
    container_name: orderer.example.com
    image: hyperledger/fabric-orderer:1.4
    environment:
      - ORDERER_GENERAL_LOGLEVEL=debug
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_GENESISMETHOD=file
      - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis.block
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer/msp
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
    command: orderer
    networks:
      - custom
    ports:
      - 7050:7050
    volumes:
        - ../network_resources/config/:/etc/hyperledger/configtx
        - ../network_resources/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/:/etc/hyperledger/msp/orderer
        - ../network_resources/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/msp/peerOrg1
        - ../network_resources/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/msp/peerOrg2

  peer0.org1.example.com:
    container_name: peer0.org1.example.com
    image: hyperledger/fabric-peer:1.4
    environment:
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_PEER_ID=peer0.org1.example.com
      - CORE_LOGGING_PEER=debug
      - CORE_CHAINCODE_LOGGING_LEVEL=DEBUG
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      # # 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=network_custom
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: peer node start
    ports:
      - 7051:7051
      - 7053:7053
    networks:
      - custom
    volumes:
        - /var/run/:/host/var/run/
        - ../network_resources/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
        - ../network_resources/crypto-config/peerOrganizations/org1.example.com/users:/etc/hyperledger/msp/users
        - ../network_resources/config:/etc/hyperledger/configtx
    depends_on:
      - orderer.example.com

  peer1.org1.example.com:
    container_name: peer1.org1.example.com
    image: hyperledger/fabric-peer:1.4
    environment:
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_PEER_ID=peer1.org1.example.com
      - CORE_LOGGING_PEER=debug
      - CORE_CHAINCODE_LOGGING_LEVEL=DEBUG
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp
      - CORE_PEER_ADDRESS=peer1.org1.example.com:7051
      - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=network_custom
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: peer node start
    networks:
      - custom
    ports:
      - 7056:7051
      - 7058:7053
    volumes:
        - /var/run/:/host/var/run/
        - ../network_resources/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/msp
        - ../network_resources/crypto-config/peerOrganizations/org1.example.com/users:/etc/hyperledger/msp/users
        - ../network_resources/config:/etc/hyperledger/configtx
    depends_on:
      - orderer.example.com

  peer0.org2.example.com:
    container_name: peer0.org2.example.com
    image: hyperledger/fabric-peer:1.4
    environment:
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_PEER_ID=peer0.org2.example.com
      - CORE_LOGGING_PEER=debug
      - CORE_CHAINCODE_LOGGING_LEVEL=DEBUG
      - CORE_PEER_LOCALMSPID=Org2MSP
      - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp
      - CORE_PEER_ADDRESS=peer0.org2.example.com:7051
      - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=network_custom
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: peer node start
    networks:
      - custom
    ports:
      - 8051:7051
      - 8053:7053
    volumes:
        - /var/run/:/host/var/run/
        - ../network_resources/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp
        - ../network_resources/crypto-config/peerOrganizations/org2.example.com/users:/etc/hyperledger/msp/users
        - ../network_resources/config:/etc/hyperledger/configtx
    depends_on:
      - orderer.example.com

  peer1.org2.example.com:
    container_name: peer1.org2.example.com
    image: hyperledger/fabric-peer:1.4
    environment:
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_PEER_ID=peer1.org2.example.com
      - CORE_LOGGING_PEER=debug
      - CORE_CHAINCODE_LOGGING_LEVEL=DEBUG
      - CORE_PEER_LOCALMSPID=Org2MSP
      - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp
      - CORE_PEER_ADDRESS=peer1.org2.example.com:7051
      - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=network_custom
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: peer node start
    networks:
      - custom
    ports:
      - 8056:7051
      - 8058:7053
    volumes:
        - /var/run/:/host/var/run/
        - ../network_resources/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp:/etc/hyperledger/fabric/msp
        - ../network_resources/crypto-config/peerOrganizations/org2.example.com/users:/etc/hyperledger/msp/users
        - ../network_resources/config:/etc/hyperledger/configtx
    depends_on:
      - orderer.example.com

from blockchain-application-using-fabric-java-sdk.

bigdaronlee163 avatar bigdaronlee163 commented on August 16, 2024 2

i met this problem too,follow the solution by @balajikadambi to increase The proposal wait time to 280000 , 380000 and turn out that this Method doesnot work at all 。please help!!!

daronlee@daronlee-virtual-machine:~/learning/experiment/tutorial/blockchain-application-using-fabric-java-sdk/network_resources$ java -cp blockchain-client.jar org.example.network.DeployInstantiateChaincode
log4j:WARN No appenders could be found for logger (org.hyperledger.fabric.sdk.helper.Config).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Aug 04, 2020 8:34:02 PM org.example.client.FabricClient deployChainCode
INFO: Deploying chaincode fabcar using Fabric client Org1MSP admin
Aug 04, 2020 8:34:02 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment FAILURE
Aug 04, 2020 8:34:02 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment FAILURE
Aug 04, 2020 8:34:02 PM org.example.client.FabricClient deployChainCode
INFO: Deploying chaincode fabcar using Fabric client Org2MSP admin
Aug 04, 2020 8:34:02 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment FAILURE
Aug 04, 2020 8:34:02 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment FAILURE
Aug 04, 2020 8:34:02 PM org.example.client.ChannelClient instantiateChainCode
INFO: Instantiate proposal request fabcar on channel mychannel with Fabric client Org2MSP admin
Aug 04, 2020 8:34:02 PM org.example.client.ChannelClient instantiateChainCode
INFO: Instantiating Chaincode ID fabcar on channel mychannel
Aug 04, 2020 8:34:06 PM org.example.client.ChannelClient instantiateChainCode
INFO: Chaincode fabcar on channel mychannel instantiation java.util.concurrent.CompletableFuture@50313382[Completed exceptionally]
Aug 04, 2020 8:34:06 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Aug 04, 2020 8:34:06 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Aug 04, 2020 8:34:06 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Aug 04, 2020 8:34:06 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE

from blockchain-application-using-fabric-java-sdk.

bigdaronlee163 avatar bigdaronlee163 commented on August 16, 2024 1

same problem....

daronlee@daronlee-virtual-machine:/learning/experiment/tutorial/blockchain-application-using-fabric-java-sdk/network_resources$ java -cp blockchain-client.jar org.example.network.DeployInstantiateChaincode
log4j:WARN No appenders could be found for logger (org.hyperledger.fabric.sdk.helper.Config).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Aug 05, 2020 11:16:05 AM org.example.client.FabricClient deployChainCode
INFO: Deploying chaincode fabcar using Fabric client Org1MSP admin
Aug 05, 2020 11:16:05 AM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment FAILURE
Aug 05, 2020 11:16:05 AM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment FAILURE
Aug 05, 2020 11:16:05 AM org.example.client.FabricClient deployChainCode
INFO: Deploying chaincode fabcar using Fabric client Org2MSP admin
Aug 05, 2020 11:16:05 AM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment FAILURE
Aug 05, 2020 11:16:05 AM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment FAILURE
Aug 05, 2020 11:16:05 AM org.example.client.ChannelClient instantiateChainCode
INFO: Instantiate proposal request fabcar on channel mychannel with Fabric client Org2MSP admin
Aug 05, 2020 11:16:05 AM org.example.client.ChannelClient instantiateChainCode
INFO: Instantiating Chaincode ID fabcar on channel mychannel
Aug 05, 2020 11:16:11 AM org.example.client.ChannelClient instantiateChainCode
INFO: Chaincode fabcar on channel mychannel instantiation java.util.concurrent.CompletableFuture@1cb346ea[Completed exceptionally]
Aug 05, 2020 11:16:11 AM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Aug 05, 2020 11:16:11 AM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Aug 05, 2020 11:16:11 AM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Aug 05, 2020 11:16:11 AM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
daronlee@daronlee-virtual-machine:
/learning/experiment/tutorial/blockchain-application-using-fabric-java-sdk/network_resources$

from blockchain-application-using-fabric-java-sdk.

balajikadambi avatar balajikadambi commented on August 16, 2024

@liujianglin1 It appears to be a timeout issue. The proposal wait time has been set to 180000ms in the instantiateChainCode method of ChannelClient.java file. Please increase it a bit and see if it helps.

from blockchain-application-using-fabric-java-sdk.

InitTheWorld avatar InitTheWorld commented on August 16, 2024

@ liujianglin1这似乎是一个超时问题。在ChannelClient.java文件的instantiateChainCode方法中,提议等待时间已设置为180000ms。请稍微加一点,看看是否有帮助。

i tried this ,but it seems no help.

from blockchain-application-using-fabric-java-sdk.

longtranvnext avatar longtranvnext commented on August 16, 2024

@balajikadambi , how i can deploy java chaincode not use go ?

from blockchain-application-using-fabric-java-sdk.

InitTheWorld avatar InitTheWorld commented on August 16, 2024

@balajikadambi , how i can deploy java chaincode not use go ?

change the CHAINCODE_1_PATH and CHAINCODE_ROOT_DIR in file Config.java

from blockchain-application-using-fabric-java-sdk.

longtranvnext avatar longtranvnext commented on August 16, 2024

@liujianglin1

  1. build source code java fabcar then copy jar to blockchain-application-using-fabric-java-sdk/network_resources/chaincode/src/chaincode/chaincode.jar

log4j:WARN No appenders could be found for logger (org.hyperledger.fabric.sdk.helper.Config).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Sep 16, 2019 5:00:58 PM org.example.client.FabricClient deployChainCode
INFO: Deploying chaincode fabcar using Fabric client Org1MSP admin
Sep 16, 2019 5:01:01 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Sep 16, 2019 5:01:01 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Sep 16, 2019 5:01:01 PM org.example.client.FabricClient deployChainCode
INFO: Deploying chaincode fabcar using Fabric client Org2MSP admin
Sep 16, 2019 5:01:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Sep 16, 2019 5:01:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Sep 16, 2019 5:01:04 PM org.example.client.ChannelClient instantiateChainCode
INFO: Instantiate proposal request fabcar on channel mychannel with Fabric client Org2MSP admin
Sep 16, 2019 5:01:04 PM org.example.client.ChannelClient instantiateChainCode
INFO: Instantiating Chaincode ID fabcar on channel mychannel
Sep 16, 2019 5:13:04 PM org.example.client.ChannelClient instantiateChainCode
INFO: Chaincode fabcar on channel mychannel instantiation java.util.concurrent.CompletableFuture@766653e6[Completed exceptionally]
Sep 16, 2019 5:13:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Sep 16, 2019 5:13:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Sep 16, 2019 5:13:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Sep 16, 2019 5:13:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE

Process finished with exit code 0

from blockchain-application-using-fabric-java-sdk.

balajikadambi avatar balajikadambi commented on August 16, 2024

@longtranvnext we have not tested with Java chaincode. can you login to docker container shell of the peers and orderer to see if there are any errors.

from blockchain-application-using-fabric-java-sdk.

solartes avatar solartes commented on August 16, 2024

Any solution? It happens the same to me. Sometimes works sometimes does not work

from blockchain-application-using-fabric-java-sdk.

balajikadambi avatar balajikadambi commented on August 16, 2024

@solartes we did not encounter the issue when we tried. so, not sure whats causing it. I would recommend debugging by logging into the docker container shell for the peers and orderer.

from blockchain-application-using-fabric-java-sdk.

longtran84 avatar longtran84 commented on August 16, 2024

@balajikadambi do you have a demo code about hyperledger java chaincode?

from blockchain-application-using-fabric-java-sdk.

balajikadambi avatar balajikadambi commented on August 16, 2024

@longtran84 It is the same as the code shared on this GitHub repo.

from blockchain-application-using-fabric-java-sdk.

longtran84 avatar longtran84 commented on August 16, 2024

your code use GO, i wanna use hyperledger java chaincode?

from blockchain-application-using-fabric-java-sdk.

maheshwarishikha avatar maheshwarishikha commented on August 16, 2024

@longtran84 , Sorry, this repo is not tested using Java chaincode. So not sure about the steps too. Debugging as per the error messages in logs might help.

from blockchain-application-using-fabric-java-sdk.

magicmae avatar magicmae commented on August 16, 2024

@liujianglin1

  1. build source code java fabcar then copy jar to blockchain-application-using-fabric-java-sdk/network_resources/chaincode/src/chaincode/chaincode.jar

log4j:WARN No appenders could be found for logger (org.hyperledger.fabric.sdk.helper.Config).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Sep 16, 2019 5:00:58 PM org.example.client.FabricClient deployChainCode
INFO: Deploying chaincode fabcar using Fabric client Org1MSP admin
Sep 16, 2019 5:01:01 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Sep 16, 2019 5:01:01 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Sep 16, 2019 5:01:01 PM org.example.client.FabricClient deployChainCode
INFO: Deploying chaincode fabcar using Fabric client Org2MSP admin
Sep 16, 2019 5:01:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Sep 16, 2019 5:01:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Sep 16, 2019 5:01:04 PM org.example.client.ChannelClient instantiateChainCode
INFO: Instantiate proposal request fabcar on channel mychannel with Fabric client Org2MSP admin
Sep 16, 2019 5:01:04 PM org.example.client.ChannelClient instantiateChainCode
INFO: Instantiating Chaincode ID fabcar on channel mychannel
Sep 16, 2019 5:13:04 PM org.example.client.ChannelClient instantiateChainCode
INFO: Chaincode fabcar on channel mychannel instantiation java.util.concurrent.CompletableFuture@766653e6[Completed exceptionally]
Sep 16, 2019 5:13:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Sep 16, 2019 5:13:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Sep 16, 2019 5:13:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Sep 16, 2019 5:13:04 PM org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE

Process finished with exit code 0

I modified 1.4.1 to x86_64-1.0.0 of fabric edition in docker-compose.yml. Then it works.

from blockchain-application-using-fabric-java-sdk.

longtran84 avatar longtran84 commented on August 16, 2024

@magicmae can you help me update to Hyperledger Fabric 2 network ?

from blockchain-application-using-fabric-java-sdk.

longtran84 avatar longtran84 commented on August 16, 2024

@balajikadambi can you help me update to Hyperledger Fabric 2 network ?

from blockchain-application-using-fabric-java-sdk.

bigdaronlee163 avatar bigdaronlee163 commented on August 16, 2024

from blockchain-application-using-fabric-java-sdk.

maheshwarishikha avatar maheshwarishikha commented on August 16, 2024

It worked for some...hence closing this issue. Please feel free to open a new issue if required. Thanks.

from blockchain-application-using-fabric-java-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.