Date   

Re: Question about invokeChaincode api #fabric-chaincode

David Faulstich Diniz Reis
 

Hi!

The chaincode has a unique identifier in the network when it is running. If a chaincode calls itself (another function) using invokeChaincode method, an error will occur.  You have to call the function directly without using invokeChaincode method. 

If a chaincode invokes another chaincode in the same channel, both calls will have their write sets appended to the transaction.

If a chaincode invokes another chaincode in another channel, it will be considered a query and no changes will be applied to the second chaincode state.

Best regards.

David




Em sex., 17 de dez. de 2021 às 08:24, BigBang019 <zhuxy0000@...> escreveu:

Environment: fabric release-2.2
My chaincode named vulnerable is as follows:


When I invoke helloworld directly, it gives me responce "helloworld", everything works fine.

But when I invoke invokeChaincode method, it gives me



and chaincode docker container logging is as follows:



It seems like
(1) the statement System.out.printf("\n%s\n", chaincodeName) works fine.
(2) org.hyperledger.fabric.shim.impl.InvocationStubImpl.invokeChaincode also finds the registered method helloworld, but it encountered another exception half way the invocation.

Does anyone met this problem before?
Thanks in advance.




Re: Question about invokeChaincode api #fabric-chaincode

BigBang019
 

Thanks for your attention: https://github.com/hyperledger/fabric-chaincode-java/issues/218


Re: Question about invokeChaincode api #fabric-chaincode

Matthew White
 

Hello;
 
Can I suggest that you raise an issue on the github  hyperledger/fabric-chaincode-java repo?
 
Though to check that you can call `helloworld()` directly from `invokeChaincode` without having to call invokeChaincode?  Pass on the ctx variable, and both methods are then part of the same transaction. 
 
Typically only use invokerChaincode, when you going to a completely different chaincode.
 
 
Regards, Matthew.
Matthew B White  IBM Blockchain Solutions Architect
 
Email me at WHITEMAT@...
Find me on StackOverflow, and generally at  calanais.me.uk
 
Note: restricted availability for meetings 14:30 to 17:00 UK Tuesday 
IBM United Kingdom Limited, Hursley Park, Winchester, Hampshire, SO21 2JN

"The wrong answers are the ones you go looking for when the right answers stare you in the face"
 
 
 
----- Original message -----
From: "BigBang019" <zhuxy0000@...>
Sent by: fabric@...
To: fabric@...
Cc:
Subject: [EXTERNAL] [Hyperledger Fabric] Question about invokeChaincode api #fabric-chaincode
Date: Fri, Dec 17, 2021 11:24 AM
 
Environment: fabric release-2.2 My chaincode named vulnerable is as follows: When I invoke helloworld directly, it gives me responce "helloworld", everything works fine. But when I invoke invokeChaincode method, it gives me and chaincode ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Environment: fabric release-2.2
My chaincode named vulnerable is as follows:


When I invoke helloworld directly, it gives me responce "helloworld", everything works fine.

But when I invoke invokeChaincode method, it gives me



and chaincode docker container logging is as follows:



It seems like
(1) the statement System.out.printf("\n%s\n", chaincodeName) works fine.
(2) org.hyperledger.fabric.shim.impl.InvocationStubImpl.invokeChaincode also finds the registered method helloworld, but it encountered another exception half way the invocation.

Does anyone met this problem before?
Thanks in advance.
 

Unless stated otherwise above:

IBM United Kingdom Limited - Registered in England and Wales with number 741598.

Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU



Question about invokeChaincode api #fabric-chaincode

BigBang019
 

Environment: fabric release-2.2
My chaincode named vulnerable is as follows:


When I invoke helloworld directly, it gives me responce "helloworld", everything works fine.

But when I invoke invokeChaincode method, it gives me



and chaincode docker container logging is as follows:



It seems like
(1) the statement System.out.printf("\n%s\n", chaincodeName) works fine.
(2) org.hyperledger.fabric.shim.impl.InvocationStubImpl.invokeChaincode also finds the registered method helloworld, but it encountered another exception half way the invocation.

Does anyone met this problem before?
Thanks in advance.


Re: Question about PrivateData Endorsement in Hyperledger Fabric #fabric-endorser

BigBang019
 

Hi, thanks for your reply.
I'm using fabric release-2.2, and deployed a test network on a clean environment. I have the following phenomena:
(1) When I use cmd docker exec peer0.org1.example.com peer channel getinfo -c mychannel and docker exec peer0.org2.example.com peer channel getinfo -c mychannel, I got the same result, which means there's no state inconsistency.
(2) When I change the endorsement policy of the chaincode vulenrable to "OR('Org1MSP.peer','Org2MSP.peer')"
     everything works fine. 

Conclusion: If we deploy a chaincode with (1) privatedata config above, (2) endorsement policy like  "AND('Org1MSP.peer','Org2MSP.peer')", then this chaincode fail with endorsement conflict.

Is this a bug? I haven't get deeper inspection of the reason.


Re: Question about PrivateData Endorsement in Hyperledger Fabric #fabric-endorser

David Enyeart
 

You're right, the private data collection should have nothing to do with that error. That error typically means state is not identical across the peers and therefore the chaincode results do not match. In a production system with load it can be caused by peers at different block heights at time of chaincode execution. If you are seeing it on a system at rest then there may be something wrong with one of your peers. Are you able to reproduce it on a clean environment?

If you'd like to troubleshoot this environment, you can take state snapshots on both peers (https://hyperledger-fabric.readthedocs.io/en/release-2.4/peer_ledger_snapshot.html) and then compare the snapshots with the new ledgerutil that was delivered in v2.4 (https://hyperledger-fabric.readthedocs.io/en/release-2.4/commands/ledgerutil.html).


Dave Enyeart


"BigBang019" ---12/15/2021 07:50:47 AM---*Scenario* : 1. I have a chaicode named *vulnerable* with a *collection-config* as follows:

From: "BigBang019" <zhuxy0000@...>
To: fabric@...
Date: 12/15/2021 07:50 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Question about PrivateData Endorsement in Hyperledger Fabric #fabric-endorser
Sent by: fabric@...





Scenario: 1. I have a chaicode named vulnerable with a collection-config as follows: and transaction functions as follows But I didn't give any endorsement policy to this chaincode, which means its endorsement policy are supposed to be  ZjQcmQRYFpfptBannerStart 
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Scenario
:
1. I have a chaicode named
vulnerable with a collection-config as follows:

and transaction functions as follows

But I didn't give any endorsement policy to this chaincode, which means its endorsement policy are supposed to be 
"MAJORITY Endorsement".
2. Now I deployed a network with 2 Orgs and 1 Peer per Org, i.e. I have 2 peers in total.
3. When I invoke this chaincode through fabric-sdk-go, as follows

It gives me:


I'm really confused, because everything works fine before I add that 
collection-config.

Could you please give any help on this situation?

Thanks in advance.






Question about PrivateData Endorsement in Hyperledger Fabric #fabric-endorser

BigBang019
 

Scenario:
1. I have a chaicode named vulnerable with a collection-config as follows:

and transaction functions as follows

But I didn't give any endorsement policy to this chaincode, which means its endorsement policy are supposed to be "MAJORITY Endorsement".
2. Now I deployed a network with 2 Orgs and 1 Peer per Org, i.e. I have 2 peers in total.
3. When I invoke this chaincode through fabric-sdk-go, as follows

It gives me:

I'm really confused, because everything works fine before I add that collection-config.

Could you please give any help on this situation?

Thanks in advance.


Re: management of k8s deployed test network

Nikos Karamolegkos
 

Extending the previous question. How can I use the scripts to deploy a second channel with an other chaincode (the asset-transfer-basic but with an other name in avoid problems in the peers). I tried to channel the ENV TEST_NETWORK_CHANNEL_NAME before creating the channel and then change TEST_NETWORK_CHAINCODE_LABEL before deploying the chaincode. However, during invoke and query the commands stall.


Re: Question on EVM chaincode on Hyperledger Fabric

Ry Jones
 

Hi, Gourav.
I've forwarded this to the Fabric mailing list, which is the best place to get an answer.
Ry

I have followed the link https://github.com/hyperledger/fabric-chaincode-evm ) to install the EVM chaincode on Hyperledger Fabric. I also deployed the ERC721 solidity smart contract on the EVM chaincode.

 

However, while querying the owner address through the function in the ERC721 smart contract, I'm getting the owner address as "AAAAAAAAAAAAAAAAMeGlXRSvGKRwCB3ufvC6Xg6YlE0=" from EVM chaincode compared to the owner address of "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4" from the same ERC721 smart contract on Ethereum. It looks like there are 2 different encoding standards followed between EVM and Ethereum.

 

Please suggest how to resolve the encoding issue between EVM and solidity.

 

Please note that I'm also getting additional characters like nulls and line breaks during the response from ERC721 smart contract on EVM chaincode.

 

Eagerly looking for your help.

 

Warm Regards,

Gourav.

--
Ry Jones
Community Architect, Hyperledger


Re: About BCCSP plugin

Yacov
 

I am aware of companies that use validation plugins to complement the built-in endorsement policy checks because they have an atypical adversary model.

I also think that endorsement plugins are useful for achieving threshold signature orchestration without needing to change Fabric, and I know of companies that have a need for threshold signatures because a strong endorsement policy has a big impact on transaction size and throughput.

While I know that plugins are not exactly... flexible or easy to use, it is still possible to use them if you are determined enough to have a hand-tailored solution for a problem that no one else will solve for you.

I also don't think we should've removed the BCCSP plugins.
Until Go 1.17 where we had a clash between plugin implementation and dependencies, they did not carry any maintenance burden.



Regards,
Yacov





From: fabric@... <fabric@...> on behalf of David Enyeart <enyeart@...>
Sent: Tuesday, December 14, 2021 11:04 PM
To: Ry Jones <rjones@...>
Cc: community-architects@... <community-architects@...>; fabric <fabric@...>; twg-china@... <twg-china@...>; 袁怿 <yy19902439@...>
Subject: [EXTERNAL] Re: [Hyperledger Fabric] About BCCSP plugin
 
The work item that removed BCCSP plugin support explains the rationale and points to a Go issue about plugin restrictions: https://jira.hyperledger.org/browse/FAB-15338 In a nutshell, nobody was using them and while they sound good on the surface, ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd

The work item that removed BCCSP plugin support explains the rationale and points to a Go issue about plugin restrictions: https://jira.hyperledger.org/browse/FAB-15338

In a nutshell, nobody was using them and while they sound good on the surface, it was unlikely that anybody would want to use them after understanding the Go restrictions.

The same Jira proposes to remove the other plugin support (endorser, validation, etc) in a future v3.0 release. So now is a good time to ask:
- is anybody using Go plugins with Fabric?
- have you found them valuable relative to the Go restrictions?
- any proposals for replacing the plugin model with something else?


Dave Enyeart


"Ry Jones" ---12/14/2021 01:18:53 PM---Hi, Sam. I've added the Fabric list so that the other maintainers can see it.

From: "Ry Jones" <rjones@...>
To: "袁怿" <yy19902439@...>, "fabric" <fabric@...>
Cc: "David Enyeart" <enyeart@...>, "community-architects@..." <community-architects@...>, "twg-china@..." <twg-china@...>
Date: 12/14/2021 01:18 PM
Subject: [EXTERNAL] Re: [Hyperledger Fabric] About BCCSP plugin
Sent by: fabric@...





Hi, Sam. I've added the Fabric list so that the other maintainers can see it. Ry On Fri, Dec 10, 2021 at 7:09 AM 袁怿 <yy19902439@...> wrote: ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ZjQcmQRYFpfptBannerStart 
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hi, Sam.
I've added the Fabric list so that the other maintainers can see it.
Ry

On Fri, Dec 10, 2021 at 7:09 AM 袁怿 <yy19902439@...> wrote:

    Hi fabric maintainers and David,

    I found two interested commits in fabric history.
    hyperledger/fabric@01c50ef
    hyperledger/fabric@0cde017#diff-62806c7dcf924402565d4ef558b602db6197cb4b1075bacb8514f95ca073392d

    mapping to jira tickets
    https://jira.hyperledger.org/browse/FAB-6189
    and
    https://jira.hyperledger.org/browse/FAB-15340

    with above things.

    Which means in historical, we support fabric BCCSP running in plugin mode and may I know the reason we removed BCCSP plugin mode support?

      Sam Yuan
      yy19902439@...
      Thanks and Regards
    签名由 网易邮箱大师 定制


--
Ry Jones
Community Architect, Hyperledger
Chat@rjones Calendar





Re: About BCCSP plugin

David Enyeart
 

The work item that removed BCCSP plugin support explains the rationale and points to a Go issue about plugin restrictions: https://jira.hyperledger.org/browse/FAB-15338

In a nutshell, nobody was using them and while they sound good on the surface, it was unlikely that anybody would want to use them after understanding the Go restrictions.

The same Jira proposes to remove the other plugin support (endorser, validation, etc) in a future v3.0 release. So now is a good time to ask:
- is anybody using Go plugins with Fabric?
- have you found them valuable relative to the Go restrictions?
- any proposals for replacing the plugin model with something else?


Dave Enyeart


"Ry Jones" ---12/14/2021 01:18:53 PM---Hi, Sam. I've added the Fabric list so that the other maintainers can see it.

From: "Ry Jones" <rjones@...>
To: "袁怿" <yy19902439@...>, "fabric" <fabric@...>
Cc: "David Enyeart" <enyeart@...>, "community-architects@..." <community-architects@...>, "twg-china@..." <twg-china@...>
Date: 12/14/2021 01:18 PM
Subject: [EXTERNAL] Re: [Hyperledger Fabric] About BCCSP plugin
Sent by: fabric@...





Hi, Sam. I've added the Fabric list so that the other maintainers can see it. Ry On Fri, Dec 10, 2021 at 7:09 AM 袁怿 <yy19902439@...> wrote: ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ZjQcmQRYFpfptBannerStart 
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hi, Sam.
I've added the Fabric list so that the other maintainers can see it.
Ry


On Fri, Dec 10, 2021 at 7:09 AM 袁怿 <yy19902439@...> wrote:

    Hi fabric maintainers and David,

    I found two interested commits in fabric history.
    hyperledger/fabric@01c50ef
    hyperledger/fabric@0cde017#diff-62806c7dcf924402565d4ef558b602db6197cb4b1075bacb8514f95ca073392d

    mapping to jira tickets
    https://jira.hyperledger.org/browse/FAB-6189
    and
    https://jira.hyperledger.org/browse/FAB-15340

    with above things.

    Which means in historical, we support fabric BCCSP running in plugin mode and may I know the reason we removed BCCSP plugin mode support?

      Sam Yuan
      yy19902439@...
      Thanks and Regards
    签名由 网易邮箱大师 定制


--
Ry Jones
Community Architect, Hyperledger
Chat@rjones Calendar





Re: About BCCSP plugin

Ry Jones
 

Hi, Sam.
I've added the Fabric list so that the other maintainers can see it.
Ry


On Fri, Dec 10, 2021 at 7:09 AM 袁怿 <yy19902439@...> wrote:

Hi fabric maintainers and David,

I found two interested commits in fabric history.

hyperledger/fabric@01c50ef

hyperledger/fabric@0cde017#diff-62806c7dcf924402565d4ef558b602db6197cb4b1075bacb8514f95ca073392d


mapping to jira tickets

https://jira.hyperledger.org/browse/FAB-6189

and

https://jira.hyperledger.org/browse/FAB-15340


with above things.


Which means in historical, we support fabric BCCSP running in plugin mode and may I know the reason we removed BCCSP plugin mode support?





--
Ry Jones
Community Architect, Hyperledger


Now: Private Chaincode Lab - 12/14/2021 #cal-notice

fabric@lists.hyperledger.org Calendar <noreply@...>
 

Private Chaincode Lab

When:
12/14/2021
8:00am to 9:00am
(UTC-08:00) America/Los Angeles

Where:
https://zoom.us/my/hyperledger.community.3?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09

Organizer: Marcus Brandenburger bur@...

View Event

Description:
Two of the Hyperleger Labs projects (private data objects and private chain code) are collaborating to develop a "private smart contracts" capability.

Join Zoom Meeting https://zoom.us/j/5184947650?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09 Meeting ID: 518 494 7650 Passcode: 475869


Re: Urgent: problems with starting local fabric(2.x) network for dev mode using docker containers #fabric #configtxgen #fabric-peer #fabric-orderer

Matthew White
 

Hello;

On Approach #2..

Do we still need to install the chaincode in the peer, if we are running the peer in dev mode inside a docker container ?
No, the approach you are doing is basically correct; using a different packaging of Fabric, but with the same concepts 
https://hyperledgendary.github.io/docs/tutorials/hyperfast_contract_development.html I was successful in the same approach

Have you tried using the `fabric-samples` test-network?  I'd be concerned if there's something wrong in the initial setup that is causing later issues. The error suggests to me that the peer still thinks this chaincode is going to be used in non-dev mode. 

 

Matthew White
IBM Blockchain Development


Re: Number of channels

Tsvetan Georgiev
 

Hello,
Older discussion on that topic:

In one of the threads above David Enyeart shared a nice section regarding PDC vs channel:


You have to consider some numbers when dealing with the ordering service cluster and number of channels per orderer:


The management of the channels may bring overhead. However it is important to consider the functional requirements first and then decide on the technical model.


It is mostly about your functional / privacy requirements. Technically speaking I see no problem scaling to 8 channels (ledgers) if your business will benefit from it. Channel management may be a maintenance concern depending on how often you need to do updates (i.e. deploy chaincodes, change policies, etc). However if regular updates are required we usually automate the steps anyways.

Best Regards,


Senofi

Tsvetan Georgiev
Director, Senofi Inc.

438-494-7854 | tsvetan@...

www.senofi.ca

www.consortia.io






---- On Sat, 11 Dec 2021 05:09:40 -0500 J K via lists.hyperledger.org <jsjkj434=yahoo.com@...> wrote ----

Hey Folks,

I want to know what is the optimum number of channels which a small network can have? What considerations shall I take to decide these?

I have a under-10 member network with around 2k transactions per day in the network. (Currently have 3 channels & like to scale to 8). I have read that due to maintenance overhead channels are not advisable rather private data collections shall be considered. Can someone please shed some light on this.

Cheers!






Updated Event: Hyperledger Project Quarterly Update Due #tsc-project-update #cal-invite

fabric@lists.hyperledger.org Calendar <noreply@...>
 

Hyperledger Project Quarterly Update Due #tsc-project-update

When:
Thursday, April 15, 2021

Organizer: community-architects@...

View Event

Description:
Please file a project status report for the TSC here:

https://wiki.hyperledger.org/display/TSC/2022+Project+Updates

https://wiki.hyperledger.org/display/TSC/2022+TSC+Project+Update+Calendar


Re: Fabric with Open Tracing

袁怿
 

Hi Yacov and everyone.

I had created a new pr, as a update/upgrade for https://github.com/hyperledger/fabric-rfcs/pull/42
With link below:

At PSWG meeting on next Tuesday, we are going to have a discuss related with it.
If you interested with this topic, welcome to join us.


On 11/17/2021 18:49袁怿<yy19902439@...> wrote:

On 11/15/2021 21:12Yacov<yacovm@...> wrote:
 
----- Original message -----
From: "袁怿" <yy19902439@...>
Sent by: fabric@...
To: "fabric@..." <fabric@...>
Cc:
Subject: [EXTERNAL] [Hyperledger Fabric] Fabric with Open Tracing
Date: Mon, Nov 15, 2021 3:03 PM
 
Hello everyone, As we know blockchain as hash value as unique identifier for each transaction or block. For fabric observability, is there any sample for use fabric together with any kind of open tracing project/tools? ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
 
Hello everyone,
 
As we know blockchain as hash value as unique identifier for each transaction or block.
For fabric observability, is there any sample for use fabric together with any kind of open tracing project/tools?
 
As Fabric running as distributed concurrency, the log for a single tx will distributed and Async Concurrency among nodes.(peer/order/client)
I am not sure if we are able to use span model to do tx tracing and with further use the tracing result for performance analysis?
 
Please let me know if there any opened rfc / GitHub issue / discussion/ Jira ticket.
 
Thanks and regards
 



Number of channels

J K
 

Hey Folks,

I want to know what is the optimum number of channels which a small network can have? What considerations shall I take to decide these?

I have a under-10 member network with around 2k transactions per day in the network. (Currently have 3 channels & like to scale to 8). I have read that due to maintenance overhead channels are not advisable rather private data collections shall be considered. Can someone please shed some light on this.

Cheers!


Re: Urgent: problems with starting local fabric(2.x) network for dev mode using docker containers #fabric #configtxgen #fabric-peer #fabric-orderer

David Enyeart
 

You will get the Approach1 error if the signer of the create channel transaction ("peer channel create" caller) isn't an admin of a consortium member.
If you start the orderer with FABRIC_LOGGING_SPEC=debug, you should be able to see if the signer has the admin role or not, right before the error message in the orderer log.
Note that v2.4 added an additional warning message for these types of errors, it includes the failed policy and signer credential information to help troubleshoot these scenarios. You should be able to simply swap in the v2.4 orderer container to get the additional message in the orderer log.

The Approach2 error is not expected, you shouldn't have to install chaincode on the peer. Since it works for you when running as a process, something must not be correct in the containerized configuration.


Dave Enyeart
IBM Blockchain


avinash.uttav---12/10/2021 11:09:40 AM---Hi Team, I am a Software Engineer in Blockchain Platform team at Oracle. We are facing an issue belo

From: avinash.uttav@...
To: fabric@...
Date: 12/10/2021 11:09 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Urgent: problems with starting local fabric(2.x) network for dev mode using docker containers #fabric #configtxgen #fabric-peer #fabric-orderer
Sent by: fabric@...





Hi Team, I am a Software Engineer in Blockchain Platform team at Oracle. We are facing an issue below with running fabric in local environment. We are trying to build a setup for starting a fabric-network locally with fabric-2.3/2.4 containers ZjQcmQRYFpfptBannerStart 
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hi Team,
 
I am a Software Engineer in Blockchain Platform team at Oracle. We are facing an issue below with running fabric in local environment.
We are trying to build a setup for starting a fabric-network locally with fabric-2.3/2.4 containers and starting the peer in dev mode for debugging the chaincodes.
Below are the simple configurations for the network that we are building for.
 
1) 1 Organization
2) 1 Peer in dev mode
3) 1 Channel
 
We have been facing multiple issues in building this setup up with Fabric 2.x
We have considered below few points after reading the documents on running peer and chaincode in dev mode and using the test network
https://hyperledger-fabric.readthedocs.io/en/release-2.3/peer-chaincode-devmode.html
https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html
 
1) Starting up peer in dev-mode is requires passing '--peer-chaincodedev=true'
2) TLS should not be enabled on the peer for dev-mode.
3) Orderer configuration in configtx.yml for generating genesisblock for orderer in solo mode
4) Channel configuration in configtx.yml for generating channel configuration file (ch1.tx)
 
We have tried below two approaches to build this network in docker containers and both have their own set of problems
 
Approach1:
Trimming down and editing the configurations for test-network which is provided with fabric-samples.
 
In this approach, we are trying to edit the docker-compose-test-net.yaml file and configtx.yaml file in the test-network according to the requirements and also according the docs for running chaincode in dev mode.
Below are the edited files.
 
We have included two new profiles into the configtx, which we use to generate genesis.block and channel.tx files. Thes profiles are namely SampleDevModeSolo, SampleSingleMSPChannel,
These are inspired from the configtx.yaml provided under sampleconfig that is used in docs for 'running peer and chaincode in dev mode'.
This is done because of multiple reasons
1) when we disable TLS and use the orderer in raft mode it does not work, we start getting errors that TLS is required.
2) Also we did not find any example of orderer type etcdraft getting used in dev-setup.
3) In the default configtx.yaml the consortium configuration was also not present, which was giving us some errors as well.
 
Therefore we pulled in these two profiles from sampleconfig to test-network, and edited them accordingly.
 
Steps that we are following to build the network and createChannel.
1. ./network.sh up with the compose file to bring up the containers.
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. Running below command from the peer container to create the channel.
export CORE_PEER_LOCALMSPID=Org1MSP
export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@.../msp (Locations are mounted on peer container)
peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
 
In Step4 we are hitting below issue.
"Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not successfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied"
 
We have tried changing the configurations in many ways but we are still stuck on this issue.
Could you please take a look at our cofigtx.yaml file attached and docker-test-net file.
Are we missing any configurations in these ?
 
 
Approach2:
 
We followed the docs for 'running peer and chaincode in dev mode' and started to build docker-compose to bring up the containers for peer and orderer.
We have also edited the configtx.yaml regarding listen addresses so that containers can talk to each other.
Below are the steps that we followed.
1. docker compose up to bring the network up
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. peer channel create -o orderer.example.com:7050 -c ch1 -f /etc/hyperledger/configtx/ch1.tx
 
5. peer channel join -b ch1.block
 
6. Started the chaindode, and it was able to register with the peer. we got success log for chaincode registration.
 
7. peer lifecycle chaincode approveformyorg  -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --package-id GoCheck1:1.0
8. peer lifecycle chaincode checkcommitreadiness -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')"
9. peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID ch1 --name chGo1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --peerAddresses peer0.org1.example.com:7051
 
10. But, after above steps when we invoke the chaincode using command "peer chaincode invoke -o orderer.example.com:7050 -C ch1 -n GoCheck1 -c '{"Args":["Init"]}' --isInit".
 
We hit below issue.
"Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction ab60ed335f58830a247fad5dda4bc7c7faf0f84c15dce416d655170240c2fae4: could not
launch chaincode GoCheck1:1.0: error building chaincode: error building image: failed to get chaincode package for external build: could not get legacy chaincode package 'GoCheck1:1.0': open /var/hyperledger/production/chaincodes/GoCheck1.1.0: no such file or directory"
 
Do we still need to install the chaincode in the peer, if we are running the peer in dev mode inside a docker container ?
The same steps when we are running peer and orderer and chaincode in seperate processes they work fine, but not in container.
 
This is an urgent issue for us. Could you please check our configs for this approach and suggest us if we are missing something in the configs or is there any better way to approach this problem.
 
 
Thanks
Avinash Uttav





Re: Urgent: problems with starting local fabric(2.x) network for dev mode using docker containers #fabric #configtxgen #fabric-peer #fabric-orderer

David Faulstich Diniz Reis
 

To check the logs I use the logspout. An easy way is to execute the script monitordock.sh inside the commercial paper tutorial. I use it to show the docker logs when I show something about Hyperledger (when teaching someone about hlf). 

You will be able to see output from the docker network. Take care if you put the environment with log status set to debug.

Em sex., 10 de dez. de 2021 às 16:02, Chris Gabriel <alaskadd@...> escreveu:

Hi Avinash,
A possible workaround is to use the IBM Blockchain extension for VSCode and view the output dialog.  Or you could just use that as it is well documented and you avoid reinventing the wheel.
best,
Chris 


On Dec 10, 2021, at 10:09 AM, avinash.uttav@... wrote:


Hi Team, 
 
I am a Software Engineer in Blockchain Platform team at Oracle. We are facing an issue below with running fabric in local environment.
We are trying to build a setup for starting a fabric-network locally with fabric-2.3/2.4 containers and starting the peer in dev mode for debugging the chaincodes.
Below are the simple configurations for the network that we are building for.
 
1) 1 Organization
2) 1 Peer in dev mode
3) 1 Channel
 
We have been facing multiple issues in building this setup up with Fabric 2.x
We have considered below few points after reading the documents on running peer and chaincode in dev mode and using the test network
 
1) Starting up peer in dev-mode is requires passing '--peer-chaincodedev=true'
2) TLS should not be enabled on the peer for dev-mode.
3) Orderer configuration in configtx.yml for generating genesisblock for orderer in solo mode
4) Channel configuration in configtx.yml for generating channel configuration file (ch1.tx)
 
We have tried below two approaches to build this network in docker containers and both have their own set of problems
 
Approach1:
Trimming down and editing the configurations for test-network which is provided with fabric-samples. 
 
In this approach, we are trying to edit the docker-compose-test-net.yaml file and configtx.yaml file in the test-network according to the requirements and also according the docs for running chaincode in dev mode.
Below are the edited files. 
 
We have included two new profiles into the configtx, which we use to generate genesis.block and channel.tx files. Thes profiles are namely SampleDevModeSolo, SampleSingleMSPChannel, 
These are inspired from the configtx.yaml provided under sampleconfig that is used in docs for 'running peer and chaincode in dev mode'.
This is done because of multiple reasons 
1) when we disable TLS and use the orderer in raft mode it does not work, we start getting errors that TLS is required. 
2) Also we did not find any example of orderer type etcdraft getting used in dev-setup.
3) In the default configtx.yaml the consortium configuration was also not present, which was giving us some errors as well.
 
Therefore we pulled in these two profiles from sampleconfig to test-network, and edited them accordingly.
 
Steps that we are following to build the network and createChannel.
1. ./network.sh up with the compose file to bring up the containers.
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. Running below command from the peer container to create the channel.
export CORE_PEER_LOCALMSPID=Org1MSP
export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@.../msp (Locations are mounted on peer container)
peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
 
In Step4 we are hitting below issue.
"Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not successfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied"
 
We have tried changing the configurations in many ways but we are still stuck on this issue.
Could you please take a look at our cofigtx.yaml file attached and docker-test-net file.
Are we missing any configurations in these ?
 
 
Approach2:
 
We followed the docs for 'running peer and chaincode in dev mode' and started to build docker-compose to bring up the containers for peer and orderer.
We have also edited the configtx.yaml regarding listen addresses so that containers can talk to each other.
Below are the steps that we followed.
1. docker compose up to bring the network up 
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. peer channel create -o orderer.example.com:7050 -c ch1 -f /etc/hyperledger/configtx/ch1.tx
 
5. peer channel join -b ch1.block
 
6. Started the chaindode, and it was able to register with the peer. we got success log for chaincode registration.
 
7. peer lifecycle chaincode approveformyorg  -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --package-id GoCheck1:1.0
8. peer lifecycle chaincode checkcommitreadiness -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" 
9. peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID ch1 --name chGo1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --peerAddresses peer0.org1.example.com:7051
 
10. But, after above steps when we invoke the chaincode using command "peer chaincode invoke -o orderer.example.com:7050 -C ch1 -n GoCheck1 -c '{"Args":["Init"]}' --isInit". 
 
We hit below issue.
"Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction ab60ed335f58830a247fad5dda4bc7c7faf0f84c15dce416d655170240c2fae4: could not 
launch chaincode GoCheck1:1.0: error building chaincode: error building image: failed to get chaincode package for external build: could not get legacy chaincode package 'GoCheck1:1.0': open /var/hyperledger/production/chaincodes/GoCheck1.1.0: no such file or directory"
 
Do we still need to install the chaincode in the peer, if we are running the peer in dev mode inside a docker container ?
The same steps when we are running peer and orderer and chaincode in seperate processes they work fine, but not in container.
 
This is an urgent issue for us. Could you please check our configs for this approach and suggest us if we are missing something in the configs or is there any better way to approach this problem.
 
 
Thanks
Avinash Uttav
<Approach1.zip>
<Approach2.zip>



--
David Reis
@davidfaulstich (Instagram)
@davidfdr (Github)


581 - 600 of 11213