markparz (Thu, 02 Feb 2017 23:29:52 GMT):
Discuss Java SDK
donjohnny (Thu, 02 Feb 2017 23:39:41 GMT):
Has joined the channel.
C0rWin (Fri, 03 Feb 2017 00:11:52 GMT):
Has joined the channel.
salmanbaset (Fri, 03 Feb 2017 01:21:10 GMT):
Has joined the channel.
tuand (Fri, 03 Feb 2017 02:08:08 GMT):
Has joined the channel.
grapebaba (Fri, 03 Feb 2017 06:29:09 GMT):
Has joined the channel.
frbrkoala (Fri, 03 Feb 2017 07:02:31 GMT):
Has joined the channel.
nvlasov (Fri, 03 Feb 2017 07:13:51 GMT):
Has joined the channel.
ryokawajp (Fri, 03 Feb 2017 07:50:57 GMT):
Has joined the channel.
jdockter (Fri, 03 Feb 2017 11:39:50 GMT):
Has joined the channel.
silliman (Fri, 03 Feb 2017 13:57:41 GMT):
Has joined the channel.
gormand (Fri, 03 Feb 2017 14:43:53 GMT):
Has joined the channel.
kletkeman (Fri, 03 Feb 2017 15:20:26 GMT):
Has joined the channel.
danacr (Fri, 03 Feb 2017 15:24:20 GMT):
Has joined the channel.
ssaddem (Fri, 03 Feb 2017 15:52:43 GMT):
Has joined the channel.
rickr (Fri, 03 Feb 2017 17:24:54 GMT):
Has joined the channel.
rickr (Fri, 03 Feb 2017 17:25:15 GMT):
First one here :) ?
tuand (Fri, 03 Feb 2017 17:39:07 GMT):
wrong
rickr (Fri, 03 Feb 2017 17:39:43 GMT):
wrong ?
karkal (Fri, 03 Feb 2017 19:55:52 GMT):
Has joined the channel.
ericmvaughn (Fri, 03 Feb 2017 22:06:37 GMT):
Has joined the channel.
Pardha (Sat, 04 Feb 2017 01:31:47 GMT):
Has joined the channel.
bfuentes@fr.ibm.com (Sat, 04 Feb 2017 09:20:39 GMT):
Has joined the channel.
yury (Sat, 04 Feb 2017 11:45:24 GMT):
Has joined the channel.
Basug (Sun, 05 Feb 2017 03:02:58 GMT):
Has joined the channel.
Basug (Sun, 05 Feb 2017 03:03:42 GMT):
Hello
smfaizalkhan (Sun, 05 Feb 2017 05:23:37 GMT):
Has joined the channel.
smfaizalkhan (Sun, 05 Feb 2017 06:59:39 GMT):
Hello All
ruslan.kryukov (Sun, 05 Feb 2017 12:36:48 GMT):
Has joined the channel.
schwentker2 (Sun, 05 Feb 2017 15:50:10 GMT):
Has joined the channel.
Honglei (Sun, 05 Feb 2017 23:56:56 GMT):
Has joined the channel.
malik-altaf (Mon, 06 Feb 2017 04:39:48 GMT):
Has joined the channel.
ankitkamra (Mon, 06 Feb 2017 05:25:56 GMT):
Has joined the channel.
ankitkamra (Mon, 06 Feb 2017 05:26:30 GMT):
Hi all, i am trying to deploy chaincode using java sdk when i deploy chaincode with noops it successfully gets deployed, but when i try it with pbft it does not get deploy
can anyone please help me to resolve the problem ?
yury (Mon, 06 Feb 2017 08:50:46 GMT):
do you try to deploy java chaincode?
ankitkamra (Mon, 06 Feb 2017 08:53:18 GMT):
yes
ankitkamra (Mon, 06 Feb 2017 08:54:08 GMT):
@yury i have tried to deploy java chaincode
yury (Mon, 06 Feb 2017 09:03:53 GMT):
https://jira.hyperledger.org/browse/FAB-1407
yury (Mon, 06 Feb 2017 09:04:31 GMT):
on the current moment we have task
pd93 (Mon, 06 Feb 2017 09:27:53 GMT):
Has joined the channel.
Jonas.Hedin (Mon, 06 Feb 2017 09:47:06 GMT):
Has joined the channel.
david.peyronnin (Mon, 06 Feb 2017 09:53:50 GMT):
Has joined the channel.
ankitkamra (Mon, 06 Feb 2017 09:54:59 GMT):
ohh that means i can't do the same in v0.6
klorenz (Mon, 06 Feb 2017 16:06:27 GMT):
Has joined the channel.
pschnap (Mon, 06 Feb 2017 18:54:19 GMT):
Has joined the channel.
weeds (Mon, 06 Feb 2017 20:28:05 GMT):
Has joined the channel.
AlexeyZavyalov (Mon, 06 Feb 2017 21:48:54 GMT):
Has joined the channel.
liutc (Tue, 07 Feb 2017 01:04:43 GMT):
Has joined the channel.
tarima (Tue, 07 Feb 2017 01:10:08 GMT):
Has joined the channel.
ArnabChatterjee (Tue, 07 Feb 2017 03:11:48 GMT):
Has joined the channel.
mbaizan (Tue, 07 Feb 2017 07:45:14 GMT):
Has joined the channel.
zlliu (Tue, 07 Feb 2017 08:18:44 GMT):
Has joined the channel.
Rymd (Tue, 07 Feb 2017 09:29:53 GMT):
Has joined the channel.
choojoyq (Tue, 07 Feb 2017 09:36:46 GMT):
Has joined the channel.
brianeno (Tue, 07 Feb 2017 10:48:52 GMT):
Has joined the channel.
nickmelis (Tue, 07 Feb 2017 12:59:02 GMT):
Has joined the channel.
shsedghi (Tue, 07 Feb 2017 14:21:35 GMT):
Has joined the channel.
ardashev120101 (Tue, 07 Feb 2017 14:59:42 GMT):
Has joined the channel.
cbf (Tue, 07 Feb 2017 15:15:47 GMT):
Has joined the channel.
mihaig (Tue, 07 Feb 2017 15:18:27 GMT):
Has joined the channel.
umasuthan (Tue, 07 Feb 2017 16:05:01 GMT):
Has joined the channel.
isramos (Tue, 07 Feb 2017 16:05:11 GMT):
Has joined the channel.
HieuDoan (Tue, 07 Feb 2017 16:07:02 GMT):
Has joined the channel.
robear (Tue, 07 Feb 2017 16:33:57 GMT):
Has joined the channel.
jworthington (Tue, 07 Feb 2017 16:45:22 GMT):
Has joined the channel.
adrianhopebailie (Tue, 07 Feb 2017 19:05:29 GMT):
Has joined the channel.
tbrooke (Tue, 07 Feb 2017 20:20:19 GMT):
Has joined the channel.
beauson45 (Tue, 07 Feb 2017 20:59:33 GMT):
Has joined the channel.
mwall (Tue, 07 Feb 2017 21:15:23 GMT):
Has joined the channel.
mgk (Tue, 07 Feb 2017 22:07:44 GMT):
Has joined the channel.
jimthematrix (Wed, 08 Feb 2017 02:37:47 GMT):
Has joined the channel.
jimthematrix (Wed, 08 Feb 2017 02:42:33 GMT):
@rickr @Pardha @malik-altaf is java chaincode support working currently in v1.0? community member is reporting a timeout error from the peer when waiting for java chaincode docker to register (image seems to have been built successfully and launched)
malik-altaf (Wed, 08 Feb 2017 02:44:59 GMT):
@jimthematrix Last thing I know is that satheesh was working on fixing some shim stuff for v1.0 (before the hackfest). @Pardha might be able to provide an update on that fix
jimthematrix (Wed, 08 Feb 2017 02:47:50 GMT):
thanks Altaf, do you know if there's a JIRA for the work Satheesh is doing or the nature of the fix?
Hangyu (Wed, 08 Feb 2017 02:49:15 GMT):
Has joined the channel.
rickr (Wed, 08 Feb 2017 02:50:50 GMT):
@Pardha mentioned to me he expected a patch by tomorrow
Andy Zhang (Wed, 08 Feb 2017 03:00:38 GMT):
Has joined the channel.
ArulmuruganS (Wed, 08 Feb 2017 03:49:28 GMT):
Has joined the channel.
Ashish (Wed, 08 Feb 2017 04:43:10 GMT):
Has joined the channel.
satheeshk (Wed, 08 Feb 2017 09:58:10 GMT):
Has joined the channel.
satheeshk (Wed, 08 Feb 2017 09:59:25 GMT):
I will submit a patch by this evening guys for java chaincode
satheeshk (Wed, 08 Feb 2017 10:01:41 GMT):
@ankitkamra If you are trying to deploy it on v0.6, can you please upload the peer logs
satheeshk (Wed, 08 Feb 2017 10:01:41 GMT):
@ankitkamra If you are trying to deploy it on v0.6, can you please upload the peer logs ?
ankitkamra (Wed, 08 Feb 2017 10:34:08 GMT):
@satheeshk i had deployed chaincode but there was no errors in logs, docker images is not created if i have enabled consensus
Percival Lucena (Wed, 08 Feb 2017 11:37:51 GMT):
Has joined the channel.
Basug (Wed, 08 Feb 2017 12:25:51 GMT):
Hi All - are there steps on how to deploy chain code and test with java sdk ?
Basug (Wed, 08 Feb 2017 12:26:25 GMT):
I have the setup running with docker as detailed in https://hyperledger-fabric.readthedocs.io/en/latest/gettingstarted/
Basug (Wed, 08 Feb 2017 12:35:39 GMT):
I have got 0.6 working fine, but for my use case want to do eventing and wanted to try java sdk
jimthematrix (Wed, 08 Feb 2017 12:46:04 GMT):
@satheeshk thanks, can you post here once the java chaincode patch is ready for review?
satheeshk (Wed, 08 Feb 2017 13:17:30 GMT):
Sure
jadhavajay (Wed, 08 Feb 2017 13:18:26 GMT):
Has joined the channel.
rickr (Wed, 08 Feb 2017 13:40:05 GMT):
Hi @satheeshk Can you please make sure the End2endJavaChaincodeIT.java Integration testcase is running with your fix. FYI Best to look at the README.md for levels of fabric and fabric_ca that we know we work with.
rickr (Wed, 08 Feb 2017 13:41:23 GMT):
On about line 34 there is currently an @Ignore that skips this test.
satheeshk (Wed, 08 Feb 2017 13:46:25 GMT):
ok @rickr , I will include that test to run removing the 'ignore'
kushnir.grigoriy (Wed, 08 Feb 2017 13:49:31 GMT):
Has joined the channel.
Basug (Wed, 08 Feb 2017 14:02:51 GMT):
@satheeshk - are there any instructions for building docker images that work with java sdk ?
rickr (Wed, 08 Feb 2017 14:05:53 GMT):
From what I understand the direction is to not send a Dockerfile at all. In fact we have a todo to remove it from the sending it in the examples.
Basug (Wed, 08 Feb 2017 14:07:31 GMT):
@rickr - so we use dev env setup instructions to build one ?
Basug (Wed, 08 Feb 2017 14:08:25 GMT):
I am wanting to setup one that works with latest version of fabric (the commit level that is specified in readme). Will have to build it for a POC, so was wondering how to do it
tuand (Wed, 08 Feb 2017 14:14:02 GMT):
@elast , any luck pushing your register user code to gerrit ?
elast (Wed, 08 Feb 2017 14:14:02 GMT):
Has joined the channel.
s0rins (Wed, 08 Feb 2017 14:21:07 GMT):
Has joined the channel.
pmcosta1 (Wed, 08 Feb 2017 14:21:56 GMT):
Has joined the channel.
o_drugan (Wed, 08 Feb 2017 14:27:21 GMT):
Has joined the channel.
aybekbuka (Wed, 08 Feb 2017 16:00:29 GMT):
Has joined the channel.
anilmuppalla (Wed, 08 Feb 2017 16:13:58 GMT):
Has joined the channel.
rickr (Wed, 08 Feb 2017 16:37:38 GMT):
Any reason to keep around fabric_v1 and WIP_fabric_v1 ?
choojoyq (Wed, 08 Feb 2017 17:46:12 GMT):
hi, does someone get such error in End2endIT.java test during sending proposal request to endorser?
choojoyq (Wed, 08 Feb 2017 17:46:15 GMT):
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: The creator certificate is not valid, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority
rickr (Wed, 08 Feb 2017 18:08:26 GMT):
My sdk code is uptodate and End2endIT works. My fabric is at the level of the specified in the README.md fabric_ca is later also with patches but unrelated .
choojoyq (Wed, 08 Feb 2017 21:06:06 GMT):
thanks, i reconfigured environment following instructions from README.md and now it works fine
zhoupeiwen (Thu, 09 Feb 2017 03:21:25 GMT):
Has joined the channel.
xiejunxi (Thu, 09 Feb 2017 03:26:12 GMT):
Has joined the channel.
Ch3ck (Thu, 09 Feb 2017 12:45:39 GMT):
Has joined the channel.
MustafaOzturk (Thu, 09 Feb 2017 21:37:08 GMT):
Has joined the channel.
MustafaOzturk (Thu, 09 Feb 2017 21:38:29 GMT):
Hello, it seems like there is a bug in the java sdk (version 0.6), where during deploy the function name is not prepended to the ChaincodeInput argument list (the hfc does this right). This causes the init function called during deployment to receive one less argument than what the client sent. How does one contribute a bug fix?
tuand (Thu, 09 Feb 2017 21:43:06 GMT):
@MustafaOzturk you can open a JIRA issue and submit a changeset to gerrit ... gerrit.hyperledger.org and clone project fabric-sdk-java
MustafaOzturk (Thu, 09 Feb 2017 21:44:13 GMT):
how do I submit a changeset to gerrit?
MustafaOzturk (Thu, 09 Feb 2017 21:45:23 GMT):
Also, do I need to be invited to gerrit?
rickr (Thu, 09 Feb 2017 21:46:10 GMT):
Use Linux Fondation ID probably the same you use here
MustafaOzturk (Thu, 09 Feb 2017 21:47:00 GMT):
I logged in here using my google id
tuand (Thu, 09 Feb 2017 21:50:45 GMT):
@MustafaOzturk you need a linux foundation id. log off rocket.chat, go back in and click the big blue bar that says lfid
mdozturk (Thu, 09 Feb 2017 21:59:33 GMT):
Has joined the channel.
mdozturk (Thu, 09 Feb 2017 22:06:40 GMT):
per @greg.haskins, it seems like v0.6 will not be patched anymore. The bug seems to be fixed in the master branch of the sdk (DeploymentProposalBuilder.java line 228)
greg.haskins (Thu, 09 Feb 2017 22:06:40 GMT):
Has joined the channel.
greg.haskins (Thu, 09 Feb 2017 22:07:17 GMT):
to be clear, that is by no means authoritative: that is just my understanding
greg.haskins (Thu, 09 Feb 2017 22:07:35 GMT):
(the freeze on v0.6 I mean)
mdozturk (Thu, 09 Feb 2017 22:08:40 GMT):
Too late, it's set in stone ;)
greg.haskins (Thu, 09 Feb 2017 22:09:16 GMT):
I just didnt want the above to be interpreted as my opinion on the matter ;)
lfeagan (Fri, 10 Feb 2017 03:33:27 GMT):
Has joined the channel.
carlosarturoq (Fri, 10 Feb 2017 05:04:22 GMT):
Has joined the channel.
mastersingh24 (Fri, 10 Feb 2017 11:03:09 GMT):
Has joined the channel.
knagware9 (Fri, 10 Feb 2017 11:06:26 GMT):
Has joined the channel.
ylsGit (Fri, 10 Feb 2017 11:16:08 GMT):
Has joined the channel.
zerppen (Fri, 10 Feb 2017 11:16:29 GMT):
Has joined the channel.
mwall (Fri, 10 Feb 2017 12:11:53 GMT):
Hello! Is there any way to setup ChainCodeID manually and do not use hash code as a chaincodeID in fabric-java-sdk v0.6?
tsnyder (Fri, 10 Feb 2017 13:32:54 GMT):
Has joined the channel.
tsnyder (Fri, 10 Feb 2017 13:42:54 GMT):
Question - Since th registration for events goes through the SDK I thought I would ask the question here. Are rejected trasactions included within the Block Event or do we need to register for them separately?
rickr (Fri, 10 Feb 2017 15:22:18 GMT):
You'll get events for all transaction
tsnyder (Fri, 10 Feb 2017 18:03:50 GMT):
Thanks Rick
tuand (Fri, 10 Feb 2017 18:18:23 GMT):
@elast @rickr updated fabric-ca swagger file https://gerrit.hyperledger.org/r/#/c/5851/2
satheeshk (Fri, 10 Feb 2017 18:31:26 GMT):
@jimthematrix @Pardha @malik-altaf I have submitted the patch for the java chaincode changes here, https://gerrit.hyperledger.org/r/#/c/5859/1
macribas (Sat, 11 Feb 2017 16:54:33 GMT):
Has joined the channel.
Basug (Sun, 12 Feb 2017 18:21:46 GMT):
All - is there a way to listen to events in java , while transactions are submitted by node js application
Basug (Sun, 12 Feb 2017 18:29:37 GMT):
trying to create a client, which listens to transactions happening, without itself having to create deploy/invoke/query
Basug (Sun, 12 Feb 2017 19:27:51 GMT):
nm - figured it out
Basug (Sun, 12 Feb 2017 20:24:31 GMT):
`Common.Payload payload = Common.Payload.parseFrom(envelope.getPayload());`
Basug (Sun, 12 Feb 2017 20:24:43 GMT):
any idea how to extract data from this signed content ?
zerppen (Mon, 13 Feb 2017 04:06:36 GMT):
hi, I am a freshman who want to contribute fabric-sdk-java,could you do me a favor about how to start my task
eheads (Mon, 13 Feb 2017 05:54:29 GMT):
Has joined the channel.
zerppen (Mon, 13 Feb 2017 06:03:32 GMT):
@all
grapebaba (Mon, 13 Feb 2017 06:04:17 GMT):
do you have a LF ID yet?
zerppen (Mon, 13 Feb 2017 06:04:28 GMT):
yeah
grapebaba (Mon, 13 Feb 2017 06:05:09 GMT):
https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-java
zerppen (Mon, 13 Feb 2017 06:05:22 GMT):
thanks
grapebaba (Mon, 13 Feb 2017 06:06:29 GMT):
use 'clone with commit msg hook' to clone the code
zerppen (Mon, 13 Feb 2017 06:08:30 GMT):
I have cloned by git
zerppen (Mon, 13 Feb 2017 06:09:02 GMT):
It's different?
grapebaba (Mon, 13 Feb 2017 06:10:48 GMT):
you mean github?
zerppen (Mon, 13 Feb 2017 06:11:26 GMT):
yeah
grapebaba (Mon, 13 Feb 2017 06:12:17 GMT):
that is a read only mirror
grapebaba (Mon, 13 Feb 2017 06:12:47 GMT):
you should could see the description there
zerppen (Mon, 13 Feb 2017 06:13:59 GMT):
I created a fork,so I can pull my code to github I think
grapebaba (Mon, 13 Feb 2017 06:14:22 GMT):
no
zerppen (Mon, 13 Feb 2017 06:14:33 GMT):
I can push my code?
grapebaba (Mon, 13 Feb 2017 06:14:55 GMT):
hyperledger projects use gerrit for development and code review
zerppen (Mon, 13 Feb 2017 06:15:03 GMT):
ok
zerppen (Mon, 13 Feb 2017 06:15:23 GMT):
u speak Chinese?
grapebaba (Mon, 13 Feb 2017 06:15:37 GMT):
yeah
grapebaba (Mon, 13 Feb 2017 06:15:51 GMT):
you can go to #twg-china
grapebaba (Mon, 13 Feb 2017 06:15:55 GMT):
channel
zerppen (Mon, 13 Feb 2017 06:16:09 GMT):
thanks
Basug (Mon, 13 Feb 2017 11:29:23 GMT):
Getting this error while trying to parse Proposal Response ```com.google.protobuf.InvalidProtocolBufferException$InvalidWireTypeException: Protocol message tag had invalid wire type.
at com.google.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:111)
at com.google.protobuf.CodedInputStream$ArrayDecoder.skipField(CodedInputStream.java:590)
at org.hyperledger.fabric.protos.peer.FabricProposalResponse$ProposalResponsePayload.
Basug (Mon, 13 Feb 2017 11:29:38 GMT):
```com.google.protobuf.InvalidProtocolBufferException$InvalidWireTypeException: Protocol message tag had invalid wire type.
at com.google.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:111)
at com.google.protobuf.CodedInputStream$ArrayDecoder.skipField(CodedInputStream.java:590)
at org.hyperledger.fabric.protos.peer.FabricProposalResponse$ProposalResponsePayload.
Basug (Mon, 13 Feb 2017 11:30:25 GMT):
All - getting the error below while trying to parse Proposal Response
Basug (Mon, 13 Feb 2017 11:30:33 GMT):
```com.google.protobuf.InvalidProtocolBufferException$InvalidWireTypeException: Protocol message tag had invalid wire type.
at com.google.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:111)
at com.google.protobuf.CodedInputStream$ArrayDecoder.skipField(CodedInputStream.java:590)
at org.hyperledger.fabric.protos.peer.FabricProposalResponse$ProposalResponsePayload.
Basug (Mon, 13 Feb 2017 11:53:06 GMT):
nm it was issue on my side... it works fine
zwsyjj (Mon, 13 Feb 2017 13:00:30 GMT):
Has joined the channel.
Basug (Mon, 13 Feb 2017 13:34:06 GMT):
If any one wants to write their own BlockListener to listen on events
Basug (Mon, 13 Feb 2017 13:34:14 GMT):
```import org.hyperledger.fabric.protos.common.Common;
import org.hyperledger.fabric.protos.peer.Chaincodeevent;
import org.hyperledger.fabric.protos.peer.FabricProposal;
import org.hyperledger.fabric.protos.peer.FabricProposalResponse;
import org.hyperledger.fabric.protos.peer.FabricTransaction;
import org.hyperledger.fabric.sdk.events.BlockListener;
import org.hyperledger.fabric.sdk.security.CryptoPrimitives;
/**
* Created by basu on 2/12/17.
*/
public class MyBlockListener implements BlockListener {
CryptoPrimitives cryptoPrimitives;
public MyBlockListener(CryptoPrimitives cryptoPrimitives) {
this.cryptoPrimitives = cryptoPrimitives;
}
@Override
public void received(Common.Block block) {
try {
Common.BlockData data = block.getData();
Common.Envelope env = Common.Envelope.parseFrom(data.getDataList().get(0));
Common.Payload payload = Common.Payload.parseFrom(env.getPayload());
FabricTransaction.Transaction transaction = FabricTransaction.Transaction.parseFrom(payload.getData());
FabricTransaction.ChaincodeActionPayload chaincodeActionPayload = FabricTransaction.ChaincodeActionPayload.parseFrom(transaction.getActionsList().get(0).getPayload());
FabricProposalResponse.ProposalResponsePayload proposalResponsePayload = FabricProposalResponse.ProposalResponsePayload.parseFrom(chaincodeActionPayload.getAction().getProposalResponsePayload());
FabricProposal.ChaincodeAction chaincodeAction = FabricProposal.ChaincodeAction.parseFrom(proposalResponsePayload.getExtension());
Chaincodeevent.ChaincodeEvent chaincodeEvent = Chaincodeevent.ChaincodeEvent.parseFrom(chaincodeAction.getEvents());
System.out.println("ChainCodeID : "+chaincodeEvent.getChaincodeID());
System.out.println("EventName : "+chaincodeEvent.getEventName());
System.out.println("TransactionId : "+chaincodeEvent.getTxID());
System.out.println("Payload : "+chaincodeEvent.getPayload().toStringUtf8());
} catch (Exception ex) {
ex.printStackTrace();
}
}
}```
dayubian (Tue, 14 Feb 2017 02:21:44 GMT):
Has joined the channel.
coolsvap (Tue, 14 Feb 2017 13:02:34 GMT):
Has joined the channel.
eddie.allen (Tue, 14 Feb 2017 18:35:26 GMT):
Has joined the channel.
isramos (Tue, 14 Feb 2017 20:30:37 GMT):
I deployed using node.js "chaincodeID" = "mycc", how to use the running "mycc" in java sdk? *queryProposalRequest.setChaincodeID(chainCodeID)* does not support chaincodeID in string format
rickr (Tue, 14 Feb 2017 20:36:43 GMT):
We'll need to add that . Can you open a JIRA bug for this ? Or would you prefer I do ?
isramos (Tue, 14 Feb 2017 20:39:52 GMT):
thanks @rickr - please open the JIRA bug. I'm not too familiar with that yet.
rickr (Tue, 14 Feb 2017 20:40:08 GMT):
Ok will do
suryalanka (Tue, 14 Feb 2017 21:12:49 GMT):
Has joined the channel.
satheeshk (Wed, 15 Feb 2017 05:11:44 GMT):
@malik-altaf Hi Altaf, I have updated the change set addressing your comments. Thanks
donaldsbell (Wed, 15 Feb 2017 14:43:42 GMT):
Has joined the channel.
zerppen (Wed, 15 Feb 2017 14:55:38 GMT):
May I ask a question?java-chaincode how to use method setEvent of chaincodeEvent like go-chaincode SetEvent v0.6
pschnap (Wed, 15 Feb 2017 15:45:52 GMT):
are there any examples yet for using the Java SDK?
tuand (Wed, 15 Feb 2017 15:57:11 GMT):
@pschnap , take a look at the end2endIT test case
pschnap (Wed, 15 Feb 2017 15:57:31 GMT):
thanks @tuand !
pschnap (Wed, 15 Feb 2017 16:18:46 GMT):
hm, there doesn't appear to be any license on that file
tuand (Wed, 15 Feb 2017 16:27:09 GMT):
you're right , prolog is missing in some of the JUnit tests ... would you mind opening a JIRA issue ?
pschnap (Wed, 15 Feb 2017 16:31:38 GMT):
what project should I put it under, Fabric?
pschnap (Wed, 15 Feb 2017 16:32:41 GMT):
(I'm very new to the project)
tuand (Wed, 15 Feb 2017 16:35:54 GMT):
component `fabri-sdk-java`
tuand (Wed, 15 Feb 2017 16:35:54 GMT):
component `fabric-sdk-java`
pschnap (Wed, 15 Feb 2017 16:41:47 GMT):
What should I file it as, Bug?
pschnap (Wed, 15 Feb 2017 16:41:51 GMT):
Task?
pschnap (Wed, 15 Feb 2017 16:48:21 GMT):
Created as task
pschnap (Wed, 15 Feb 2017 16:48:22 GMT):
https://jira.hyperledger.org/browse/FAB-2252
pschnap (Wed, 15 Feb 2017 16:49:14 GMT):
@tuand ^
rameshthoomu (Wed, 15 Feb 2017 18:29:35 GMT):
Has joined the channel.
liutc (Thu, 16 Feb 2017 07:12:36 GMT):
@tuand the Java SDK example you mentioned, is it for v0.6 or v1.0?
Eagel (Thu, 16 Feb 2017 08:33:37 GMT):
Has joined the channel.
Eagel (Thu, 16 Feb 2017 08:45:14 GMT):
I saw there are two branch "WIP_fabric_v1" and "fabric_v1". Which one is for "v1.0.0-preview"?
Eagel (Thu, 16 Feb 2017 08:48:09 GMT):
The fabric "v1.0.0-preview"
wutongtree (Thu, 16 Feb 2017 09:58:29 GMT):
Has joined the channel.
tuand (Thu, 16 Feb 2017 12:06:16 GMT):
The `master` branch is for v1.0 work. There is no preview or alpha branch.
ercw (Thu, 16 Feb 2017 12:09:49 GMT):
Has joined the channel.
Eagel (Thu, 16 Feb 2017 12:15:51 GMT):
Thanks
rickr (Thu, 16 Feb 2017 12:51:42 GMT):
Hi @malik-altaf @Pardha @satheeshk I plan by tomorrow to delete the WIP_fabric_v and fabric_v1 unless I hear from you any good reason to keep them.
rrader (Thu, 16 Feb 2017 15:10:06 GMT):
Has joined the channel.
pschnap (Thu, 16 Feb 2017 19:17:49 GMT):
fyi: just posted https://jira.hyperledger.org/browse/FAB-2273
bobbiejc (Thu, 16 Feb 2017 20:57:00 GMT):
Has joined the channel.
mcoblenz (Thu, 16 Feb 2017 21:00:30 GMT):
Has joined the channel.
mcoblenz (Thu, 16 Feb 2017 21:03:48 GMT):
Has left the channel.
RajkumarNatarajan (Fri, 17 Feb 2017 03:56:42 GMT):
Has joined the channel.
RajkumarNatarajan (Fri, 17 Feb 2017 04:07:59 GMT):
Hi guys
RajkumarNatarajan (Fri, 17 Feb 2017 04:08:04 GMT):
I am rajkumar
RajkumarNatarajan (Fri, 17 Feb 2017 04:08:36 GMT):
I want to work with this team and contribute to fabric-sdk-java
RajkumarNatarajan (Fri, 17 Feb 2017 04:09:46 GMT):
Can anyone hep me with Jira access and github access
rameshthoomu (Fri, 17 Feb 2017 04:12:35 GMT):
@RajkumarNatarajan I would suggest you to go through this doc and create a LFID to get access to Gerrit and JIRA http://hyperledger-fabric.readthedocs.io/en/latest/Gerrit/lf-account/
RajkumarNatarajan (Fri, 17 Feb 2017 04:12:59 GMT):
@rameshthoomu
RajkumarNatarajan (Fri, 17 Feb 2017 04:13:07 GMT):
Thanks
RajkumarNatarajan (Fri, 17 Feb 2017 04:13:23 GMT):
I will go through it nad get back if I need any help
rameshthoomu (Fri, 17 Feb 2017 04:14:11 GMT):
sure
mwall (Fri, 17 Feb 2017 16:52:25 GMT):
Hello! How can I handle this `panic: Own checkpoint for seqNo 30 (CAsSQIpPFvKebFWy+m2TAdP7aTd81EC3AJo6sSU5TgG4xq3+bH74yJxkYDZzHQmQEpyl9hTrtl6Uqa004oFNTZtFG0AaQMcwvg2v92PjvmzVXH3KoPBNvGnPJAeBbivC6EKWSWQIVfTcJUAf1v+AkBxX77MQetWpLWTvx7riohEPPuhOOHk=) different from weak checkpoint certificate (CAsSQAlFXxAlQbHSQicJBptYJQTa2pgfTRuP5cPMbPY8hmNAlIMDj9kRgouWRddx7AAryuf92OD4QoC/gAxnlsxnx+MaQOYL4z+XcjXGbTCxcmAcd2XPFOK1sQHDTm1FJinLjmIeWEt+xlTspwUXhUGrG5AhzmXBsW39rDBqmouHoYfg84o=)`
rickr (Fri, 17 Feb 2017 16:56:33 GMT):
@mwall V.6 ?
tuand (Fri, 17 Feb 2017 16:59:19 GMT):
@mwall `weak checkpoint cert` points to v0.6 consensus ... I see you're already on #fabric-consensus
mwall (Fri, 17 Feb 2017 16:59:39 GMT):
yep, v.6
mwall (Fri, 17 Feb 2017 17:00:10 GMT):
okey, will try to find solution in fabric-consensus
harrijk (Fri, 17 Feb 2017 19:34:20 GMT):
Has joined the channel.
andyz (Sat, 18 Feb 2017 11:28:39 GMT):
Has joined the channel.
RajkumarNatarajan (Sun, 19 Feb 2017 01:44:02 GMT):
Hi Team
RajkumarNatarajan (Sun, 19 Feb 2017 01:44:31 GMT):
I am going through http://hyperledger-fabric.readthedocs.io/en/latest/Gerrit/lf-account/ to set up account
RajkumarNatarajan (Sun, 19 Feb 2017 01:44:55 GMT):
Message Attachments
RajkumarNatarajan (Sun, 19 Feb 2017 01:45:05 GMT):
I am getting error the above error
RajkumarNatarajan (Sun, 19 Feb 2017 01:45:57 GMT):
I am able to login https://gerrit.hyperledger.org/ with the userid/password
RajkumarNatarajan (Sun, 19 Feb 2017 01:46:07 GMT):
but checkout code is giving error
RajkumarNatarajan (Sun, 19 Feb 2017 01:48:21 GMT):
Also I have added ssh public key to my gerrit profile
rameshthoomu (Sun, 19 Feb 2017 02:04:42 GMT):
@RajkumarNatarajan : clone project with `clone with commit msg-hook` and choose `ssh` option
rameshthoomu (Sun, 19 Feb 2017 02:05:45 GMT):
Message Attachments
RajkumarNatarajan (Sun, 19 Feb 2017 02:09:48 GMT):
kool
RajkumarNatarajan (Sun, 19 Feb 2017 02:09:58 GMT):
Thanks @rameshthoomu
RajkumarNatarajan (Sun, 19 Feb 2017 02:10:11 GMT):
it worked :thumbsup:
jimthematrix (Mon, 20 Feb 2017 02:52:35 GMT):
@satheeshk @rickr @greg.haskins can I ask the current state of things with the java chaincode? if I want to deploy java chaincode, is there any remaining work in the peer and docker build to support this? how does the SDK package up the chaincode source files?
ascatox (Mon, 20 Feb 2017 10:17:51 GMT):
Has joined the channel.
yury (Mon, 20 Feb 2017 12:38:15 GMT):
hi, why I can not call 'qscc' from java sdk?
I get following error: "chainID qscc provided for a chainless syscc"
kleman (Mon, 20 Feb 2017 13:40:08 GMT):
Has joined the channel.
rickr (Mon, 20 Feb 2017 13:47:53 GMT):
FYI Gerrit patches Verify are now being tested with full End2endIT test being done. Big thanks to @rameshthoomu ! There are some kinks where we are seeing false postives so its probably *always* good pratice for the final merge to check the console log for a `Query payload of b returned 300`
The Fabric and Fabric_ca commit levels that are tested against are in src/test/fabric_test_commitlevel.sh. This should match what we document in the README.md
rrader (Mon, 20 Feb 2017 14:34:52 GMT):
https://github.com/hyperledger/fabric-sdk-java#using-the-sdk
`Chain testChain = new Chain("chain1");`
It says "Chain is not public", can you fix that on github please, and change how it must be
rickr (Mon, 20 Feb 2017 17:52:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=y5N8FigtXRY4c8TsF) @jimthematrix @sanchezl is going to look at trying this out on the latest Gerrit patch that submitted. @Satheesh Kathamuthu can you work on this too ?
rickr (Mon, 20 Feb 2017 17:52:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=y5N8FigtXRY4c8TsF) @jimthematrix @sanchezl is going to look at trying this out on the latest Gerrit patch https://gerrit.hyperledger.org/r/#/c/6073/ that submitted. @Satheesh Kathamuthu can you work on this too ?
rickr (Mon, 20 Feb 2017 17:52:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=y5N8FigtXRY4c8TsF) @jimthematrix @sanchezl is going to look at trying this out on the latest Gerrit patch https://gerrit.hyperledger.org/r/#/c/6073/ that submitted. @Satheesh Kathamuthu can you work on this too ?
rickr (Mon, 20 Feb 2017 17:52:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=y5N8FigtXRY4c8TsF) @jimthematrix @sanchezl is going to look at trying this out on the latest Gerrit patch https://gerrit.hyperledger.org/r/#/c/6073/ that submitted. @satheeshk can you work on this too ?
sanchezl (Mon, 20 Feb 2017 17:52:00 GMT):
Has joined the channel.
jimthematrix (Mon, 20 Feb 2017 17:55:14 GMT):
thanks Rick
jimthematrix (Mon, 20 Feb 2017 17:56:02 GMT):
we need to get this sorted out in the next couple of days, thanks @sanchezl for help
jimthematrix (Mon, 20 Feb 2017 18:07:54 GMT):
please give @Ratnakar a heads up
Ratnakar (Mon, 20 Feb 2017 18:07:54 GMT):
Has joined the channel.
jimthematrix (Mon, 20 Feb 2017 18:08:12 GMT):
so his sample app can be modified accordingly
Ying (Tue, 21 Feb 2017 02:05:43 GMT):
Has joined the channel.
Ying (Tue, 21 Feb 2017 02:43:50 GMT):
hi, I'm trying java sdk and run into maven dependencies conflict. Any suggestions? Thanks.
Failed to execute goal on project fabric-sdk-java: Could not resolve dependencies for project org.hyperledger.fabric-sdk-java:fabric-sdk-java:jar:1.0-SNAPSHOT: Failed to collect dependencies at io.grpc:grpc-netty:jar:1.0.3 -> io.grpc:grpc-core:jar:[1.0.3]
zerppen (Tue, 21 Feb 2017 06:24:38 GMT):
zerppen (Tue, 21 Feb 2017 06:24:57 GMT):
zerppen (Tue, 21 Feb 2017 06:25:16 GMT):
@Ying try using this
rrader (Tue, 21 Feb 2017 08:07:27 GMT):
Why `Chain` https://github.com/hyperledger/fabric-sdk-java/blob/master/src/main/java/org/hyperledger/fabric/sdk/Chain.java don't have public constructor? How to create a `Chain` object?
kleman (Tue, 21 Feb 2017 09:14:39 GMT):
in V1, you can try this :
kleman (Tue, 21 Feb 2017 09:14:43 GMT):
```HFClient hfclient = null;
Chain testChain = null;
hfclient = HFClient.createNewInstance();
testChain = hfclient.newChain(CHAIN_NAME);
```
kleman (Tue, 21 Feb 2017 09:19:54 GMT):
Hi, i'm trying to deploy java chaincode to IBM bluemix running fabric v0,6 but the fabric sdk java seems not support grpcS used by the Membership Services, any workaround ?
kleman (Tue, 21 Feb 2017 09:19:54 GMT):
Hi, i'm trying to deploy java chaincode to IBM bluemix running fabric v0,6 but the fabric sdk java seems not supported grpcS used by the Membership Services, any workaround ?
rrader (Tue, 21 Feb 2017 09:21:32 GMT):
I am also trying `testChain.setMemberServicesUrl("grpc://localhost:7054", null);` and get *java.net.MalformedURLException: unknown protocol: grpc*
kleman (Tue, 21 Feb 2017 09:21:54 GMT):
in V1 or v0,6 ?
rrader (Tue, 21 Feb 2017 09:22:26 GMT):
V1
kleman (Tue, 21 Feb 2017 09:26:03 GMT):
i do not have this issue using this dependency instead of those listed upper
kleman (Tue, 21 Feb 2017 09:26:06 GMT):
```
rrader (Tue, 21 Feb 2017 09:31:06 GMT):
I am using gradle, and I have `compile group: 'io.grpc', name: 'grpc-all', version: '1.1.2'` in dependencies
kleman (Tue, 21 Feb 2017 09:32:47 GMT):
ok, if you're also using "shim-client" as dependency maybe there is a dependency conflict
kleman (Tue, 21 Feb 2017 09:32:58 GMT):
it was my problem
rrader (Tue, 21 Feb 2017 09:33:44 GMT):
no, I only have 2 dependencies
```
compile group: 'io.grpc', name: 'grpc-all', version: '1.1.2'
compile group: 'org.hyperledger.fabric-sdk-java', name: 'fabric-sdk-java', version: '1.0-SNAPSHOT'
```
kleman (Tue, 21 Feb 2017 09:34:54 GMT):
ok
kleman (Tue, 21 Feb 2017 09:35:22 GMT):
maybe try to add the memberserviceurl like this :
kleman (Tue, 21 Feb 2017 09:35:26 GMT):
``` MemberServices memberServices = new MemberServicesFabricCAImpl("https://d279de66429f4c0e8ab63572b0f2cf94-ca.us.blockchain.ibm.com:30001", null);
testChain.setMemberServices(memberServices);```
kleman (Tue, 21 Feb 2017 09:36:48 GMT):
my bad, grpcs seems to work with v1.0
kleman (Tue, 21 Feb 2017 09:38:36 GMT):
but the sdk v1 is still unachieved, i have th following issue when i try to enroll : `at org.hyperledger.fabric.sdk.MemberServicesFabricCAImpl.enroll(MemberServicesFabricCAImpl.java:289) => org.hyperledger.fabric.sdk.exception.RegistrationException: TODO`
kleman (Tue, 21 Feb 2017 09:38:36 GMT):
but the sdk v1 is still unachieved, i have th following issue when i try to enroll : `org.hyperledger.fabric.sdk.MemberServicesFabricCAImpl.enroll(MemberServicesFabricCAImpl.java:289) => org.hyperledger.fabric.sdk.exception.RegistrationException: TODO`
kleman (Tue, 21 Feb 2017 09:41:38 GMT):
my bad with grpcs => java.net.MalformedURLException: unknown protocol: grpcs
rrader (Tue, 21 Feb 2017 09:42:14 GMT):
yeap, I got this exception too
kleman (Tue, 21 Feb 2017 09:43:13 GMT):
same issue with grpc
Ying (Tue, 21 Feb 2017 09:43:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=M6nqTP2MJYqAf6fBf) @zerppen Tried, with maven cache cleared, but still stuck.
kleman (Tue, 21 Feb 2017 09:44:58 GMT):
@Ying have you try this one : ```
kleman (Tue, 21 Feb 2017 09:44:58 GMT):
@Ying have you try this one :
```
Ying (Tue, 21 Feb 2017 09:48:34 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=r7Nwums6NbzsYCFzN) @kleman Yes, but not work. Thanks kleman
kleman (Tue, 21 Feb 2017 09:50:48 GMT):
@Ying have you rebuild the sdk using theses dependencies ?
Ying (Tue, 21 Feb 2017 09:52:29 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=X2E2TnPcgvvh66X9t) @kleman I did: modify pom file, then delete maven cache, then update project
kleman (Tue, 21 Feb 2017 09:55:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ipL3jL6k7xHNH79yg) it was looking for version [1.0.3] but he code submited by zerppen is 0.15.0
kleman (Tue, 21 Feb 2017 09:55:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ipL3jL6k7xHNH79yg) it was looking for version [1.0.3] but the code submited by zerppen is 0.15.0
kleman (Tue, 21 Feb 2017 09:55:37 GMT):
maybe try ths ```
kleman (Tue, 21 Feb 2017 09:55:37 GMT):
maybe try ths ```
kleman (Tue, 21 Feb 2017 09:55:37 GMT):
maybe try ths `
kleman (Tue, 21 Feb 2017 09:55:53 GMT):
```
kleman (Tue, 21 Feb 2017 09:55:53 GMT):
```
Ying (Tue, 21 Feb 2017 09:57:55 GMT):
Doesn't change?
kleman (Tue, 21 Feb 2017 09:59:54 GMT):
grpc version is not the same
kleman (Tue, 21 Feb 2017 10:00:39 GMT):
an other solution is maybe to build using gradle instead of maven
Ying (Tue, 21 Feb 2017 10:06:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ZjMtW3pEm3cEbWm2L) @kleman got it, thanks
kleman (Tue, 21 Feb 2017 10:07:23 GMT):
you're welcome
rrader (Tue, 21 Feb 2017 12:36:04 GMT):
Where I can open an issue?
rrader (Tue, 21 Feb 2017 12:36:04 GMT):
Where can I open an issue?
rickr (Tue, 21 Feb 2017 12:37:23 GMT):
https://jira.hyperledger.org
psa (Wed, 22 Feb 2017 15:56:55 GMT):
Has joined the channel.
sloveland (Wed, 22 Feb 2017 16:21:26 GMT):
Has joined the channel.
Ying (Thu, 23 Feb 2017 07:38:09 GMT):
Has left the channel.
Jonas.Hedin (Thu, 23 Feb 2017 09:56:02 GMT):
Has left the channel.
uber.twin (Thu, 23 Feb 2017 14:35:27 GMT):
Has joined the channel.
uber.twin (Thu, 23 Feb 2017 14:43:21 GMT):
hi, is there a tutorial showing how to deploy and invoke chaincode using the java sdk, similarly to what is presented here, using nodejs: https://hyperledger-fabric.readthedocs.io/en/latest/asset_sdk/
rickr (Thu, 23 Feb 2017 14:44:46 GMT):
which version ?
rrader (Thu, 23 Feb 2017 14:49:51 GMT):
v1
uber.twin (Thu, 23 Feb 2017 15:05:23 GMT):
it seems my java sdk has (at least) an unresolved import statement i.e. : import org.hyperledger.fabric.protos...
uber.twin (Thu, 23 Feb 2017 15:06:16 GMT):
might anybody have an idea about which dependency I'm missing?
rickr (Thu, 23 Feb 2017 15:08:03 GMT):
have you followed the README.md ?
uber.twin (Thu, 23 Feb 2017 15:17:27 GMT):
doesn't seem relevant given the context
uber.twin (Thu, 23 Feb 2017 15:20:06 GMT):
it ain't addressing my question:)
rickr (Thu, 23 Feb 2017 15:20:27 GMT):
missing imports ?
uber.twin (Thu, 23 Feb 2017 15:20:44 GMT):
yes
rickr (Thu, 23 Feb 2017 15:21:05 GMT):
what happens when you run
mvn install ?
uber.twin (Thu, 23 Feb 2017 15:22:15 GMT):
it downloaded lots of jar in my local repository but seems like none of them contains such package(org.hyperledger.fabric.protos)
rickr (Thu, 23 Feb 2017 15:23:40 GMT):
Do you have now target/generated-sources/protobuf/java/org/hyperledger/fabric/protos ?
uber.twin (Thu, 23 Feb 2017 15:23:52 GMT):
oh actually there might by one, sorry
uber.twin (Thu, 23 Feb 2017 15:24:03 GMT):
than the classpath is no good
uber.twin (Thu, 23 Feb 2017 15:24:37 GMT):
alright, thanks
uber.twin (Thu, 23 Feb 2017 15:37:00 GMT):
I just expected that the project's standard maven dependencies to implicitly include this package
uber.twin (Thu, 23 Feb 2017 15:39:29 GMT):
my /target/generated-sources/protobuf is still empty
but I got them in
.m2/repository/org/hyperledger/fabric-sdk-java/fabric-sdk-java/1.0-SNAPSHOT
uber.twin (Thu, 23 Feb 2017 15:46:57 GMT):
and that was because I ran "mvn" instead of "mvn install":)
rickr (Thu, 23 Feb 2017 18:28:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=W2Cz4wHy5ap4L6Zqh) @uber.twin what is in the README.md under comiling ?
rickr (Thu, 23 Feb 2017 18:28:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=W2Cz4wHy5ap4L6Zqh) @uber.twin what is in the README.md under compiling ?
ianj_mitchell@uk.ibm.com (Thu, 23 Feb 2017 20:55:38 GMT):
Has joined the channel.
rnair@itbit.com (Thu, 23 Feb 2017 21:50:25 GMT):
Has joined the channel.
CarlXK (Fri, 24 Feb 2017 02:04:41 GMT):
Has joined the channel.
pd93 (Fri, 24 Feb 2017 10:16:26 GMT):
Has left the channel.
nickmelis (Fri, 24 Feb 2017 11:50:45 GMT):
using v0.6, it looks like if I try to enroll a user with the wrong secret, I'm then not able to re-enroll it with the right one anymore. Is that the case?
nickmelis (Fri, 24 Feb 2017 12:05:08 GMT):
sorry let me rephrase, if I enroll a user with the right key, I can't re-enroll it without getting an error. So how long does the enrollment last for?
nickmelis (Fri, 24 Feb 2017 12:08:09 GMT):
that means if for any reason the enrollment in the test.properties is misplaced, I will never be able to enroll again until I reset the ledger
nickmelis (Fri, 24 Feb 2017 12:17:39 GMT):
and it looks like there's no way to "un-enroll" too
rickr (Fri, 24 Feb 2017 13:15:18 GMT):
q
uber.twin (Fri, 24 Feb 2017 13:43:43 GMT):
@rickr hi, any advice on this error?
uber.twin (Fri, 24 Feb 2017 13:43:44 GMT):
Running org.hyperledger.fabric.sdk.End2endIT
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.
Feb 24, 2017 3:39:36 PM io.grpc.internal.ManagedChannelImpl
rickr (Fri, 24 Feb 2017 13:45:11 GMT):
are you using the fabric level in the README.md ?
uber.twin (Fri, 24 Feb 2017 13:49:08 GMT):
probably not, I was trying to reuse same platform installed by the docker compose from here curl -L https://raw.githubusercontent.com/hyperledger/fabric/master/examples/sfhackfest/sfhackfest.tar.gz -o sfhackfest.tar.gz 2> /dev/null; tar -xvf sfhackfest.tar.gz
uber.twin (Fri, 24 Feb 2017 13:52:13 GMT):
so it's a compatibility issue than?
rickr (Fri, 24 Feb 2017 13:53:14 GMT):
Only version we've tested what's in master is what's documneted in the README.md
uber.twin (Fri, 24 Feb 2017 13:56:30 GMT):
ok, thanks, I'll try to build a dedicated platform for java-sdk, I thought I could reuse what I already had tested with the node sdk
uber.twin (Fri, 24 Feb 2017 15:36:10 GMT):
the routine for build a fabric environment doesn't seem very straight forward
uber.twin (Fri, 24 Feb 2017 15:36:22 GMT):
isn't there a docker-compose spec which gets whats needed just as the docker-compose-gettingstarted.yml in the sfhackfest setup does for node sdk?
rickr (Fri, 24 Feb 2017 15:51:33 GMT):
No not at the moment.
RajkumarNatarajan (Sun, 26 Feb 2017 20:29:35 GMT):
hi team
RajkumarNatarajan (Sun, 26 Feb 2017 20:29:44 GMT):
I am using eclipse IDE
RajkumarNatarajan (Sun, 26 Feb 2017 20:29:54 GMT):
and I am getting compilation errors
RajkumarNatarajan (Sun, 26 Feb 2017 20:30:23 GMT):
Message Attachments
RajkumarNatarajan (Sun, 26 Feb 2017 20:30:51 GMT):
but when I compile using `mvn clean compile test`
RajkumarNatarajan (Sun, 26 Feb 2017 20:31:04 GMT):
the compilation and unit tests are running fine
RajkumarNatarajan (Sun, 26 Feb 2017 20:31:18 GMT):
Any idea/suggesstion
RajkumarNatarajan (Sun, 26 Feb 2017 20:31:18 GMT):
Any idea/suggesstion?
RajkumarNatarajan (Sun, 26 Feb 2017 20:31:18 GMT):
?
tuand (Mon, 27 Feb 2017 02:35:50 GMT):
@RajkumarNatarajan it looks like you're missing the step that generates the java protobuf files ... You should import as a maven project and run `mvn install` ... the README.md describes what you need to get going
RajkumarNatarajan (Mon, 27 Feb 2017 02:36:21 GMT):
thanks @tuand
RajkumarNatarajan (Mon, 27 Feb 2017 02:36:29 GMT):
let me try this
RajkumarNatarajan (Mon, 27 Feb 2017 02:52:21 GMT):
@tuand It solved the eclipse problem
RajkumarNatarajan (Mon, 27 Feb 2017 02:52:25 GMT):
thanks alot
RajkumarNatarajan (Mon, 27 Feb 2017 02:52:25 GMT):
thanks a lot
RajkumarNatarajan (Mon, 27 Feb 2017 02:53:33 GMT):
one more question
RajkumarNatarajan (Mon, 27 Feb 2017 02:53:39 GMT):
I am setting up my local
RajkumarNatarajan (Mon, 27 Feb 2017 02:53:52 GMT):
as mentioned in link https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/devenv.md
RajkumarNatarajan (Mon, 27 Feb 2017 02:54:28 GMT):
the below command is failing
RajkumarNatarajan (Mon, 27 Feb 2017 02:55:22 GMT):
Message Attachments
RajkumarNatarajan (Mon, 27 Feb 2017 02:55:47 GMT):
pip install -I flask==0.10.1 python-dateutil==2.2 pytz==2014.3 pyyaml==3.10 couchdb==1.0 flask-cors==2.0.1 requests==2.4.3 pyOpenSSL==16.2.0 sha3==0.2.1
RajkumarNatarajan (Mon, 27 Feb 2017 02:56:12 GMT):
the above command is failing with error in screenshot
RajkumarNatarajan (Mon, 27 Feb 2017 02:56:27 GMT):
I am using Fedora 25 OS
rickr (Mon, 27 Feb 2017 02:58:07 GMT):
What were you doing there ?
rickr (Mon, 27 Feb 2017 02:59:23 GMT):
If that's building the fabric it self you should ask on the fabric-dev-env channel
RajkumarNatarajan (Mon, 27 Feb 2017 03:08:47 GMT):
@rickr I am sorry
RajkumarNatarajan (Mon, 27 Feb 2017 03:08:54 GMT):
I resolved the issue
RajkumarNatarajan (Mon, 27 Feb 2017 03:09:10 GMT):
I should have googled a bit before posted that question
RajkumarNatarajan (Mon, 27 Feb 2017 03:09:27 GMT):
I was missing some redhat depnedencies
hyp0th3rmi4 (Mon, 27 Feb 2017 07:49:54 GMT):
Has joined the channel.
zerppen (Mon, 27 Feb 2017 08:12:43 GMT):
Excuse,me.I created two fabric v0.6 environments.Firstly,I excuted "make peer" and "SimpleSample chaincode" refering to JAVAChaincode.md successfully for two.i changed one of them(I added some methods like setEvent,getRows) Java-shim(fabric/core/chaincode/shim/java for my Chaincode,another is original.All "make peer" successfully.But when I tested the SimpleSample ,the first one show that " [chaincode] Launch -> ERRO 01a launchAndWaitForRegister failed Timeout expired while starting chaincode " .I noticed that the first one lost a step of "[genesis] funcl -> INFO 00f Creating genesis bock"when I excuted "peer node start" after raising startuptimeout and deploytimeout for serveral times.So,it is a bug?
Rymd (Mon, 27 Feb 2017 08:22:03 GMT):
I'm getting an error when running End2endIT.java test.
```Creating install proposal
2017-02-27 09:17:20 ERROR Chain:791 - Sending proposal to peer failed because of gRPC failure=Status{code=UNKNOWN, description=invalid function to lccc install, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: invalid function to lccc install
at org.hyperledger.fabric.sdk.Chain.sendProposalToPeers(Chain.java:791)
at org.hyperledger.fabric.sdk.Chain.sendInstallProposal(Chain.java:662)
at org.hyperledger.fabric.sdk.End2endIT.setup(End2endIT.java:111)```
What is wrong?
rickr (Tue, 28 Feb 2017 13:15:59 GMT):
*FYI* Commited change that upped V1.0's fabric version.
Jonas.Hedin (Tue, 28 Feb 2017 14:30:54 GMT):
Has joined the channel.
rickr (Wed, 01 Mar 2017 01:57:39 GMT):
Had @rjones add a gerrit group `cr-fabric-sdk-java` if you put that into the reviewers it will add all the maintainer in one shot.
rjones (Wed, 01 Mar 2017 01:57:39 GMT):
Has joined the channel.
rickr (Wed, 01 Mar 2017 01:59:09 GMT):
Message Attachments
rickr (Wed, 01 Mar 2017 01:59:53 GMT):
Message Attachments
Sky (Wed, 01 Mar 2017 06:45:02 GMT):
Has joined the channel.
Rymd (Wed, 01 Mar 2017 09:40:49 GMT):
why doesn't install work with lccc. Im using the same commit levels in `src/test/fabric_test_commitlevel.sh`?
suganuma (Wed, 01 Mar 2017 14:17:59 GMT):
Has joined the channel.
rickr (Wed, 01 Mar 2017 15:21:29 GMT):
FYI Change was introduced that affects api. Best to sync that change
rickr (Wed, 01 Mar 2017 15:21:29 GMT):
FYI Change was introduced that affects api. Best to sync to that change
Donald Liu (Thu, 02 Mar 2017 01:27:57 GMT):
Has joined the channel.
zhaochy (Thu, 02 Mar 2017 05:26:06 GMT):
Has joined the channel.
zhaochy (Thu, 02 Mar 2017 05:29:40 GMT):
hi team, I'm trying the fabric-sdk-java with fabric v1.0 preview, I tried the branch master and fabric_v1, but both get error. It seems the org.hyperledger.fabric.sdk.Chain doesn't have a public constructor.
bh4rtp (Thu, 02 Mar 2017 06:22:59 GMT):
Has joined the channel.
lohitkrishnan (Thu, 02 Mar 2017 09:33:23 GMT):
Has joined the channel.
aghaneka (Thu, 02 Mar 2017 14:20:09 GMT):
Has joined the channel.
aghaneka (Thu, 02 Mar 2017 14:23:21 GMT):
Why org.hyperledger.fabric.sdk.PeerClientTest is not compiling? I wanted to try deploy and query of chaincode.
rickr (Thu, 02 Mar 2017 14:35:54 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=iX9LEFe3SbanNZB65) README.md *Using the SDK* will help
rickr (Thu, 02 Mar 2017 14:35:54 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=iX9LEFe3SbanNZB65) README.md *Using the SDK* will help see example code
rickr (Thu, 02 Mar 2017 14:40:19 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=a9R8evehJpnEqgXDE) Did you do the steps in README.md *Compiling* section ? I assume yes, can paste us some output of that to help us out ?
rickr (Thu, 02 Mar 2017 14:41:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=a9R8evehJpnEqgXDE) Did you follow the steps in READM.md *Compiling* I'll assume yes. Could you paste some how that failed here so we might help?
rickr (Thu, 02 Mar 2017 14:41:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=a9R8evehJpnEqgXDE) Did you follow the steps in READM.md *Compiling* I'll assume yes. Could you paste how that failed here so we might help?
rickr (Thu, 02 Mar 2017 14:41:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=a9R8evehJpnEqgXDE) Did you follow the steps in READM.md *Compiling* I'll assume yes. Could you paste it here so we might help?
aghaneka (Thu, 02 Mar 2017 15:32:53 GMT):
@rickr Thanks for your help. I will get back to you.
rickr (Thu, 02 Mar 2017 15:38:40 GMT):
*FYI* Latest code updates includes creating an new Channel (aka Chain) . Joining Peers to the Channel. Currently chain creation is limited to only creating chains to a single organization . End2endIT.java has been updated to demo this.
zerppen (Thu, 02 Mar 2017 16:25:32 GMT):
Hi,guys. On line 248 of User.java of master branch,the memberServices should be MemberServicesFabricCAImpl?
rickr (Thu, 02 Mar 2017 16:32:56 GMT):
Old code from v.6 Please look at End2EndIT.java how to enroll .. it may change in up coming days too.
zerppen (Thu, 02 Mar 2017 16:34:54 GMT):
ok...
zerppen (Thu, 02 Mar 2017 16:35:14 GMT):
thanks
rickr (Thu, 02 Mar 2017 16:36:43 GMT):
Also at the moment we don't support register so only the Admin who is already registered can actually enroll ... great security feature :)
We hope to have register implemented in the coming days so the admin can register other users .. who can then enroll
zerppen (Thu, 02 Mar 2017 16:37:51 GMT):
Enrollment enrollment = null; //need access in test env.
zerppen (Thu, 02 Mar 2017 16:37:59 GMT):
I noticed
zerppen (Thu, 02 Mar 2017 16:40:09 GMT):
so we should enroll each time
rickr (Thu, 02 Mar 2017 16:47:09 GMT):
users enrolled state is kept in a key store .. If you look at End2endIt.java we wipe that out so it does an enroll each time
zerppen (Thu, 02 Mar 2017 16:53:52 GMT):
File fileStore = new File(System.getProperty("user.home") + "/test.properties");
if (fileStore.exists()) {
fileStore.delete();
}
zerppen (Thu, 02 Mar 2017 16:54:40 GMT):
but the key store file will be deleted
rickr (Thu, 02 Mar 2017 16:55:10 GMT):
For that test
zerppen (Thu, 02 Mar 2017 16:55:24 GMT):
yeah
rickr (Fri, 03 Mar 2017 01:04:28 GMT):
@malik-altaf @Pardha @satheeshk I'm starting to look at registration. I'm considering on moving all the enrollment and registration out of the sdk.. This should be done between the application and the member services implementation outside of the sdk. The sdk will still cache user context in the file store. If a user context is missing an enrollment which is really all we need it can look in the store to retrieve it. If not there or not provided the sdk will throw exception. This is close what the Node sdk is doing. . Not seeing why the sdk needs to be a _shim_ between application and member services implementation. The sdk will still have an _optional_ tcert provider interface for getting tcerts. The service member implementation can implement that and set it on the sdk. If provided, the sdk ll get tcerts, if not it will use ecerts.
rickr (Fri, 03 Mar 2017 01:04:28 GMT):
@malik-altaf @Pardha @satheeshk I'm starting to look at registration. I'm considering on moving all the enrollment and registration out of the sdk.. This should be done between the application and the member services implementation outside of the sdk. The sdk will still cache user context in the file store. If a user context is missing an enrollment which is really all we need it can look in the store to retrieve it. If not there or not provided the sdk will throw exception. This is close what the Node sdk is doing. . Not seeing why the sdk needs to be a _shim_ between application and member services implementation. The sdk will still have an _optional_ tcert provider interface for getting tcerts. The service member implementation can implement that and set it on the sdk client. If provided, the sdk ll get tcerts, if not it will use ecerts.
rickr (Fri, 03 Mar 2017 01:04:28 GMT):
@malik-altaf @Pardha @satheeshk I'm starting to look at registration. I'm considering on moving all the enrollment and registration out of the sdk.. This should be done between the application and the member services implementation outside of the sdk. The sdk will still cache user context in the file store. If a user context is missing an enrollment which is really all we need it can look in the store to retrieve it. If not there or not provided the sdk will throw exception. This is close what the Node sdk is doing. . Not seeing why the sdk needs to be a _shim_ between application and member services implementation. The sdk client will still have an _optional_ tcert provider interface for getting tcerts. The service member implementation can implement that and set it on the sdk client. If provided, the sdk ll get tcerts, if not it will use ecerts.
rickr (Fri, 03 Mar 2017 01:04:28 GMT):
@malik-altaf @Pardha @satheeshk I'm starting to look at registration. I'm considering on moving all the enrollment and registration out of the sdk.. This should be done between the application and the member services implementation outside of the sdk. The sdk will still cache user context in the file store. If a user context is missing an enrollment which is really all we need it can look in the store to retrieve it. If not there or not provided the sdk will throw exception. This is close what the Node sdk is doing. . Not seeing why the sdk needs to be a _shim_ between application and member services implementation. The sdk client will still have an _optional_ tcert provider interface for getting tcerts. The service member implementation can implement that and set it on the sdk client. If provided, the sdk will get tcerts, if not it will use ecerts.
rickr (Fri, 03 Mar 2017 01:07:52 GMT):
@jimthematrix ^^
Willson (Fri, 03 Mar 2017 03:02:39 GMT):
Has joined the channel.
jimthematrix (Fri, 03 Mar 2017 03:06:19 GMT):
yes that's what node sdk is structured, one package (fabric-client) responsible for communicating with peers and orderers, and another (fabric-ca-client) for member services. this allows the flexibility of either using fabric-ca or any other "standard" ca to issue certs and that is transparent to the main sdk client (fabric-client). node sdk doesn't have tcert support yet but what Rick said makes sense: that it'll be managed through a minimal interface without specifically requiring fabric-ca-client
jimthematrix (Fri, 03 Mar 2017 03:06:19 GMT):
yes that's how node sdk is structured, one package (fabric-client) responsible for communicating with peers and orderers, and another (fabric-ca-client) for member services. this allows the flexibility of either using fabric-ca or any other "standard" ca to issue certs and that is transparent to the main sdk client (fabric-client). node sdk doesn't have tcert support yet but what Rick said makes sense: that it'll be managed through a minimal interface without specifically requiring fabric-ca-client
zerppen (Fri, 03 Mar 2017 07:39:38 GMT):
Hi,I have no idea that I need run new Peer(String url,String pem) from Peer.java,this method will invoke EndorserClient(ManagedChannelBuilder channelBuilder) from EndorserClient.java that import org.hyperledger.fabric.protos.peer.EndorserGrpc I can't find
zerppen (Fri, 03 Mar 2017 07:41:21 GMT):
It's renamed?
ssaddem (Fri, 03 Mar 2017 08:29:26 GMT):
hi in v0.6 when i try to query block chain i got this error org.hyperledger.fabric.sdk.exception.ChainCodeException: Missing Transaction Certificate.
Pom dependency
Julien0 (Fri, 03 Mar 2017 09:27:03 GMT):
Has joined the channel.
Willson (Fri, 03 Mar 2017 10:09:35 GMT):
Hello guys, I have a problem. When I use mvn failsafe:integration-test -DskipITs=false to run the End2endIT.java, I got an error with this: Caused by: io.grpc.StatusRuntimeException: UNKNOWN: chainID not provided for chaincode lccc ,anybody know why?
Rymd (Fri, 03 Mar 2017 11:32:46 GMT):
Why isn't InstallProposalRequest public?
rickr (Fri, 03 Mar 2017 12:07:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=y6jyPH84njAMvNTpQ) @Willson Are you running the git commit levels listed in the README.md for fabric and fabric_ca ?
rickr (Fri, 03 Mar 2017 12:10:49 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=YrKoK77tP8nxmvikh) @Rymd _mea culpa_ :flushed:I'll look into this immediately.
Rymd (Fri, 03 Mar 2017 12:14:50 GMT):
same with InstantiateProposalRequest
rickr (Fri, 03 Mar 2017 12:18:03 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=cTtYKtvsZfZrHzn2i) @zerppen Is this V1.0 ? If yes, There is a complete example listed in README.md on running chaincode and how to set that up. There should be no direct usage Peer.java
ssaddem (Fri, 03 Mar 2017 13:15:04 GMT):
hi in v0.6 when i try to query block chain i got this error org.hyperledger.fabric.sdk.exception.ChainCodeException: Missing Transaction Certificate.
Pom dependency
ssaddem (Fri, 03 Mar 2017 13:55:33 GMT):
plz any solution ?
ruslan.kryukov (Fri, 03 Mar 2017 14:07:32 GMT):
why when I call method .sendTransaction and try to call method get of 'Future-object', Get method returns nothing and throws timeout error?
ruslan.kryukov (Fri, 03 Mar 2017 14:07:32 GMT):
why when I call method .sendTransaction and try to call method get of 'Future-object', Get-method returns nothing and throws timeout error?
ruslan.kryukov (Fri, 03 Mar 2017 14:08:18 GMT):
`CompletableFuture
ruslan.kryukov (Fri, 03 Mar 2017 14:08:46 GMT):
network is working, all orderers are alive
ruslan.kryukov (Fri, 03 Mar 2017 14:10:37 GMT):
also I have another problem
ruslan.kryukov (Fri, 03 Mar 2017 14:12:23 GMT):
I'm doing stress test, I have 50 threads and 5000 invoke-tasks for this threads. When I run test, it is failed after some successful invokes with error:
```
Exception in thread "grpc-default-executor-11" java.lang.NullPointerException: channel
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:228)
at io.grpc.netty.WriteQueue.
ruslan.kryukov (Fri, 03 Mar 2017 14:13:10 GMT):
I've noticed that if I set 2k invoke tasks, they ended successfuly
ruslan.kryukov (Fri, 03 Mar 2017 14:13:36 GMT):
but if I set more then 2k, when sdk client throws this error
ruslan.kryukov (Fri, 03 Mar 2017 14:15:28 GMT):
invoke task is simple:
```
Zip2
ruslan.kryukov (Fri, 03 Mar 2017 14:15:28 GMT):
'invoke task' is simple:
```
Zip2
ruslan.kryukov (Fri, 03 Mar 2017 14:15:28 GMT):
'invoke-task' is simple:
```
Zip2
ssaddem (Fri, 03 Mar 2017 15:18:44 GMT):
can any one here help ?
weeds (Fri, 03 Mar 2017 15:36:08 GMT):
@dave.enyeart Hi Dave - can you help @ssaddem please?
dave.enyeart (Fri, 03 Mar 2017 15:36:08 GMT):
Has joined the channel.
ssaddem (Fri, 03 Mar 2017 15:36:39 GMT):
hi weeds thnx
ssaddem (Fri, 03 Mar 2017 15:36:43 GMT):
in v0.6 when i try to query block chain i got this error org.hyperledger.fabric.sdk.exception.ChainCodeException: Missing Transaction Certificate.
Pom dependency
suganuma (Fri, 03 Mar 2017 15:50:02 GMT):
Hi, I'm trying to run End2endIT.java with TLS enabled (in fabric-ca/cmd/fabric-ca-server/config.go). I got an enrollment exception as follows. '2017-03-03 14:39:10 ERROR MemberServicesFabricCAImpl:322 - Failed to enroll user admin
org.hyperledger.fabric.sdk.exception.EnrollmentException: Failed to enroll user admin
at org.hyperledger.fabric.sdk.MemberServicesFabricCAImpl.enroll(MemberServicesFabricCAImpl.java:321)
at org.hyperledger.fabric.sdk.User.enroll(User.java:248)
at org.hyperledger.fabric.sdk.HFClient.enroll(HFClient.java:303)
at org.hyperledger.fabric.sdk.End2endIT.setup(End2endIT.java:92)'
dave.enyeart (Fri, 03 Mar 2017 15:50:56 GMT):
@ssaddem I actually don't have experience with the 0.6 sdk APIs, maybe @mlishok has some insight?
mlishok (Fri, 03 Mar 2017 15:50:56 GMT):
Has joined the channel.
suganuma (Fri, 03 Mar 2017 15:51:41 GMT):
Here is the log message in fabric-ca. ```2017/03/03 09:30:46 http: TLS handshake error from 172.17.0.1:38634: tls: oversized record received with length 21536'
suganuma (Fri, 03 Mar 2017 15:51:59 GMT):
Any idea on what's wrong?
ssaddem (Fri, 03 Mar 2017 15:53:20 GMT):
@dave.enyeart thx
rickr (Fri, 03 Mar 2017 15:55:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=NZeGg4js2Ds5JXvb5) @suganuma Hi we have an open JIRA open for this. Needs to be investigated on how to set this up and documented.
ssaddem (Fri, 03 Mar 2017 16:37:53 GMT):
@mlishok please can you help me ?
in v0.6 when i try to query block chain i got this error org.hyperledger.fabric.sdk.exception.ChainCodeException: Missing Transaction Certificate.
Pom dependency
mlishok (Fri, 03 Mar 2017 16:46:56 GMT):
@ssaddem thats not something I have seen, but I have not used the java SDK that much on 0.6, as it was just barely getting started at that point I believe.
mlishok (Fri, 03 Mar 2017 16:47:21 GMT):
where is this 0.6 network? docker? starter plan?
ssaddem (Fri, 03 Mar 2017 16:47:46 GMT):
ok thx :)
ssaddem (Fri, 03 Mar 2017 16:47:55 GMT):
on docker yes
ssaddem (Fri, 03 Mar 2017 16:48:19 GMT):
no not starter plan
ssaddem (Fri, 03 Mar 2017 16:48:29 GMT):
i can connect with node but not on java
mlishok (Fri, 03 Mar 2017 16:50:12 GMT):
4 node or 1 node network?
ssaddem (Fri, 03 Mar 2017 16:50:25 GMT):
4 nodes
ssaddem (Fri, 03 Mar 2017 16:50:58 GMT):
the problem i guess is the java not use certificate
mlishok (Fri, 03 Mar 2017 16:51:12 GMT):
there is definitely a limitation with 0.6 java that security cannot be on.
mlishok (Fri, 03 Mar 2017 16:51:21 GMT):
is security on the network?
ssaddem (Fri, 03 Mar 2017 16:52:39 GMT):
yes
rickr (Fri, 03 Mar 2017 16:52:54 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=YrKoK77tP8nxmvikh) @Rymd fix has been pushed to master
mlishok (Fri, 03 Mar 2017 16:53:20 GMT):
@ssaddem https://developer.ibm.com/answers/questions/342814/java-secured-support-on-bluemix-blockchain/
ssaddem (Fri, 03 Mar 2017 16:53:52 GMT):
nop it's not my problem
ssaddem (Fri, 03 Mar 2017 16:54:06 GMT):
my chain code is with go
ssaddem (Fri, 03 Mar 2017 16:54:20 GMT):
but i would like to querry it with java sdk
ssaddem (Fri, 03 Mar 2017 16:54:26 GMT):
i can connect with node js
ManjeetGambhir (Fri, 03 Mar 2017 16:56:49 GMT):
Has joined the channel.
ssaddem (Fri, 03 Mar 2017 17:05:17 GMT):
the resp is 17:04:00.662 [peer] ProcessTransaction -> ERRO 4b5 ProcessTransaction failed to verify transaction Missing Transaction Certificate.
mlishok (Fri, 03 Mar 2017 17:24:41 GMT):
@ssaddem the queries require a transaction certificate too, so if java-sdk cant handle security properly it will still be an issue.
mlishok (Fri, 03 Mar 2017 17:24:50 GMT):
Let me try to get more info.
ssaddem (Fri, 03 Mar 2017 17:28:56 GMT):
ok thx
wlahti (Fri, 03 Mar 2017 21:31:19 GMT):
Has joined the channel.
zerppen (Sun, 05 Mar 2017 15:24:44 GMT):
Hi,rickr @rickr U r online?
zerppen (Sun, 05 Mar 2017 15:36:16 GMT):
I noticed maven building fabric-sdk-java cannot find org.apache.maven.plugins:maven-source-plugin:2.2.1/org.apache.maven.plugins:maven-gpg-plugin:1.5/org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7/maven-assembly-plugin:2.3.By CLI run mvn install,showing source not found. I used Intellij idea building 3 times but showing plugin not found.
zerppen (Sun, 05 Mar 2017 15:57:45 GMT):
2017-03-05 23:54:57 ERROR CryptoPrimitives:203 - Cannot verify signature. Error is: Could not parse certificate: java.io.IOException: Empty input
Certificate (PEM, hex): 00
java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: Empty input
2017-03-05 23:54:57 ERROR CryptoPrimitives:207 - Cannot verify. Signature algorithm is invalid. Error is: Could not verify signature
java.security.SignatureException: Could not verify signature
at sun.security.ec.ECDSASignature.engineVerify(ECDSASignature.java:320)
Caused by: java.security.SignatureException: Could not decode signature
at sun.security.ec.ECDSASignature.decodeSignature(ECDSASignature.java:386)
at sun.security.ec.ECDSASignature.engineVerify(ECDSASignature.java:317)
... 30 more
Caused by: java.io.IOException: Encoding bytes too short
zerppen (Sun, 05 Mar 2017 15:57:54 GMT):
Here is logs
tuand (Sun, 05 Mar 2017 20:01:27 GMT):
@zerppen , is that `ERROR CryptoPrimitives ...` coming out of the mvn install ? The unit tests exercise the signing/verification error paths so you will see many exceptions like that during the build. What's the end result of your mvn install ? Your log should look something like this ```[INFO] --- maven-failsafe-plugin:2.13:verify (failsafe-integration-tests) @ fabric-sdk-java ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ fabric-sdk-java ---
[INFO] Installing /Users/ttd/work/src/github.com/hyperledger/fabric-sdk-java/target/fabric-sdk-java-1.0-SNAPSHOT.jar to /Users/ttd/.m2/repository/org/hyperledger/fabric-sdk-java/fabric-sdk-java/1.0-SNAPSHOT/fabric-sdk-java-1.0-SNAPSHOT.jar
[INFO] Installing /Users/ttd/work/src/github.com/hyperledger/fabric-sdk-java/pom.xml to /Users/ttd/.m2/repository/org/hyperledger/fabric-sdk-java/fabric-sdk-java/1.0-SNAPSHOT/fabric-sdk-java-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.297 s
[INFO] Finished at: 2017-03-05T14:50:43-05:00
[INFO] Final Memory: 35M/615M
[INFO] ------------------------------------------------------------------------```
obernin (Sun, 05 Mar 2017 21:01:02 GMT):
Has joined the channel.
gauthampamu (Mon, 06 Mar 2017 00:17:59 GMT):
Has joined the channel.
gauthampamu (Mon, 06 Mar 2017 00:21:14 GMT):
Is support for java sdk targeted for v1.0 ? Where can I find documentation on how to use the java sdk ?
rickr (Mon, 06 Mar 2017 00:36:18 GMT):
https://github.com/hyperledger/fabric-sdk-java
Scroll down to read the README.md Read through it _thoroughly_ at least once. IMO will save you a lot of time in the long run.
You can clone that git rep.
Look over the *End2endIT.java* code it points to. It's a complete example of deploying chain code.
rickr (Mon, 06 Mar 2017 00:36:18 GMT):
https://github.com/hyperledger/fabric-sdk-java
Scroll down to read the README.md Read through it _thoroughly_ at least once. IMO will save you a lot of time in the long run.
You can clone that git repo.
Look over the *End2endIT.java* code it points to. It's a complete example of deploying chain code.
rjones (Mon, 06 Mar 2017 03:39:31 GMT):
rickr
rpbarnes (Mon, 06 Mar 2017 06:49:09 GMT):
Has joined the channel.
rpbarnes (Mon, 06 Mar 2017 06:52:22 GMT):
Hi, I notice that protocols such as Chain.sendInstallProposal and sendInstantiationProposal take as their arguments proposal request classes which are package-private. It's not clear to me how I am supposed to write client code using the SDK api. Am I missing something? thanks
kelvinzhong (Mon, 06 Mar 2017 07:19:06 GMT):
Has joined the channel.
ruslan.kryukov (Mon, 06 Mar 2017 09:06:52 GMT):
I have found bug in sdk
ruslan.kryukov (Mon, 06 Mar 2017 09:07:02 GMT):
Sdk doesn't close connections
ruslan.kryukov (Mon, 06 Mar 2017 09:07:24 GMT):
when we use it a long time, we get connections limit
ruslan.kryukov (Mon, 06 Mar 2017 09:07:48 GMT):
And finally we have a exception of netty
Exception in thread "grpc-default-executor-11" java.lang.NullPointerException: channel
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:228)
at io.grpc.netty.WriteQueue.
ruslan.kryukov (Mon, 06 Mar 2017 09:08:55 GMT):
for example I use sdk by sending 2100 invoke proposals:
```
[root@docker0 opt]# lsof -Pan -p 7730 -i | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
312
[root@docker0 opt]# lsof -Pan -p 7730 -i | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
651
[root@docker0 opt]# lsof -Pan -p 7730 -i | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
916
[root@docker0 opt]# lsof -Pan -p 7730 -i | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
1195
[root@docker0 opt]# lsof -Pan -p 7730 -i | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
1487
[root@docker0 opt]# lsof -Pan -p 7730 -i | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
1761
[root@docker0 opt]# lsof -Pan -p 7730 -i | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
1990
[root@docker0 opt]# lsof -Pan -p 7730 -i | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
0
[root@docker0 opt]# lsof -Pan -p 7730 -i | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
0
[root@docker0 opt]#
```
ruslan.kryukov (Mon, 06 Mar 2017 09:09:18 GMT):
The number is count of active connections for sdk app
ruslan.kryukov (Mon, 06 Mar 2017 09:09:18 GMT):
The number is a count of active connections for sdk app
ruslan.kryukov (Mon, 06 Mar 2017 09:14:22 GMT):
```
java 7925 root 1625u IPv6 2818050 0t0 TCP
ruslan.kryukov (Mon, 06 Mar 2017 09:14:57 GMT):
Connections to orderer are not closed
vitaly.ilinykh (Mon, 06 Mar 2017 09:27:59 GMT):
Has joined the channel.
kleman (Mon, 06 Mar 2017 09:48:25 GMT):
a factory ?
Rymd (Mon, 06 Mar 2017 11:27:11 GMT):
the recent commit made them public
rpbarnes (Mon, 06 Mar 2017 11:34:35 GMT):
Ah, thanks! I'm probably a day or two behind. And BTW, I'm finding End2endIT extremely useful as an example of writing client-side code so thanks to all involved with that.
rickr (Mon, 06 Mar 2017 11:58:00 GMT):
@rpbarnes from all of us, you're welcome! Nice to hear some positive feedback!
ManjeetGambhir (Mon, 06 Mar 2017 13:24:02 GMT):
@rickr getting error on identity on default setting of fabric, fabric ca images ?
ManjeetGambhir (Mon, 06 Mar 2017 13:24:19 GMT):
Did you get chance to look into it
ManjeetGambhir (Mon, 06 Mar 2017 13:24:55 GMT):
@ I have posted error on fabric-ci channel
rickr (Mon, 06 Mar 2017 13:38:20 GMT):
My first take on this is it's some environment error. For that it's best that @rameshthoomu looking into this.
rameshthoomu (Mon, 06 Mar 2017 13:40:25 GMT):
@ManjeetGambhir did you change image reference in docker compose file? I think ccenv image is not tagged properly..
ManjeetGambhir (Mon, 06 Mar 2017 13:48:35 GMT):
@rameshthoomu yes @rahulhegde from my company changed it.even though getting error
rahulhegde (Mon, 06 Mar 2017 13:48:35 GMT):
Has joined the channel.
rameshthoomu (Mon, 06 Mar 2017 13:49:09 GMT):
ok
rickr (Mon, 06 Mar 2017 14:48:26 GMT):
@rameshthoomu Please get @ManjeetGambhir working with MSPID as "DEFAULT". I've opened a JIRA https://jira.hyperledger.org/browse/FAB-2656 to look at supporting multiple MSPIDs
simsc (Mon, 06 Mar 2017 14:59:35 GMT):
Has joined the channel.
jimthematrix (Mon, 06 Mar 2017 15:52:00 GMT):
@rickr for java sdk to support the multi-org setup, here are the two relevant CRs in node sdk as reference:
- https://gerrit.hyperledger.org/r/#/c/6653/ - gets the chain's config block from the orderer, parses it and inits the verifying MSPs in the chain object
- https://gerrit.hyperledger.org/r/#/c/6869/, https://gerrit.hyperledger.org/r/#/c/6881/ - creates the default endorsement policy that makes uses of the verifying msps initialized above
ManjeetGambhir (Mon, 06 Mar 2017 15:57:29 GMT):
@rameshthoomu can we have images
ManjeetGambhir (Mon, 06 Mar 2017 15:59:17 GMT):
@rameshthoomu where we can work with default identity by java sdk
jimthematrix (Mon, 06 Mar 2017 16:07:39 GMT):
@ManjeetGambhir also make sure when you launch the network, that you don't override the `LocalMSPID` values for either the orderer or the peers
jimthematrix (Mon, 06 Mar 2017 16:08:04 GMT):
the best way to launch a network that works with the sdk is to use the docker-compose.yaml in test/fixtures/src folder
jimthematrix (Mon, 06 Mar 2017 16:08:04 GMT):
the best way to launch a network that works with the sdk is to use the docker-compose.yaml in test/fixture/src folder
jimthematrix (Mon, 06 Mar 2017 16:09:29 GMT):
my guess is that you either used a docker-compose.yaml from a different source or have modified it yourself
simsc (Mon, 06 Mar 2017 18:07:29 GMT):
@ManjeetGambhir are you running end to end now?
ManjeetGambhir (Mon, 06 Mar 2017 22:00:23 GMT):
@rickr I am trying to depoy my chaincode and corrected chain-code name , but still getting below error while deploying :Sending instantiateProposalRequest code with a and b set to 100 and 200 respectively
java.lang.Exception: Not enough endorsers for instantiate :0. Sending proposal to peer failed because of gRPC failure=Status{code=UNKNOWN, description=Error starting container: API error (500): {"message":"Error parsing reference: \"dev-vp0-ClsPublicCC.go-1.0\" is not a valid repository/tag: repository name must be lowercase"}
, cause=null}. Was verified:false
ManjeetGambhir (Mon, 06 Mar 2017 22:00:49 GMT):
how to remove previous incorrected name chaincode from repository
ManjeetGambhir (Mon, 06 Mar 2017 22:02:22 GMT):
@rickr stopped network , docker rm -f${docker ps -aq}
ManjeetGambhir (Mon, 06 Mar 2017 22:03:19 GMT):
ignore "Sending instantiateProposalRequest code with a and b set to 100 and 200 respectivel" just sysout
muralisr (Mon, 06 Mar 2017 22:06:28 GMT):
Has joined the channel.
muralisr (Mon, 06 Mar 2017 22:07:42 GMT):
@ManjeetGambhir do you have peer side log by any chance ?
muralisr (Mon, 06 Mar 2017 22:07:55 GMT):
I see "\." in the name
muralisr (Mon, 06 Mar 2017 22:08:12 GMT):
can to try without the `.`
muralisr (Mon, 06 Mar 2017 22:08:12 GMT):
can you to try without the `.`
muralisr (Mon, 06 Mar 2017 22:09:57 GMT):
also try lower case name... although we should have caught and converted
muralisr (Mon, 06 Mar 2017 22:11:23 GMT):
(I think the case is the culprit)
ManjeetGambhir (Mon, 06 Mar 2017 22:14:49 GMT):
@muralisr after twice restarting working fine
muralisr (Mon, 06 Mar 2017 22:15:06 GMT):
I assume it was the lowercase ?
ManjeetGambhir (Mon, 06 Mar 2017 22:15:14 GMT):
I did lowercase
muralisr (Mon, 06 Mar 2017 22:15:18 GMT):
ok
ManjeetGambhir (Mon, 06 Mar 2017 22:15:31 GMT):
and tried to redeploy and deleted all container
muralisr (Mon, 06 Mar 2017 22:15:35 GMT):
ok
ManjeetGambhir (Mon, 06 Mar 2017 22:15:47 GMT):
never mind
ManjeetGambhir (Mon, 06 Mar 2017 22:15:52 GMT):
now its working
muralisr (Mon, 06 Mar 2017 22:16:01 GMT):
ok
ManjeetGambhir (Mon, 06 Mar 2017 22:41:24 GMT):
@muralisr do chaincode file name should be lowercase?
muralisr (Mon, 06 Mar 2017 22:42:48 GMT):
@ManjeetGambhir the docker image does not like uppercase.. we had a filter that converted to names to be dockerfriendly but my guess is that's not in the code path for some reason
ManjeetGambhir (Tue, 07 Mar 2017 03:55:51 GMT):
@rickr do you know how to get read,write set and proposalrequest in BlockEvent by blocklistener?
I can not see from blockevent ,any api to directly get mentioned above
ManjeetGambhir (Tue, 07 Mar 2017 04:01:09 GMT):
@jimthematrix Jim, BlockEvent has read,write and proposal data ?
jimthematrix (Tue, 07 Mar 2017 04:29:43 GMT):
@ManjeetGambhir correct, readset, writeset, and proposal
ManjeetGambhir (Tue, 07 Mar 2017 04:31:14 GMT):
@jimthematrix is there direct api to get all mentioned above ?
ManjeetGambhir (Tue, 07 Mar 2017 04:31:40 GMT):
I am trying to get read ,write and proposal but can not see
ManjeetGambhir (Tue, 07 Mar 2017 04:32:54 GMT):
iterating over List
jimthematrix (Tue, 07 Mar 2017 04:34:10 GMT):
I don't think the BlockEvent wrapper class has been enhanced to support accessing those fields yet
ManjeetGambhir (Tue, 07 Mar 2017 04:35:48 GMT):
I thought last discussion with sharon and clayton, it looked like it will be available now
jimthematrix (Tue, 07 Mar 2017 04:36:04 GMT):
if you have to get that right now, you can getBlock() and use the protobuf classes to parse the original block object
jimthematrix (Tue, 07 Mar 2017 04:36:22 GMT):
let me double check
ManjeetGambhir (Tue, 07 Mar 2017 04:36:38 GMT):
but I can not see
ManjeetGambhir (Tue, 07 Mar 2017 04:41:23 GMT):
ok waiting on you
ManjeetGambhir (Tue, 07 Mar 2017 04:44:10 GMT):
Actually our whole business logic is based on those..without that it will be very difficult to integrate business pieces we developed so ar
ManjeetGambhir (Tue, 07 Mar 2017 04:44:14 GMT):
far*
jimthematrix (Tue, 07 Mar 2017 04:47:48 GMT):
yes understood, i know Rick told me Tuan has been working on that (enhancing the block wrapper class), so it may well be still work in progress
ManjeetGambhir (Tue, 07 Mar 2017 04:49:01 GMT):
Any ETA ?
ManjeetGambhir (Tue, 07 Mar 2017 04:50:03 GMT):
This piece is highest priority for us ..see if it can available soon
ManjeetGambhir (Tue, 07 Mar 2017 04:50:26 GMT):
we can live without other features for few days..
jimthematrix (Tue, 07 Mar 2017 04:51:41 GMT):
i don't know the latest progress on that, @rickr would have to provide that
jimthematrix (Tue, 07 Mar 2017 04:51:41 GMT):
i don't know the latest progress on that, @rickr would have to provide an ETA
ManjeetGambhir (Tue, 07 Mar 2017 04:52:11 GMT):
ok Thanks Jim..you are always helpful..Will check Rick tomm
jimthematrix (Tue, 07 Mar 2017 04:52:21 GMT):
sounds good
lehors (Tue, 07 Mar 2017 12:51:39 GMT):
Has joined the channel.
ElliScharlin (Tue, 07 Mar 2017 12:52:08 GMT):
Has joined the channel.
ElliScharlin (Tue, 07 Mar 2017 12:52:13 GMT):
Hey guys
ElliScharlin (Tue, 07 Mar 2017 12:52:28 GMT):
I have this when trying to enroll a user using the java sdk
ElliScharlin (Tue, 07 Mar 2017 12:53:59 GMT):
```
Connected to the target VM, address: '127.0.0.1:64422', transport: 'socket'
Exception in thread "main" org.hyperledger.fabric.sdk.exception.EnrollmentException: Failed to enroll user
at org.hyperledger.fabric.sdk.MemberServicesImpl.enroll(MemberServicesImpl.java:219)
at org.hyperledger.fabric.sdk.Member.enroll(Member.java:212)
at org.hyperledger.fabric.sdk.Chain.enroll(Chain.java:300)
at JavaHyperledgerSample.main(JavaHyperledgerSample.java:28)
Caused by: java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.
at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:151)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:128)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:117)
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:88)
at io.grpc.netty.NettyChannelBuilder.createProtocolNegotiator(NettyChannelBuilder.java:259)
at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.newClientTransport(NettyChannelBuilder.java:314)
at io.grpc.internal.AbstractManagedChannelImplBuilder$AuthorityOverridingTransportFactory.newClientTransport(AbstractManagedChannelImplBuilder.java:235)
at io.grpc.internal.TransportSet$1.call(TransportSet.java:215)
at io.grpc.internal.TransportSet$1.call(TransportSet.java:203)
at io.grpc.internal.TransportSet.obtainActiveTransport(TransportSet.java:175)
at io.grpc.internal.ManagedChannelImpl$3.getTransport(ManagedChannelImpl.java:381)
at io.grpc.SimpleLoadBalancerFactory$SimpleLoadBalancer.pickTransport(SimpleLoadBalancerFactory.java:97)
at io.grpc.internal.ManagedChannelImpl$1.get(ManagedChannelImpl.java:135)
at io.grpc.internal.ClientCallImpl.start(ClientCallImpl.java:206)
at io.grpc.stub.ClientCalls.startCall(ClientCalls.java:245)
at io.grpc.stub.ClientCalls.asyncUnaryRequestCall(ClientCalls.java:225)
at io.grpc.stub.ClientCalls.futureUnaryCall(ClientCalls.java:186)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:132)
at org.hyperledger.protos.ECAPGrpc$ECAPBlockingStub.createCertificatePair(ECAPGrpc.java:211)
at org.hyperledger.fabric.sdk.MemberServicesImpl.enroll(MemberServicesImpl.java:191)
... 3 more
Disconnected from the target VM, address: '127.0.0.1:64422', transport: 'socket'
Process finished with exit code 1
```
ElliScharlin (Tue, 07 Mar 2017 12:54:29 GMT):
Any thoughts would be greatly appreciated! :)
iscy (Tue, 07 Mar 2017 17:30:50 GMT):
Has joined the channel.
mdozturk (Tue, 07 Mar 2017 20:42:32 GMT):
Hi everybody, I'm playing around with hyperledger fabric 0.6 and created some simple chaincode where when initialize my environment and run my application, an entity is created on the chaincode.
mdozturk (Tue, 07 Mar 2017 20:43:02 GMT):
When I rerun my application, my application tries to create the same entity it just created and as per the chaincode rules the creation fails (as expected)
mdozturk (Tue, 07 Mar 2017 20:43:31 GMT):
However I noticed the java sdk hangs while the invoke is being processed by the fabric
mdozturk (Tue, 07 Mar 2017 20:44:25 GMT):
checking the logs, it seems like after the error the validator sends an event to the sdk to inform of the error, however the message sent ("block") contains no information about which transaction failed
mdozturk (Tue, 07 Mar 2017 20:45:00 GMT):
Is this by design?
tuand (Tue, 07 Mar 2017 21:09:39 GMT):
@mdozturk suggest you move to the V1.0 fabric and sdk-java code ... I don't know what shape the V0.6 sdk-java is in but we're all concentrating on V1.0 right now
mdozturk (Tue, 07 Mar 2017 21:18:34 GMT):
Is there a document describing how to migrate
mdozturk (Tue, 07 Mar 2017 21:18:36 GMT):
?
mdozturk (Tue, 07 Mar 2017 21:18:55 GMT):
I barely have a handle on v0.6 :)
tuand (Tue, 07 Mar 2017 21:22:21 GMT):
there is no migration from V0.6 to V1.0 ... take a look on the wiki, in particular http://hyperledger-fabric.readthedocs.io/en/latest/ and https://wiki.hyperledger.org/community/fabric-design-docs
tuand (Tue, 07 Mar 2017 21:22:56 GMT):
once you've cloned fabric-sdk-java, take a look at the README as well
mdozturk (Tue, 07 Mar 2017 21:35:06 GMT):
cool tnanks
kletkeman (Wed, 08 Mar 2017 01:51:05 GMT):
@mdozturk Fabric v0.5 had serious problems with storing non-deterministic errors into blocks (e.g. network timeouts, etc.) and so bluemix based v0.5 fabrics became unstable quickly as one or more peers would diverge their block hash and that was that. The fix in v0.6 was to stop storing sucj errors in the block, but the baby was thrown out with the bath water in this instance as legitimate failures (chaincode errors such as yours) were also not stored. Thus, the block event is no longer useful for both. If I recall, the rejection event is sent out, so you can listen for both. I implemented my own event in my IoT Contract Platform (it works for any contract, but is oriented to the performance requirements of IoT) in all cases. Peculiarly, v0.6 does store the event in a parallel array with transactions, and so by emitting a success or failure event, I can listen for my own events and know every transaction's fate. And I can display blocks correctly by grabbing the event and then filling in the rest of the info from the transaction array for those transactions that succeeded. Funky, but it works. I have an event listener that I derived from the sample block listener that is able to catch every event that our contracts can emit (we have several). The listener code is at https://github.com/ibm-watson-iot/blockchain-samples/tree/master/applications/event_listener.
I have our platform and samples ported to v1, however the cli remains elusive for external chaincode (any chaincode not copied into the fabric name space) and going to the SDK from REST is exactly as much fun as you might expect.
Willson (Wed, 08 Mar 2017 02:46:14 GMT):
Hello guys, when I use the newest fabric-sdk-java and correspond commitlevel fabrci and fabric-ca to run the "mvn failsafe:integration-test -DskipITs=false", I got and error like this ERROR Chain:164 - New chain foo error. StatusValue 400. Status BAD_REQUEST.Anybody can tell me why and how to solute it? Thanks
rickr (Wed, 08 Mar 2017 02:57:20 GMT):
How are you starting your Peers and Orderer .. the docker-compose.yml ?
Willson (Wed, 08 Mar 2017 02:58:22 GMT):
Yes,the docker-compose.yml that in the fixture
rickr (Wed, 08 Mar 2017 02:58:55 GMT):
in Vagrant ?
Willson (Wed, 08 Mar 2017 02:59:05 GMT):
yes
rickr (Wed, 08 Mar 2017 02:59:47 GMT):
double check your Vagrant files host native port settings
rickr (Wed, 08 Mar 2017 03:00:21 GMT):
at the moment that's the only thing that come to mind
Willson (Wed, 08 Mar 2017 03:02:29 GMT):
Message Attachments
Willson (Wed, 08 Mar 2017 03:03:06 GMT):
is right?
rickr (Wed, 08 Mar 2017 03:05:08 GMT):
y
Willson (Wed, 08 Mar 2017 03:06:21 GMT):
@rickr Are there any other suggestions?
rickr (Wed, 08 Mar 2017 03:08:16 GMT):
you know how to print the orderer logs from docker ?
rickr (Wed, 08 Mar 2017 03:09:01 GMT):
docker logs container
Willson (Wed, 08 Mar 2017 03:18:58 GMT):
er
Willson (Wed, 08 Mar 2017 03:19:20 GMT):
2017-03-08 02:59:55.858 UTC [configtx/tool/localconfig] Load -> INFO 001 Checking for configtx.yaml at: /etc/hyperledger/fabric
2017-03-08 02:59:55.859 UTC [configtx/tool/localconfig] Load -> INFO 002 Checking for configtx.yaml at:
2017-03-08 02:59:55.880 UTC [viperutil] EnhancedExactUnmarshal -> INFO 003 map[orderer:map[Kafka:map[Brokers:[127.0.0.1:9092]] Organizations:
bh4rtp (Wed, 08 Mar 2017 03:27:45 GMT):
Has left the channel.
rickr (Wed, 08 Mar 2017 03:30:59 GMT):
the last ERROR is not an issue it looks like it created the foo chain .. if you recycle your docker down ... up and rerun this consistently happens ?
Willson (Wed, 08 Mar 2017 03:35:39 GMT):
yes, i had use docker kill $(docker ps -qa) to kill the containers and restart
Basug (Wed, 08 Mar 2017 03:39:36 GMT):
How would I include any additional jar files that might be needed for my application.
Basug (Wed, 08 Mar 2017 03:40:44 GMT):
I want to write chaincode in java & have it use some third party libraries, do these need to be included in docker image ?
rickr (Wed, 08 Mar 2017 03:40:49 GMT):
Wilson -- I think you may have an older SDK toolkit
rickr (Wed, 08 Mar 2017 03:41:50 GMT):
Basug please take that fabric-java-chaincode
Basug (Wed, 08 Mar 2017 03:42:29 GMT):
Ok will do - looks like not much activity in there, asked that question there this morning
Willson (Wed, 08 Mar 2017 03:42:41 GMT):
ok, i clone it again, thanks
rickr (Wed, 08 Mar 2017 03:42:41 GMT):
Basug -- also I know at the moment java chain code in v1 is broken but it's actively being worked on.
Basug (Wed, 08 Mar 2017 03:43:00 GMT):
ok, thank you
rickr (Wed, 08 Mar 2017 03:43:15 GMT):
Sorry folks need to break away for now
Willson (Wed, 08 Mar 2017 04:38:28 GMT):
@rickr I had clone the newest sdk of master branch and the error is still exist
Willson (Wed, 08 Mar 2017 04:54:38 GMT):
2017-03-08 04:46:37.286 UTC [orderer/main] main -> INFO 006 Beginning to serve requests
2017-03-08 04:46:37.831 UTC [orderer/common/deliver] Handle -> ERRO 007 Error reading from channel, cause was: NOT_FOUND
2017-03-08 04:46:38.184 UTC [orderer/common/deliver] Handle -> ERRO 008 Error reading from channel, cause was: NOT_FOUND
2017-03-08 04:48:21.938 UTC [orderer/multichain] newChain -> INFO 009 Created and starting new chain foo
2017-03-08 04:48:22.685 UTC [orderer/common/deliver] Handle -> ERRO 00a Error reading from stream: stream error: code = 1 desc = "context canceled"
Willson (Wed, 08 Mar 2017 07:32:16 GMT):
Guys,there is a new error like this: ERROR Chain:306 - org.hyperledger.fabric.sdk.exception.ProposalException: Join peer to chain foo failed. Status FAILURE, details: Sending proposal to peer failed because of gRPC failure=Status{code=UNKNOWN, description=The creator certificate is not valid, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority, cause=null}..What caused it?
icordoba (Wed, 08 Mar 2017 11:17:43 GMT):
Has joined the channel.
rickr (Wed, 08 Mar 2017 11:32:30 GMT):
This is one step past the previous error can you share how that was fixed ?
Suma (Wed, 08 Mar 2017 15:44:29 GMT):
Has joined the channel.
dknochen (Wed, 08 Mar 2017 16:13:27 GMT):
Has joined the channel.
Basug (Thu, 09 Mar 2017 01:13:58 GMT):
All - In End2EndIT.java it deploys go chain code, is it possible to write chaincode in java like in 0.6 ?
Basug (Thu, 09 Mar 2017 01:16:23 GMT):
Looks like there is SimpleSample.java in tests - will try it out
Willson (Thu, 09 Mar 2017 01:22:00 GMT):
@rickr After reclone the sdk,the former error has disappeared,but the later error is appearing
rickr (Thu, 09 Mar 2017 01:24:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Mn4voi3L2zqgfEf3g) Not going to work :) It's broken but actively being worked on.
Basug (Thu, 09 Mar 2017 01:24:33 GMT):
ok.
Basug (Thu, 09 Mar 2017 01:25:28 GMT):
@rickr - looks like most of the imports for chaincode itself come from shim, would it be possible I write chain code in java, but deploy using node api ?
rickr (Thu, 09 Mar 2017 01:26:57 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=o8vQdbfR33tsc3vs8) No. Its not the deployment its the shim and or the fabric ...
Basug (Thu, 09 Mar 2017 01:27:21 GMT):
ah ok.I guess I will have to wait :)
rickr (Thu, 09 Mar 2017 01:37:23 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=3ShK24r5Q9v3sdqHP) in vagrant at the fabric directory `docker-compose down; rm -rf /var/hyperledger/*; docker-compose up --force-recreate`
rickr (Thu, 09 Mar 2017 01:37:49 GMT):
then run the `mvn failsafe:integration-test -DskipITs=false`
rickr (Thu, 09 Mar 2017 01:38:02 GMT):
Kinda running out of ideas
rickr (Thu, 09 Mar 2017 01:39:03 GMT):
and in that directory you have docker-compose.yml that's in the java sdk
Willson (Thu, 09 Mar 2017 01:43:16 GMT):
thanks, let me try it again
Willson (Thu, 09 Mar 2017 02:08:41 GMT):
it is still not working
Basug (Thu, 09 Mar 2017 02:12:10 GMT):
@rickr - while discussing with @sanchezl yesterday he mentioned that I should be able to atleast deploy and initialize . Is that broken too ?
Basug (Thu, 09 Mar 2017 02:12:29 GMT):
`2017-03-08 21:10:35 ERROR Chain:164 - New chain foo error. StatusValue 400. Status BAD_REQUEST`
rickr (Thu, 09 Mar 2017 02:51:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=em29jbFfGYruMvQoR) @Basug Well that's a pretty low bar ... but if it's working and suits your needs.... by all means go for it :)
Basug (Thu, 09 Mar 2017 02:54:44 GMT):
@rickr - that wouldn't be enough for my POC - I am hoping by the time I need it (March 15th of so, it would all work end to end). I am using some 3rd party libraries and if it initializes, I know they are loaded fine. Getting it to do other things wont be an issue, as I have had go chain code working for my needs.
rickr (Thu, 09 Mar 2017 02:56:36 GMT):
+
rickr (Thu, 09 Mar 2017 03:03:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=pYXQ9rL97C7veC43v) What os are you on ?
Willson (Thu, 09 Mar 2017 03:27:19 GMT):
The vagrant runs a CentOS
rickr (Thu, 09 Mar 2017 03:27:45 GMT):
client ?
Willson (Thu, 09 Mar 2017 03:27:46 GMT):
The vagrant runs a CentOS7 and the sdk runs on Win10
icordoba (Thu, 09 Mar 2017 09:44:18 GMT):
Hello, anybody has any code example of how to deploy chain code and execute a method in a contract using GRPC in Java? (For org.hyperledger.fabric-sdk-java:fabric-sdk-java:0.6 or 1.0 version)
icordoba (Thu, 09 Mar 2017 09:44:18 GMT):
Hello, anybody has any code example of how to deploy chain code and execute a method in a contract using GRPC in Java? (For org.hyperledger.fabric-sdk-java:fabric-sdk-java:0.6 version)
rickr (Thu, 09 Mar 2017 13:29:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=q78KabffbCCsYcSh2) @Willson Thinking now may be windows bugs we have. you could try running from your vagrant shell restart the fabric with the docker-compose.. in another terminal . ```vagrant ssh
sudo apt-get update
sudo apt-get install -y default-jdk maven
sudo unlink /usr/share/maven/plexus-classworlds-2.x.jar
git clone http://gerrit.hyperledger.org/r/fabric-sdk-java
cd fabric-sdk-java
mvn install
mvn failsafe:integration-test -DskipITs=false
```
rickr (Thu, 09 Mar 2017 13:29:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=q78KabffbCCsYcSh2) @Willson Thinking now may be windows bugs we have. you could try running from your vagrant shell restart the fabric with the docker-compose.. in another terminal . ```vagrant ssh
sudo apt-get update
sudo apt-get install -y default-jdk maven
sudo unlink /usr/share/maven/boot/plexus-classworlds-2.x.jar
git clone http://gerrit.hyperledger.org/r/fabric-sdk-java
cd fabric-sdk-java
mvn install
mvn failsafe:integration-test -DskipITs=false
```
rickr (Thu, 09 Mar 2017 13:29:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=q78KabffbCCsYcSh2) @Willson Thinking now may be windows bugs we have. you could try running from your vagrant shell restart the fabric with the docker-compose.. in another terminal . ```vagrant ssh
sudo apt-get update
sudo apt-get install -y default-jdk maven
sudo unlink /usr/share/maven/boot/plexus-classworlds-2.x.jar
git clone http://gerrit.hyperledger.org/r/fabric-sdk-java
cd fabric-sdk-java
mvn install
mvn failsafe:integration-test -DskipITs=false
```
rickr (Thu, 09 Mar 2017 13:29:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=q78KabffbCCsYcSh2) @Willson Thinking now may be windows bugs we have. you could try running from your vagrant shell restart the fabric with the docker-compose.. in another terminal . ```vagrant ssh
sudo apt-get update
sudo apt-get install -y default-jdk maven
sudo unlink /usr/share/maven/boot/plexus-classworlds-2.x.jar
git clone http://gerrit.hyperledger.org/r/fabric-sdk-java
cd fabric-sdk-java
mvn install
GOPATH=/opt/gopath/src/github.com/hyperledger/fabric/fabric-sdk-java/src/test/fixture
mvn failsafe:integration-test -DskipITs=false
```
rickr (Thu, 09 Mar 2017 13:29:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=q78KabffbCCsYcSh2) @Willson Thinking now may be windows bugs we have. you could try running from your vagrant shell restart the fabric with the docker-compose.. in another terminal . ```vagrant ssh
sudo apt-get update
sudo apt-get install -y default-jdk maven
sudo unlink /usr/share/maven/boot/plexus-classworlds-2.x.jar
git clone http://gerrit.hyperledger.org/r/fabric-sdk-java
cd fabric-sdk-java
mvn install
export GOPATH=/opt/gopath/src/github.com/hyperledger/fabric/fabric-sdk-java/src/test/fixture
mvn failsafe:integration-test -DskipITs=false
```
mdozturk (Thu, 09 Mar 2017 13:33:36 GMT):
@icordoba check the test scripts included in the package
mdozturk (Thu, 09 Mar 2017 13:34:24 GMT):
@icordoba https://github.com/hyperledger/fabric-sdk-java/blob/v0.6/src/test/java/org/hyperledger/fabric/sdk/PeerClientTest.java
aberfou (Thu, 09 Mar 2017 13:48:31 GMT):
Has joined the channel.
rehmke (Thu, 09 Mar 2017 15:02:02 GMT):
Has joined the channel.
kletkeman (Thu, 09 Mar 2017 16:33:55 GMT):
@here Can I get a read on the status of the Java SDK w.r.t. maturity and stability? Also w.r.t. completeness as compared with the node sdk? The reason I ask is that we are porting two applications to v1, one in JavaScript and one in Java. Many thanks.
weeds (Thu, 09 Mar 2017 16:54:32 GMT):
@icordoba I would go here for now- https://jenkins.hyperledger.org and look under the fabric tab to see what all they have. I also know that they are working on updating documentation
ManjeetGambhir (Thu, 09 Mar 2017 18:45:27 GMT):
@rickr after leaving eventlister opened for long time ..seeing below error ERROR EventHub:77 - Error in stream: UNAVAILABLE
ManjeetGambhir (Thu, 09 Mar 2017 18:47:13 GMT):
@rickr and eventlistener doesnt receive any event
rickr (Thu, 09 Mar 2017 19:07:16 GMT):
@ManjeetGambhir open a JIRA need logs for client and orderer and peer
bmos299 (Thu, 09 Mar 2017 19:34:41 GMT):
Has joined the channel.
bmos299 (Thu, 09 Mar 2017 19:42:35 GMT):
@ManjeetGambhir if you want to post your information on the fabric-quality channel we can work with you and discuss your setup.
isramos (Thu, 09 Mar 2017 21:39:07 GMT):
I'm looking for a sample JAVA app, similar to the "Asset Transfer with SDK" demo for Node.js? (https://hyperledger-fabric.readthedocs.io/en/latest/asset_setup.html) Anyone has that?
isramos (Thu, 09 Mar 2017 21:39:07 GMT):
I'm looking for a sample JAVA app, similar to the "Asset Transfer with SDK" demo for Node.js (https://hyperledger-fabric.readthedocs.io/en/latest/asset_setup.html) Anyone has that?
Willson (Fri, 10 Mar 2017 01:21:44 GMT):
@rickr ok,thanks
imherro (Fri, 10 Mar 2017 08:10:43 GMT):
Has joined the channel.
imherro (Fri, 10 Mar 2017 08:11:00 GMT):
I'm looking for a sample JAVA app, similar to the "Asset Transfer with SDK" demo for Node.js (https://hyperledger-fabric.readthedocs.io/en/latest/asset_setup.html) Anyone has that?
ikruiper (Fri, 10 Mar 2017 11:01:21 GMT):
Has joined the channel.
anrodon (Fri, 10 Mar 2017 11:26:47 GMT):
Has joined the channel.
anrodon (Fri, 10 Mar 2017 11:27:36 GMT):
Getting this using the SDK:
Caught an exception
org.hyperledger.fabric.sdk.exception.EnrollmentException: Failed to enroll user user_type1_0
at org.hyperledger.fabric.sdk.MemberServicesFabricCAImpl.enroll(MemberServicesFabricCAImpl.java:312)
at org.hyperledger.fabric.sdk.User.enroll(User.java:238)
at org.hyperledger.fabric.sdk.Chain.enroll(Chain.java:553)
at org.hyperledger.fabric.sdkexample.End2EndSample.setup(End2EndSample.java:53)
at org.hyperledger.fabric.sdkexample.End2EndSample.main(End2EndSample.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.Exception: POST request to https://378348750a38463d9fe6980153f24650-vp0.us.blockchain.ibm.com:5002/api/v1/cfssl/enroll failed with status code: 404. Response: {"Error":"Openchain endpoint not found."}
Any thoughs?
rickr (Fri, 10 Mar 2017 12:00:29 GMT):
@anrodon edit the docker-compose.yml under services->cop->command change that line to add a `-d`
Should look like this: `sh -c 'fabric-ca-server start -b admin:adminpw -d'`
now restart all your docker containers recreate the issue pipe the output to a file
post it to a utility like `justpaste.`
and report it in the fabric_ca channel.
anrodon (Fri, 10 Mar 2017 12:00:58 GMT):
I'm using the Bluemix platform :sweat:
anrodon (Fri, 10 Mar 2017 12:01:30 GMT):
should I contact them?
rickr (Fri, 10 Mar 2017 12:02:30 GMT):
that was with V1 client ?
anrodon (Fri, 10 Mar 2017 12:04:17 GMT):
yes
anrodon (Fri, 10 Mar 2017 12:05:06 GMT):
I can send you the logs if you want
rickr (Fri, 10 Mar 2017 12:07:48 GMT):
that's .6 version I'm pretty sure so you need to use that client at least
tenshun (Fri, 10 Mar 2017 13:08:33 GMT):
Has joined the channel.
anrodon (Fri, 10 Mar 2017 13:09:15 GMT):
okay thanks :D
anrodon (Fri, 10 Mar 2017 14:17:32 GMT):
anyone has a sample example of working with the 0.6 sdk and bluemix? Thanks
anrodon (Fri, 10 Mar 2017 14:17:47 GMT):
Also without google should be good too
anrodon (Fri, 10 Mar 2017 14:17:47 GMT):
Also without bluemix should be good too
JatinderBali (Fri, 10 Mar 2017 15:46:36 GMT):
Has joined the channel.
Willson (Fri, 10 Mar 2017 15:49:08 GMT):
@rickr How can i get back the chain that had deployed on the network after restart the SdkClient to invoke a transaction?
Willson (Fri, 10 Mar 2017 15:51:00 GMT):
I did't find the API
rickr (Fri, 10 Mar 2017 15:52:44 GMT):
WIP At the moment its not persisted you can have to reconstructed it.
Willson (Fri, 10 Mar 2017 15:59:21 GMT):
are you meanting that everytime i want to invoke a invoke method in the chaincode i must reconstructed the chain?
tuand (Fri, 10 Mar 2017 16:03:38 GMT):
no, only when you restart your client app that uses the SDK
rickr (Fri, 10 Mar 2017 16:05:33 GMT):
At the moment you do.
Willson (Fri, 10 Mar 2017 16:09:59 GMT):
It seems to produce error when i deployed a with the same name repeatedly
Willson (Fri, 10 Mar 2017 16:10:27 GMT):
It seems to produce error when i deployed a chain with the same name repeatedly
Willson (Fri, 10 Mar 2017 16:19:43 GMT):
and the data that in last chain will be lost after reconstructing the chain, is not it?
rickr (Fri, 10 Mar 2017 16:20:25 GMT):
not tested ... but try this...
```
private static Chain reconstructChain(String name, HFClient client) throws Exception {
//////////////////////////// TODo Needs to be made out of bounds and here chain just retrieved
//Construct the chain
//
Chain newChain = client.newChain(name);
int i = 0;
for (String peerloc : PEER_LOCATIONS) {
Peer peer = client.newPeer(peerloc);
newChain.addPeer(peer);
peer.setName("peer_" + i);
}
for (String orderloc : ORDERER_LOCATIONS) {
Orderer orderer = client.newOrderer(orderloc);
newChain.addOrderer(orderer);
}
for (String eventHubLoc : EVENTHUB_LOCATIONS) {
EventHub eventHub = client.newEventHub(eventHubLoc);
newChain.addEventHub(eventHub);
}
return newChain;
}```
Willson (Fri, 10 Mar 2017 16:36:11 GMT):
It does not working org.hyperledger.fabric.sdk.exception.ProposalException: sendInstallProposal on chain not initialized.
rickr (Fri, 10 Mar 2017 16:38:43 GMT):
what if before that newChain .. it does newChain.initialize();
Willson (Fri, 10 Mar 2017 16:48:17 GMT):
sorry, i can't understand what you are meaning
rickr (Fri, 10 Mar 2017 17:14:37 GMT):
```
newChain.initialize()
return newChain;
```
rickr (Fri, 10 Mar 2017 17:15:31 GMT):
BTW how'd you get up and running ?
rickr (Fri, 10 Mar 2017 17:58:32 GMT):
@jimthematrix @tuand
After looking at this some I'm wondering why the SDK is on the hook for saving user/userContexts The User should have been just an interface for the things the SDK needed. The application using the SDK should have implemented it and storing / retrieving/registering/enrolling should have been the responsibility of the application
rickr (Fri, 10 Mar 2017 18:19:35 GMT):
Another related thought is the use of GOPATH env var I don't think the SDK ought use that as a `hidden` source for the GO source. The source should always be specifically specified by the application it self. If it wants it can use the GOPATH env var as the source location it can . In light of supporting multiple _usercontexts_ (ie users ) what would GOPATH env var really mean ? I doubt that multiple users would be using the very same source location referred to by a single env var (GOPATH)
tuand (Fri, 10 Mar 2017 19:41:19 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=NxmPZ3CtBnRFGprrX) @rickr i see the User object as a container for the key/cert ... how the user is created/managed should be outside the sdk, especially given that there's no requirement to use fabric-ca
rickr (Fri, 10 Mar 2017 19:46:55 GMT):
Yeah I think I'm leaning to refactor it that way unless I see an issue or someone give me a strong enough argument against taking that approach
rickr (Fri, 10 Mar 2017 19:46:55 GMT):
Yeah I think I'm leaning to refactor it that way unless I see an issue or someone gives me a strong enough argument against taking that approach
Basug (Fri, 10 Mar 2017 20:23:57 GMT):
@rickr - any idea what this would mean `2017-03-10 15:23:06 ERROR Chain:1012 - Sending proposal to peer failed because of gRPC failure=Status{code=UNKNOWN, description=Block number should have been 1 but was 0, cause=null}`
Basug (Fri, 10 Mar 2017 20:24:08 GMT):
Running End2EndIT.java
Basug (Fri, 10 Mar 2017 20:24:48 GMT):
`org.hyperledger.fabric.sdk.exception.ProposalException: Join peer to chain foo failed. Status FAILURE, details: Sending proposal to peer failed because of gRPC failure=Status{code=UNKNOWN, description=Block number should have been 1 but was 0, cause=null}
`
rickr (Fri, 10 Mar 2017 20:27:50 GMT):
That's coming from the Fabric side we're just the _bearer_ of bad news. Best to ask on the fabric channel
Basug (Fri, 10 Mar 2017 20:28:13 GMT):
:-)
rickr (Fri, 10 Mar 2017 20:29:16 GMT):
That's at least where I'd start
Basug (Fri, 10 Mar 2017 20:50:38 GMT):
@rickr - I am able to make more progress.. This is the new one I am getting
Basug (Fri, 10 Mar 2017 20:51:32 GMT):
```Creating install proposal
Successful install proposal response Txid: e2eadf4380e9152faab0ae0e7019ca2fc1e57380bf737a168c5218d0fdeaac91
Successful install proposal response Txid: e2eadf4380e9152faab0ae0e7019ca2fc1e57380bf737a168c5218d0fdeaac91
Received 2 install proposal responses. Successful+verified: 2 . Failed: 0
Sending instantiateProposalRequest code with a and b set to 100 and 200 respectively
2017-03-10 15:49:28 ERROR Chain:1012 - Sending proposal to peer failed because of gRPC failure=Status{code=UNKNOWN, description=Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image
rickr (Fri, 10 Mar 2017 21:04:53 GMT):
Is this the End2endIT test out of the box ? no modifications ?
Basug (Fri, 10 Mar 2017 21:06:54 GMT):
yeah no modifications
Basug (Fri, 10 Mar 2017 21:07:05 GMT):
I am sure I am missing a step somewhere..
rickr (Fri, 10 Mar 2017 21:07:41 GMT):
Looks to me like something went wrong in building your fabric side
Basug (Fri, 10 Mar 2017 21:07:54 GMT):
ok, will take a look
tuand (Fri, 10 Mar 2017 21:14:48 GMT):
@basug, I ran into that `platform-specific docker build` not too long ago ... I rebuilt vagrant ( halt, destroy then up ) to clear it
Basug (Fri, 10 Mar 2017 23:24:01 GMT):
thanks @tuand
Basug (Fri, 10 Mar 2017 23:24:27 GMT):
is it possible to run SimpleSample.java or right now go is the only option ?
icordoba (Fri, 10 Mar 2017 23:41:25 GMT):
Hello, I am following https://github.com/hyperledger/fabric-sdk-java . I hace successfully made fabric-ca and fabric "docker" builds, and launched them with the docker-compose.yml as described but when I execute the tests I get Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/fe80:0:0:0:0:0:0:1%1:5151 error
icordoba (Fri, 10 Mar 2017 23:42:18 GMT):
I see that OrdererTest.java file points to port 5151. Should just change it to 7050 in the java source code or I am missing a docker that should listen to 5151 ?
rickr (Fri, 10 Mar 2017 23:44:57 GMT):
That test is checking out an error case id doesn't expect to see anything there
icordoba (Fri, 10 Mar 2017 23:45:58 GMT):
You mean there should be nothing listening to port 5151 and that OrdererTest is supposed to fail?
rickr (Fri, 10 Mar 2017 23:46:12 GMT):
y
rickr (Fri, 10 Mar 2017 23:47:09 GMT):
mvn clean
rickr (Fri, 10 Mar 2017 23:47:15 GMT):
mvn install
rickr (Fri, 10 Mar 2017 23:47:36 GMT):
do you see an BUILD SUCCESS ?
icordoba (Fri, 10 Mar 2017 23:47:47 GMT):
let me check...
Basug (Fri, 10 Mar 2017 23:48:53 GMT):
@rickr - are we at a stage where I can run Java Chaincode ? or only go chain code works ?
icordoba (Fri, 10 Mar 2017 23:48:58 GMT):
yes, I just see many test errors also so I though they were not meant to occur, like so many connection attempts to 5151 port.
icordoba (Fri, 10 Mar 2017 23:48:58 GMT):
@rickr yes, I just see many test errors also so I though they were not meant to occur, like so many connection attempts to 5151 port.
rickr (Fri, 10 Mar 2017 23:50:35 GMT):
At the moment I've not heard that Java chain code is running ..
rickr (Fri, 10 Mar 2017 23:52:32 GMT):
But you're asking on the wrong channel
Basug (Fri, 10 Mar 2017 23:52:43 GMT):
oh, which is the right one ?
Basug (Fri, 10 Mar 2017 23:52:49 GMT):
fabric ?
rickr (Fri, 10 Mar 2017 23:53:37 GMT):
fabric-java-chaincode When it gets fixed I'm sure it will be announced there
icordoba (Fri, 10 Mar 2017 23:55:06 GMT):
@rickr So this fabric-sdk-java can only be used to deploy GO chaincode in this versions 1.0 and v0.6.1 dockers are still needed to deploy java chaincode ? (hyperledger/fabric-peer:x86_64-0.6.1-preview and hyperledger/fabric-javaenv:x86_64-0.6.1-preview )
icordoba (Fri, 10 Mar 2017 23:55:36 GMT):
Oops, I'll ask there.
icordoba (Sat, 11 Mar 2017 00:00:30 GMT):
@rickr can this fabric-sdk-java client work with the 0.6.1 fabric (hyperledger/fabric-peer:x86_64-0.6.1-preview and hyperledger/fabric-peer:x86_64-0.6.1-preview) dockers via REST or GRPC or it only works with new 1.0 ones?
rickr (Sat, 11 Mar 2017 00:01:02 GMT):
Strictly V1.0
rickr (Sat, 11 Mar 2017 00:02:36 GMT):
master branch ofJava SDK is V1.0 and only works with Fabric V1.0 version
rickr (Sat, 11 Mar 2017 02:15:21 GMT):
@jimthematrix https://gerrit.hyperledger.org/r/#/c/6941/
icordoba (Sat, 11 Mar 2017 13:02:38 GMT):
Hello, I am trying to run the v0.6 tests of fabric-sdk-java with 0.61 version dockers and I've sorted out some problems. I am now getting this error:
icordoba (Sat, 11 Mar 2017 13:02:46 GMT):
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: sql: no rows in result set
icordoba (Sat, 11 Mar 2017 13:03:48 GMT):
As explained in the doc I delete the /var/hyperledger/production directory but I am not sure if I should delete anything else (the link in that doc is not working anymore
Willson (Sat, 11 Mar 2017 14:17:55 GMT):
Guys,I created a chain code configuration file integralchain.configtx via running the command that "./configtxgen -outputCreateChannelTx integralchain.configtx -profile SampleSingleMSPSolo -channelID integralchain".The chain was created successfully by running initialize() and the sendInstallProposal() return a successful respond.But when I invoke the method that sendInstantiationProposal(), it return an error like this:Sending proposal to peer failed because of gRPC failure=Status{code=UNKNOWN, description=Failed to deserialize creator identity, err MSP DEFAULT is unknown, cause=null}.What's wrong with this?
rickr (Sat, 11 Mar 2017 14:20:19 GMT):
Was the peer joined to the that new Channel ?
Willson (Sat, 11 Mar 2017 14:21:12 GMT):
Yeah ,
Willson (Sat, 11 Mar 2017 14:21:15 GMT):
public void constructChain() {
Chain chain = null;
try {
String[] orderArray = orders.split(",");
String[] peerArray = peers.split(",");
String[] eventhubArray = eventhubs.split(",");
ChainConfiguration chainConfiguration = new ChainConfiguration(new File("src/main/resources/" + chainName + ".configtx"));
chain = client.newChain(chainName, client.newOrderer(orderArray[0]), chainConfiguration);
for (String orderLocation : orderArray) {
Orderer orderer = client.newOrderer(orderLocation);
chain.addOrderer(orderer);
}
for (String eventhubLocation : eventhubArray) {
EventHub eventHub = client.newEventHub(eventhubLocation);
chain.addEventHub(eventHub);
}
int i = 0;
for (String peerLocation : peerArray) {
Peer peer = client.newPeer(peerLocation);
peer.setName("peer_" + i);
chain.addPeer(peer);
i++;
}
chain.setInvokeWaitTime(invokeWAitTime);
chain.setDeployWaitTime(deployWAitTime);
chain.initialize();
Collection
rickr (Sat, 11 Mar 2017 14:22:49 GMT):
no doesn't look to me like it was joined
Willson (Sat, 11 Mar 2017 14:23:36 GMT):
And i have modifed the configrx.yaml like this :
AnchorPeers:
# AnchorPeers defines the location of peers which can be used
# for cross org gossip communication. Note, this value is only
# encoded in the genesis block in the Application section context.
- Host: vp0
Port: 7051
- Host: vp1
Port: 7051
Addresses:
- orderer:7050
Willson (Sat, 11 Mar 2017 14:24:33 GMT):
What should i do?
rickr (Sat, 11 Mar 2017 14:24:56 GMT):
join the peer instead of adding it
Willson (Sat, 11 Mar 2017 14:28:35 GMT):
Can you elaborate on it? I can't get the sample in the sdk.Thank you!
rickr (Sat, 11 Mar 2017 14:30:50 GMT):
~chain.addPeer(peer);~
chain.joinPeer(peer);
rickr (Sat, 11 Mar 2017 14:31:09 GMT):
why can't you get the sample ?
Willson (Sat, 11 Mar 2017 14:33:49 GMT):
I was careless, sorry!:cold_sweat:
anrodon (Sat, 11 Mar 2017 20:37:55 GMT):
Hey guys
anrodon (Sat, 11 Mar 2017 20:38:04 GMT):
I'm using the 0.6 SDK
anrodon (Sat, 11 Mar 2017 20:38:09 GMT):
with this code
anrodon (Sat, 11 Mar 2017 20:38:19 GMT):
````
public static void main(String[] args) throws CertificateException, EnrollmentException {
chain = new Chain(chainId);
chain.setMemberServicesUrl(memberServicesUrl, null);
chain.setKeyValStore(new FileKeyValStore(System.getProperty("user.home")+"/test.properties"));
chain.addPeer(peerUrl, null);
Member member = chain.getMember(userId);
if (!member.isEnrolled()) {
member = chain.enroll(userId, userPsswd);
}
System.out.println(member);
}
`````
anrodon (Sat, 11 Mar 2017 20:39:04 GMT):
What happens is that when it tries to enroll the user, the program hangs in this state:
Mar 11, 2017 9:33:36 PM io.grpc.internal.TransportSet$1 call
INFO: Created transport io.grpc.netty.NettyClientTransport@285c08c8(378348750a38463d9fe6980153f24650-ca.us.blockchain.ibm.com/169.47.55.104:30002) for 378348750a38463d9fe6980153f24650-ca.us.blockchain.ibm.com/169.47.55.104:30002
Mar 11, 2017 9:33:37 PM io.grpc.internal.TransportSet$TransportListener transportShutdown
INFO: Transport io.grpc.netty.NettyClientTransport@285c08c8(378348750a38463d9fe6980153f24650-ca.us.blockchain.ibm.com/169.47.55.104:30002) for 378348750a38463d9fe6980153f24650-ca.us.blockchain.ibm.com/169.47.55.104:30002 is being shutdown
anrodon (Sat, 11 Mar 2017 20:42:16 GMT):
Anyone here knows what could be happening?
anrodon (Sat, 11 Mar 2017 20:43:06 GMT):
I don't know if it helps, but the program was telling, ALPN is not well configured and I solved it including jettty-alpn-boot as a classpath
rickr (Sun, 12 Mar 2017 00:01:43 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=q78KabffbCCsYcSh2) @Willson So I finally got to trying the SDK on Window's (7) and everything ran OK. You never did tell me how you got around the issues you were seeing.
JasonD (Sun, 12 Mar 2017 06:14:10 GMT):
Has joined the channel.
Willson (Sun, 12 Mar 2017 07:06:27 GMT):
Yeah, when i reinstall me os, everything is ok. Maybe there are some wrong settings in my system.
Willson (Sun, 12 Mar 2017 07:06:48 GMT):
Yeah, when i reinstall my os, everything is ok. Maybe there are some wrong settings in my system.
Willson (Sun, 12 Mar 2017 13:34:20 GMT):
@rickr Hello guy, after operating newChain.addEventHub(eventHub); , how can we listen the blockevent and recieve the block data from the channel?
tuand (Sun, 12 Mar 2017 13:42:16 GMT):
@willson check in Chain.java for how `registerBlockListener` and `registerTransactionListerner` are used
Willson (Sun, 12 Mar 2017 13:46:29 GMT):
ok thanks
Willson (Sun, 12 Mar 2017 14:00:44 GMT):
@tuand I am sorry? There is no a method named registerTransactionListerner or registerTransactionListerner in the Chain.java even in the sdk.Has not yet been submitted to github?
Willson (Sun, 12 Mar 2017 14:08:19 GMT):
oh sorry, I get them.thanks
rickr (Sun, 12 Mar 2017 18:37:09 GMT):
@jimthematrix @tuand @Pardha @malik-altaf @satheeshk Let me first state I'm not one for creating Java Interface just for the sake of Interfaces :) However, the more I think about it the more I feel the SDK public facing classes should be all Interfaces :( Keep clean what classes we expect users to use in the SDK and those not to use and produce a clean Javadoc of just those interfaces. Thoughts ?
anrodon (Mon, 13 Mar 2017 08:45:15 GMT):
how do I specify the client-config for the ca?
o.o. (Mon, 13 Mar 2017 09:49:13 GMT):
Has joined the channel.
Basug (Mon, 13 Mar 2017 11:13:09 GMT):
Getting this error with 0.6 , what could be causing this ?
Basug (Mon, 13 Mar 2017 11:13:12 GMT):
```java.lang.IllegalStateException: Cannot put state in query context
at org.hyperledger.java.shim.Handler.handlePutState(Handler.java:541)
at org.hyperledger.java.shim.ChaincodeStub.putState(ChaincodeStub.java:69)
Basug (Mon, 13 Mar 2017 12:03:22 GMT):
nm - got it working
rickr (Mon, 13 Mar 2017 12:04:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=fvLRB6J3G3QL3vWNm) v1.0? Certificate authority ?
tuand (Mon, 13 Mar 2017 13:13:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=K4TZ2dPmoaWvKNujq) @rickr on first thought, I'd say we have the "possible multiple implementations" objects like user, crypto, CA and the fabric specific objects like channel, block, envelope, event. What's your scenario ?
dorrakhribi (Mon, 13 Mar 2017 13:14:32 GMT):
Has joined the channel.
rickr (Mon, 13 Mar 2017 13:23:45 GMT):
Scenario is providing user's only the Interfaces we expect them use with only the methods they should invoke. This can then produce clean Javadoc something we should be providing. It allows the implementation more freedom in organizing the code in different packages. Most of the classes that need to be interfaces for the embedding application will be addressed in FAB-1204
rickr (Mon, 13 Mar 2017 13:29:24 GMT):
FYI I went through the existing open JIRAs and marked those _I think_ with are *must haves* as highest priority. *run ats* as higher anything else is _icing on the cake_
rickr (Mon, 13 Mar 2017 13:29:24 GMT):
FYI I went through the existing open JIRAs and marked those _I think_ are *must haves* as highest priority. *run ats* as higher anything else is _icing on the cake_
rickr (Mon, 13 Mar 2017 13:29:24 GMT):
FYI I went through the existing open JIRAs and marked those _I think_ are *must haves* as highest priority. *run ats* as higher anything else is _icing on the cake_ for V1
harsha (Mon, 13 Mar 2017 14:13:18 GMT):
Has joined the channel.
eric.wall (Mon, 13 Mar 2017 14:42:25 GMT):
Has joined the channel.
tsnyder (Mon, 13 Mar 2017 15:38:03 GMT):
Eventing Question - If a client goes down for awhile, when it comes back up what is the process for resync'ing the interim missing Block Events? Does the client need to track the last Block Event that it has processed? For each channel? Do the interim Block Events need to be requested or are they auto (magically) sent? How does the Peer's Event Hub differentiate Block Events across multiple channels / Ledgers? Is there a way for the Client to send in - this is the last Block Event I received and for the Peer to start sending all Block Events across all channels in time order irrespective of channel? I am trying to determine the recovery process for a Client application.
rickr (Mon, 13 Mar 2017 15:48:46 GMT):
I think there's one answer for most of the above.. There are no plans for the SDK to preserve any state (aka persistence). .The event hub listener only provides events for that chain. We don't plan on having a "starting" point for the Blocklistener. We would have to hold off all the block events coming in till the ones the application consumed that it wanted from previously. I don't see the SDK doing this.
rickr (Mon, 13 Mar 2017 15:58:33 GMT):
We don't have a query to get block ranges ... but that might be a reasonable request.
tsnyder (Mon, 13 Mar 2017 17:14:23 GMT):
@rickr - Thanks for the response. So via the SDK we need to register to a peer for every channel we want to receive the Block Events on - correct? And this is a separate listener instance, presumably, or could it be the same instance across channels? (Probably not important but options are good things.) The key is that the client itself that the SDK is part of needs to keep track of the last Block Event that it has processed for each channel it is authorized to. On restart after being down, it needs to be able to query the Block Events for each of the channels up to the point that it becomes current. It could then register a listener with each channel to start receiving them automatically from that point on. Is this how you would envision it working?
rickr (Mon, 13 Mar 2017 17:39:10 GMT):
Right now it's a instance per channel. Yes about the restart. I would assume, in any production environment you would really want to keep that state of where you're at in the blockchain in a database or process the blocs themselves in a consumer producer via MQ or Kafka if you really wanted that type of reliability.. @jimthematrix did something really interesting work based on V.6 that is close to what I think you asking about. Feel free to take a look :)
https://github.com/jimthematrix/blockchain-features
rickr (Mon, 13 Mar 2017 18:11:55 GMT):
@tsnyder I got to thinking that starting off the EH from a specific starting point might be an easier task for the Fabric side to handle as an option the SDK would just pass them (_how's that for just passing the buck!_ :) ). Talking to those developers it didn't seem out of the realm of possibilities. I suggest you open a JIRA for an improvement for them to evaluate.
tsnyder (Mon, 13 Mar 2017 20:25:35 GMT):
Added JIRA 2770
wisam.mohammed (Mon, 13 Mar 2017 21:01:22 GMT):
Has joined the channel.
Basug (Mon, 13 Mar 2017 22:17:33 GMT):
with 0.6 can I listen to transaction events ?
Basug (Mon, 13 Mar 2017 22:17:40 GMT):
in Java
Basug (Mon, 13 Mar 2017 22:19:22 GMT):
I see EventHub in 0.6 branch as well, I guess it works ?
kletkeman (Mon, 13 Mar 2017 22:25:38 GMT):
@basug Event listening in Go works perfectly. So if the Java SDK is able to connect, you will get events.
zhoupeiwen (Tue, 14 Mar 2017 02:06:33 GMT):
hi , I just run the testing java sdk 1.0 End2endIT, fabric and ca is installed in another machine, got the exception "org.hyperledger.fabric.sdk.exception.TransactionException: New chain foo error. StatusValue 400. Status BAD_REQUEST", anything I missed?
Willson (Tue, 14 Mar 2017 02:31:33 GMT):
Maybe you did not reset the commitlevel of fabric and fabtic-ca
yoheiueda (Tue, 14 Mar 2017 07:47:54 GMT):
Has joined the channel.
ruslan.kryukov (Tue, 14 Mar 2017 08:42:07 GMT):
```
public String getMSPID() {
return "DEFAULT"; //TODO what will this be ?
}
```
ruslan.kryukov (Tue, 14 Mar 2017 08:43:35 GMT):
Is there task for this problem?
sachikoy (Tue, 14 Mar 2017 10:21:39 GMT):
Has joined the channel.
rickr (Tue, 14 Mar 2017 11:00:34 GMT):
Addressed in this pending cs https://gerrit.hyperledger.org/r/#/c/6797/
zerppen (Tue, 14 Mar 2017 13:34:39 GMT):
Hi, rickr @rickr go-chaincode can get all table information using GetRows when parameter key is nil,while java-chaincode method getRows in ChaincodeStub.java from branch v0.6 can't deal with the Null parameter key but get NullPointException
rickr (Tue, 14 Mar 2017 13:35:46 GMT):
I'm not working on .6
zerppen (Tue, 14 Mar 2017 13:35:51 GMT):
And I have changed the method getRows like go-chaincode v0.6
zerppen (Tue, 14 Mar 2017 13:36:29 GMT):
I wanner push this but I can't get a way
zerppen (Tue, 14 Mar 2017 13:40:16 GMT):
ok..
zerppen (Tue, 14 Mar 2017 13:42:39 GMT):
I commited it then pushed but got error"error: failed to push some refs to 'ssh://zerppen@gerrit.hyperledger.org:29418/fabric-sdk-java"
zerppen (Tue, 14 Mar 2017 13:43:00 GMT):
Could u do me a favor? @rickr
rickr (Tue, 14 Mar 2017 13:43:45 GMT):
for .6 get in contact with @satheeshk
zerppen (Tue, 14 Mar 2017 13:44:43 GMT):
ok,thanks
moriohara (Tue, 14 Mar 2017 14:45:08 GMT):
Has joined the channel.
moriohara (Tue, 14 Mar 2017 15:00:45 GMT):
1732
lignyxg (Tue, 14 Mar 2017 17:26:24 GMT):
Has joined the channel.
ManjeetGambhir (Wed, 15 Mar 2017 02:30:08 GMT):
2017-03-14 22:17:51 ERROR Chain:1012 - Sending proposal to peer failed because of gRPC failure=Status{code=UNKNOWN, description=failed to obtain cds for publiccc - transaction not found publiccc/bar, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: failed to obtain cds for publiccc - transaction not found publiccc/bar
Any idea about this error ?
I am trying to create separate program for creating chain -- got success
install and instantiate after loading chain ---got success ..can see container for publiccc
but when I trying to invoke transaction getting above error ..any idea
rickr (Wed, 15 Mar 2017 02:32:07 GMT):
Are you running more than one Peer ?
ManjeetGambhir (Wed, 15 Mar 2017 02:32:59 GMT):
Yes
ManjeetGambhir (Wed, 15 Mar 2017 02:33:03 GMT):
Two peer
ManjeetGambhir (Wed, 15 Mar 2017 02:34:54 GMT):
If I create chain and install and instantiate in one step ,theninvoke transaction works
rickr (Wed, 15 Mar 2017 02:35:06 GMT):
For now try this _work around_ put a 5 second sleep before you send the invoke proposal
ManjeetGambhir (Wed, 15 Mar 2017 02:35:15 GMT):
ok
ManjeetGambhir (Wed, 15 Mar 2017 02:35:24 GMT):
let me try
ManjeetGambhir (Wed, 15 Mar 2017 02:40:21 GMT):
no luck ..
rickr (Wed, 15 Mar 2017 02:41:28 GMT):
does it succeed on one peer but fails on the other ?
rickr (Wed, 15 Mar 2017 02:42:23 GMT):
are you waiting for the instantiate transaction to complete ?
ManjeetGambhir (Wed, 15 Mar 2017 02:44:56 GMT):
Yes
ManjeetGambhir (Wed, 15 Mar 2017 02:45:11 GMT):
I can see docker container for publiccc
ManjeetGambhir (Wed, 15 Mar 2017 02:45:17 GMT):
running
rickr (Wed, 15 Mar 2017 02:45:39 GMT):
can you try for now with one peer ?
ManjeetGambhir (Wed, 15 Mar 2017 02:46:09 GMT):
I removed one peer and try same result
ManjeetGambhir (Wed, 15 Mar 2017 02:46:12 GMT):
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4699ba73ec9a dev-vp0-publiccc-1.0 "chaincode -peer.a..." 7 minutes ago Up 7 minutes dev-vp0-publiccc-1.0
23d624451cdb dev-vp1-publiccc-1.0 "chaincode -peer.a..." 7 minutes ago Up 7 minutes dev-vp1-publiccc-1.0
a
ManjeetGambhir (Wed, 15 Mar 2017 02:47:32 GMT):
no luck
ManjeetGambhir (Wed, 15 Mar 2017 02:48:03 GMT):
do you want me do above process with one peer
rickr (Wed, 15 Mar 2017 02:48:04 GMT):
if you're run with one peer and the eventhub is to that same peer can you see if it reproduces ?
rickr (Wed, 15 Mar 2017 02:48:11 GMT):
yes
rickr (Wed, 15 Mar 2017 02:50:36 GMT):
have to go now tell me if it helped any
ManjeetGambhir (Wed, 15 Mar 2017 02:52:11 GMT):
Not worked same erorr ..tried with single peer
ManjeetGambhir (Wed, 15 Mar 2017 02:52:56 GMT):
nothing got changed ..same error coming if I load chain and call invoke
rickr (Wed, 15 Mar 2017 02:55:19 GMT):
@muralisr ^^^ Error seems to be not just isolated to multiple peers
ManjeetGambhir (Wed, 15 Mar 2017 02:56:36 GMT):
murali will suggest ?
muralisr (Wed, 15 Mar 2017 03:11:09 GMT):
@ManjeetGambhir do you have the peer logs ?
ManjeetGambhir (Wed, 15 Mar 2017 03:13:43 GMT):
I have to rerun scenario..let me do it
ManjeetGambhir (Wed, 15 Mar 2017 03:22:34 GMT):
Message Attachments
ManjeetGambhir (Wed, 15 Mar 2017 03:22:54 GMT):
@muralisr uploaded logs
muralisr (Wed, 15 Mar 2017 03:32:46 GMT):
@ManjeetGambhir I don't see publiccc but see some other activity
muralisr (Wed, 15 Mar 2017 03:32:57 GMT):
are you sure this is the right log ?
ManjeetGambhir (Wed, 15 Mar 2017 03:33:27 GMT):
Yes ..lets do it tomm..
muralisr (Wed, 15 Mar 2017 03:33:43 GMT):
let me make sure I was looking at the right download...
muralisr (Wed, 15 Mar 2017 03:34:53 GMT):
never mind, my mistake... I was looking at the wrong file
muralisr (Wed, 15 Mar 2017 03:39:46 GMT):
I see the chaincode was successfully started and instantiated
muralisr (Wed, 15 Mar 2017 03:40:02 GMT):
however, I don't see a Commit message
muralisr (Wed, 15 Mar 2017 03:40:55 GMT):
which basically says the transaction flow did not complete post endorsement
muralisr (Wed, 15 Mar 2017 03:41:06 GMT):
do you have orderer logs ?
ManjeetGambhir (Wed, 15 Mar 2017 03:55:24 GMT):
@muralisr I will rerun this scenario tomm and provide you orderer details
muralisr (Wed, 15 Mar 2017 03:55:47 GMT):
sure, I was going to suggest we take this up tomorrow too
muralisr (Wed, 15 Mar 2017 03:56:35 GMT):
please use ORDERER_GENERAL_LOGLEVEL=debug flag to capture debug on orderer
Xie.YZ (Wed, 15 Mar 2017 08:13:43 GMT):
Has joined the channel.
ruslan.kryukov (Wed, 15 Mar 2017 08:44:13 GMT):
When I run sdk with only invoke function, I have error: Bad last configuation block type 3, expected 1
ruslan.kryukov (Wed, 15 Mar 2017 08:44:43 GMT):
I send invoke to own channel (not testchainid) and this channel exists
ruslan.kryukov (Wed, 15 Mar 2017 08:45:05 GMT):
also chaincode exists too
ruslan.kryukov (Wed, 15 Mar 2017 08:45:50 GMT):
but if I start with all lifecycle functions (install, instantiate, invoke), all works good
karumbas (Wed, 15 Mar 2017 11:49:19 GMT):
Has joined the channel.
rickr (Wed, 15 Mar 2017 12:03:38 GMT):
ok will have to try that
balashevich (Wed, 15 Mar 2017 12:34:17 GMT):
Has joined the channel.
rickr (Wed, 15 Mar 2017 12:40:12 GMT):
FYI Last night changes were submitted that will most likely break any existing code based on the SDK. To summarize: Certificate authority and Block chain /code management functionality have been separated more cleanly into two separate clients. HFCAClient to handle certificate authority and HFClient to manage channels and chain code. The only linkage between them at the moment is a certificate authority needs to implement the HFClient's Enrollment interface. The next change is the HFClient User is now an interface instead of a class. Most embedding application have some concept of a user already and forcing them to use the SDK's User class seemed too tightly coupled. An interface allows for more easily integration in other persistence technologies like JDO and reuse of existing application classes by just implementing the SDK User's interface. Lastly the SDK no longer use's the GOPATH environment variable for finding GO application source. In a multiuser context this does not seem realistic and not something the SDK should force on the embedding application. The embedding application is free to implement by setting the setChaincodeSourceLocation on InstallProposalRequest to the GOPATH environment variable.
The update also now allows a user with an admin role to register and enroll additional users to use the SDK.
The End2endIT.java sample has been refactored to show how this all can work together.
kleman (Wed, 15 Mar 2017 16:53:30 GMT):
:thumbsup:
tuand (Wed, 15 Mar 2017 17:04:47 GMT):
all ... https://gerrit.hyperledger.org/r/#/c/7027/ is now merged into the V1.0 master branch ... this change set add methods to Chain to invoke the Query System Chain Code , i.e queryBlockChainInfo, queryBlockByHash/Number, queryTxByID
Xie.YZ (Thu, 16 Mar 2017 07:10:43 GMT):
@tuand chinese?
ruslan.kryukov (Thu, 16 Mar 2017 10:11:12 GMT):
What if multiple users want to work with HFClient?
ruslan.kryukov (Thu, 16 Mar 2017 10:11:29 GMT):
We need to create multiple instances too?
ruslan.kryukov (Thu, 16 Mar 2017 10:12:53 GMT):
because there is no another way due to HFCClient has only one user context:
```
/**
* Set the User context for this client.
*
* @param userContext
*/
public void setUserContext(User userContext) throws InvalidArgumentException
```
ruslan.kryukov (Thu, 16 Mar 2017 10:12:53 GMT):
because there is no another way due to HFClient has only one user context:
```
/**
* Set the User context for this client.
*
* @param userContext
*/
public void setUserContext(User userContext) throws InvalidArgumentException
```
ruslan.kryukov (Thu, 16 Mar 2017 10:14:31 GMT):
it's not suitable for using sdk by this way because HFC client is heavy (in my opinion)
ruslan.kryukov (Thu, 16 Mar 2017 10:14:31 GMT):
it's not suitable for using sdk by this way because HFClient is heavy (in my opinion)
bh4rtp (Thu, 16 Mar 2017 10:18:00 GMT):
Has joined the channel.
ruslan.kryukov (Thu, 16 Mar 2017 10:20:44 GMT):
I was noticed that we get userContext when construct TransactionContext in install/instantiate/send methods. What if we just pass userContext in this methods instead of storing user in HFClient?
ruslan.kryukov (Thu, 16 Mar 2017 10:20:44 GMT):
I'm noticed that we get userContext when construct TransactionContext in install/instantiate/send methods. What if we just pass userContext in this methods instead of storing user in HFClient?
ruslan.kryukov (Thu, 16 Mar 2017 10:20:44 GMT):
I'm noticed that we get userContext when construct TransactionContext in install/instantiate/send methods. What if we just pass userContext in Request-object to this methods instead of storing user in HFClient?
ruslan.kryukov (Thu, 16 Mar 2017 10:20:58 GMT):
for example
ruslan.kryukov (Thu, 16 Mar 2017 10:22:52 GMT):
We can place UserContext in TransactionRequest, InstantiateProposalRequest, InstallProposalRequest
ruslan.kryukov (Thu, 16 Mar 2017 10:23:16 GMT):
and when we create requests to fabric, we assign user to request
ruslan.kryukov (Thu, 16 Mar 2017 10:24:32 GMT):
But then there's the problem where we need to store userContext between requests
ruslan.kryukov (Thu, 16 Mar 2017 10:25:09 GMT):
I see that we have org.hyperledger.fabric.sdkintegration.SampleStore class
ruslan.kryukov (Thu, 16 Mar 2017 10:25:29 GMT):
this class represents key value store for members
ruslan.kryukov (Thu, 16 Mar 2017 10:26:31 GMT):
we can use it for store users between requests and fetch target user by name when we need to send request to fabric
ruslan.kryukov (Thu, 16 Mar 2017 10:30:34 GMT):
for example we have:
`InstallProposalRequest installProposalRequest = client.newInstallProposalRequest();`
it can be changed to:
`InstallProposalRequest installProposalRequest = client.newInstallProposalRequest(userContext);'
ruslan.kryukov (Thu, 16 Mar 2017 10:30:34 GMT):
for example we have:
`InstallProposalRequest installProposalRequest = client.newInstallProposalRequest();`
it can be changed to:
`InstallProposalRequest installProposalRequest = client.newInstallProposalRequest(userContext);`
ruslan.kryukov (Thu, 16 Mar 2017 10:30:52 GMT):
and so on
rickr (Thu, 16 Mar 2017 11:29:11 GMT):
We plan to allow switching users in the userContext but that's not there right now. Probably many cases where work is done in the context of a single user. If there just a few they can create an client instance for each.
anrodon (Thu, 16 Mar 2017 12:29:02 GMT):
Hey guys
which is the best way to ask for old states of a chaincode?
I want to build a ui where see all the logs and states from every object
tuand (Thu, 16 Mar 2017 12:45:11 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=oDA6mcM3cLzrzBaCe) @Xie.YZ vietnamese :)
karumbas (Thu, 16 Mar 2017 13:09:05 GMT):
Hi everyone... I am running the End2endIT test but getting the following error
karumbas (Thu, 16 Mar 2017 13:09:06 GMT):
Failed tests:
End2endIT.setup:175 New chain foo error. StatusValue 404. Status NOT_FOUND
karumbas (Thu, 16 Mar 2017 13:09:26 GMT):
Tests run: 2, Failures: 1, Errors: 0, Skipped: 1
karumbas (Thu, 16 Mar 2017 13:09:56 GMT):
What am I doing wrong?
pschnap (Thu, 16 Mar 2017 13:17:05 GMT):
I've been asked to do a code review on https://gerrit.hyperledger.org/r/#/c/7249/ and am in a quandary: the "name" parameter has been switched to "grpcUrl", which is a URL as I'd thought it should be, but the naming used in the class is inconsistent now: "url" vs "grpcUrl". Should I request they change it to just "url" to be consistent with the rest of the class?
rickr (Thu, 16 Mar 2017 13:21:45 GMT):
I'm looking at it now .. This method should not be exposed .. and won't be. It should have the public removed. I can accept the change but it's not something as an enduser should be exposed to.
rickr (Thu, 16 Mar 2017 13:23:05 GMT):
BTW you need to add reviewers to your submitted patches
rickr (Thu, 16 Mar 2017 13:24:29 GMT):
Type the Add then the letter c ... you see a sdk java group
rickr (Thu, 16 Mar 2017 13:24:29 GMT):
By Reviewers click Add.. then the letter c ... you see a sdk java group
pschnap (Thu, 16 Mar 2017 13:30:19 GMT):
Thanks rickr, I added the group. This is the first time I've submitted a bug to an OSS project so I'm not familiar w/ the workflow
rickr (Thu, 16 Mar 2017 13:30:44 GMT):
np -- thx for helping out
rickr (Thu, 16 Mar 2017 13:31:24 GMT):
I've commented on your change address and I'll submitt
pschnap (Thu, 16 Mar 2017 13:31:25 GMT):
(I also removed myself as a reviewer)
pschnap (Thu, 16 Mar 2017 13:36:14 GMT):
(I only submitted the bug, not the patch; Cong Honglei will have to change it I guess)
pschnap (Thu, 16 Mar 2017 13:36:38 GMT):
Thanks again, rickr !
andrea.turli (Thu, 16 Mar 2017 13:53:41 GMT):
Has joined the channel.
andrea.turli (Thu, 16 Mar 2017 13:57:25 GMT):
hi @here, thanks for the java-sdk, I found it today and I'm trying to use starting from `End2endIT`
I'd like to replace this `mockUserContext` https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L124 with something real, where should I get it from membershipService maybe? thanks!
andrea.turli (Thu, 16 Mar 2017 13:57:25 GMT):
hi @here, thanks for the java-sdk, I found it today and I'm trying to use it starting from `End2endIT`
I'd like to replace this `mockUserContext` https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L124 with something real, where should I get it from membershipService maybe? thanks!
rickr (Thu, 16 Mar 2017 14:07:51 GMT):
The User is an interface you can create any User class you like as long as it implements that interface
andrea.turli (Thu, 16 Mar 2017 14:14:11 GMT):
thank @rickr shoudn't a user be memeber of the mernershipService?
tuand (Thu, 16 Mar 2017 14:24:38 GMT):
no , membership services give you a certificate signed by the correct CA, it does not keep track of users. You can implement users however you like as long as it follows the User interface
andrea.turli (Thu, 16 Mar 2017 14:29:09 GMT):
thanks @tuand that makes sense. so starting from this class https://github.com/hyperledger/fabric-sdk-java/blob/2d5629cca2dba95274ab70dba34e9d86e1092e0e/src/test/java/org/hyperledger/fabric/sdk/TestHFClient.java#L36-L36 which are the relevant bit I need to set on the HFClient to target my environment?
andrea.turli (Thu, 16 Mar 2017 14:47:34 GMT):
@rickr and @tuand I'd appreciate a simple example on how to configure a real world HFClient, if you can, thanks!
rickr (Thu, 16 Mar 2017 14:49:02 GMT):
Implement the User interface in your application follow the End2endIT example
andrea.turli (Thu, 16 Mar 2017 14:52:44 GMT):
and for https://github.com/hyperledger/fabric-sdk-java/blob/f101e665dfc7478b9ea965389c630e25b0491c88/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L117-L117, do I need that?
cshields (Thu, 16 Mar 2017 15:07:17 GMT):
Has joined the channel.
rickr (Thu, 16 Mar 2017 15:07:37 GMT):
For now yes. This may change it the future .. The only need for registering a CA with the SDK is to provide optionally Tcerts. and the interface would most likely be different . Just growing pains :)
tuand (Thu, 16 Mar 2017 15:08:28 GMT):
you do ... you start fresh everytime you run end2endit so you need to register and enroll users
andrea.turli (Thu, 16 Mar 2017 15:09:24 GMT):
ok I wll try to understand better why it is failing for me, do you have a simple sequence of this call that needs to happen to have an HFClient properly configured?
andrea.turli (Thu, 16 Mar 2017 15:11:30 GMT):
for example `HFCAClient` deals with `http/s` but my `membershipServicesUrl` looks like `grpc://localhost:7054`
andrea.turli (Thu, 16 Mar 2017 15:12:07 GMT):
do you have another impl for grpc ?
o.o. (Thu, 16 Mar 2017 15:18:19 GMT):
If I understand correctly the responses we get when running an invoke from the java client come from the endorsers.
The committing peers may then still mark the transactions as invalid later on (say if the read/write-sets collide).
Is there some event or response that would tell us whether the transaction were accepted by committers or not?
What function can we use to check this otherwise?
rickr (Thu, 16 Mar 2017 15:21:30 GMT):
If the transaction is marked bad the future will not complete successfully .. It will falling into the
```
}).exceptionally(e -> {
System.err.println("Bad status value for proposals transaction: " + e.getMessage());
if (e instanceof TransactionEventException) {
BlockEvent.TransactionEvent te = ((TransactionEventException) e).getTransactionEvent();
if (te != null) {
fail(format("Transaction with txid %s failed. %s", te.getTransactionID(), e.getMessage()));
}
}
fail(format("Transaction failed %s", e.getMessage()));
return null;```
tuand (Thu, 16 Mar 2017 15:26:40 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=x7vesn8xqyHSHToJJ) @andrea.turli are you running with Fabric v0.6 ? we're all working on v1.0, no guarantees if you run with v0.6
andrea.turli (Thu, 16 Mar 2017 15:27:55 GMT):
yes running on v0.6 at the moment, I understand there are no guarantees - any ideas on https://chat.hyperledger.org/channel/fabric-sdk-java?msg=x7vesn8xqyHSHToJJ ?
andrea.turli (Thu, 16 Mar 2017 15:28:32 GMT):
or you are telling me that v1.0 will not support grpc ?
tuand (Thu, 16 Mar 2017 15:30:04 GMT):
fabric-ca ( the replacement for memberservices ) uses a rest api. comms between sdk/peer/orderer use grpc
andrea.turli (Thu, 16 Mar 2017 15:31:14 GMT):
got it @tuand I've still a lot to learn + so many moving parts :D
tuand (Thu, 16 Mar 2017 15:31:33 GMT):
also, fabric-ca is now decentralized ... there is one fabric-ca per organization participating in the blockchain
andrea.turli (Thu, 16 Mar 2017 15:32:17 GMT):
ok so maybe I should re-start from https://github.com/hyperledger/fabric-sdk-java#working-with-the-fabric-vagrant-environment
andrea.turli (Thu, 16 Mar 2017 15:32:31 GMT):
and create a v1.0 env, would that help @tuand ?
rickr (Thu, 16 Mar 2017 15:33:07 GMT):
Please follow the README.md
tuand (Thu, 16 Mar 2017 15:33:17 GMT):
also https://wiki.hyperledger.org/community/fabric-design-docs
andrea.turli (Thu, 16 Mar 2017 15:34:59 GMT):
thanks @rickr and @tuand much appreciated!
o.o. (Thu, 16 Mar 2017 15:36:37 GMT):
Ok, so the future needs the transaction to be completely accepted. Nice!
Thanks rickr!
samdeir (Thu, 16 Mar 2017 16:49:08 GMT):
Has joined the channel.
dejan.milosavljevic (Thu, 16 Mar 2017 19:26:02 GMT):
Has joined the channel.
bh4rtp (Fri, 17 Mar 2017 02:11:38 GMT):
@rickr hi, i have already read java sdk. it seems to be developing as source codes are not formatted yet. would you please tell me which files implement gRPC? i only see the proto definition files.
Willson (Fri, 17 Mar 2017 03:34:08 GMT):
Hello guys,there is an error when i reconstruct the Chain like this:org.hyperledger.fabric.sdk.exception.TransactionException: Bad last configuation block type 3, expected 1
anybody can tell me why?thank you
RahulBagaria (Fri, 17 Mar 2017 04:00:24 GMT):
Has joined the channel.
zhoupeiwen (Fri, 17 Mar 2017 09:11:19 GMT):
@Willson I just met the same problem, I think it's because every time you call the chain.initialize, the sdk will get the config block first ,but the code get the latest block not the latest config block ,this raise the exception.
Willson (Fri, 17 Mar 2017 09:41:10 GMT):
@zhoupeiwen oh,thanks
andrea.turli (Fri, 17 Mar 2017 12:24:26 GMT):
hi @here I'm following the README to install Fabric Vagrant Environment
```
Step 14/15 : RUN core/chaincode/shim/java/javabuild.sh
---> Running in 8ba6461bbb15
FAILURE: Build failed with an exception.
* Where:
Build file '/root/core/chaincode/shim/java/build.gradle' line: 30
* What went wrong:
Error resolving plugin [id: 'com.google.protobuf', version: '0.8.0']
> Could not GET 'https://plugins.gradle.org/api/gradle/2.12/plugin/use/com.google.protobuf/0.8.0'.
> Connect to 10.0.2.2:443 [/10.0.2.2] failed: Connection refused (Connection refused)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
The command '/bin/sh -c core/chaincode/shim/java/javabuild.sh' returned a non-zero code: 1
```
when:
```
ssh into vagrant,
go to $GOPATH/src/github.com/hyperledger/fabric
run make docker to create the docker images for peer and orderer
```
andrea.turli (Fri, 17 Mar 2017 12:24:34 GMT):
any idea?
greg.haskins (Fri, 17 Mar 2017 12:26:00 GMT):
@andrea.turli you seem to have connectivity problems to https://plugins.gradle.org, check your proxy settings
andrea.turli (Fri, 17 Mar 2017 12:26:40 GMT):
could it be a misconfigured vagrant-proxyconf @greg.haskins ?
Basug (Fri, 17 Mar 2017 12:29:18 GMT):
hi @here I see 0.6 has Event listener. Is there a test/sample on how to use it ?
greg.haskins (Fri, 17 Mar 2017 12:30:19 GMT):
@andrea.turli could be
Basug (Fri, 17 Mar 2017 12:30:20 GMT):
sorry EventHub
greg.haskins (Fri, 17 Mar 2017 12:30:36 GMT):
it looks like its trying to connect to 10.0.2.2
andrea.turli (Fri, 17 Mar 2017 12:30:53 GMT):
ok I'll remove that vagrant plugin and restarted
andrea.turli (Fri, 17 Mar 2017 12:30:53 GMT):
ok I'll remove that vagrant plugin and restart
andrea.turli (Fri, 17 Mar 2017 12:32:43 GMT):
that was it, thanks @greg.haskins -- build passed that step
andrea.turli (Fri, 17 Mar 2017 12:39:41 GMT):
next up, according to https://github.com/hyperledger/fabric-sdk-java#working-with-the-fabric-vagrant-environment I should `vagrant ssh` and go to $GOPATH/src/github/hyperledger/fabric-ca
andrea.turli (Fri, 17 Mar 2017 12:39:46 GMT):
but that path is not in that VM
greg.haskins (Fri, 17 Mar 2017 12:40:15 GMT):
@Basug the nodesdk v0.6.5 supports registering for events
Basug (Fri, 17 Mar 2017 12:40:58 GMT):
@greg.haskins thank you, will take a look
andrea.turli (Fri, 17 Mar 2017 12:42:27 GMT):
@greg.haskins ops I've not cloned `fabric-ca` locally
andrea.turli (Fri, 17 Mar 2017 12:42:31 GMT):
need to restart again :(
andrea.turli (Fri, 17 Mar 2017 12:58:18 GMT):
now the fabric looks ok but the endToEnd test in java sdk fails because of
```
2017-03-17 13:56:44,127 ERROR Bad newest block expected status 200 got 404, Chain test
org.hyperledger.fabric.sdk.exception.TransactionException: Bad newest block expected status 200 got 404, Chain test
at org.hyperledger.fabric.sdk.Chain.getLatestBlock(Chain.java:939) [fabric-sdk-java-1.0-SNAPSHOT.jar:na]
13:56:44.127 brooklyn-execmanager-oUz5c9JI-7 org.hyperledger.fabric.sdk.Chain Bad newest block expected status 200 got 404, Chain test
org.hyperledger.fabric.sdk.exception.TransactionException: Bad newest block expected status 200 got 404, Chain test
at org.hyperledger.fabric.sdk.Chain.getLatestBlock(Chain.java:939) [fabric-sdk-java-1.0-SNAPSHOT.jar:na]
at org.hyperledger.fabric.sdk.Chain.getConfigurationBlock(Chain.java:775) [fabric-sdk-java-1.0-SNAPSHOT.jar:na]
at org.hyperledger.fabric.sdk.Chain.parseConfigBlock(Chain.java:718) [fabric-sdk-java-1.0-SNAPSHOT.jar:na]
at org.hyperledger.fabric.sdk.Chain.initialize(Chain.java:456) [fabric-sdk-java-1.0-SNAPSHOT.jar:na]org.hyperledger.fabric.sdk.exception.TransactionException: Bad newest block expected status 200 got 404, Chain test
```
andrea.turli (Fri, 17 Mar 2017 12:58:25 GMT):
any idea?
andrea.turli (Fri, 17 Mar 2017 13:51:45 GMT):
@here ^^
andrea.turli (Fri, 17 Mar 2017 14:22:36 GMT):
@tuand and/or @greg.haskins do you have any idea?
rickr (Fri, 17 Mar 2017 15:03:47 GMT):
@jimthematrix @tuand Real simply review https://gerrit.hyperledger.org/r/#/c/7311/ fix not getting last config block
rickr (Fri, 17 Mar 2017 15:50:09 GMT):
@Willson @zhoupeiwen Getting Bad config block error should be fixed with the very latest HLJSDK
Willson (Sat, 18 Mar 2017 08:39:06 GMT):
@rickr thanks
dorrakhribi (Sun, 19 Mar 2017 00:04:16 GMT):
hi everyone, who succeded to deploy a chaincode suing fabric java sdk
dorrakhribi (Sun, 19 Mar 2017 00:04:44 GMT):
i'm getting this error the deploy request is submitted, but is not completed
tuand (Sun, 19 Mar 2017 00:11:49 GMT):
@dorrakhribi , follow the sdk-java README , the end2endIT test deploys a chaincode
dorrakhribi (Sun, 19 Mar 2017 00:12:20 GMT):
thanks @tuand i'll take a look .
dorrakhribi (Sun, 19 Mar 2017 00:27:08 GMT):
the problem is that i'm working with fabric java sdk 0.6, so i didn't find any example to follow and i couldn't figure out if there's an error in my code or not
dorrakhribi (Sun, 19 Mar 2017 23:00:07 GMT):
hi , how can i start a non-validating peer on docker-compose ?
zhoupeiwen (Mon, 20 Mar 2017 01:41:50 GMT):
hi, I have installed the example_cc using the script in fabric and I can invoke and query it using the script successfully, but when i use sdk to call the invoke method, exception "failed to obtain cds for mycc - transaction not found mycc/mychannel" . Any idea for this?
tuand (Mon, 20 Mar 2017 01:56:21 GMT):
@zhoupeiwen , check this discussion https://chat.hyperledger.org/channel/fabric-peer-endorser-committer?msg=6uoGLRtJjpGRejYpX
zhoupeiwen (Mon, 20 Mar 2017 01:56:43 GMT):
thank you @tuand
xf891220 (Mon, 20 Mar 2017 06:43:50 GMT):
Has joined the channel.
liuzhudong (Mon, 20 Mar 2017 09:34:39 GMT):
Has joined the channel.
liuzhudong (Mon, 20 Mar 2017 09:37:06 GMT):
code `mychannel.initialize();`
run error:
`org.hyperledger.fabric.sdk.exception.CryptoException: Unable to converts byte array to certificate. error : Extensions not allowed in v2 certificate`
ruslan.kryukov (Mon, 20 Mar 2017 10:00:15 GMT):
Hello guys, I have found that ca-folder path is hardcoded:
`File certsFolder = new File("cacerts").getAbsoluteFile();`
Maybe make it configurable ?
Willson (Mon, 20 Mar 2017 10:02:28 GMT):
Maybe you can override that and install the jar, I did that
ruslan.kryukov (Mon, 20 Mar 2017 11:12:19 GMT):
yep, but it more useful to select custom location
also
I need a constructor for TLS Orderer. Now there is only one constructor:
```
public Orderer newOrderer(String grpcURL) throws InvalidArgumentException {
return Orderer.createNewInstance(grpcURL, null);
}
```
Maybe Do I create task for it?
ruslan.kryukov (Mon, 20 Mar 2017 11:12:51 GMT):
or just use Orderer.createNewInstance(grpcURL, null)
ruslan.kryukov (Mon, 20 Mar 2017 11:12:52 GMT):
hmmmm
ruslan.kryukov (Mon, 20 Mar 2017 11:13:14 GMT):
okay I select second, fine
Rymd (Mon, 20 Mar 2017 11:14:08 GMT):
```2017-03-20 12:11:16 ERROR HFCAClient:269 - org.glassfish.json.JsonStringImpl cannot be cast to javax.json.JsonObject
java.lang.ClassCastException: org.glassfish.json.JsonStringImpl cannot be cast to javax.json.JsonObject
at org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl.getJsonObject(JsonObjectBuilderImpl.java:184)
at org.hyperledger.fabric_ca.sdk.HFCAClient.enroll(HFCAClient.java:255)
at org.hyperledger.fabric.sdkintegration.End2endIT.setup(End2endIT.java:135)```
help!
ruslan.kryukov (Mon, 20 Mar 2017 11:15:32 GMT):
just update fabric-ca
ruslan.kryukov (Mon, 20 Mar 2017 11:15:55 GMT):
pull updates and rebuild by calling make docker
Rymd (Mon, 20 Mar 2017 11:37:15 GMT):
doesn't work
rickr (Mon, 20 Mar 2017 11:50:56 GMT):
@ruslan.kryukov TLS support is in the works
ruslan.kryukov (Mon, 20 Mar 2017 11:52:02 GMT):
oh, well
rickr (Mon, 20 Mar 2017 11:53:41 GMT):
The hardcoded cacerts will go away entirely when we get the multiple org support
Rymd (Mon, 20 Mar 2017 11:58:53 GMT):
```REPOSITORY TAG IMAGE ID CREATED SIZE
hyperledger/fabric-ca latest 7853ed27cdaa 10 seconds ago 237 MB
hyperledger/fabric-ca x86_64-1.0.0-snapshot-894b7e4 7853ed27cdaa 10 seconds ago 237 MB
hyperledger/fabric-buildenv latest b9010e506d0c About a minute ago 1.31 GB
hyperledger/fabric-buildenv x86_64-1.0.0-snapshot-22c1a1f b9010e506d0c About a minute ago 1.31 GB
hyperledger/fabric-orderer latest 9e82dd6767f4 About a minute ago 182 MB
hyperledger/fabric-orderer x86_64-1.0.0-snapshot-22c1a1f 9e82dd6767f4 About a minute ago 182 MB
hyperledger/fabric-peer latest 21a205b05c2f About a minute ago 184 MB
hyperledger/fabric-peer x86_64-1.0.0-snapshot-22c1a1f 21a205b05c2f About a minute ago 184 MB
hyperledger/fabric-javaenv latest df722624b4f8 About a minute ago 1.42 GB
hyperledger/fabric-javaenv x86_64-1.0.0-snapshot-22c1a1f df722624b4f8 About a minute ago 1.42 GB
hyperledger/fabric-ccenv latest c3671b3fb3d9 2 minutes ago 1.29 GB
hyperledger/fabric-ccenv x86_64-1.0.0-snapshot-22c1a1f c3671b3fb3d9 2 minutes ago 1.29 GB
hyperledger/fabric-baseimage x86_64-0.3.0 f4751a503f02 7 weeks ago 1.27 GB
hyperledger/fabric-baseos x86_64-0.3.0 c3a4cf3b3350 7 weeks ago 161 MB```
Should these images work?
Rymd (Mon, 20 Mar 2017 13:16:30 GMT):
ok now it works
tuand (Mon, 20 Mar 2017 13:33:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=tLjiqiAXbPxp9XQwW) @ruslan.kryukov `cacerts` is a temporary thing ... it will go away as soon as sdk can parse the real genesis block.
ruslan.kryukov (Mon, 20 Mar 2017 13:34:58 GMT):
okay great!
Rymd (Mon, 20 Mar 2017 15:19:17 GMT):
How do i authorize my client for my chain?
I get this error:
```2017-03-20 16:17:27 ERROR Chain:879 - Bad newest block expected status 200 got 403, Chain mychannel0
org.hyperledger.fabric.sdk.exception.TransactionException: Bad newest block expected status 200 got 403, Chain mychannel0
at org.hyperledger.fabric.sdk.Chain.getLatestBlock(Chain.java:938)
at org.hyperledger.fabric.sdk.Chain.getConfigurationBlock(Chain.java:775)
at org.hyperledger.fabric.sdk.Chain.parseConfigBlock(Chain.java:718)
at org.hyperledger.fabric.sdk.Chain.initialize(Chain.java:456)
at org.hyperledger.fabric.sdkintegration.End2endIT.reconstructChain(End2endIT.java:571)
at org.hyperledger.fabric.sdkintegration.End2endIT.setup(End2endIT.java:165)```
Rymd (Mon, 20 Mar 2017 15:20:04 GMT):
and the orderer logs this;: `2017-03-20 15:17:27.123 UTC [orderer/common/deliver] Handle -> WARN 3bb Received unauthorized deliver request for channel mychannel0`
donaldsbell (Mon, 20 Mar 2017 17:10:11 GMT):
Sanity check question: I have read so many different versions of the documents I have confused myself. I am not getting any compile errors, but I am getting a NoSuchMethod exception when I execute Chain.setMemberServicesUrl(String). Does the v0.6 version of the Java SDK actually work (I've seen reports that only v1.0 works)?
zerppen (Tue, 21 Mar 2017 06:40:33 GMT):
Hi,rickr @rickr I am testing java-Chaincode v0.6 . I merged and tested all methods in fabric-sdk-java about chaincode, most of them are good except setEvent. Satheesh @satheeshk said that can't merge here https://gerrit.hyperledger.org/r/#/c/2975 but I really want to test event for sending event to app,especially in v1.0 .But I can't find setEvent solved,anybody can do me a favor? Thanks
yury (Tue, 21 Mar 2017 13:20:47 GMT):
please see my PR https://gerrit.hyperledger.org/r/#/c/7363/
yury (Tue, 21 Mar 2017 13:20:47 GMT):
please check my PR https://gerrit.hyperledger.org/r/#/c/7363/
rickr (Tue, 21 Mar 2017 13:40:42 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=GhNTegzwb5gZ3AjaF) @zerppen This change set is really old. It needs updating if it's even applicable any more. @sanchezl ^^^
rickr (Tue, 21 Mar 2017 13:40:42 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=GhNTegzwb5gZ3AjaF) @zerppen This change set is really old. It needs updating if it's even applicable any more. @sanchezl vvv
rickr (Tue, 21 Mar 2017 13:48:15 GMT):
https://gerrit.hyperledger.org/r/#/c/7361/ @rameshthoomu @jimthematrix
sanchezl (Tue, 21 Mar 2017 14:13:24 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=GhNTegzwb5gZ3AjaF) @zerppen Please go ahead and open a Jira item and assign it to me.
vasiledirla (Tue, 21 Mar 2017 15:01:00 GMT):
Has joined the channel.
vasiledirla (Tue, 21 Mar 2017 15:01:13 GMT):
Hi
vasiledirla (Tue, 21 Mar 2017 15:01:28 GMT):
I get this error Status{code=UNKNOWN, description=Identity or token does not match., cause=null}
vasiledirla (Tue, 21 Mar 2017 15:01:34 GMT):
while try to enroll a user
vasiledirla (Tue, 21 Mar 2017 15:02:26 GMT):
do you have any idea what's happening? (maybe for someone rings a bell when see this error message)
vasiledirla (Tue, 21 Mar 2017 15:04:29 GMT):
I use the docker version: x86_64-0.6.1-preview
vasiledirla (Tue, 21 Mar 2017 15:05:27 GMT):
and the error i get is when I run the MemberTest from fabric-sdk-java
vasiledirla (Tue, 21 Mar 2017 15:06:12 GMT):
registrar = testChain.enroll("admin", "Xurw3yU9zI0l");
vasiledirla (Tue, 21 Mar 2017 15:09:47 GMT):
that's the fabric-sdk-java version i use: a8940f20523fb08580285aafee49c2d8af8c9ccc (v0.6)
icordoba (Tue, 21 Mar 2017 21:35:45 GMT):
Hello, when I deploy java chain code using fabric-sdk-java info a peer in Docker (vp0...), I do deployRequest.setChaincodePath(). This path should be the path where the java project is visible to the application running fabric-sdk-java (usually my workspace path) or to the mounted volume of that workspace path in the docker where the chaincode will be deployed?
andrea.turli (Tue, 21 Mar 2017 23:02:22 GMT):
hi @here anyone has seen this before https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6oGYbZKJbapZ6aoiX ?
zerppen (Wed, 22 Mar 2017 02:14:31 GMT):
@rickr @sanchezl Ok~ and thanks
zerppen (Wed, 22 Mar 2017 02:53:25 GMT):
Here is the issue https://jira.hyperledger.org/browse/FAB-2852
ersudiplama (Wed, 22 Mar 2017 04:55:30 GMT):
Has joined the channel.
andrea.turli (Wed, 22 Mar 2017 08:36:46 GMT):
hi @here following the README I can't run `make docker` command on fabric project
```
$ make docker
Building build/docker/bin/peer
mkdir -p build/image/peer/payload
cp build/docker/bin/peer peer/core.yaml build/msp-sampleconfig.tar.bz2 common/configtx/tool/configtx.yaml build/image/peer/payload
mkdir -p build/image/ccenv/payload
cp build/docker/gotools/bin/protoc-gen-go build/bin/chaintool build/goshim.tar.bz2 build/image/ccenv/payload
mkdir -p build/image/javaenv/payload
cp build/javashim.tar.bz2 build/protos.tar.bz2 settings.gradle build/image/javaenv/payload
mkdir -p build/image/orderer/payload
cp build/docker/bin/orderer build/msp-sampleconfig.tar.bz2 orderer/orderer.yaml common/configtx/tool/configtx.yaml build/image/orderer/payload
mkdir -p build/image/testenv/payload
cp build/docker/bin/orderer orderer/orderer.yaml common/configtx/tool/configtx.yaml build/docker/bin/peer peer/core.yaml build/msp-sampleconfig.tar.bz2 images/testenv/install-softhsm2.sh build/image/testenv/payload
Building docker testenv-image
docker build -t hyperledger/fabric-testenv build/image/testenv
Sending build context to Docker daemon 43.97 MB
Step 1/16 : FROM hyperledger/fabric-buildenv:x86_64-0.7.0-snapshot-96b1b90
repository hyperledger/fabric-buildenv not found: does not exist or no pull access
make: *** [build/image/testenv/.dummy-x86_64-1.0.0-snapshot-0ef3510] Error 1
```
andrea.turli (Wed, 22 Mar 2017 08:37:13 GMT):
what's the 'hyperldger/fabric-buildenv` ?
andrea.turli (Wed, 22 Mar 2017 08:37:13 GMT):
what's the `hyperldger/fabric-buildenv` ?
yhelal (Wed, 22 Mar 2017 08:52:33 GMT):
Has joined the channel.
magg (Wed, 22 Mar 2017 09:15:03 GMT):
Has joined the channel.
magg (Wed, 22 Mar 2017 09:15:42 GMT):
@tuand i have some questions regarding the youtube tutotial
Willson (Wed, 22 Mar 2017 10:02:24 GMT):
@tuand Hello tuand, i launch the fabric network via the docker-compose.yaml which in the directory fixture/e2e-2Orgs and enable the TLS.When i invoke the client1.newChain(), there is an error at orderer log like that:
Server.Serve failed to complete security handshake from "10.0.2.2:50776": tls: first record does not look like a TLS handshake
what's wrong?
icordoba (Wed, 22 Mar 2017 10:10:59 GMT):
Hello, I am getting this error when executing Chain.setMemberServicesUrl() in a WebApp inside Liberty server. I have included dependencies. Can anybody post here exact jar versions required for favric-sdk-java 0.6.6 so I can make sure my gradle is getting them right? thanks
icordoba (Wed, 22 Mar 2017 10:11:00 GMT):
Caused by: java.lang.NoSuchMethodError: io.grpc.protobuf.ProtoUtils.marshaller(Lcom/google/protobuf/Message;)Lio/grpc/MethodDescriptor$Marshaller;
at org.hyperledger.protos.ECAAGrpc.
magg (Wed, 22 Mar 2017 10:20:04 GMT):
@tuand https://gist.github.com/magg/78a01bab26d63e627a28aab0e2289239 i get this error while running integration tests.... what branch should I use, im using master
harsha (Wed, 22 Mar 2017 10:35:04 GMT):
@andrea.turli Perhaps, try `make docker-clean` and try `make docker` ?
andrea.turli (Wed, 22 Mar 2017 11:07:43 GMT):
thanks @harsha looks like docker-clean did the right incantation
yhelal (Wed, 22 Mar 2017 11:14:59 GMT):
hi, there is an sdk java for v1.0 ??
icordoba (Wed, 22 Mar 2017 11:53:40 GMT):
Hello, I am getting this exception when trying to enrol a user for first time: (Security disabled):
icordoba (Wed, 22 Mar 2017 11:53:40 GMT):
Caused by: java.security.spec.InvalidKeySpecException: key spec not recognised
at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source)
at org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi.engineGeneratePublic(Unknown Source)
at java.security.KeyFactory.generatePublic(KeyFactory.java:328)
at org.hyperledger.fabric.sdk.security.CryptoPrimitives.eciesDecrypt(CryptoPrimitives.java:165)
... 67 more
icordoba (Wed, 22 Mar 2017 11:53:46 GMT):
Thanks for any help
Willson (Wed, 22 Mar 2017 12:02:41 GMT):
@yhelal https://github.com/hyperledger/fabric-sdk-java
andrea.turli (Wed, 22 Mar 2017 14:53:53 GMT):
@harsha do you know how to solve https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6J6mZC4mpJ7jKTNiS or what I can try?
andrea.turli (Wed, 22 Mar 2017 14:54:09 GMT):
I think it is the same with `End2EndIT` test
rickr (Wed, 22 Mar 2017 15:21:37 GMT):
how are you running end2end ?
agiledeveloper (Wed, 22 Mar 2017 15:48:39 GMT):
Has joined the channel.
sanchezl (Wed, 22 Mar 2017 21:04:34 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=pTBoMWLmPobumzvbt) @uber.twin Did you ever get past this error? I'm seeing it myself and haven't figured out why.
xiangyw (Thu, 23 Mar 2017 02:34:19 GMT):
Has joined the channel.
zhoupeiwen (Thu, 23 Mar 2017 05:23:56 GMT):
hi ,running the End2enIT test,i got the following exception:Caught an exception while invoking chaincode
java.util.concurrent.ExecutionException: org.hyperledger.fabric.sdk.exception.TransactionEventException: Received invalid transaction event. Transaction ID : c776f2099d1dab1f62604265875cdf5e04c00d8a278027c7210addde7b9af81c
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
at org.hyperledger.fabric.sdkintegration.End2endIT.lambda$runChain$0(End2endIT.java:352)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
zhoupeiwen (Thu, 23 Mar 2017 05:25:33 GMT):
hi I got the following exception while running the end2endit test:Caught an exception while invoking chaincode
java.util.concurrent.ExecutionException: org.hyperledger.fabric.sdk.exception.TransactionEventException: Received invalid transaction event. Transaction ID : c776f2099d1dab1f62604265875cdf5e04c00d8a278027c7210addde7b9af81c
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
at org.hyperledger.fabric.sdkintegration.End2endIT.lambda$runChain$0(End2endIT.java:352)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
any config i missed?
zhoupeiwen (Thu, 23 Mar 2017 05:36:42 GMT):
and I checked the logs in peer0:2017-03-23 05:19:59.865 UTC [txvalidator] VSCCValidateTx -> ERRO 008 VSCC check failed for transaction txid=77db77e000485582656d34da59b72b3e80cd0c44da019fb9a8e14102d9e17419, error VSCC error: policy evaluation failed, err Failed to authenticate policy
zhoupeiwen (Thu, 23 Mar 2017 06:10:52 GMT):
I guess it's because I used "Org0MSP" rather than "DEFAULT" for the MSPID, but how can i change the policyBitsAdmin file?
Willson (Thu, 23 Mar 2017 06:12:38 GMT):
@zhoupeiwen follow this https://jira.hyperledger.org/browse/FAB-2376
zhoupeiwen (Thu, 23 Mar 2017 06:44:08 GMT):
thanks @Willson
sitomani (Thu, 23 Mar 2017 08:12:09 GMT):
Has joined the channel.
anik (Thu, 23 Mar 2017 08:51:00 GMT):
Has joined the channel.
xuzhao103389 (Thu, 23 Mar 2017 10:39:02 GMT):
Has joined the channel.
xuzhao103389 (Thu, 23 Mar 2017 10:40:21 GMT):
Is there any document that I can start to build and test the SDK? thanks
xuzhao103389 (Thu, 23 Mar 2017 10:40:59 GMT):
For hyperledger V1.0
imherro (Thu, 23 Mar 2017 11:59:55 GMT):
end2endit.java User 'user1' is already registered . any thoughts?
ersudiplama (Thu, 23 Mar 2017 13:30:38 GMT):
Hi I show a video about fabric-sdk-java in youtube ( https://www.youtube.com/watch?v=qxfuWVz7jRA ). Could anyone please share the code and docker-compose file or steps to create the network that was used in video?
rickr (Thu, 23 Mar 2017 14:30:33 GMT):
Have you looked at the fabric sdk java README.md ?
rickr (Thu, 23 Mar 2017 14:30:48 GMT):
probably a good place to start
ersudiplama (Thu, 23 Mar 2017 15:13:20 GMT):
Ya i look at https://github.com/hyperledger/fabric-sdk-java/blob/master/README.md but when i press link to setup development environment it throws 404
ersudiplama (Thu, 23 Mar 2017 15:17:37 GMT):
And it couldnt find the java class which access the chaincode as shown in the video. so Anyone who can help me to find the steps to configure the network and executed java-sdk.
ersudiplama (Thu, 23 Mar 2017 15:17:43 GMT):
Thanks in Advance
ersudiplama (Thu, 23 Mar 2017 15:17:58 GMT):
:relaxed:
magg (Thu, 23 Mar 2017 15:36:58 GMT):
can the java SDK be used with Java chaincode? and how?
magg (Thu, 23 Mar 2017 15:36:58 GMT):
can the Java SDK be used with Java chaincode? and how?
rickr (Thu, 23 Mar 2017 15:39:36 GMT):
Any means to deploy and exercise chain code should work with any supported chain code GO or Java . But at the moment Java CC is broken awaiting a fix
magg (Thu, 23 Mar 2017 15:40:14 GMT):
oh :(
rickr (Thu, 23 Mar 2017 15:41:47 GMT):
If you have specific question for Java CC that should be addressed in java-chaincode channel
magg (Thu, 23 Mar 2017 15:41:56 GMT):
thanks
shsedghi (Thu, 23 Mar 2017 15:49:29 GMT):
I cloned sdk but my mvn install -DskipTests fails with:
[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.5.0:compile (default) on project fabric-sdk-java: An IO error occured: /Users/xyz/workspaces/javasdk/fabric-sdk-java/target/protoc-dependencies/68c4b793d3558a08db1ed377969ae022/google/protobuf/any.proto (No such file or directory) -> [Help 1]
andrea.turli (Thu, 23 Mar 2017 16:16:07 GMT):
hi
andrea.turli (Thu, 23 Mar 2017 16:16:29 GMT):
I've set up a fabric using
andrea.turli (Thu, 23 Mar 2017 16:16:29 GMT):
I've set up a fabric using docker compose
andrea.turli (Thu, 23 Mar 2017 16:16:52 GMT):
here my yaml
icordoba (Thu, 23 Mar 2017 16:16:55 GMT):
@tuand I am reproducing your video Fabric end to end scenario and I am getting 2017-03-23 17:12:20 ERROR Chain:1508 - Sending proposal to peer failed because of gRPC failure=Status{code=UNIMPLEMENTED, description=unknown service protos.Endorser, cause=null}
when executing End2endIT.java as Test. Any idea why? Thanks.
andrea.turli (Thu, 23 Mar 2017 16:17:05 GMT):
```
version: '2.0'
services:
ca:
image: hyperledger/fabric-ca:x86_64-1.0.0-alpha
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
container_name: ca
orderer:
image: hyperledger/fabric-orderer:x86_64-1.0.0-alpha
environment:
- ORDERER_GENERAL_LOGLEVEL=debug
- ORDERER_GENERAL_LEDGERTYPE=ram
- ORDERER_GENERAL_BATCHTIMEOUT=10s
- ORDERER_GENERAL_MAXMESSAGECOUNT=10
- ORDERER_GENERAL_MAXWINDOWSIZE=1000
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_RAMLEDGER_HISTORY_SIZE=100
- ORDERER_GENERAL_ORDERERTYPE=solo
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
command: orderer
ports:
- 7050:7050
vp0:
image: hyperledger/fabric-peer:x86_64-1.0.0-alpha
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_NETWORKID=${CORE_PEER_NETWORKID}
- CORE_NEXT=true
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_PEER_ID=vp0
- CORE_PEER_PROFILE_ENABLED=false
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
volumes:
- /var/run/:/host/var/run/
command: peer node start
links:
- orderer
ports:
- 7051:7051
- 7053:7053
depends_on:
- orderer
vp1:
image: hyperledger/fabric-peer:x86_64-1.0.0-alpha
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_NETWORKID=${CORE_PEER_NETWORKID}
- CORE_NEXT=true
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_PEER_ID=vp1
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
volumes:
- /var/run/:/host/var/run/
command: peer node start
links:
- orderer
- vp0
ports:
- 7056:7051
depends_on:
- orderer
```
andrea.turli (Thu, 23 Mar 2017 16:17:17 GMT):
but when I try this java code
andrea.turli (Thu, 23 Mar 2017 16:17:29 GMT):
```
Chain chain = client.newChain(name);
for (String peerloc : PEER_LOCATIONS) {
Peer peer = client.newPeer(peerloc);
peer.setName("peer1");
chain.addPeer(peer);
}
for (String orderloc : ORDERER_LOCATIONS) {
Orderer orderer = client.newOrderer(orderloc);
chain.addOrderer(orderer);
}
for (String eventHub : EVENTHUB_LOCATIONS) {
EventHub orderer = client.newEventHub(eventHub);
chain.addEventHub(orderer);
}
chain.setInvokeWaitTime(1000);
chain.setDeployWaitTime(12000);
chain.initialize();
```
andrea.turli (Thu, 23 Mar 2017 16:17:38 GMT):
I get this exception
andrea.turli (Thu, 23 Mar 2017 16:17:50 GMT):
```
org.hyperledger.fabric.sdk.exception.TransactionException: Bad newest block expected status 200 got 404, Chain test
at org.hyperledger.fabric.sdk.Chain.getLatestBlock(Chain.java:939)
at org.hyperledger.fabric.sdk.Chain.getConfigurationBlock(Chain.java:775)
at org.hyperledger.fabric.sdk.Chain.parseConfigBlock(Chain.java:718)
at org.hyperledger.fabric.sdk.Chain.initialize(Chain.java:456)
at io.brooklyn.hyperledger.fabric.location.HyperledgerFabricLocation.instantiateChaincode(HyperledgerFabricLocation.java:178)
at io.brooklyn.hyperledger.fabric.location.HyperledgerFabricLocation.createHyperledgerFabricLocation(HyperledgerFabricLocation.java:119)
at io.brooklyn.hyperledger.fabric.location.HyperledgerFabricLocation.obtain(HyperledgerFabricLocation.java:104)
at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ObtainLocationTask.call(MachineLifecycleEffectorTasks.java:443)
at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ObtainLocationTask.call(MachineLifecycleEffectorTasks.java:433)
at org.apache.brooklyn.util.core.task.Tasks.withBlockingDetails(Tasks.java:106)
at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ProvisionMachineTask.call(MachineLifecycleEffectorTasks.java:414)
at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ProvisionMachineTask.call(MachineLifecycleEffectorTasks.java:390)
at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:359)
at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:522)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
org.hyperledger.fabric.sdk.exception.ProposalException: sendInstallProposal on chain not initialized.
at org.hyperledger.fabric.sdk.Chain.sendInstallProposal(Chain.java:1050)
at io.brooklyn.hyperledger.fabric.location.HyperledgerFabricLocation.instantiateChaincode(HyperledgerFabricLocation.java:200)
at io.brooklyn.hyperledger.fabric.location.HyperledgerFabricLocation.createHyperledgerFabricLocation(HyperledgerFabricLocation.java:119)
at io.brooklyn.hyperledger.fabric.location.HyperledgerFabricLocation.obtain(HyperledgerFabricLocation.java:104)
at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ObtainLocationTask.call(MachineLifecycleEffectorTasks.java:443)
at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ObtainLocationTask.call(MachineLifecycleEffectorTasks.java:433)
at org.apache.brooklyn.util.core.task.Tasks.withBlockingDetails(Tasks.java:106)
at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ProvisionMachineTask.call(MachineLifecycleEffectorTasks.java:414)
at org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ProvisionMachineTask.call(MachineLifecycleEffectorTasks.java:390)
at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:359)
at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:522)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```
andrea.turli (Thu, 23 Mar 2017 16:18:01 GMT):
where line 178 is `chain.initialize()
magg (Thu, 23 Mar 2017 16:20:12 GMT):
I also cant reproduce the youtube video... the end-to end test does not work
magg (Thu, 23 Mar 2017 16:21:38 GMT):
```Running org.hyperledger.fabric.sdkintegration.End2endIT
2017-03-23 17:21:22 ERROR HFCAClient:343 - POST request to http://localhost:7054/api/v1/cfssl/register failed with status code: 500. Response: {"success":false,"result":null,"errors":[{"code":0,"message":"User 'user1' is already registered"}],"messages":[]}
```
magg (Thu, 23 Mar 2017 16:28:07 GMT):
here is another error i get
magg (Thu, 23 Mar 2017 16:28:19 GMT):
``` mvn failsafe:integration-test -DskipITs=false
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: x86_64
[INFO] os.detected.release: ubuntu
[INFO] os.detected.release.version: 16.10
[INFO] os.detected.release.like.ubuntu: true
[INFO] os.detected.release.like.debian: true
[INFO] os.detected.classifier: linux-x86_64
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building fabric-java-sdk 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-failsafe-plugin:2.13:integration-test (default-cli) @ fabric-sdk-java ---
[INFO] Failsafe report directory: /home/magg/fabric-sdk-java/target/failsafe-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.hyperledger.fabric.sdkintegration.End2endIT
Mar 23, 2017 5:27:28 PM io.grpc.internal.ManagedChannelImpl
rickr (Thu, 23 Mar 2017 16:28:21 GMT):
each time you run that testcase make sure you restart both fabric and fabric ca
magg (Thu, 23 Mar 2017 16:29:08 GMT):
@rickr i rebuilt the containers from scratch and get this second error
rickr (Thu, 23 Mar 2017 16:31:19 GMT):
mvn clean install
results ?
icordoba (Thu, 23 Mar 2017 16:34:13 GMT):
Anybody has been able to reproduce that video? What are the previous installation steps to have the Test case configured in Eclipse? I get gRPC failure=Status{code=UNIMPLEMENTED, description=unknown service protos.Endorser, cause=null} when executing the Test case using Run as JUnit Test. But the guy in the video already has the test case in a Menu. Maybe a special config is needed.
icordoba (Thu, 23 Mar 2017 16:34:13 GMT):
Anybody has been able to reproduce that video? What are the previous installation steps to have the Test case configured in Eclipse? I get gRPC failure=Status{code=UNIMPLEMENTED, description=unknown service protos.Endorser, cause=null} when executing the End2endIT.java Test case using Run as JUnit Test. But the guy in the video already has the test case in a Menu. Maybe a special config is needed.
rickr (Thu, 23 Mar 2017 16:38:03 GMT):
My recommendation is not to follow a video. Read through the README.md FULLY once .. (need to fix one broken link :( )
ersudiplama (Thu, 23 Mar 2017 17:04:34 GMT):
@rickr Which README.md you are talking. Could you please share the link of that README.md? As i access this https://github.com/hyperledger/fabric-sdk-java/blob/master/README.md and When I click link to stepup the environment it throws 404
rickr (Thu, 23 Mar 2017 17:05:28 GMT):
That's the broken link I referred to . I'm look for they moved it
ersudiplama (Thu, 23 Mar 2017 17:05:28 GMT):
Message Attachments
ersudiplama (Thu, 23 Mar 2017 17:05:34 GMT):
Thank you in advance
ersudiplama (Thu, 23 Mar 2017 17:06:59 GMT):
Could you please share the link for setup the network and java-sdk that support V1.
ersudiplama (Thu, 23 Mar 2017 17:07:05 GMT):
Thank you in advance
Wenyang Liu (Thu, 23 Mar 2017 18:11:28 GMT):
Has joined the channel.
rickr (Thu, 23 Mar 2017 18:12:10 GMT):
http://hyperledger-fabric.readthedocs.io/en/latest/dev-setup/devenv.html
once ssh'ed into Vagrant
make docker
after all that's done
cd $GOPATH/src/github.com/hyperledger
git clone http://gerrit.hyperledger.org/r/fabric-ca
cd fabric-ca
make docker
rickr (Thu, 23 Mar 2017 18:12:10 GMT):
http://hyperledger-fabric.readthedocs.io/en/latest/dev-setup/devenv.html
once ssh'ed into Vagrant
make docker
after all that's done
cd $GOPATH/src/github.com/hyperledger
git clone http://gerrit.hyperledger.org/r/fabric-ca
cd fabric-ca
make docker
rickr (Thu, 23 Mar 2017 18:12:10 GMT):
http://hyperledger-fabric.readthedocs.io/en/latest/dev-setup/devenv.html
once ssh'ed into Vagrant
make docker
after all that's done
cd $GOPATH/src/github.com/hyperledger
git clone http://gerrit.hyperledger.org/r/fabric-ca
cd fabric-ca
make docker
rickr (Thu, 23 Mar 2017 18:12:10 GMT):
http://hyperledger-fabric.readthedocs.io/en/latest/dev-setup/devenv.html
once ssh'ed into Vagrant
make docker
after all that's done
cd $GOPATH/src/github.com/hyperledger
git clone http://gerrit.hyperledger.org/r/fabric-ca
cd fabric-ca
make docker
rickr (Thu, 23 Mar 2017 18:12:10 GMT):
http://hyperledger-fabric.readthedocs.io/en/latest/dev-setup/devenv.html
once ssh'ed into Vagrant
make docker
after all that's done
cd $GOPATH/src/github.com/hyperledger
git clone http://gerrit.hyperledger.org/r/fabric-ca
cd fabric-ca
make docker
rickr (Thu, 23 Mar 2017 18:12:58 GMT):
ersudiplama (Thu, 23 Mar 2017 18:16:22 GMT):
Thank you
ersudiplama (Thu, 23 Mar 2017 18:16:26 GMT):
@rickr
ersudiplama (Thu, 23 Mar 2017 18:16:35 GMT):
I will try and let you know.
rjones (Thu, 23 Mar 2017 18:16:55 GMT):
Has left the channel.
JaemanHong (Fri, 24 Mar 2017 01:46:39 GMT):
Has joined the channel.
Eagel (Fri, 24 Mar 2017 05:52:34 GMT):
I saw the fabric v1.0.0-alpha released. Is there any plan for java SDK?
ranjan008 (Fri, 24 Mar 2017 06:42:32 GMT):
Has joined the channel.
ranjan008 (Fri, 24 Mar 2017 06:42:43 GMT):
hi i am trying to deploy the example_cc chaincode through fabric-sdk-java but it is giving following error
-- use of vendored package not allowed
zhoupeiwen (Fri, 24 Mar 2017 07:51:58 GMT):
Hi , is there any way to upgrade Chain code using java sdk?
icordoba (Fri, 24 Mar 2017 08:42:54 GMT):
Is fabric-sdk-java allowing (or will allow) not only a deployment path but for example a InputStream so you can have chaincode packed somewhere and use it and not an O.S. filesystem path? Thanks
anik (Fri, 24 Mar 2017 09:15:18 GMT):
hi can i run java sdk on windows ? my download failed as some of the file name are too long for windows
ruslan.kryukov (Fri, 24 Mar 2017 09:21:19 GMT):
When I try to initialize chain object, I get an error:
```
org.hyperledger.fabric.sdk.exception.TransactionException: Bad last configuation block type 3, expected 1
```
ruslan.kryukov (Fri, 24 Mar 2017 09:21:41 GMT):
Chain is already exists, I've created it with genesis block in orderer
ruslan.kryukov (Fri, 24 Mar 2017 09:26:30 GMT):
I've found that if I initialize chain without install&instantiate any chaincode with cli, initialization ends successfully, but if I install and instantiate chaincode in the beginning and then try to initialize chain, I am getting this the error
ruslan.kryukov (Fri, 24 Mar 2017 09:27:16 GMT):
initialize by calling chain.initialize()
ruslan.kryukov (Fri, 24 Mar 2017 09:27:43 GMT):
maybe am I doing something wrong?
ruslan.kryukov (Fri, 24 Mar 2017 09:37:27 GMT):
Oh, great, I just should to update project, @rickr has fixed this error
rickr (Fri, 24 Mar 2017 12:09:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=yuugF5FGqjrFJGcHQ) @ranjan008 V1.0 ?
ranjan008 (Fri, 24 Mar 2017 12:10:31 GMT):
yes
rickr (Fri, 24 Mar 2017 12:14:23 GMT):
That's odd because Vendored package is the recommended way from what I know. This is not an error produced from the JDK so it's the Fabric itself that is responding like that. I'd open a JIRA show your file structure via `tree` show where your source location is and chain code path values are. See if there is any error on the server fabric side (see docker output )
ranjan008 (Fri, 24 Mar 2017 12:17:33 GMT):
and also is it required to run the docker through vagrant only i guess using vagrant is not recommended right
rickr (Fri, 24 Mar 2017 12:18:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=m4W4Sqwjq6qgWeA9J) @zhoupeiwen Hi once https://jira.hyperledger.org/browse/FAB-2752
gets done .. I just started it.
ruslan.kryukov (Fri, 24 Mar 2017 12:20:49 GMT):
Howto deploy chaincode on peers which are assigned to different organisations?
ruslan.kryukov (Fri, 24 Mar 2017 12:21:11 GMT):
fabric throws error that I sent him incorrect msp id
ruslan.kryukov (Fri, 24 Mar 2017 12:21:30 GMT):
cuz I can choose only one msp id but peers have different msp ids
ruslan.kryukov (Fri, 24 Mar 2017 12:23:04 GMT):
suppose I have two peers with msp_id FOO and BAR, I create instantiate request and set msp id FOO on my HFClient, now I send request and second peer throws error that he is BAR, not FOO
rickr (Fri, 24 Mar 2017 12:23:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=BqhTixtvpc4a93Ryc) @icordoba I thought that should something we should support. The only reservation is the sdk can only support the format that the fabric supports which for now is just zip compressed tar tgz I don't think the SDK is going to get in to format conversions. Open this as a JIRA improvement
rickr (Fri, 24 Mar 2017 12:23:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=BqhTixtvpc4a93Ryc) @icordoba I thought that should be something we should support. The only reservation is the sdk can only support the format that the fabric supports which for now is just zip compressed tar tgz I don't think the SDK is going to get in to format conversions. Open this as a JIRA improvement
ruslan.kryukov (Fri, 24 Mar 2017 12:24:05 GMT):
Should I send instantiate request separately?
rickr (Fri, 24 Mar 2017 12:28:51 GMT):
Not sure of your scenario. We just updated the SDK showing an example mulit org chain scenario
rickr (Fri, 24 Mar 2017 12:30:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=cjjG8HQSstkCAdj7f) @anik yes you should. Can you say which files it complains on show the exact error
ruslan.kryukov (Fri, 24 Mar 2017 12:40:12 GMT):
@rickr I've checked End2End again and found it, but because of what we have `client.setUserContext(sampleOrg.getAdmin());`, we can work with different organisations consistently only... yes?
anik (Fri, 24 Mar 2017 12:59:29 GMT):
Message Attachments
agiledeveloper (Fri, 24 Mar 2017 13:17:44 GMT):
Hi, I am getting below exception when I send post to http://localhost:7050/chaincode
agiledeveloper (Fri, 24 Mar 2017 13:18:08 GMT):
Message Attachments
rickr (Fri, 24 Mar 2017 13:25:15 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rhjRgxDb6pP25LK8R) @anik Can you open a JIRA defect on this ?
rickr (Fri, 24 Mar 2017 13:25:15 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rhjRgxDb6pP25LK8R) @anik Can you open a JIRA defect on this ? This isn't really the SDK. Those are created with the crypto tooling so it's that tool that needs to be fixed
cgrecu (Fri, 24 Mar 2017 14:44:53 GMT):
Has joined the channel.
cgrecu (Fri, 24 Mar 2017 14:56:54 GMT):
@rickr do you happen to know if the e2e tests work with IBM JVM ? Do i need to change the certs or it should work out of the box ?
rickr (Fri, 24 Mar 2017 15:22:39 GMT):
I know of no specific reasons it would not but I don't test for specific JVMs
rickr (Fri, 24 Mar 2017 15:22:39 GMT):
I know of no specific reasons it would not but I don't test for specific JVMs or OSs
cgrecu (Fri, 24 Mar 2017 17:01:41 GMT):
i am a bit confused admin functionality of the sdk. It seems to be capable to create channels & deploy chaincode but ... how are the roles being enforced here? fabric-ca can give certs associated with certain roles, but how would a peer enforce them? From what i have seen so far , a peer has its own MSP with org certs, ie. no role information
cgrecu (Fri, 24 Mar 2017 17:01:41 GMT):
i am a bit confused about admin functionality of the sdk. It seems to be capable to create channels & deploy chaincode but ... how are the roles being enforced here? fabric-ca can give certs associated with certain roles, but how would a peer enforce them? From what i have seen so far , a peer has its own MSP with org certs, ie. no role information
cgrecu (Fri, 24 Mar 2017 17:01:41 GMT):
i am a bit confused about admin functionality of the sdk. It seems to be capable of creating channels & deploy chaincode but ... how are the roles being enforced here? fabric-ca can give certs associated with certain roles, but how would a peer enforce them? From what i have seen so far , a peer has its own MSP with org certs, ie. no role information
cgrecu (Fri, 24 Mar 2017 17:27:34 GMT):
while looking at the src/test/fixture/sdkintegration test i realized that TLS is turned off. Was that because it did not work with the sdk? The fabric e2e works with tls no problem
dhwang (Fri, 24 Mar 2017 17:39:06 GMT):
Has joined the channel.
rickr (Fri, 24 Mar 2017 18:02:59 GMT):
There's no claim that the SDK is at e2e level. It's still alpha and work in progress. Support is not there and coming .. It will also not be available in the test/sample code till
https://jira.hyperledger.org/browse/FAB-2855 gets addressed .. if it's important to you please give them a patch :)
akashmar (Fri, 24 Mar 2017 19:16:39 GMT):
Has joined the channel.
akashmar (Fri, 24 Mar 2017 19:19:14 GMT):
When I develop java chaincode, am I supposed to use hyperledger/fabric-sdk-java or the java package under hyperledger/fabric/core/chaincode/shim?
akashmar (Fri, 24 Mar 2017 19:19:28 GMT):
There seems to be duplicate code there
shaileshrl (Fri, 24 Mar 2017 20:15:06 GMT):
Has joined the channel.
GaneshBagalur (Fri, 24 Mar 2017 20:15:47 GMT):
Has joined the channel.
ranjan008 (Sat, 25 Mar 2017 05:27:57 GMT):
@rickr hi i tried to run the End2End class I am getting this error what could be the mistake
ERROR Chain:169 - Bad deliver expected status 200 got 403, Chain foo
ranjan008 (Sat, 25 Mar 2017 05:31:33 GMT):
the error came from orderer
icordoba (Sat, 25 Mar 2017 10:50:16 GMT):
Thanks, I did: https://jira.hyperledger.org/browse/FAB-2881 (My first entry in hyperledger Jira. Sorry if I missed anything there. I will also have a look at code should consider accepting a Pull Request/Patch. Thanks) [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=WCeajeamkxXuqvKmm) @rickr
rickr (Sat, 25 Mar 2017 12:47:13 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=eiY2rRYhSPZcgmnfo) @ranjan008 How are you running the test ? When you get that error what is the output (logs) from the Orderer ?
conor (Mon, 27 Mar 2017 00:38:11 GMT):
Has joined the channel.
t-watana (Mon, 27 Mar 2017 09:51:27 GMT):
Has joined the channel.
xuanyue202 (Mon, 27 Mar 2017 11:29:39 GMT):
Has joined the channel.
magg (Mon, 27 Mar 2017 11:29:53 GMT):
i'm trying to run the End2End too without luck... i'm using the docker compose file in fabric-sdk-java/src/test/fixture/sdkintegration I modified the compose file because the images were throwing an error so i added ":x86_64-1.0.0-alpha" to all images. Then i do `mvn clean install` and `mvn failsafe:integration-test -DskipITs=false`
xuanyue202 (Mon, 27 Mar 2017 11:30:30 GMT):
Hi guys, do you have plans on publish a new version to the Maven Central?
magg (Mon, 27 Mar 2017 11:32:19 GMT):
here is the error output: https://pastebin.com/b8qrhyt7
magg (Mon, 27 Mar 2017 11:32:27 GMT):
can you help me?
rickr (Mon, 27 Mar 2017 11:35:05 GMT):
We don't test with alpha level .. we have running test that check end2endit quite regularly and we also run it locally. My advise is to follow the README.md closely.
rickr (Mon, 27 Mar 2017 11:35:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=AFL7kMvdS4TFxpbiq) @xuanyue202 Sure someday :)
xuanyue202 (Mon, 27 Mar 2017 11:37:08 GMT):
Cool. Is there a expected date?
rickr (Mon, 27 Mar 2017 11:37:51 GMT):
No
magg (Mon, 27 Mar 2017 11:37:54 GMT):
ok @rickr
rickr (Mon, 27 Mar 2017 11:39:15 GMT):
https://chat.hyperledger.org/channel/fabric-maintainers?msg=XeNfnapGTiZMsraGL
cgrecu (Mon, 27 Mar 2017 13:41:01 GMT):
hey guys, i am having a bit of a trouble understanding e2e_2Orgs crypto-config structure. From the cryto-config dir, there are two categories of participants, orderers and peers. Since there are two peer orgs listed there, does that not mean there are 3 organizations involved in this scenario (the ordered org and the two peers orgs) ? A diff between orderer pem files and peer files revealed that the certs were different.
cgrecu (Mon, 27 Mar 2017 13:44:19 GMT):
also following up to my previous question, each peer and orderer config dif has a 'ca' directory. Does that mean that each org has its own fabric-ca? Docker-compose file instantiates two fabric-ca containers, from /crypto-config/peerOrganizations/peerOrg1/ca/ and /crypto-config/peerOrganizations/peerOrg2/ca/, respectively. Looks like the orderer 'ca' config is not used
tuand (Mon, 27 Mar 2017 13:53:18 GMT):
@cgrecu the ordering service can be set up by a separate org ( subject to out-of-band approval by the orgs participating in the fabric network ) or each org can contribute one or more orderer nodes. In the e2e example, it's separated out because it's simpler to see what's going on and easier to configure
tuand (Mon, 27 Mar 2017 13:56:22 GMT):
each peer org has its own fabric-ca because we want to show new users being registered via fabric-ca. Note that it's not required that a peer org go through fabric-ca. An org can create and sign its certificates using any mechanism it wants. Again, for orderer, it was just easier to configure before hand
cgrecu (Mon, 27 Mar 2017 14:23:02 GMT):
@tuand thanks. More questions if you don't mind ... in crypto-config dir, each organization has its own 'ca' directory, its own 'msp' directory and finally its own list of dirs that contain a similar to msp structure (have an additional keystore dir). What is the meaning of 'msp' directories ? They do not seem to be used.
tuand (Mon, 27 Mar 2017 14:43:29 GMT):
I think you're referring to, for example, `peerOrganizations/peerOrg1/peers/peerOrg1Peer1` ? I believe those are mapped to a peer's "local" MSP ... Also, this is very much an internal fabric peer configuration and since we're an sdk client , we don't care :D ... seriously though, it's a matter of re-using the `cryptogen` output and taking advantage of a working fabric environment. You should take a look at hyperledger/fabric/examples/e2e_cli to understand why the config is described in more detail
mwall (Mon, 27 Mar 2017 16:32:08 GMT):
`Mar 27, 2017 7:31:30 PM org.hyperledger.fabric.sdk.EndorserClient sendProposal
WARNING: RPC failed: Status{code=UNKNOWN, description=Failed to deserialize creator identity, err MSP DEFAULT is unknown, cause=null}
Exception in thread "main" org.hyperledger.fabric.sdk.exception.PeerException: Sending transaction to peer failed
at org.hyperledger.fabric.sdk.EndorserClient.sendProposal(EndorserClient.java:59)
at org.hyperledger.fabric.sdk.Peer.sendProposal(Peer.java:128)
at org.hyperledger.fabric.sdk.Chain.sendDeploymentProposal(Chain.java:625)
at uk.dsxt.fabric.FabricManagerOne.main(FabricManagerOne.java:58)
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Failed to deserialize creator identity, err MSP DEFAULT is unknown
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:230)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:211)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:144)
at org.hyperledger.fabric.protos.peer.EndorserGrpc$EndorserBlockingStub.processProposal(EndorserGrpc.java:135)
at org.hyperledger.fabric.sdk.EndorserClient.sendProposal(EndorserClient.java:55)
... 3 more`
mwall (Mon, 27 Mar 2017 16:33:36 GMT):
Hello! Can you help me to fix it https://pastebin.com/qugANTMz ?
mwall (Mon, 27 Mar 2017 16:33:36 GMT):
Hello! Can you help me to fix it https://pastebin.com/qugANTMz ? I'm using fabric_v1
mwall (Mon, 27 Mar 2017 16:33:36 GMT):
Hello! Can you help me to fix it https://pastebin.com/qugANTMz ? I'm using fabric_v1.
mwall (Mon, 27 Mar 2017 16:33:36 GMT):
@here Hello! Can you help me to fix it https://pastebin.com/qugANTMz ? I'm using fabric_v1.
tuand (Mon, 27 Mar 2017 17:14:38 GMT):
@mwall, it looks like you're using the wrong identity to sign the proposal messages ... take a look at the README, the End2EndIT.java code and the hyperledger/fabric/examples/e2e_cli code and follow how the peer Orgs are set up.
mwall (Mon, 27 Mar 2017 17:18:03 GMT):
@tuand ok, thank you, will try out
AvN (Mon, 27 Mar 2017 19:25:24 GMT):
Has joined the channel.
AvN (Mon, 27 Mar 2017 19:42:18 GMT):
So I am using docker and referring to the latest images (x86_64-1.0.0-alpha) published to the repo: https://hub.docker.com/u/hyperledger/
Here is my config file
```
version: '2.0'
services:
ca:
image: hyperledger/fabric-ca:x86_64-1.0.0-alpha
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
container_name: ca
orderer:
image: hyperledger/fabric-orderer:x86_64-1.0.0-alpha
environment:
- ORDERER_GENERAL_LOGLEVEL=debug
- ORDERER_GENERAL_LEDGERTYPE=ram
- ORDERER_GENERAL_BATCHTIMEOUT=10s
- ORDERER_GENERAL_MAXMESSAGECOUNT=10
- ORDERER_GENERAL_MAXWINDOWSIZE=1000
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_RAMLEDGER_HISTORY_SIZE=100
- ORDERER_GENERAL_ORDERERTYPE=solo
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
command: orderer
ports:
- 7050:7050
vp0:
image: hyperledger/fabric-peer:x86_64-1.0.0-alpha
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_NETWORKID=${CORE_PEER_NETWORKID}
- CORE_NEXT=true
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_PEER_ID=vp0
- CORE_PEER_PROFILE_ENABLED=false
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
volumes:
- /var/run/:/host/var/run/
command: peer node start
links:
- orderer
ports:
- 7051:7051
- 7053:7053
depends_on:
- orderer
vp1:
image: hyperledger/fabric-peer:x86_64-1.0.0-alpha
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_NETWORKID=${CORE_PEER_NETWORKID}
- CORE_NEXT=true
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_PEER_ID=vp1
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
volumes:
- /var/run/:/host/var/run/
command: peer node start
links:
- orderer
- vp0
ports:
- 7056:7051
depends_on:
- orderer
```
And when I try to run the End2endIT test, I get the following error
AvN (Mon, 27 Mar 2017 19:42:57 GMT):
```
2017-03-27 12:41:45 ERROR HFCAClient:343 - POST request to http://localhost:7054/api/v1/cfssl/register failed with status code: 500. Response: {"success":false,"result":null,"errors":[{"code":0,"message":"User 'user1' is already registered"}],"messages":[]}
2017-03-27 12:41:45 ERROR HFCAClient:183 - POST request to http://localhost:7054/api/v1/cfssl/register failed with status code: 500. Response: {"success":false,"result":null,"errors":[{"code":0,"message":"User 'user1' is already registered"}],"messages":[]}
java.lang.Exception: POST request to http://localhost:7054/api/v1/cfssl/register failed with status code: 500. Response: {"success":false,"result":null,"errors":[{"code":0,"message":"User 'user1' is already registered"}],"messages":[]}
```
rickr (Mon, 27 Mar 2017 19:59:32 GMT):
so user 1 is already registered
rickr (Mon, 27 Mar 2017 19:59:57 GMT):
have you tried restarting your docker compose
AvN (Mon, 27 Mar 2017 22:47:23 GMT):
So I ran the docker-compose in fabric-sdk-java/src/test/fixture/sdkintegration. Had to remove the references to couchdb. After starting the docker container, you should see the following nodes running
hyperledger/fabric-peer:x86_64-1.0.0-alpha
hyperledger/fabric-peer:x86_64-1.0.0-alpha
hyperledger/fabric-peer:x86_64-1.0.0-alpha
hyperledger/fabric-peer:x86_64-1.0.0-alpha
hyperledger/fabric-ca:x86_64-1.0.0-alpha
hyperledger/fabric-ca:x86_64-1.0.0-alpha
hyperledger/fabric-orderer:x86_64-1.0.0-alpha
AFter running the End2endIT, am seeing the following errors
```
Running Chain foo
Sending install proposal
Successful install proposal response Txid: fc6a518fcccaf46f714913a955a9fb5debcabf0475390ac6be86075622452bbe from peer peer0
Successful install proposal response Txid: fc6a518fcccaf46f714913a955a9fb5debcabf0475390ac6be86075622452bbe from peer peer1
Received 2 install proposal responses. Successful+verified: 2 . Failed: 0
Sending instantiateProposalRequest to all peers with arguments: a and b set to 100 and 200 respectively
2017-03-27 15:33:30 ERROR Chain:1511 - Sending proposal to peer1 failed because of gRPC failure=Status{code=UNKNOWN, description=Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image
at org.hyperledger.fabric.sdk.Chain.sendProposalToPeers(Chain.java:1511)
at org.hyperledger.fabric.sdk.Chain.sendInstantiationProposal(Chain.java:1031)
at org.hyperledger.fabric.sdkintegration.End2endIT.runChain(End2endIT.java:269)
at org.hyperledger.fabric.sdkintegration.End2endIT.setup(End2endIT.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image
at io.grpc.Status.asRuntimeException(Status.java:539)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:439)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:422)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:74)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:508)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:425)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:540)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:152)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```
rickr (Mon, 27 Mar 2017 22:49:55 GMT):
Have not tried to run with alpha
rickr (Mon, 27 Mar 2017 22:51:12 GMT):
that looks like the runtimes are missing
AvN (Tue, 28 Mar 2017 03:59:44 GMT):
I am using the docker.yml under the sdkintegration folder. I had to modify it to pick up the latest docker images. The other ones were uploaded around 6 months back
AvN (Tue, 28 Mar 2017 04:00:47 GMT):
And when running the Integration test, I get the error
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image
rickr (Tue, 28 Mar 2017 07:44:30 GMT):
I would highly recommend reading the README.md fully and follow the step it lays out.
karumbas (Tue, 28 Mar 2017 08:50:03 GMT):
@tuan @rickr Hi, I am getting this error https://pastebin.com/9G63A01y when creating newChain
The orderer show the error below
orderer0 | 2017-03-28 08:26:47.700 UTC [common/configtx] addToMap -> DEBU 580 Adding to config map: [Policy] /Channel/AcceptAllPolicy
orderer0 | 2017-03-28 08:26:47.700 UTC [orderer/common/broadcast] Handle -> WARN 581 Rejecting CONFIG_UPDATE because: Error validating DeltaSet: Attempt to set key [Values] /Channel/Orderer/ChannelRestrictions to version 0, but key is at version 0
Could you please help fix it?
karumbas (Tue, 28 Mar 2017 08:50:03 GMT):
@tuand @rickr Hi, I am getting this error https://pastebin.com/9G63A01y when creating newChain
The orderer show the error below
orderer0 | 2017-03-28 08:26:47.700 UTC [common/configtx] addToMap -> DEBU 580 Adding to config map: [Policy] /Channel/AcceptAllPolicy
orderer0 | 2017-03-28 08:26:47.700 UTC [orderer/common/broadcast] Handle -> WARN 581 Rejecting CONFIG_UPDATE because: Error validating DeltaSet: Attempt to set key [Values] /Channel/Orderer/ChannelRestrictions to version 0, but key is at version 0
Could you please help fix it?
cgrecu (Tue, 28 Mar 2017 15:12:26 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=gPoaaCb7RxnotSscs) @AvN did you change the parent directory where docker compose file was? It could also be that the container you are trying to bring up does not see the fabric containers because of a different network. If you change the parent dir, docker-compose creates a different default network with the name yourparentdir_default.
rickr (Wed, 29 Mar 2017 00:35:42 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=uiuJ4xSqogXpRvEde) @karumbas Never seen that error before. Were you just running the E2EIT ? No changes ?
xiangyw (Wed, 29 Mar 2017 01:52:39 GMT):
Message Attachments
dorrakhribi (Wed, 29 Mar 2017 10:17:16 GMT):
have any one display the history of transactions done by a specific peer ?
karumbas (Wed, 29 Mar 2017 12:45:23 GMT):
@rick yes was running E2EIT, there were no changes. On first run i got this error https://pastebin.com/mRNWzrEP then the error above.
karumbas (Wed, 29 Mar 2017 12:45:23 GMT):
@rickr yes was running E2EIT, there were no changes. On first run i got this error https://pastebin.com/mRNWzrEP then the error above.
karumbas (Wed, 29 Mar 2017 12:45:23 GMT):
@rickr yes, I was running E2EIT and there were no changes. On first run i got this error https://pastebin.com/mRNWzrEP then the error above.
anrodon (Wed, 29 Mar 2017 13:56:08 GMT):
http://area51.stackexchange.com/proposals/107923/hyperledger?referrer=uwBppPb347ObXyZLiQ6nVQ2
dorrakhribi (Wed, 29 Mar 2017 15:16:24 GMT):
hi, i've been working with fabric 0.6 and i've been disabling the security env_variable because i've been told that the java chaincode does not work with security anbled , now i'm starting to read about fabric 1.0 , i want to know if the java chaincode support security and if i am able to work with certificates
rickr (Wed, 29 Mar 2017 15:23:01 GMT):
Right now fix for Java chain code is not in. I would direct your questions to fabric-java-chaincode channel
dorrakhribi (Wed, 29 Mar 2017 15:36:18 GMT):
alright, thanks @rickr , is the fabric 1.0 still under development or it is the final release ?
rickr (Wed, 29 Mar 2017 15:38:37 GMT):
I'd ask that on the fabric channel. I don't want to speak for them :) As for the Java SDK it is alpha work in progress.
dorrakhribi (Wed, 29 Mar 2017 16:27:55 GMT):
thank you @rickr for your answer :)
ManjeetGambhir (Wed, 29 Mar 2017 18:49:17 GMT):
@suryalanka FO: [io.grpc.internal.ManagedChannelImpl-1] Created with target 10.34.32.144:9050
2017-03-29 13:33:37 ERROR OrdererClient:104 - sendTransaction error Send transactions failed. Reason: INTERNAL
org.hyperledger.fabric.sdk.exception.TransactionException: Send transactions failed. Reason: INTERNAL
at org.hyperledger.fabric.sdk.OrdererClient.sendTransaction(OrdererClient.java:103)
at org.hyperledger.fabric.sdk.Orderer.sendTransaction(Orderer.java:102)
at org.hyperledger.fabric.sdk.Chain.
ArnabChatterjee (Thu, 30 Mar 2017 05:31:07 GMT):
Hello everyone. Can you please confirm if I can mix query and invoke calls in a single chaincode invocation? Unlike in v0.6, where we could not commit a txn in a query call. Or cannot return data in an invoke call. Now in v1.0, is this feasible?
Willson (Thu, 30 Mar 2017 06:50:53 GMT):
Hello @rickr , the ca0 and ca1 can't start after setting the "ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS=--tls.enabled", i found that a directory called cas should be contained at src/test/fixture/sdkintegration/e2e-2Orgs/tls/ which contains the cert.pem of peerOrg1 and peerOrg2, but i can't find the cas, how can i get it?
rickr (Thu, 30 Mar 2017 09:51:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ShdntbosqMYdvzxSR) @ArnabChatterjee You can now return values from invokes if that helps
rickr (Thu, 30 Mar 2017 09:55:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bGDH39rKkMoq2H8Wg) @Willson At the _current time_ if TLS is important for you'll need to create them.
Willson (Thu, 30 Mar 2017 11:47:07 GMT):
yeah, i am learning how to create it. any suggestion for that? thanks
rickr (Thu, 30 Mar 2017 11:52:16 GMT):
cfssl openssh. If you see in the README.md cryptogen once I see it's fixed. You can try that if it works we'll welcome a patch :wink:
rickr (Thu, 30 Mar 2017 11:52:16 GMT):
cfssl openssh. If you see in the README.md cryptogen once I see it's fixed. You can try that if it works we'll welcome a patch :wink:
For the Fabric I don't think it's as easy as just generating the certs. They have to be from common CA. On shaky ground as far as my knowledge on this but I think the peers in the org may have to be cross certified.
Willson (Thu, 30 Mar 2017 12:02:36 GMT):
thanks, let me try it
ManjeetGambhir (Thu, 30 Mar 2017 14:48:25 GMT):
@rickr try to install chaincode using java alpha commit level and fabric alpha release , image is installed and can see custom chain-code image and container but in couchdb I can not see lscc entry ..
rickr (Thu, 30 Mar 2017 14:50:21 GMT):
I have not tried with alpha
ManjeetGambhir (Thu, 30 Mar 2017 14:50:28 GMT):
@rickr can no see any error in orderer and peer logs ...only getting timeout exception in java client..I am using compose file of java sdk alpha release
ManjeetGambhir (Thu, 30 Mar 2017 14:51:03 GMT):
do you know who can help
rickr (Thu, 30 Mar 2017 14:51:07 GMT):
I don't know of any java sdk alpha compose
rickr (Thu, 30 Mar 2017 14:51:38 GMT):
What wrong with following the the README.md ?
rickr (Thu, 30 Mar 2017 14:51:57 GMT):
I think others here have gotten it to work with that
ManjeetGambhir (Thu, 30 Mar 2017 14:52:26 GMT):
Can not take fabric and fabric-ca commit level of fabric ca
ManjeetGambhir (Thu, 30 Mar 2017 14:53:04 GMT):
that mentioned in readme file..need to integrated with alpha release
ManjeetGambhir (Thu, 30 Mar 2017 14:53:21 GMT):
because chaincodes are tested on alpha
ManjeetGambhir (Thu, 30 Mar 2017 14:53:39 GMT):
that's the guidelines we are following
rickr (Thu, 30 Mar 2017 14:54:16 GMT):
I don't have any experience at getting that DC running with alpha
rickr (Thu, 30 Mar 2017 14:55:08 GMT):
I run with the latest .. as I need to test with that
rickr (Thu, 30 Mar 2017 15:07:47 GMT):
As far as I know chaincode is being continuously tested
rickr (Thu, 30 Mar 2017 16:33:03 GMT):
@Ratnakar can you help Manjeet I think you had some experience with the Node SDK on alpha
Ratnakar (Thu, 30 Mar 2017 17:06:03 GMT):
@rickr sure I will be working with @ManjeetGambhir , Howeve he is dealing with Java SDk not the Node sdk
rickr (Thu, 30 Mar 2017 17:31:31 GMT):
Yeah it much better :smile:
anrodon (Thu, 30 Mar 2017 19:56:04 GMT):
http://area51.stackexchange.com/proposals/107923/hyperledger
icordoba (Thu, 30 Mar 2017 22:56:13 GMT):
Hi... I was going to add users to my network using sdk-java. I see that RegistrationRequest class has no enrollmentPWD property. How can set the password for a user if I register it this way? (not using memberrvc.yaml) thanks!
rickr (Thu, 30 Mar 2017 23:01:48 GMT):
End2endIT
```
SampleUser user = sampleStore.getMember(TESTUSER_1_NAME, sampleOrg.getName());
if (!user.isRegistered()) { // users need to be registered AND enrolled
RegistrationRequest rr = new RegistrationRequest(user.getName(), "org1.department1");
user.setEnrollmentSecret(ca.register(rr, admin));
}```
your given a pw set in the users setEnrollmentSecret
icordoba (Thu, 30 Mar 2017 23:02:01 GMT):
OOOps. thanks.
rickr (Thu, 30 Mar 2017 23:03:05 GMT):
np
icordoba (Thu, 30 Mar 2017 23:07:12 GMT):
@rickr so the memberServices(RegistrationRequest, Member) method, the Member parameter is not the registrar (the one registering users) but the user being registered? I should set the user.setEnrollmentSecret to that object, am I right?
icordoba (Thu, 30 Mar 2017 23:07:23 GMT):
(I am using 0.6... maybe that's my problem)
rickr (Thu, 30 Mar 2017 23:09:23 GMT):
Not down to speed with v.6 :(
icordoba (Thu, 30 Mar 2017 23:11:51 GMT):
@rickr I do want to move to 1.0 but I have read here it is still not running Java chain code... too bad, for me.... anyway, I'm browsing 1.0 code now... I think I was wrong in something: I can't set the secret when I register a user. I just should pass the RegistrationRequest and the HFCAClient returns the secret for that user, am I right?
ManjeetGambhir (Fri, 31 Mar 2017 01:11:34 GMT):
@rickr while reconstructing chain getting org.hyperledger.fabric.sdk.exception.TransactionException: Bad last configuation block type 3, expected 1
at org.hyperledger.fabric.sdk.Chain.getConfigurationBlock(Chain.java:855)
at org.hyperledger.fabric.sdk.Chain.parseConfigBlock(Chain.java:718)
at org.hyperledger.fabric.sdk.Chain.initialize(Chain.java:456)
at org.hyperledger.fabric.sdkintegration.End2endIT.reconstructChain(End2endIT.java:935)
rickr (Fri, 31 Mar 2017 01:12:19 GMT):
An old problem need to move to latest code
ManjeetGambhir (Fri, 31 Mar 2017 01:13:00 GMT):
if I move to latest does it work with alpha release
rickr (Fri, 31 Mar 2017 01:15:41 GMT):
Work with commit levels in the README.md
ManjeetGambhir (Fri, 31 Mar 2017 01:16:48 GMT):
can you post commit
ManjeetGambhir (Fri, 31 Mar 2017 01:16:58 GMT):
I can not open link
rickr (Fri, 31 Mar 2017 01:18:04 GMT):
you can't get to https://github.com/hyperledger/fabric-sdk-java ?
ManjeetGambhir (Fri, 31 Mar 2017 01:18:55 GMT):
ohhk..I thought you are specifying
ManjeetGambhir (Fri, 31 Mar 2017 01:19:02 GMT):
something specific
Willson (Fri, 31 Mar 2017 03:28:50 GMT):
@rickr Unfortunately, i created the private key and cert by openssl and can connect to the ca by tls, but when constructing the chain, there is an error:
2017-03-31 10:53:58 ERROR CryptoPrimitives:169 - Unable to converts byte array to certificate. error : Extensions not allowed in v2 certificate
2017-03-31 10:53:58 ERROR Endpoint:100 - Error getting Subject CN from certificate. Try setting it specifically with hostnameOverride property. Unable to converts byte array to certificate. error : Extensions not allowed in v2 certificate
2017-03-31 10:53:58 ERROR Chain:161 - Jetty ALPN/NPN has not been properly configured.
i try to solve it but fail. have some suggestions?
Willson (Fri, 31 Mar 2017 08:09:38 GMT):
Till now, i recreate the root cacert, private keys and certs of orderer and peers, and set the VM option "-Xbootclasspath/p", the sdk have been started up, but there is a new error appearing while connecting to the orderer:
org.hyperledger.fabric.sdk.exception.TransactionException: Send transactions failed. Reason: UNAVAILABLE: Channel closed while performing protocol negotiation
i track the logs of the orderer, it shows that:
grpc: Server.Serve failed to complete security handshake from "192.168.216.1:55665": EOF
do my certs illegal?
rickr (Fri, 31 Mar 2017 12:17:52 GMT):
If you're using alpn the bootclasspath is in the pom.xml for the failsafe plugin. Your certs will need a CN that matches the alias for the services in the docker-compose.yaml (ca0, ca1, orderer0 ) if you're using the one we provided. Since most likely your DNS will not match that you'll need to use the `trustServerCertificate` property or `hostnameOverride` on the orderer, peer and eventhubs
Willson (Fri, 31 Mar 2017 12:54:37 GMT):
thanks, where and hwo to set the `trustServerCertificate` property or `hostnameOverride`?
rickr (Fri, 31 Mar 2017 12:56:01 GMT):
look for examples in TestConfig.java
rickr (Fri, 31 Mar 2017 12:56:25 GMT):
its a property like the pemFile
Willson (Fri, 31 Mar 2017 12:58:01 GMT):
ok, let me try it
rickr (Fri, 31 Mar 2017 13:16:08 GMT):
How'd you get past the `r : Extensions not allowed in v2 certificate`
rickr (Fri, 31 Mar 2017 13:17:08 GMT):
I used cfssl and the certs it produced seemed to be ok. Did you use that ?
Willson (Fri, 31 Mar 2017 13:25:45 GMT):
Maybe i was using the v3, after i recreate the root cacerts, it worked
Rymd (Fri, 31 Mar 2017 13:26:15 GMT):
If i use cryptogen tool to generate cryptografic artifacts do i need to create new certificates for my java client? I'm getting this error `Sending proposal to peer failed because of gRPC failure=Status{code=UNKNOWN, description=The creator certificate is not valid, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority, cause=null}` when i'm sending an InstallProposalRequest
Rymd (Fri, 31 Mar 2017 13:26:28 GMT):
or is it something wrong with my network setup
allenc2016 (Fri, 31 Mar 2017 13:41:33 GMT):
Has joined the channel.
Willson (Fri, 31 Mar 2017 13:42:03 GMT):
You no need
Willson (Fri, 31 Mar 2017 13:45:35 GMT):
Most likely for you error is that you did not reset the commitlevel
Willson (Fri, 31 Mar 2017 13:55:45 GMT):
@rickr Setting ·properties.setProperty("trustServerCertificate", "true")· does not seem to work
Willson (Fri, 31 Mar 2017 13:56:22 GMT):
@rickr Setting `properties.setProperty("trustServerCertificate", "true")` does not seem to work
rickr (Fri, 31 Mar 2017 13:57:45 GMT):
in your certs did you have the CN matching the yaml service alias ?
Willson (Fri, 31 Mar 2017 13:58:34 GMT):
Maybe not
bh4rtp (Fri, 31 Mar 2017 14:37:08 GMT):
hi, does the latest fabric-sdk-java run junit-test ok? i launch src/test/fixture/sdkintegration/docker-compose.yaml. and run sdk junit-test, there are a number of errors.
bh4rtp (Fri, 31 Mar 2017 14:41:37 GMT):
2017-03-31 07:39:12 ERROR OrdererClient:104 - sendTransaction error Send transactions failed. Reason: UNAVAILABLE
bh4rtp (Fri, 31 Mar 2017 14:42:15 GMT):
2017-03-31 07:39:13 ERROR CryptoPrimitives:425 - Cannot validate certificate. Error is: Path does not chain with any of the trust anchors
bh4rtp (Fri, 31 Mar 2017 14:42:56 GMT):
2017-03-31 07:39:13 ERROR CryptoPrimitives:229 - Cannot verify. Signature algorithm is invalid. Error is: Could not verify signature
rickr (Fri, 31 Mar 2017 14:46:26 GMT):
They are continuously run and run each time code is delivered and merged
bh4rtp (Fri, 31 Mar 2017 14:56:50 GMT):
Yes, End2endIT.java runs ok.
o.o. (Fri, 31 Mar 2017 16:09:04 GMT):
@Rymd: Vadim has the answers
https://chat.hyperledger.org/channel/fabric-crypto?msg=zdDgp4ebPSNxENTbG
rickr (Fri, 31 Mar 2017 16:18:32 GMT):
If you have the certs/cas to make the End2end flow work .. contributions are welcome :)
ManjeetGambhir (Sat, 01 Apr 2017 16:33:03 GMT):
itrying to run docker compose file provided by java sdk commit level mentioned "315420e" ,but ca server is not coming up
showing error sh: 1: fabric-ca-server: not found
ManjeetGambhir (Sat, 01 Apr 2017 16:33:37 GMT):
@rickr trying to run docker compose file provided by java sdk commit level mentioned "315420e" ,but ca server is not coming up
showing error sh: 1: fabric-ca-server: not found
ManjeetGambhir (Sat, 01 Apr 2017 16:34:47 GMT):
ca0:
image: hyperledger/fabric-ca
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
ports:
- "7054:7054"
# ca_PeerOrg1 uses the key of peerOrg1 so any new registration is automatically included in peerOrg1
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/peerOrg1-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/d8a5b3cac1b821f6e4b487ceaf1fd239cdcfc310894150908b90f05e9179556a_sk -b admin:adminpw ${ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS} --tls.certfile /etc/hyperledger/tls/cas/peerOrg1/cert.pem --tls.keyfile /etc/hyperledger/tls/cas/peerOrg1/key.pem -d'
volumes:
- ./e2e-2Orgs/crypto-config/peerOrganizations/peerOrg1/ca/:/etc/hyperledger/fabric-ca-server-config
- ./e2e-2Orgs/tls:/etc/hyperledger/tls
container_name: ca_peerOrg1
ManjeetGambhir (Sat, 01 Apr 2017 16:38:13 GMT):
ignore
ManjeetGambhir (Sat, 01 Apr 2017 16:38:15 GMT):
it
ManjeetGambhir (Sat, 01 Apr 2017 17:32:32 GMT):
@rickr Sending instantiateProposalRequest to all peers with arguments: a and b set to 100 and 200 respectively
2017-04-01 13:11:49 ERROR Chain:1664 - Sending proposal to peer1 failed because of gRPC failure=Status{code=UNKNOWN, description=Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image
ManjeetGambhir (Sat, 01 Apr 2017 17:32:49 GMT):
with new images .getting above error
ManjeetGambhir (Sat, 01 Apr 2017 17:33:04 GMT):
using E2EIt
ManjeetGambhir (Sat, 01 Apr 2017 17:41:54 GMT):
though I can see chaincode is installed
ManjeetGambhir (Sat, 01 Apr 2017 17:55:11 GMT):
but not created images
ManjeetGambhir (Sat, 01 Apr 2017 17:55:27 GMT):
for sample chaincode
rameshthoomu (Sun, 02 Apr 2017 15:03:52 GMT):
@ManjeetGambhir It seem you don't have ccenv image..
rameshthoomu (Sun, 02 Apr 2017 15:04:17 GMT):
try to pull ccenv image and re-run the tests..
ManjeetGambhir (Sun, 02 Apr 2017 15:05:25 GMT):
Ok sure
reoim10 (Tue, 04 Apr 2017 01:19:03 GMT):
Has joined the channel.
reoim10 (Tue, 04 Apr 2017 01:21:13 GMT):
Hi guys, just have a quick question. Is fabric-sdk-java v1.0 is stable enough or is it still under development?
dharmjit (Tue, 04 Apr 2017 03:44:04 GMT):
Has joined the channel.
ranjan008 (Tue, 04 Apr 2017 07:36:01 GMT):
@rickr in java sdk test classes we are using pre-defined config files for channel configuration and chaincode endorsement policy can we define those things programmatically??
rickr (Tue, 04 Apr 2017 08:35:47 GMT):
There is a change coming that will let you define the CC EP via a yaml file. The channel configuration is very involved and doing it programmatic I feel it's understatement to say it's not for the faint of heart
rohitbordia (Tue, 04 Apr 2017 22:01:39 GMT):
Has joined the channel.
rohitbordia (Tue, 04 Apr 2017 22:02:17 GMT):
Hi Guys, was trying to run sdk-java test and getting following error
rohitbordia (Tue, 04 Apr 2017 22:02:28 GMT):
ava.lang.ClassCastException: org.glassfish.json.JsonStringImpl cannot be cast to javax.json.JsonObject
rohitbordia (Tue, 04 Apr 2017 22:02:41 GMT):
017-04-04 14:45:12 ERROR HFCAClient:305 - org.glassfish.json.JsonStringImpl cannot be cast to javax.json.JsonObject
java.lang.ClassCastException: org.glassfish.json.JsonStringImpl cannot be cast to javax.json.JsonObject
at org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl.getJsonObject(JsonObjectBuilderImpl.java:184)
at org.hyperledger.fabric_ca.sdk.HFCAClient.enroll(HFCAClient.java:292)
rohitbordia (Tue, 04 Apr 2017 22:02:49 GMT):
anyone encountered this error
rickr (Tue, 04 Apr 2017 22:03:17 GMT):
is this a fresh git pull ?
rickr (Tue, 04 Apr 2017 22:03:23 GMT):
no changes ?
rickr (Tue, 04 Apr 2017 22:04:06 GMT):
I've not seen anyone come across that
rickr (Tue, 04 Apr 2017 22:04:10 GMT):
1.0 ?
rickr (Tue, 04 Apr 2017 22:04:22 GMT):
has to be :)
rickr (Tue, 04 Apr 2017 22:05:10 GMT):
more likely a commit level issue
rickr (Tue, 04 Apr 2017 22:05:22 GMT):
are you using what's in the README.md
rohitbordia (Tue, 04 Apr 2017 22:06:31 GMT):
yes , I did the fresh git pull this afternoon
rickr (Tue, 04 Apr 2017 22:07:23 GMT):
of the HLJSDK and do your fabric_ca commit levels match the README.md
rohitbordia (Tue, 04 Apr 2017 22:07:28 GMT):
https://github.com/hyperledger/fabric-sdk-java .. just did git pull .. did setup ca, peers and started to run End2endIT
rohitbordia (Tue, 04 Apr 2017 22:07:36 GMT):
let me check
rohitbordia (Tue, 04 Apr 2017 22:08:29 GMT):
I did setup fabric, ca server using docker
rickr (Tue, 04 Apr 2017 22:09:03 GMT):
did you build the docker images ?
rohitbordia (Tue, 04 Apr 2017 22:10:02 GMT):
when building : image: hyperledger/fabric-ca .. i was getting docker error that no Manifest found
rohitbordia (Tue, 04 Apr 2017 22:10:23 GMT):
so, i build using sfhackfest22017/fabric-ca:x86_64-0.7.0-snapshot-6294c57
rickr (Tue, 04 Apr 2017 22:10:38 GMT):
theres your problme
rickr (Tue, 04 Apr 2017 22:12:01 GMT):
ask on the fabric-ca about your build issue
rohitbordia (Tue, 04 Apr 2017 22:12:07 GMT):
ok
rohitbordia (Tue, 04 Apr 2017 22:15:37 GMT):
thanks rick
rickr (Tue, 04 Apr 2017 22:16:05 GMT):
yw
rohitbordia (Tue, 04 Apr 2017 22:54:22 GMT):
solved the problem by loading latest fabric code
rohitbordia (Tue, 04 Apr 2017 22:56:16 GMT):
but now getting
rohitbordia (Tue, 04 Apr 2017 22:56:18 GMT):
ERROR HFCAClient:554 - POST request to http://localhost:7054/api/v1/cfssl/register failed with status code: 500. Response: {"success":false,"result":null,"errors":[{"code":0,"message":"User 'user1' is already registered"}],"messages":[]}
rickr (Tue, 04 Apr 2017 22:56:50 GMT):
restart DC
rohitbordia (Tue, 04 Apr 2017 22:57:04 GMT):
you mean docker/
rickr (Tue, 04 Apr 2017 22:57:17 GMT):
docker compose
rohitbordia (Tue, 04 Apr 2017 22:57:20 GMT):
ok
rickr (Tue, 04 Apr 2017 22:57:21 GMT):
down up
rohitbordia (Tue, 04 Apr 2017 22:59:39 GMT):
org.apache.http.conn.HttpHostConnectException: Connect to localhost:8054 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused
rohitbordia (Tue, 04 Apr 2017 23:00:39 GMT):
I was looking around and in TestConfig has peerOrg2.ca_location for 8054
rickr (Tue, 04 Apr 2017 23:01:21 GMT):
ok
rohitbordia (Tue, 04 Apr 2017 23:03:58 GMT):
if , I remove that config i get some other exceptions
rickr (Tue, 04 Apr 2017 23:05:05 GMT):
i suggest you follow the readme.md not change a thing get that working then go from there
rohitbordia (Tue, 04 Apr 2017 23:05:15 GMT):
ok
nickmelis (Wed, 05 Apr 2017 09:48:56 GMT):
does anyone know what causes this error (running with HL & sdk 0.6)?
Error:Failed to execute transaction or query(Error sending QUERY: txid:fd9989456b6d30e9b9be4282b5ab4ce3c51be4d8ec997e2bd07b679f2ecc7aaf exists)
nickmelis (Wed, 05 Apr 2017 09:50:25 GMT):
the txid value is my chaincode ID (and I don't understand why it's being used as txid)
mmani99 (Wed, 05 Apr 2017 12:49:45 GMT):
Has joined the channel.
rliu (Wed, 05 Apr 2017 13:14:58 GMT):
Has joined the channel.
rohitbordia (Wed, 05 Apr 2017 18:32:38 GMT):
after making all changes as per readme.md from sdk , after running end2end test , I get Bad deliver expected status 200 got 403
rohitbordia (Wed, 05 Apr 2017 18:33:01 GMT):
017-04-04 16:16:29 ERROR Chain:665 - Bad deliver expected status 200 got 403, Chain foo
org.hyperledger.fabric.sdk.exception.TransactionException: Bad deliver expected status 200 got 403, Chain foo
at org.hyperledger.fabric.sdk.Chain.getGenesisBlock(Chain.java:631)
rickr (Wed, 05 Apr 2017 18:57:05 GMT):
Can you restart your docker containers and see what output there is on the orderer
rohitbordia (Wed, 05 Apr 2017 19:42:57 GMT):
ok
rohitbordia (Wed, 05 Apr 2017 19:54:20 GMT):
orderer_1 | 2017-04-05 19:53:54.240 UTC [orderer/main] Deliver -> DEBU 3e2 Starting new Deliver handler
orderer_1 | 2017-04-05 19:53:54.240 UTC [orderer/common/deliver] Handle -> DEBU 3e3 Starting new deliver loop
orderer_1 | 2017-04-05 19:53:54.240 UTC [orderer/common/deliver] Handle -> DEBU 3e4 Attempting to read seek info message
orderer_1 | 2017-04-05 19:53:54.241 UTC [common/policies] GetPolicy -> DEBU 3e5 Returning policy Readers for evaluation
orderer_1 | 2017-04-05 19:53:54.241 UTC [cauthdsl] func1 -> DEBU 3e6 Gate evaluation starts: (&{N:1 policies:
rohitbordia (Wed, 05 Apr 2017 19:54:59 GMT):
looks like this is the error WARN 3f6 Received unauthorized deliver request for channel foo
rickr (Wed, 05 Apr 2017 20:07:47 GMT):
this is with no changes ?
rohitbordia (Wed, 05 Apr 2017 20:09:28 GMT):
no change.. as it is from README and running the test
rickr (Wed, 05 Apr 2017 20:10:00 GMT):
are you running this in vagrant ?
rohitbordia (Wed, 05 Apr 2017 20:10:28 GMT):
yes on macbook
rickr (Wed, 05 Apr 2017 20:11:26 GMT):
you CD to sdkintegration dir and start your DC from there
rohitbordia (Wed, 05 Apr 2017 20:12:18 GMT):
no I went to src/test/fixture/src as per the youtube video from tuand
rickr (Wed, 05 Apr 2017 20:12:37 GMT):
does the README.md say that ?
rohitbordia (Wed, 05 Apr 2017 20:13:01 GMT):
aah missed that
rohitbordia (Wed, 05 Apr 2017 20:13:15 GMT):
sorry let me running from sdk
rohitbordia (Wed, 05 Apr 2017 20:17:03 GMT):
Hi Rick, what is the best way to understand how hyperledger is working
rohitbordia (Wed, 05 Apr 2017 20:17:36 GMT):
like, ca, orderer is there any document or video I should look for?
rohitbordia (Wed, 05 Apr 2017 20:19:10 GMT):
with sdkintegration it works perfect
rickr (Wed, 05 Apr 2017 20:19:32 GMT):
https://wiki.hyperledger.org/ starter
rohitbordia (Wed, 05 Apr 2017 20:20:54 GMT):
thanks for your help, Im able to run java sdk and its example
rickr (Wed, 05 Apr 2017 20:21:15 GMT):
sure glad to hear it
AvN (Wed, 05 Apr 2017 21:06:55 GMT):
Is the latest build broken ?
AvN (Wed, 05 Apr 2017 21:07:37 GMT):
git clone http://gerrit.hyperledger.org/r/fabric-sdk-java
mvn clean install gives the following errors
fabric-sdk-java/src/main/java/org/hyperledger/fabric/sdk/ChaincodeEndorsementPolicy.java:[30,57] package org.hyperledger.fabric.protos.common.MspPrincipal does not exist
rickr (Wed, 05 Apr 2017 21:29:43 GMT):
there's a bending fix
rickr (Wed, 05 Apr 2017 21:30:14 GMT):
I think it's now merged .. do a refresh
AvN (Wed, 05 Apr 2017 21:36:40 GMT):
Build is fixed. But I am still not able to run the End2End test
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image
at org.hyperledger.fabric.sdk.Chain.sendProposalToPeers(Chain.java:1972)
at org.hyperledger.fabric.sdk.Chain.sendInstantiationProposal(Chain.java:1142)
at org.hyperledger.fabric.sdkintegration.End2endIT.runChain(End2endIT.java:271)
at org.hyperledger.fabric.sdkintegration.End2endIT.setup(End2endIT.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image
rickr (Wed, 05 Apr 2017 21:38:17 GMT):
you have fabric/ca build at the readme.md level ?
AvN (Wed, 05 Apr 2017 23:15:00 GMT):
I am not familiar with vagrant. I am using the docker file in fabric-sdk-java/src/test/fixture/sdkintegration
rickr (Wed, 05 Apr 2017 23:23:05 GMT):
Are you building the docker images ?
rickr (Wed, 05 Apr 2017 23:23:20 GMT):
both fabric and fabric-ca ?
ranjan008 (Thu, 06 Apr 2017 07:41:38 GMT):
@rickr one fabric internal ques if you don't mind .... Is sbft works along with kafka and zookeerper or it is a different ordering algorithm as a whole ?
rickr (Thu, 06 Apr 2017 11:47:52 GMT):
sbft :confused:
rickr (Thu, 06 Apr 2017 11:47:52 GMT):
sbft :confused: The HLJSKD should work with any ordering system solo, kafak et al. If you have a fabric side question the best channel to probably ask that on is #fabric
shsedghi (Thu, 06 Apr 2017 15:06:49 GMT):
[10 7 79 114 103 50 77 83 80 18 197 5 45 45 45 45 45 66 69 71 73 78 32 67 69 82 84 73 70 73 67 65 84 69 45 45 45 45 45 10 77 73 73 66 51 106 67 67 65 89 83 103 65 119 73 66 65 103 73 85 67 73 86 108 85 115 84 76 77 57 48 55 77 47 48 55 77 74 76 117 47 47 76 71 85 76 52 119 67 103 89 73 75 111 90 73 122 106 48 69 65 119 73 119 10 89 68 69 76 77 65 107 71 65 49 85 69 66 104 77 67 86 86 77 120 69 122 65 82 66 103 78 86 66 65 103 84 67 107 78 104 98 71 108 109 98 51 74 117 97 87 69 120 70 106 65 85 66 103 78 86 66 65 99 84 68 86 78 104 10 98 105 66 71 99 109 70 117 89 50 108 122 89 50 56 120 69 84 65 80 66 103 78 86 66 65 111 84 67 72 66 108 90 88 74 80 99 109 99 121 77 82 69 119 68 119 89 68 86 81 81 68 69 119 104 119 90 87 86 121 84 51 74 110 10 77 106 65 101 70 119 48 120 78 122 65 48 77 68 85 121 77 68 65 50 77 68 66 97 70 119 48 120 79 68 65 122 77 68 85 119 78 68 65 50 77 68 66 97 77 66 65 120 68 106 65 77 66 103 78 86 66 65 77 84 66 87 70 107 10 98 87 108 117 77 70 107 119 69 119 89 72 75 111 90 73 122 106 48 67 65 81 89 73 75 111 90 73 122 106 48 68 65 81 99 68 81 103 65 69 78 43 89 117 106 99 86 118 108 97 57 74 79 47 120 85 104 84 79 104 102 73 113 122 10 77 97 54 48 73 89 74 83 77 73 47 109 83 57 43 65 97 75 108 81 57 117 103 77 68 100 106 114 97 65 74 85 53 67 48 49 81 115 70 71 71 88 78 70 118 97 79 57 76 53 90 106 78 86 52 57 99 84 100 76 102 54 78 115 10 77 71 111 119 68 103 89 68 86 82 48 80 65 81 72 47 66 65 81 68 65 103 73 69 77 65 119 71 65 49 85 100 69 119 69 66 47 119 81 67 77 65 65 119 72 81 89 68 86 82 48 79 66 66 89 69 70 71 76 71 82 72 49 104 10 86 47 54 77 53 81 83 111 88 57 101 112 49 68 55 122 66 108 117 86 77 67 115 71 65 49 85 100 73 119 81 107 77 67 75 65 73 74 97 57 116 88 57 79 43 57 122 121 65 97 74 112 105 90 54 48 102 105 112 122 43 55 99 111 10 114 104 84 85 102 81 49 97 43 51 88 100 54 110 72 101 77 65 111 71 67 67 113 71 83 77 52 57 66 65 77 67 65 48 103 65 77 69 85 67 73 81 68 84 89 47 77 104 88 77 77 53 105 82 80 74 81 70 79 67 98 76 82 121 10 109 51 103 47 116 53 53 122 112 111 89 85 66 84 113 47 107 119 49 103 77 81 73 103 79 47 105 114 115 51 119 111 51 87 48 74 47 76 48 54 90 115 54 67 54 118 89 90 85 116 104 51 84 105 49 117 110 108 73 120 112 106 90 75 10 56 112 77 61 10 45 45 45 45 45 69 78 68 32 67 69 82 84 73 70 73 67 65 84 69 45 45 45 45 45 10]
rickr (Thu, 06 Apr 2017 15:16:47 GMT):
@shsedghi please delete ^^^
shsedghi (Thu, 06 Apr 2017 17:51:57 GMT):
sorry did not know when this happend
rickr (Thu, 06 Apr 2017 17:56:20 GMT):
np
AvN (Thu, 06 Apr 2017 23:07:24 GMT):
image: hyperledger/fabric-peer:x86_64-1.0.0-alpha
image: hyperledger/fabric-couchdb:x86_64-1.0.0-alpha
image: hyperledger/fabric-orderer:x86_64-1.0.0-alpha
image: hyperledger/fabric-ca:x86_64-1.0.0-alpha
AvN (Thu, 06 Apr 2017 23:07:47 GMT):
These are the docker images I am using. The latest docker images dont seem to work
AvN (Thu, 06 Apr 2017 23:08:31 GMT):
I am using the ones published to the public repository https://hub.docker.com/u/hyperledger/
rohitbordia (Thu, 06 Apr 2017 23:25:00 GMT):
AvN, did you took the docker images using the script
rohitbordia (Thu, 06 Apr 2017 23:25:27 GMT):
I downloaded all images from : https://github.com/hyperledger/fabric/blob/master/examples/e2e_cli/download-dockerimages.sh
rohitbordia (Thu, 06 Apr 2017 23:26:15 GMT):
then ran : fabric-sdk-java/src/test/fixture/sdkintegration , docker-compose -f docker-compose.yaml up
rohitbordia (Thu, 06 Apr 2017 23:26:49 GMT):
and Ran end2End test and it worked
xiangyw (Fri, 07 Apr 2017 01:30:33 GMT):
@rickr hi rickr, i am test End2endIT with docker-compose.yaml under fabric-sdk-java/src/test/fixture/sdkintegration, all images are x86_64-1.0.0-alpha, 2 install requests are Successful+verified until now, but instantiateProposalRequest timeout, i saw the following error in chaincode container's logs, can you give me some suggestion?
xiangyw (Fri, 07 Apr 2017 01:30:45 GMT):
Message Attachments
xiangyw (Fri, 07 Apr 2017 01:31:48 GMT):
Message Attachments
rickr (Fri, 07 Apr 2017 01:32:15 GMT):
I don't run with alpha. I never have. Please follow the readme.md or maybe someone else here can help you.
xiangyw (Fri, 07 Apr 2017 01:33:15 GMT):
thanks anyway
rickr (Fri, 07 Apr 2017 01:34:57 GMT):
I think most people have been able to follow it and get it to work.
xuanyue202 (Fri, 07 Apr 2017 02:16:22 GMT):
Hi guys, is this sdk for both application and chaincode?
rickr (Fri, 07 Apr 2017 02:21:15 GMT):
The first paragraph of the README.md may help -- get back if it doesn't
AvN (Fri, 07 Apr 2017 03:30:44 GMT):
If you dont want to build fabric, and instead want to rely on the fabric images, whatever Rohit suggested works fine.
https://github.com/hyperledger/fabric/blob/master/examples/e2e_cli/download-dockerimages.sh
sh download-dockerimages.sh
Will download all the necessary docker images and tag them as the latest.
docker-compose up --force-recreate should start the peers and orderers
xiangyw (Fri, 07 Apr 2017 03:31:11 GMT):
Message Attachments
JayXie (Fri, 07 Apr 2017 03:38:42 GMT):
Has joined the channel.
kaz (Fri, 07 Apr 2017 04:00:57 GMT):
Has joined the channel.
xuanyue202 (Fri, 07 Apr 2017 06:29:09 GMT):
@rickr but when I try to use the sdk to write chaincode and run, it throws the err: "Sent GOAWAY: lastStreamId '0', errorCode '1', debugData 'First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002'. Forcing shutdown of the connection." I am using the lastest commit of fabric-sdk-java master, and recommended commit of fabric in README.md
o.o. (Fri, 07 Apr 2017 07:48:36 GMT):
Does someone know what `Sending proposal to peer_0 failed because of gRPC failure=Status{code=UNKNOWN, description=Failed to deserialize creator identity, err MSP Org1MSP is unknown, cause=null}` means.
It happens as I try to do a _init_ instantiateproposal. I have an MSP with id _Org1MSP, and I set this as mspid for the user so that enrolling works (admin user).
o.o. (Fri, 07 Apr 2017 07:48:36 GMT):
Does someone know what `Sending proposal to peer_0 failed because of gRPC failure=Status{code=UNKNOWN, description=Failed to deserialize creator identity, err MSP Org1MSP is unknown, cause=null}` means.
It happens as I try to do a _init_ instantiateproposal. I have an MSP with id _Org1MSP_, and I set this as mspid for the user so that enrolling works (admin user).
o.o. (Fri, 07 Apr 2017 07:52:10 GMT):
Should the user not have just a string with the MSP definition ID?
o.o. (Fri, 07 Apr 2017 07:52:10 GMT):
Should the user not have just a string as mspid with the MSP definition ID?
o.o. (Fri, 07 Apr 2017 07:52:10 GMT):
Should the user not have just a string as mspid with the MSP definition ID?
sangramkhaire (Fri, 07 Apr 2017 08:28:30 GMT):
Has joined the channel.
gujx (Fri, 07 Apr 2017 10:22:49 GMT):
Has joined the channel.
o.o. (Fri, 07 Apr 2017 11:02:19 GMT):
I might have used the wrong one of `join/addPeer` when doing construct-chain; or perhaps used the wrong files as genesis .block and channel .tx.
rickr (Fri, 07 Apr 2017 12:26:53 GMT):
ok so it sounds like you resolve your issue.
rickr (Fri, 07 Apr 2017 12:26:53 GMT):
ok so it sounds like you resolved your issue.
rickr (Fri, 07 Apr 2017 12:32:19 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=xpDZ8GKmxPaHfJQgp) @xuanyue202 I have never seen that msg before. Did you first try to run the end2endIIT test as suggested in the readme.md to see if your setup is working ? I would recommend always doing that each time anyone gets the sdk to make sure your env. is ok and then move on to writing your own chain code
o.o. (Fri, 07 Apr 2017 16:16:16 GMT):
How do I parse the large box of hex number pairs in a thing that looks like `Peer Identity [0a 07 4f ... ]`?
o.o. (Fri, 07 Apr 2017 16:16:16 GMT):
How do I parse the large box of hex number pairs in a thing that looks like `Peer Identity [0a 07 4f ... ]`? (As given in peer logging)
rohitbordia (Fri, 07 Apr 2017 18:32:50 GMT):
@rick: If i deploy the README to a unix box
rohitbordia (Fri, 07 Apr 2017 18:33:52 GMT):
what changes wil i need to do make to run test from my machine to the containers running in unix box
ibmmqmet (Sat, 08 Apr 2017 11:10:25 GMT):
Has joined the channel.
rickr (Sat, 08 Apr 2017 12:55:00 GMT):
If you're asking how you can get the test to run against another system then look at the `defaultProperty ` in `src/test/java/org/hyperledger/fabric/sdk/testutils/TestConfig.java`
rickr (Sat, 08 Apr 2017 12:55:00 GMT):
If you're asking how you can get the test to run against another system then look at the `defaultProperty ` in `src/test/java/org/hyperledger/fabric/sdk/testutils/TestConfig.java` probably all the localhost references will need changing
Adeel Qureshi (Sat, 08 Apr 2017 15:12:48 GMT):
Has joined the channel.
king3000 (Mon, 10 Apr 2017 01:52:56 GMT):
Has joined the channel.
peter.kalambet (Mon, 10 Apr 2017 11:06:47 GMT):
Has joined the channel.
kimmokh (Mon, 10 Apr 2017 11:36:41 GMT):
Has joined the channel.
zian (Mon, 10 Apr 2017 14:02:25 GMT):
Has joined the channel.
in0rdr (Mon, 10 Apr 2017 14:25:22 GMT):
Has joined the channel.
clempo (Mon, 10 Apr 2017 15:33:42 GMT):
Has joined the channel.
clempo (Mon, 10 Apr 2017 15:35:04 GMT):
I am trying to start the environment to be able to run the end2end integration tests.cp10710@devdc2:/opt/gopath/src/github.com/hyperledger/fabric-sdk-java/src/test/fixture/sdkintegration$ docker-compose up
clempo (Mon, 10 Apr 2017 15:35:49 GMT):
and I get this error ERROR: for couchdb Cannot create container for service couchdb: Conflict. The container name "/couchdb" is already in use by container aced3b3753c2ad34ff121184c9dac42048d067983d95aa081842fd85cf09ff7f. You have to remove (or rename) that container to be able to reuse that name.
clempo (Mon, 10 Apr 2017 15:36:44 GMT):
I downloaded the images with /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/download-dockerimages.sh
rickr (Mon, 10 Apr 2017 15:38:30 GMT):
I'd recommend following the readme.md never worked with script
clempo (Mon, 10 Apr 2017 15:39:27 GMT):
I am not familiar with vagrant. Isn't vagrant supposed to be deprecated in v1.0
clempo (Mon, 10 Apr 2017 15:43:08 GMT):
alright then, how do I clean up my environment so I can start again from the readme
clempo (Mon, 10 Apr 2017 15:46:50 GMT):
Do I need to run build/bin/configtxgen the first time I run the tests, or that's just when I create a new channel for my work?
rickr (Mon, 10 Apr 2017 15:47:14 GMT):
No -- you really don't strictly need vagrant if you can build it natively
clempo (Mon, 10 Apr 2017 15:47:39 GMT):
I did rebuild all of fabric
rickr (Mon, 10 Apr 2017 15:47:43 GMT):
And no v1.0 still and will support vagarant buidl
clempo (Mon, 10 Apr 2017 15:48:09 GMT):
it complained about the "latest" image
clempo (Mon, 10 Apr 2017 15:48:22 GMT):
still learning docker, so I found that script that also did it for me
clempo (Mon, 10 Apr 2017 15:51:46 GMT):
Do you plan to make the integration tests self-contained instead of relying on a pre-existing environment?
rickr (Mon, 10 Apr 2017 15:53:57 GMT):
The `integration` tests rely on a fabric and fabric_ca they are also fairly complete examples of using the sdk. So I see no change in that
clempo (Mon, 10 Apr 2017 15:55:02 GMT):
That's unfortunate. I find the java sdk easy to learn but setting up a running fabric environment very difficult
rickr (Mon, 10 Apr 2017 15:55:45 GMT):
Well what would you do with the SDK with without anything to run it against ?
clempo (Mon, 10 Apr 2017 15:56:19 GMT):
I would have the tests start the environment it needs
clempo (Mon, 10 Apr 2017 15:57:01 GMT):
That would give an example to build upon
rickr (Mon, 10 Apr 2017 16:00:36 GMT):
If someone is committed to doing they're welcome to give it a shot.
rickr (Mon, 10 Apr 2017 16:03:37 GMT):
The direction will probably be more like publishing fabric/fabric_ca images to docker that we know works with the sdk that have past the integration test along with snapshot images of the sdk to maven
clempo (Mon, 10 Apr 2017 16:10:12 GMT):
This page explains how to solve my problem with the zombie container http://www.dedoimedo.com/computers/docker-create-remove-named-container-fix.html
clempo (Mon, 10 Apr 2017 16:10:22 GMT):
docker rm
clempo (Mon, 10 Apr 2017 16:10:34 GMT):
now I can start the environment
clempo (Mon, 10 Apr 2017 16:19:15 GMT):
and the integration tests ran successfully
rohitbordia (Mon, 10 Apr 2017 17:55:40 GMT):
@rickr: thanks, I ran docker-compose in another system .. Didnt change anything the container can be accessed by localhost
rohitbordia (Mon, 10 Apr 2017 17:56:03 GMT):
Im thinking I need to add host in docker-compose so that it uses system port
pschnap (Mon, 10 Apr 2017 18:07:31 GMT):
It looks like to build the SDK you have to have exactly v3.0.0 of protoc?
pschnap (Mon, 10 Apr 2017 19:30:23 GMT):
protoc does not seem to be running to generate the java code form the proto stuff, how can I get it to generate these files?
rickr (Mon, 10 Apr 2017 19:31:39 GMT):
what's the command you're using
pschnap (Mon, 10 Apr 2017 19:32:45 GMT):
I'm not calling it manually, I thought the mvn stuff was supposed to take care of that (correct me if I'm wrong); I had to change the dependency on protoc to 3.2 since that's what I have installed and that seemed to work, but after I cleaned it went back to not finding (some of?) the generated files
pschnap (Mon, 10 Apr 2017 19:33:26 GMT):
I was just calling mvn install but that's erroring on the tests, I don't know if that affects anything
rickr (Mon, 10 Apr 2017 19:33:51 GMT):
should not have to change anything to first run the integration tests
pschnap (Mon, 10 Apr 2017 19:34:16 GMT):
the orderer/peer need to be running for the tests to complete, I assume?
rickr (Mon, 10 Apr 2017 19:34:57 GMT):
for the integration test .. have read over the readme.md .. ?
pschnap (Mon, 10 Apr 2017 19:36:18 GMT):
weird, the "readme.md" link sent me to some weird site
rickr (Mon, 10 Apr 2017 19:36:51 GMT):
should be on your disk
pschnap (Mon, 10 Apr 2017 19:37:08 GMT):
I read some of the readme on github but did only skim a majority of it
pschnap (Mon, 10 Apr 2017 19:37:29 GMT):
I'm running my peer inside an ubuntu VM, not using the std vagrant environment
rickr (Mon, 10 Apr 2017 19:37:40 GMT):
that should be ok
rickr (Mon, 10 Apr 2017 19:38:09 GMT):
have you built the fabric and fabric_ca creating the docker images ?
rickr (Mon, 10 Apr 2017 19:39:04 GMT):
without changing a single thing
if you in the sdk directory
do `mvn clean install` what happens
pschnap (Mon, 10 Apr 2017 19:39:05 GMT):
haven't built the fabric_ca
pschnap (Mon, 10 Apr 2017 19:39:41 GMT):
the fabric seems to fail at some point due to incompatible docker-compose versions, though I can still run the orderer and peer
pschnap (Mon, 10 Apr 2017 19:40:43 GMT):
`mvn clean install` succeeded even though a bunch of exception traces were shown
rickr (Mon, 10 Apr 2017 19:40:55 GMT):
y normal
rickr (Mon, 10 Apr 2017 19:41:51 GMT):
next step is to build the fabric and ca ..
pschnap (Mon, 10 Apr 2017 19:42:27 GMT):
ok, I'll work on that; thank you very much for your help @rickr !
rickr (Mon, 10 Apr 2017 19:43:31 GMT):
others have been able to pull the images from somewhere wo building if you read back.. but you're own your own
rickr (Mon, 10 Apr 2017 19:43:31 GMT):
others have been able to pull the images from somewhere wo building if you read back.. but you're on your own
pschnap (Mon, 10 Apr 2017 19:43:56 GMT):
hm, hadn't though of that
pschnap (Mon, 10 Apr 2017 19:44:12 GMT):
may give it a try
pschnap (Mon, 10 Apr 2017 19:44:17 GMT):
thanks!
rohitbordia (Tue, 11 Apr 2017 00:02:30 GMT):
has anyone came across this error
rohitbordia (Tue, 11 Apr 2017 00:02:30 GMT):
Fatal error when setting up MSP from directory /etc/hyperledger/msp/peer/: err Could not load a valid signer certificate from directory /etc/hyperledger/msp/peer/signcerts, err Could not read directory open /etc/hyperledger/msp/peer/signcerts: no such file or directory, err /etc/hyperledger/msp/peer/signcerts
rickr (Tue, 11 Apr 2017 00:17:13 GMT):
the setup of the docker-compose in the sdk mounts directory that map to the msp needed. That should be there if you have the whole sdkintegration directory with it's docker-compose and you're starting it from there.
rickr (Tue, 11 Apr 2017 00:18:15 GMT):
by _whole_ it should in include all it sub directories too.
medlahbib (Tue, 11 Apr 2017 11:23:52 GMT):
Has joined the channel.
medlahbib (Tue, 11 Apr 2017 11:24:31 GMT):
hi ,
I am trying to work with Java Sdk but when i was trying to build the Java SDK project i have this error with all classes inside `org.hyperledger.fabric.protos` they doesn't even exist in my project `The import org.hyperledger.fabric.protos cannot be resolved`
nickmelis (Tue, 11 Apr 2017 12:37:58 GMT):
have you tried to build the SDK first?
nickmelis (Tue, 11 Apr 2017 13:12:19 GMT):
does anyone know if Java SDK 0.6 works with SSL?
nickmelis (Tue, 11 Apr 2017 13:12:29 GMT):
and if not, will it be supported by 1.0?
rickr (Tue, 11 Apr 2017 13:17:26 GMT):
TLS is working with v1.0 of the sdk. Generally it's not enabled if you just run the integration suite but during our verify builds we do it have it enabled
nickmelis (Tue, 11 Apr 2017 13:27:49 GMT):
great news @rickr. Do you have any idea if it was supported in v0.6 too?
rickr (Tue, 11 Apr 2017 13:36:48 GMT):
Wasn't on board then.
nickmelis (Tue, 11 Apr 2017 13:58:43 GMT):
ah right ok! thanks for the info!
clempo (Tue, 11 Apr 2017 15:37:55 GMT):
I am studying End2endAndBackAgainIT to learn how to create a ChainCodeID. In the file org.hyperledger.fabric.protos.peer.ChainCode, it says
clempo (Tue, 11 Apr 2017 15:37:56 GMT):
*ChaincodeID contains the path as specified by the deploy transaction
*that created it as well as the hashCode that is generated by the
*system for the path. From the user level (ie, CLI, REST API and so on)
*deploy transaction is expected to provide the path and other requests
*are expected to provide the hashCode. The other value will be ignored.
*Internally, the structure could contain both values. For instance, the
*hashCode will be set when first generated using the path
clempo (Tue, 11 Apr 2017 15:38:22 GMT):
In the sample, it sets both the name and the path and the name does not like a hash
clempo (Tue, 11 Apr 2017 15:38:31 GMT):
which one is more correct?
clempo (Tue, 11 Apr 2017 15:39:13 GMT):
This is what it says for getName
clempo (Tue, 11 Apr 2017 15:39:14 GMT):
*all other requests will use the name (really a hashcode) generated by
*the deploy transaction
*
*
* optional string name = 2;
*/
public java.lang.String getName() {
rickr (Tue, 11 Apr 2017 15:39:38 GMT):
where is that it state that about the hash ..I think that's out of date
rickr (Tue, 11 Apr 2017 15:40:00 GMT):
I suggest to follow the End2endIT example
rickr (Tue, 11 Apr 2017 15:40:05 GMT):
what really works
clempo (Tue, 11 Apr 2017 15:43:23 GMT):
End2EndAndBackAgainIT is better for me because I do not want to install a new chaincode. I'm really grateful the two use cases are there.
rickr (Tue, 11 Apr 2017 15:44:26 GMT):
can you tell me where that hash statement came from so I can if necessary clean it up
clempo (Tue, 11 Apr 2017 15:44:44 GMT):
>>> In the file org.hyperledger.fabric.protos.peer.ChainCode
clempo (Tue, 11 Apr 2017 15:45:00 GMT):
That file resides in target/generated-sources
clempo (Tue, 11 Apr 2017 15:46:21 GMT):
Can the name and path of a chain code ID be arbitrary values, or they need to match something with the actual chain code
rickr (Tue, 11 Apr 2017 15:47:00 GMT):
In general unless your doing a real deepdive into hyperledger I would recommend staying away from proto or generated code ...
The SDK tries to hide that complexitiy .. and to be honest the proto description are not up to date
clempo (Tue, 11 Apr 2017 15:48:08 GMT):
OK, but the layer in the SDK was not informative what the name and path should be
clempo (Tue, 11 Apr 2017 15:48:26 GMT):
For example, my first question was whether I needed a copy of the chain code source code in every caller
clempo (Tue, 11 Apr 2017 15:48:36 GMT):
the proto layer seems to say no
clempo (Tue, 11 Apr 2017 15:49:33 GMT):
and the path does not seem related to the source code path since that's a different field
rickr (Tue, 11 Apr 2017 15:50:47 GMT):
```
InstallProposalRequest installProposalRequest = client.newInstallProposalRequest();
installProposalRequest.setChaincodeID(chainCodeID);
////For GO language and serving just a single user, chaincodeSource is mostly likely the users GOPATH
installProposalRequest.setChaincodeSourceLocation(new File(TEST_FIXTURES_PATH + "/sdkintegration/gocc/sample1"));
installProposalRequest.setChaincodeVersion(CHAIN_CODE_VERSION);``
``
clempo (Tue, 11 Apr 2017 15:51:20 GMT):
yes, that's where I discovered the path and source path are not the same thing
clempo (Tue, 11 Apr 2017 15:51:31 GMT):
this is not obvious at first
rickr (Tue, 11 Apr 2017 15:52:06 GMT):
the Chaincode ID can be any thing but I'd stick to alphanumerics same with version
clempo (Tue, 11 Apr 2017 15:52:43 GMT):
I assume the convention will be to use domain names as part of the path like Java does for packages
clempo (Tue, 11 Apr 2017 15:52:52 GMT):
part -> path
clempo (Tue, 11 Apr 2017 15:56:04 GMT):
ignore the mistyped "part -> path"
rickr (Tue, 11 Apr 2017 15:56:34 GMT):
at the moment Java chain is not working .. once it does I'll have an update that will show how to deploy it.
clempo (Tue, 11 Apr 2017 15:58:32 GMT):
Nice to know. I'm working on the client side for now. Any chaincode will do. So I'm fine.
rickr (Tue, 11 Apr 2017 15:59:25 GMT):
for GO the sourcelocation will be the root where we tar from. But only files in that are tared up are chaincodeSourceLocation /chainCodeID.path
any libraries needed have to be vendorized
clempo (Tue, 11 Apr 2017 16:01:31 GMT):
OK. I'm not there yet. I figured out the ChainCodeID. Next is to figure out which parms I need to configure a User. I'll study this more and come back if I need help.
clempo (Tue, 11 Apr 2017 16:01:33 GMT):
Thanks
rickr (Tue, 11 Apr 2017 16:02:20 GMT):
IMO best look at both samples see what they do look at how the CC is layed out too
rohitbordia (Tue, 11 Apr 2017 17:13:07 GMT):
does anyone know why we need hyperledger/fabric-baseos:x86_64-0.3.0
rohitbordia (Tue, 11 Apr 2017 17:13:48 GMT):
while running the test case from sdkintegration , I see my test case is failing 2017-04-11 17:10:42.579 UTC [dockercontroller] deployImage -> ERRO 642 Image Output:
peer0 | ********************
peer0 | Step 1/3 : FROM hyperledger/fabric-baseos:x86_64-0.3.0
peer0 |
peer0 | ********************
samdeir (Tue, 11 Apr 2017 17:24:04 GMT):
why when i pull the SDK its full of compile errors!
rickr (Tue, 11 Apr 2017 17:24:49 GMT):
how'd you compile it ?
samdeir (Tue, 11 Apr 2017 17:24:56 GMT):
lot of imports are not there
samdeir (Tue, 11 Apr 2017 17:25:07 GMT):
i use intillij
samdeir (Tue, 11 Apr 2017 17:25:09 GMT):
maven
samdeir (Tue, 11 Apr 2017 17:25:19 GMT):
it worked like 2 weeks ago
rickr (Tue, 11 Apr 2017 17:25:36 GMT):
what are the errors ?
rickr (Tue, 11 Apr 2017 17:25:51 GMT):
There have been breaking updates
samdeir (Tue, 11 Apr 2017 17:26:18 GMT):
import org.hyperledger.fabric.protos.msp.Identities;
import org.hyperledger.fabric.protos.peer.Chaincode;
import org.hyperledger.fabric.protos.peer.FabricProposal;
import org.hyperledger.fabric.protos.peer.FabricProposalResponse;
samdeir (Tue, 11 Apr 2017 17:26:25 GMT):
on many files
samdeir (Tue, 11 Apr 2017 17:26:51 GMT):
it seems the protos package is gone
rickr (Tue, 11 Apr 2017 17:27:00 GMT):
from the sdk directory what happens if you do a
mvn clean install
rickr (Tue, 11 Apr 2017 17:27:38 GMT):
is there finally a build success msg ?
samdeir (Tue, 11 Apr 2017 17:28:28 GMT):
[INFO] 31 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.277 s
[INFO] Finished at: 2017-04-11T13:27:41-04:00
[INFO] Final Memory: 29M/592M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project fabric-sdk-java: Compilation failure: Compilation failure:
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[49,22] package Chaincode does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[54,28] package ChaincodeSpec does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[65,49] package Chaincode does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[108,26] package FabricProposal does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[115,83] package Chaincode does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[115,27] package FabricProposal does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[159,76] package Chaincode does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[159,115] package ChaincodeSpec does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[159,13] cannot find symbol
[ERROR] symbol: class ChaincodeInvocationSpec
[ERROR] location: class org.hyperledger.fabric.sdk.transaction.ProposalBuilder
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[223,48] package ChaincodeSpec does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[54,56] package ChaincodeSpec does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[93,40] package Chaincode.ChaincodeSpec does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[93,76] package Chaincode.ChaincodeSpec does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[118,9] cannot find symbol
[ERROR] symbol: class ChaincodeHeaderExtension
[ERROR] location: class org.hyperledger.fabric.sdk.transaction.ProposalBuilder
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-
samdeir (Tue, 11 Apr 2017 17:30:55 GMT):
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[49,22] package Chaincode does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[54,28] package ChaincodeSpec does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[65,49] package Chaincode does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[108,26] package FabricProposal does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[115,83] package Chaincode does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[115,27] package FabricProposal does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[159,76] package Chaincode does not exist
[ERROR] /home/ubuntub/IdeaProjects/fabric-sdk-java-new/src/main/java/org/hyperledger/fabric/sdk/transaction/ProposalBuilder.java:[159,115] package ChaincodeSpec does not exist
rickr (Tue, 11 Apr 2017 17:31:51 GMT):
can you download a fresh copy from git and and do that ?
samdeir (Tue, 11 Apr 2017 17:32:36 GMT):
i just did that 30 min ago, is there a newer one?
rickr (Tue, 11 Apr 2017 17:32:41 GMT):
no
samdeir (Tue, 11 Apr 2017 17:32:54 GMT):
then this is the latest
samdeir (Tue, 11 Apr 2017 17:33:31 GMT):
just downloaded the latest and compiled and that what i have
samdeir (Tue, 11 Apr 2017 17:33:46 GMT):
i'm still working on an old one that works fine
rickr (Tue, 11 Apr 2017 17:37:36 GMT):
not sure what's going on in your environment .. Just to make sure I just did a fresh git clone from github and it built ok
rickr (Tue, 11 Apr 2017 17:38:05 GMT):
right now you're the only one I know of that's reporting this
samdeir (Tue, 11 Apr 2017 17:38:22 GMT):
are you using this git https://github.com/hyperledger/fabric-sdk-java.git
rickr (Tue, 11 Apr 2017 17:39:00 GMT):
$git clone git@github.com:hyperledger/fabric-sdk-java.git
rickr (Tue, 11 Apr 2017 17:46:01 GMT):
http://www.heypasteit.com/clip/02RDXB
rickr (Tue, 11 Apr 2017 17:46:50 GMT):
src/main
find -type f | xargs sum
rickr (Tue, 11 Apr 2017 17:52:02 GMT):
build failed https://gerrit.hyperledger.org/r/#/c/7933/
samdeir (Tue, 11 Apr 2017 17:59:14 GMT):
Thanks
samdeir (Tue, 11 Apr 2017 17:59:36 GMT):
i'll get new Vm and clone the code on it
rickr (Tue, 11 Apr 2017 18:00:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=iDPWRXo53hA68DJ6J)
Just to be clear that was on a development build .. not what's in github
Actually posted it in the wrong chat. Too many balls up in the air
samdeir (Tue, 11 Apr 2017 18:06:49 GMT):
got it, for some reason it didn't generate the sources
samdeir (Tue, 11 Apr 2017 18:06:54 GMT):
not it works fine
samdeir (Tue, 11 Apr 2017 18:07:04 GMT):
thanks for clearing things up
clempo (Tue, 11 Apr 2017 19:00:39 GMT):
User.getAccount() is never called, is that a bug in the User interface or in the rest of the SDK?
clempo (Tue, 11 Apr 2017 19:01:10 GMT):
I found this comment in PeerClientTest
clempo (Tue, 11 Apr 2017 19:01:12 GMT):
128: // //registrationRequest.setAccount(); TODO setAccount missing from registrationRequest?
rickr (Tue, 11 Apr 2017 19:05:16 GMT):
The SDK is still WIP :) That will come into play when we support Tcerts.
Are you experiencing a bug with that
clempo (Tue, 11 Apr 2017 19:06:37 GMT):
no bug, more a documentation bug
clempo (Tue, 11 Apr 2017 19:06:51 GMT):
what is the affiliation and account used for
clempo (Tue, 11 Apr 2017 19:07:05 GMT):
I have not seen those in typical User ifaces
rickr (Tue, 11 Apr 2017 19:07:13 GMT):
as I said above
clempo (Tue, 11 Apr 2017 19:08:25 GMT):
still confused, what is the affiliation and account used for in Tcert support
rickr (Tue, 11 Apr 2017 19:08:33 GMT):
y
clempo (Tue, 11 Apr 2017 19:09:02 GMT):
I have to expose parameters to let my users make chaincode call
clempo (Tue, 11 Apr 2017 19:09:09 GMT):
what do I tell them these are for?
clempo (Tue, 11 Apr 2017 19:09:53 GMT):
so they know how to fill it in
rickr (Tue, 11 Apr 2017 19:10:30 GMT):
Right now just view them as optional that should not set/use
clempo (Tue, 11 Apr 2017 19:10:54 GMT):
ok, I will not expose them for now
rickr (Tue, 11 Apr 2017 19:11:12 GMT):
name and enrollement is what's important at this moment
clempo (Tue, 11 Apr 2017 19:11:33 GMT):
yes, I will assume my users are already registered
clempo (Tue, 11 Apr 2017 19:11:50 GMT):
the user gets the enrollment from the sys admin?
rickr (Tue, 11 Apr 2017 19:13:56 GMT):
Look at the flow from End2endIt ... admin can register other users with FabricCA ... the user then enrolls that gets him an Enrollement
clempo (Tue, 11 Apr 2017 19:14:33 GMT):
yes, I saw that, but that's within a single program acting as many participants
clempo (Tue, 11 Apr 2017 19:14:48 GMT):
in real life, there is a human user in a separate client program
clempo (Tue, 11 Apr 2017 19:15:01 GMT):
where does the human get the enrollment from?
clempo (Tue, 11 Apr 2017 19:15:15 GMT):
that looks like a long password that he can't remember
rickr (Tue, 11 Apr 2017 19:16:12 GMT):
We're just the messenger :) :
clempo (Tue, 11 Apr 2017 19:16:53 GMT):
I expected you would it is the app responsibility, but I would appreciate guidance
clempo (Tue, 11 Apr 2017 19:17:07 GMT):
is the enrollment typable or it's binary?
clempo (Tue, 11 Apr 2017 19:17:28 GMT):
would -> would say
clempo (Tue, 11 Apr 2017 19:18:00 GMT):
surely, you have something in mind how this is supposed to be used in real life
clempo (Tue, 11 Apr 2017 19:18:08 GMT):
like, should I store this in ldap
clempo (Tue, 11 Apr 2017 19:18:39 GMT):
should I recompute it each time? query it from the fabric_ca?
clempo (Tue, 11 Apr 2017 19:19:08 GMT):
store it in an encrypted file
clempo (Tue, 11 Apr 2017 19:19:52 GMT):
I assume a user would prefer to type a username/password than a username/enrollment
clempo (Tue, 11 Apr 2017 19:22:41 GMT):
I guess it could be treated like a private key
clempo (Tue, 11 Apr 2017 19:23:01 GMT):
but I'd like to do the same thing the standard fabric GUIs do it
rickr (Tue, 11 Apr 2017 19:23:36 GMT):
you're free to persist for user Enrollment any way you wish. Give a user a username/password to a retrieve it
rickr (Tue, 11 Apr 2017 19:24:45 GMT):
but yes there are security implications it has certs and private keys
clempo (Tue, 11 Apr 2017 19:25:41 GMT):
didn't know it had internal structure
clempo (Tue, 11 Apr 2017 19:25:48 GMT):
probably not accessible
clempo (Tue, 11 Apr 2017 19:26:37 GMT):
are there fabric tools that take enrollment as parameter?
rickr (Tue, 11 Apr 2017 19:27:18 GMT):
Yes and no
clempo (Tue, 11 Apr 2017 19:29:28 GMT):
an enrollment clearly expires if it contains certs
rickr (Tue, 11 Apr 2017 19:29:34 GMT):
EVERYTHING needs to be signed by the user.. all Proposals .. transactions. The SDK does that AND validates responses
clempo (Tue, 11 Apr 2017 19:29:59 GMT):
can you update a user without making it completely new user?
rickr (Tue, 11 Apr 2017 19:30:02 GMT):
are signed by the organizations for that chang
rickr (Tue, 11 Apr 2017 19:30:02 GMT):
are signed by the organizations for that chain
clempo (Tue, 11 Apr 2017 19:31:14 GMT):
for now, I'll ask my users to tell the path to a file that contains the enrollment, we may improve that later
clempo (Tue, 11 Apr 2017 19:32:02 GMT):
is it possible to update the keys of a user when his cert expires?
clempo (Tue, 11 Apr 2017 19:32:55 GMT):
what happens to the old stuff he signed?
rickr (Tue, 11 Apr 2017 19:35:01 GMT):
org/hyperledger/fabric_ca/sdkintegration/HFCAClientEnrollIT.java ?
clempo (Tue, 11 Apr 2017 19:35:17 GMT):
I'll take a look
clempo (Tue, 11 Apr 2017 19:37:04 GMT):
looks like reenroll should do it
rickr (Tue, 11 Apr 2017 19:37:44 GMT):
If you specific question the details of enrollments and user the experts are on the fabric-ca channel
clempo (Tue, 11 Apr 2017 19:38:19 GMT):
I'll take note of that
clempo (Tue, 11 Apr 2017 19:40:22 GMT):
to reconstruct a chain, the code needs to know a lot about the network, peers, orderers...
clempo (Tue, 11 Apr 2017 19:40:39 GMT):
compare that to bittorrent that figures all of it
clempo (Tue, 11 Apr 2017 19:41:10 GMT):
I'm struggling to figure out how to let my users configure all this
clempo (Tue, 11 Apr 2017 19:41:24 GMT):
is there a discovery protocol or one that is planned?
rickr (Tue, 11 Apr 2017 19:41:56 GMT):
more of a question for fabric channel
clempo (Tue, 11 Apr 2017 19:42:32 GMT):
no problem
Lin-YiTang (Tue, 11 Apr 2017 21:20:27 GMT):
Has joined the channel.
karumbas (Wed, 12 Apr 2017 09:54:39 GMT):
Hi @rickr, for each proposal request its required that you setChaiCodeID which is of type ChainCodeID. Previously in fabric 0.6 deploying a chaincode emitted a hash string such that when doing future transaction you reference the hash. Is there such a provision for transaction request to setChainCodeID as a hash string instead of an object which can be saved and reference latter?
karumbas (Wed, 12 Apr 2017 09:54:39 GMT):
Hi @rickr @tuand , for each proposal request its required that you setChaiCodeID which is of type ChainCodeID. Previously in fabric 0.6 deploying a chaincode emitted a hash string such that when doing future transaction you reference the hash. Is there such a provision for transaction request to setChainCodeID as a hash string instead of an object which can be saved and reference latter?
rickr (Wed, 12 Apr 2017 12:02:54 GMT):
The hashing is gone. All you need is name and version. I you like hashing you always have your application do the hashing and use that as the name.
clempo (Wed, 12 Apr 2017 14:24:53 GMT):
I think it would be better if the User iface would return List
clempo (Wed, 12 Apr 2017 14:24:55 GMT):
ArrayList
clempo (Wed, 12 Apr 2017 14:25:09 GMT):
Is there a reason for the concrete type?
ruslan.kryukov (Wed, 12 Apr 2017 14:27:33 GMT):
Hello, I try to create new channel with fabric-sdk but get error:
orderer-xxx | 2017-04-12 14:26:03.876 UTC [orderer/common/broadcast] Handle -> WARN 005 Rejecting CONFIG_UPDATE because: Error validating DeltaSet: Attempt to set key [Policy] /Channel/Application/Writers to version 0, but key is at version 0
ruslan.kryukov (Wed, 12 Apr 2017 14:27:33 GMT):
Hello, I try to create new channel with fabric-sdk but get error:
```
orderer-xxx | 2017-04-12 14:26:03.876 UTC [orderer/common/broadcast] Handle -> WARN 005 Rejecting CONFIG_UPDATE because: Error validating DeltaSet: Attempt to set key [Policy] /Channel/Application/Writers to version 0, but key is at version 0
```
ruslan.kryukov (Wed, 12 Apr 2017 14:29:05 GMT):
I've created channelTx file with configtxgen tool, and I had created genesis-block which assign to orderer
ruslan.kryukov (Wed, 12 Apr 2017 14:29:39 GMT):
- ORDERER_GENERAL_GENESISFILE=/opt/genesis/block.dat
- ORDERER_GENERAL_GENESISMETHOD=file
ruslan.kryukov (Wed, 12 Apr 2017 14:30:14 GMT):
but when I call sdk method client.newChain(channelID, orderer, chainConfiguration); it fails
ruslan.kryukov (Wed, 12 Apr 2017 14:30:35 GMT):
channeltx file is created without errors
rickr (Wed, 12 Apr 2017 14:30:39 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=XJwbk9M5bK2cGHSFT) @clempo sure
clempo (Wed, 12 Apr 2017 14:31:33 GMT):
Do you need a Jira or you can do it on the side?
rickr (Wed, 12 Apr 2017 14:32:12 GMT):
I'll see it gets changed think it should be a Set
swettdj (Wed, 12 Apr 2017 14:59:25 GMT):
Has joined the channel.
clempo (Wed, 12 Apr 2017 16:37:03 GMT):
The SDK expects the user instance to contain the Enrollment, not the enrollment secret.
clempo (Wed, 12 Apr 2017 16:37:16 GMT):
I see no way to retrieve that value after the fact.
clempo (Wed, 12 Apr 2017 16:37:30 GMT):
I could call reenroll() but that creates a new cert
clempo (Wed, 12 Apr 2017 16:38:08 GMT):
The way the integration test suite makes it work is by serializing it into the store
rickr (Wed, 12 Apr 2017 16:38:25 GMT):
ok
clempo (Wed, 12 Apr 2017 16:38:48 GMT):
This is not practical in real life
clempo (Wed, 12 Apr 2017 16:39:07 GMT):
Let's say my customer already has his user and he needs to work with my app from now on
rickr (Wed, 12 Apr 2017 16:39:15 GMT):
you want the to keep the enrollement you need to to persist it
clempo (Wed, 12 Apr 2017 16:40:12 GMT):
that's unfortunate
clempo (Wed, 12 Apr 2017 16:40:31 GMT):
so I can't use an existing user, I have to recreate it
clempo (Wed, 12 Apr 2017 16:40:38 GMT):
at least once
clempo (Wed, 12 Apr 2017 16:41:39 GMT):
that also assumes the user will always be created in Java
clempo (Wed, 12 Apr 2017 16:42:04 GMT):
that's a serious limitation
clempo (Wed, 12 Apr 2017 16:42:58 GMT):
let's assume the other sdk's have that same limitation
clempo (Wed, 12 Apr 2017 16:43:06 GMT):
so a user is bound to a single sdk?
clempo (Wed, 12 Apr 2017 16:44:03 GMT):
if I reenroll(), I bet that revokes the previous cert in the other sdk
clempo (Wed, 12 Apr 2017 16:48:11 GMT):
do you know what the other sdk's are doing? I only know (part of) the Java sdk
rickr (Wed, 12 Apr 2017 16:55:57 GMT):
The Node sdk has an interface that essentialy will call the application back if to store the user .. I don't see a need for that
clempo (Wed, 12 Apr 2017 17:04:23 GMT):
I am not sure I understand their solution. So what is your solution in the Java SDK?
clempo (Wed, 12 Apr 2017 17:04:57 GMT):
Let's say I have apps in Node sdk and Java sdk and I want to use the same user?
clempo (Wed, 12 Apr 2017 17:05:14 GMT):
let's assume the node sdk created the user already
rickr (Wed, 12 Apr 2017 17:18:12 GMT):
Override the node sdk interface to store the certs,keys,username to a file. then Have your java application read that file
clempo (Wed, 12 Apr 2017 17:24:47 GMT):
Are we allowed to unpack an enrollment into its constituents and recreate it?
rickr (Wed, 12 Apr 2017 17:25:31 GMT):
ah it's an interface
clempo (Wed, 12 Apr 2017 17:28:47 GMT):
that would work if the sdk never down casts
rickr (Wed, 12 Apr 2017 17:29:05 GMT):
?
clempo (Wed, 12 Apr 2017 17:29:41 GMT):
that means I could have my own implementation as long as the SDK always refers to it as an iface
clempo (Wed, 12 Apr 2017 17:30:19 GMT):
which is almost certainly what it does
rickr (Wed, 12 Apr 2017 17:30:55 GMT):
really ? where ?
clempo (Wed, 12 Apr 2017 17:31:27 GMT):
I'm saying I don't expect that it casts
clempo (Wed, 12 Apr 2017 17:31:39 GMT):
is HFCAEnrollment a public API?
rickr (Wed, 12 Apr 2017 17:33:47 GMT):
shouldnt need to tamper with it
clempo (Wed, 12 Apr 2017 17:34:16 GMT):
that's the point, can I reuse it
clempo (Wed, 12 Apr 2017 17:34:57 GMT):
some SDK say some classes are there but should be ignored because they are part of the private implementation
rickr (Wed, 12 Apr 2017 17:35:42 GMT):
not tried this but create another object foobar that implements enrollment in the end2endIt ... then copy the need parts to it and run the tests
rickr (Wed, 12 Apr 2017 17:36:00 GMT):
if it breaks I'd be interested
rickr (Wed, 12 Apr 2017 17:37:08 GMT):
have to break off for today .. too many other task at hand
clempo (Wed, 12 Apr 2017 17:37:26 GMT):
alright
rohitbordia (Wed, 12 Apr 2017 20:58:38 GMT):
has anyone tried installing docker images on swarm cluster
rohitbordia (Wed, 12 Apr 2017 20:58:58 GMT):
of fabric, orderer and peer
Gua (Thu, 13 Apr 2017 01:11:18 GMT):
Has joined the channel.
xiangyw (Thu, 13 Apr 2017 03:03:57 GMT):
Message Attachments
xiangyw (Thu, 13 Apr 2017 03:06:39 GMT):
@rickr do you have an idea for this scenario
xiangyw (Thu, 13 Apr 2017 03:14:16 GMT):
revoke my question,i am not update code, there is a example here
o.o. (Thu, 13 Apr 2017 08:53:31 GMT):
Hello!
Is there some way to access and modify the _transient_ field of a proposal from the java-sdk?
rickr (Thu, 13 Apr 2017 12:05:56 GMT):
Still a to do
achraf17 (Thu, 13 Apr 2017 12:50:07 GMT):
Has joined the channel.
clempo (Thu, 13 Apr 2017 13:11:13 GMT):
Can you make the HFCAEnrollment constructor public?
clempo (Thu, 13 Apr 2017 13:11:30 GMT):
or it is intentionally package private?
rickr (Thu, 13 Apr 2017 13:24:01 GMT):
intentionally
jimthematrix (Thu, 13 Apr 2017 19:28:29 GMT):
@rickr @sanchezl can you take a look at this one that @Satheesh Kathamuthu submitted to add chaincode event support to the shim? I just checked the current shim still doesn't seem to have chaincode event support. if that's indeed the case, we need to revive this changeset and finish the work
jimthematrix (Thu, 13 Apr 2017 19:28:57 GMT):
(this came about from a ping by @cbf on cleaning up)
sanchezl (Thu, 13 Apr 2017 21:01:25 GMT):
I got that on my list
sanchezl (Thu, 13 Apr 2017 21:01:25 GMT):
I have that on my list
kelvinzhong (Fri, 14 Apr 2017 03:06:00 GMT):
well, i have implement the deserialization of read write set in fabric-sdk-java. if it's needed i could try to find out how to commit the code
zerppen (Fri, 14 Apr 2017 03:26:25 GMT):
Hi, ChaincodeEndorsementPolicy.java import MspPrincipa there is not a class called MspPrincipal in org.hyperledger.fabric.protos.msp,but in org.hyperledger.fabric.protos.common.It is the same class?
zerppen (Fri, 14 Apr 2017 03:30:11 GMT):
Fabric-sdk-java-1.0-SNAPSHOT.jar where the .class file is automatically generated by the grpc protocol or written by the developer
If the agreement is automatically generated, then the agreement documents which jar package did not see the corresponding agreement documents.
If it is prepared by the developer, that can show the design documents? I think I can do something for javaSDK
king3000 (Fri, 14 Apr 2017 07:13:15 GMT):
Hi, everyone. I have tried the example of sdk-Node. But, I'm not familiar with node.js ,so come to try sdk-java. And I find that "the very latest Hyperledger Fabric builds may not work with this sdk" in the webpage of github of sdk-java. So, how about the progress of sdk-java? And with the release plan SDK-java can has some big progress?
ivanm (Fri, 14 Apr 2017 09:10:28 GMT):
Has joined the channel.
kelvinzhong (Fri, 14 Apr 2017 09:45:39 GMT):
eh... i found an issue in JIRA "FAB-2810 Use proto messages for trasnaction read-write set" and it's marked as done, but seems it's not merged to the master branch yet, and wasted my time to decode it
xuzhao103389 (Fri, 14 Apr 2017 10:09:42 GMT):
Hi
xuzhao103389 (Fri, 14 Apr 2017 10:09:46 GMT):
I am following https://github.com/hyperledger/fabric-sdk-java
xuzhao103389 (Fri, 14 Apr 2017 10:09:59 GMT):
I need to use Project Commit level Date
fabric 7eb2cf966f68ac8259357f294d9c8787cec8617b Mar 31 15:59:03 2017 +0000
fabric-ca bad855205b9c9365508965931fc35988eea1a1fd Mar 29 19:28:33 2017 +0000
xuzhao103389 (Fri, 14 Apr 2017 10:10:06 GMT):
but I got error
xuzhao103389 (Fri, 14 Apr 2017 10:10:17 GMT):
[root@xuzhao fabric-ca]# git checkout bad855205b9c9365508965931fc35988eea1a1fd
fatal: reference is not a tree: bad855205b9c9365508965931fc35988eea1a1fd
[root@xuzhao fabric-ca]#
xuzhao103389 (Fri, 14 Apr 2017 10:10:29 GMT):
who can tell why is this failing
xuzhao103389 (Fri, 14 Apr 2017 10:10:30 GMT):
?
xuzhao103389 (Fri, 14 Apr 2017 10:13:33 GMT):
I have resolved this issue
xuzhao103389 (Fri, 14 Apr 2017 10:13:35 GMT):
thanks
rickr (Fri, 14 Apr 2017 10:55:02 GMT):
```
git clone git@github.com:hyperledger/fabric.git
cd fabric
git reset --hard 7eb2cf966f68ac8259357f294d9c8787cec8617b
```
?
xuzhao103389 (Fri, 14 Apr 2017 11:02:09 GMT):
yes
xuzhao103389 (Fri, 14 Apr 2017 11:02:12 GMT):
that is try
xuzhao103389 (Fri, 14 Apr 2017 11:02:15 GMT):
true
xuzhao103389 (Fri, 14 Apr 2017 11:09:08 GMT):
I am using fabric-ca 7eb2cf966f68ac8259357f294d9c8787cec8617b ,
when doing unit test , failed
xuzhao103389 (Fri, 14 Apr 2017 11:09:17 GMT):
2017/04/14 11:08:12 [INFO] Listening at http://0.0.0.0:7095
FAIL
coverage: 91.9% of statements
FAIL github.com/hyperledger/fabric-ca/cmd/fabric-ca-server 0.860s
error: exit status 1
panic: EOF
goroutine 1 [running]:
panic(0x4daca0, 0xc42000a1a0)
/opt/go/src/runtime/panic.go:500 +0x1a1
main.main()
/opt/gopath/src/github.com/AlekSi/gocov-xml/gocov-xml.go:60 +0x15fd
*** END FAILURES ***
Makefile:144: recipe for target 'unit-tests' failed
make: *** [unit-tests] Error 1
xuzhao103389 (Fri, 14 Apr 2017 11:09:51 GMT):
sorry the fabric-ca is bad855205b9c9365508965931fc35988eea1a1fd
xuzhao103389 (Fri, 14 Apr 2017 11:10:13 GMT):
and when I am using fabric commit 7eb2cf966f68ac8259357f294d9c8787cec8617b
xuzhao103389 (Fri, 14 Apr 2017 11:10:18 GMT):
the make behave failed
rickr (Fri, 14 Apr 2017 11:10:57 GMT):
all you need to do is make docker
rickr (Fri, 14 Apr 2017 11:11:02 GMT):
on each of them
xuzhao103389 (Fri, 14 Apr 2017 11:11:08 GMT):
really
xuzhao103389 (Fri, 14 Apr 2017 11:11:12 GMT):
only make docker
xuzhao103389 (Fri, 14 Apr 2017 11:11:16 GMT):
thanks
xuzhao103389 (Fri, 14 Apr 2017 11:11:19 GMT):
let me try
zerppen (Fri, 14 Apr 2017 11:19:26 GMT):
@rickr Fabric-sdk-java-1.0-SNAPSHOT.jar where the .class file is automatically generated by the grpc protocol or written by the developer
If the agreement is automatically generated, then the agreement documents which jar package did not see the corresponding agreement documents.
If it is prepared by the developer, that can show the design documents? I think I can do something for javaSDK
rickr (Fri, 14 Apr 2017 11:25:45 GMT):
I'm not following your question. The grpc protos are from the fabric with some very minor changes for java. The to interface to them is generated
zerppen (Fri, 14 Apr 2017 11:27:20 GMT):
So there is no design documents?
rickr (Fri, 14 Apr 2017 11:27:39 GMT):
The comments that are in the proto :)
zerppen (Fri, 14 Apr 2017 11:28:19 GMT):
In the fabric-sdk-java-1.0-SNAPSHOT.jar?
zerppen (Fri, 14 Apr 2017 11:28:58 GMT):
Like common.proto?
rickr (Fri, 14 Apr 2017 11:31:06 GMT):
src/main/proto that's the interface between the client and server. Not sure if that's what you want. I'm still uncertain what it is your asking about
zerppen (Fri, 14 Apr 2017 11:32:45 GMT):
It is the same as i noticed in fabric-sdk-java-1.0-SNAPSHOT.jar
zerppen (Fri, 14 Apr 2017 11:33:21 GMT):
But I don't think the proto match the .class
rickr (Fri, 14 Apr 2017 11:34:19 GMT):
the protos are being included in the jar by accident . I just noticed that a day ago should be removed
zerppen (Fri, 14 Apr 2017 11:36:29 GMT):
For example,there are only 164 lines in src/main/proto/common.proto,but there are 6598 lines in common.class of the sdk.jar
rickr (Fri, 14 Apr 2017 11:37:35 GMT):
the protos only generate code after that nothing uses them
zerppen (Fri, 14 Apr 2017 11:39:31 GMT):
But it is not easy to read the generate code without any annotation
rickr (Fri, 14 Apr 2017 11:40:35 GMT):
There's no reason to read the generated code. The SDK should hide most of that. With maybe a few exceptions
rickr (Fri, 14 Apr 2017 11:40:35 GMT):
There's no reason to read the generated code. The SDK should hide most of that with maybe a few exceptions
rickr (Fri, 14 Apr 2017 11:41:28 GMT):
FYI I'm going to be gone pretty much till Mon so won't be too active here
zerppen (Fri, 14 Apr 2017 11:43:23 GMT):
We need invoke the generated code if we improve the SDK,right?
zerppen (Fri, 14 Apr 2017 11:44:27 GMT):
I mean we need invoke methods of the generated code if we decide to improve the SDK,ringht?
rickr (Fri, 14 Apr 2017 11:46:02 GMT):
one of the purposes of the SDK is so users don't have to do that. If your developing the SDK itself then yes you need write code to the classes it generates
zerppen (Fri, 14 Apr 2017 11:48:32 GMT):
maybe we got misunderstanding.
zerppen (Fri, 14 Apr 2017 11:52:38 GMT):
In my opinion,firstly the .class files of the sdk.jar are writtern by developers,it's proofed that I am wrong,right?
zerppen (Fri, 14 Apr 2017 11:54:29 GMT):
Then if I want to improve the SDK project with all of u, I need know and invoke the methods of the sdk.jar,it's right?
zerppen (Fri, 14 Apr 2017 12:01:32 GMT):
So,the conclusion is our team wrote or improved code to the classes it generates,right?
xuzhao103389 (Fri, 14 Apr 2017 12:56:47 GMT):
for the SDK dependencies
xuzhao103389 (Fri, 14 Apr 2017 12:57:03 GMT):
mvn dependency:list
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.448 s
[INFO] Finished at: 2017-04-14T12:56:37+00:00
[INFO] Final Memory: 8M/106M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:list (default-cli): Goal requires a project to execute but there is no POM in this directory (/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
xuzhao103389 (Fri, 14 Apr 2017 12:57:20 GMT):
so how to resolve the dependencies?
zerppen (Fri, 14 Apr 2017 15:36:02 GMT):
Hi rickr @rickr u r online?
xuzhao103389 (Fri, 14 Apr 2017 20:16:14 GMT):
Hi I got a new error
xuzhao103389 (Fri, 14 Apr 2017 20:16:15 GMT):
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building java-SimpleSample-example 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.hyperledger:shim-client:jar:1.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.600 s
[INFO] Finished at: 2017-04-14T20:15:16+00:00
[INFO] Final Memory: 8M/106M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project chaincode-SimpleSample: Could not resolve dependencies for project example:chaincode-SimpleSample:jar:1.0: Failure to find org.hyperledger:shim-client:jar:1.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
xuzhao103389 (Fri, 14 Apr 2017 20:16:30 GMT):
the example:chaincode-SimpleSample:jar:1.0 can not be found
xuzhao103389 (Fri, 14 Apr 2017 20:16:38 GMT):
who can tell me why is that ?
xuzhao103389 (Fri, 14 Apr 2017 20:20:12 GMT):
how to update the pom.xml
sanchezl (Fri, 14 Apr 2017 21:06:22 GMT):
@xuzhao103389 , what are you trying to do / how did you get the error?
kmadala (Fri, 14 Apr 2017 21:33:24 GMT):
Has joined the channel.
kmadala (Fri, 14 Apr 2017 21:34:47 GMT):
Hi, can someone point me documentation for Java-SDK for Fabric 1.0 release?
munireddya (Sat, 15 Apr 2017 07:10:59 GMT):
Has joined the channel.
xuzhao103389 (Sat, 15 Apr 2017 19:43:04 GMT):
Hi
xuzhao103389 (Sat, 15 Apr 2017 19:43:25 GMT):
I want to query where is the file target/fabric-sdk-java-1.0-SNAPSHOT.jar ?
xuzhao103389 (Sat, 15 Apr 2017 19:43:34 GMT):
I can not find this file
xuzhao103389 (Sat, 15 Apr 2017 19:47:31 GMT):
now I got it thanks
xuzhao103389 (Sat, 15 Apr 2017 19:49:31 GMT):
When I do "mvn test", I got lots of failures
xuzhao103389 (Sat, 15 Apr 2017 19:50:00 GMT):
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ fabric-sdk-java ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ fabric-sdk-java ---
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.hyperledger.fabric.sdk.BlockEventTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.971 sec - in org.hyperledger.fabric.sdk.BlockEventTest
Running org.hyperledger.fabric.sdk.EndpointTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.093 sec - in org.hyperledger.fabric.sdk.EndpointTest
Running org.hyperledger.fabric.sdk.PeerTest
java.io.NotSerializableException: org.hyperledger.fabric.sdk.TestHFClient$1
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at org.hyperledger.fabric.sdkintegration.SampleUser.saveState(SampleUser.java:177)
at org.hyperledger.fabric.sdkintegration.SampleUser.setEnrollment(SampleUser.java:230)
at org.hyperledger.fabric.sdk.TestHFClient.newInstance(TestHFClient.java:53)
at org.hyperledger.fabric.sdk.PeerTest.setupClient(PeerTest.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.88 sec - in org.hyperledger.fabric.sdk.PeerTest
Running org.hyperledger.fabric.sdk.helper.ConfigTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.023 sec - in org.hyperledger.fabric.sdk.helper.ConfigTest
Running org.hyperledger.fabric.sdk.ChaincodeEndorsementPolicyTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.316 sec - in org.hyperledger.fabric.sdk.ChaincodeEndorsementPolicyTest
Running org.hyperledger.fabric.sdk.OrdererTest
xuzhao103389 (Sat, 15 Apr 2017 19:51:49 GMT):
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec - in org.hyperledger.fabric.sdk.ChainTest
Running org.hyperledger.fabric.sdk.ClientTest
java.io.NotSerializableException: org.hyperledger.fabric.sdk.TestHFClient$1
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at org.hyperledger.fabric.sdkintegration.SampleUser.saveState(SampleUser.java:177)
at org.hyperledger.fabric.sdkintegration.SampleUser.setEnrollment(SampleUser.java:230)
at org.hyperledger.fabric.sdk.TestHFClient.newInstance(TestHFClient.java:53)
at org.hyperledger.fabric.sdk.ClientTest.setupClient(ClientTest.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec - in org.hyperledger.fabric.sdk.ClientTest
Results :
Tests run: 66, Failures: 0, Errors: 0, Skipped: 2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.538 s
[INFO] Finished at: 2017-04-15T19:51:15+00:00
[INFO] Final Memory: 25M/342M
[INFO] ------------------------------------------------------------------------
xuzhao103389 (Sat, 15 Apr 2017 19:52:45 GMT):
@sanchezl can you help take a look , thanks :)
xuzhao103389 (Sat, 15 Apr 2017 20:39:44 GMT):
FYI: I am doing then unit test Running the unit tests
To run the unit tests, please use mvn test or mvn install which will run the unit tests and build the jar file. You must be running a local peer and orderer to be able to run the unit tests.
rickr (Sat, 15 Apr 2017 20:50:29 GMT):
looks to be a kv_rwset
xuzhao103389 (Sat, 15 Apr 2017 20:50:41 GMT):
sorry
xuzhao103389 (Sat, 15 Apr 2017 20:50:53 GMT):
I can run the integration test all good
xuzhao103389 (Sat, 15 Apr 2017 20:50:59 GMT):
but the unit tests failed
xuzhao103389 (Sat, 15 Apr 2017 20:51:10 GMT):
another thing is that I can not see sdkintegration/End2endIT.java
xuzhao103389 (Sat, 15 Apr 2017 20:51:44 GMT):
vagrant@hyperledger-devenv:v0.3.0-51b7e85:/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration$ ll
total 40
drwxr-xr-x 1 vagrant vagrant 4096 Apr 14 09:56 ./
drwxr-xr-x 1 vagrant vagrant 4096 Apr 14 11:24 ../
-rw-r--r-- 1 vagrant vagrant 731 Apr 14 09:56 chaincodeendorsementpolicy.yaml
-rw-r--r-- 1 vagrant vagrant 9755 Apr 14 09:56 docker-compose.yaml
drwxr-xr-x 1 vagrant vagrant 4096 Apr 14 09:56 e2e-2Orgs/
-rw-r--r-- 1 vagrant vagrant 271 Apr 14 09:56 .env
drwxr-xr-x 1 vagrant vagrant 4096 Apr 14 09:56 gocc/
drwxr-xr-x 1 vagrant vagrant 4096 Apr 14 09:56 javacc/
Dpkkmr (Sun, 16 Apr 2017 14:54:43 GMT):
Has joined the channel.
msoumeit (Sun, 16 Apr 2017 18:35:02 GMT):
Has joined the channel.
rogeriofza (Sun, 16 Apr 2017 22:59:49 GMT):
Has joined the channel.
xiangyw (Mon, 17 Apr 2017 08:29:02 GMT):
Message Attachments
xiangyw (Mon, 17 Apr 2017 08:29:44 GMT):
@rickr ByteString s=returnedBlock.getBlock().getMetadata().getMetadata(0); the metadata is transaction info?
xiangyw (Mon, 17 Apr 2017 08:32:47 GMT):
how can i parse a transaction to clear text as bluemix showing
zerppen (Mon, 17 Apr 2017 09:52:23 GMT):
Hi tuand @tuand I am watching https://jira.hyperledger.org/browse/FAB-1830 Could u get in touch with me when u r open
net0410 (Mon, 17 Apr 2017 13:32:47 GMT):
Has joined the channel.
NpraveeN (Mon, 17 Apr 2017 13:33:43 GMT):
Has joined the channel.
sanchezl (Mon, 17 Apr 2017 14:13:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=LL4AqnqSTHnidRHdY) @xiangyw ```
final Block block = returnedBlock.getBlock();
for(final ByteString envelopeBytes: block.getData().getDataList()) {
final Envelope envelope = Envelope.parseFrom(envelopeBytes);
final Payload payload = Payload.parseFrom(envelope.getPayload());
// etc...
}
```
sanchezl (Mon, 17 Apr 2017 14:13:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=LL4AqnqSTHnidRHdY) @xiangyw
```
final Block block = returnedBlock.getBlock();
for(final ByteString envelopeBytes: block.getData().getDataList()) {
final Envelope envelope = Envelope.parseFrom(envelopeBytes);
final Payload payload = Payload.parseFrom(envelope.getPayload());
// etc...
}
```
sanchezl (Mon, 17 Apr 2017 14:13:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=LL4AqnqSTHnidRHdY) @xiangyw
```
final Block block = returnedBlock.getBlock();
for(final ByteString envelopeBytes: block.getData().getDataList()) {
final Envelope envelope = Envelope.parseFrom(envelopeBytes);
final Payload payload = Payload.parseFrom(envelope.getPayload());
// etc...
}
```
dhuseby (Mon, 17 Apr 2017 14:40:00 GMT):
Has joined the channel.
Willson (Mon, 17 Apr 2017 15:37:42 GMT):
hello @rickr Have u ever met this error?
`orderer0 | 2017-04-17 15:29:08.637 UTC [orderer/common/deliver] Handle -> WARN 43f Received unauthorized deliver request for channel foo`
Willson (Mon, 17 Apr 2017 15:40:04 GMT):
and the sdk side is that :
```
org.hyperledger.fabric.sdk.exception.TransactionException: Bad deliver expected status 200 got 403, Chain foo
at org.hyperledger.fabric.sdk.Chain.getGenesisBlock(Chain.java:631)
at org.hyperledger.fabric.sdk.Chain.
rickr (Mon, 17 Apr 2017 15:52:37 GMT):
If you're running the standard end2end are you starting your docker the sdkintegration directory ?
Willson (Mon, 17 Apr 2017 15:53:08 GMT):
yes
Willson (Mon, 17 Apr 2017 15:53:18 GMT):
but running with tls
giridharg (Mon, 17 Apr 2017 17:18:43 GMT):
Has joined the channel.
net0310 (Mon, 17 Apr 2017 23:54:13 GMT):
Has joined the channel.
YoungHoonKim (Tue, 18 Apr 2017 00:40:48 GMT):
Has joined the channel.
xiangyw (Tue, 18 Apr 2017 01:12:14 GMT):
@sanchezl thank you very much
Willson (Tue, 18 Apr 2017 02:15:29 GMT):
Fortunately @rickr ,the error nothing to do with tls. it is worked after i regenarate the twoorgs.orderer.block.
Willson (Tue, 18 Apr 2017 02:18:05 GMT):
however it can install and instantiate the chaincode, when sending a transactionProposal to peers, it cause an error:
```
```
Willson (Tue, 18 Apr 2017 02:18:42 GMT):
however it can install and instantiate the chaincode, when sending a transactionProposal to peers, it cause an error:
```
2017-04-18 10:11:21 ERROR Chain:1972 - Sending proposal to peer1 failed because of gRPC failure=Status{code=UNKNOWN, description=failed to obtain cds for example_cc_go - transaction not found example_cc_go/foo, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: failed to obtain cds for example_cc_go - transaction not found example_cc_go/foo
at org.hyperledger.fabric.sdk.Chain.sendProposalToPeers(Chain.java:1972)
at org.hyperledger.fabric.sdk.Chain.sendProposal(Chain.java:1911)
at org.hyperledger.fabric.sdk.Chain.sendTransactionProposal(Chain.java:1853)
at org.hyperledger.fabric.sdkintegration.MyEnd2endIT.lambda$runChain$0(MyEnd2endIT.java:297)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
at org.hyperledger.fabric.sdk.Chain$TL.lambda$fire$1(Chain.java:2407)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```
Willson (Tue, 18 Apr 2017 02:19:27 GMT):
however it can install and instantiate the chaincode, when sending a transactionProposal to peers, it cause an error:
```2017-04-18 10:11:21 ERROR Chain:1972 - Sending proposal to peer1 failed because of gRPC failure=Status{code=UNKNOWN, description=failed to obtain cds for example_cc_go - transaction not found example_cc_go/foo, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: failed to obtain cds for example_cc_go - transaction not found example_cc_go/foo
at org.hyperledger.fabric.sdk.Chain.sendProposalToPeers(Chain.java:1972)
at org.hyperledger.fabric.sdk.Chain.sendProposal(Chain.java:1911)
at org.hyperledger.fabric.sdk.Chain.sendTransactionProposal(Chain.java:1853)
at org.hyperledger.fabric.sdkintegration.MyEnd2endIT.lambda$runChain$0(MyEnd2endIT.java:297)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
at org.hyperledger.fabric.sdk.Chain$TL.lambda$fire$1(Chain.java:2407)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)```
rickr (Tue, 18 Apr 2017 06:31:10 GMT):
Try this ... stop all the containers docker-compose down
docker ps -a make sure all containers are stopped
remove ALL chainccode containers should look like `dev-peer3-example_cc_go-*`
docker rm -f ....
docker images
likewise remove all the images too
docker rmi -f
enable tls for them as you probable have already done via the two env vars
once all the chaincode images are gone restart your docker `docker-compose up --force-recreate`
then rerun the tests
Willson (Tue, 18 Apr 2017 06:58:27 GMT):
it does not work. the peer0 is ok ,but the peer1 get a error while instantiate the chaincode :
`2017-04-18 06:54:48.951 UTC [lccc] Invoke -> ERRO 448 ChaincodeId: example_cc_go does not exist on channel: foo(err:chaincode not found example_cc_go)`
Halminhu (Tue, 18 Apr 2017 08:44:13 GMT):
Has joined the channel.
shibo.lin (Tue, 18 Apr 2017 09:13:39 GMT):
Has joined the channel.
zerppen (Tue, 18 Apr 2017 10:20:00 GMT):
@rickr Maybe it's stupid,but I never use git pull code to gerrit.
Firstly,i excuted git clone ssh://zerppen@gerrit.hyperledger.org:29418/fabric-sdk-java,then I excuted git checkout FAB-3211
So,i finished the task FAB-3211 and tested good.Then I excuted git commit -a -s,wrote something in the opening file
when I excuted git review,it showed that No '.gitreview' file found in this repository. We don't know where
your gerrit is. Please manually create a remote named "gerrit" and try
again.
So I should excute git remote add gerrit ssh://zerppen@gerrit.hyperledger.org:29418/fabric-sdk-java?
zerppen (Tue, 18 Apr 2017 10:20:00 GMT):
@rickr I have tested the task FAB-3211 and review it please..
zerppen (Tue, 18 Apr 2017 10:22:34 GMT):
@jimthematrix can u give me some advice
smithbk (Tue, 18 Apr 2017 11:43:17 GMT):
Has joined the channel.
rickr (Tue, 18 Apr 2017 12:30:11 GMT):
zerppen See you found out how to do that so need to reply
rickr (Tue, 18 Apr 2017 12:32:24 GMT):
@Willson Do you see the same issues w/o TLS ? I don't think it can be the issue but just making sure.
BTW you need to do that procedure I stated if you move back and forth between TLS/non-TLS
o.o. (Tue, 18 Apr 2017 13:09:02 GMT):
> o.o. 10:53 AM
> Hello!
> Is there some way to access and modify the _transient_ field of a proposal from the java-sdk?
>
> rickr 2:05 PM
> Still a to do
Any idea of the timeline for this?
Saw that there are also TODO's for T-cert batches, are these related?
rickr (Tue, 18 Apr 2017 13:11:25 GMT):
no timelines Can you please open a Jira for this ... thanks
o.o. (Tue, 18 Apr 2017 13:44:41 GMT):
I'm sorry; should ofcourse check there first!
Found https://jira.hyperledger.org/browse/FAB-2119
> User should be able to specify transient field while creating the proposal when deploying/invoking the chaincode. For more details, see https://gerrit.hyperledger.org/r/#/c/5091/
We need to add this in the SDK Design Spec as well so that other SDKs can implement this as well.
That has been set to _done_,
o.o. (Tue, 18 Apr 2017 13:44:41 GMT):
I'm sorry; should ofcourse check there first!
Found https://jira.hyperledger.org/browse/FAB-2119
> User should be able to specify transient field while creating the proposal when deploying/invoking the chaincode. For more details, see https://gerrit.hyperledger.org/r/#/c/5091/
> We need to add this in the SDK Design Spec as well so that other SDKs can implement this as well.
That has been set to _done_,
What does this mean?
ssaddem (Tue, 18 Apr 2017 15:24:23 GMT):
hi guys there is any artifact on maven for v1 ?
rickr (Tue, 18 Apr 2017 15:25:16 GMT):
There is but it's already out of date
ssaddem (Tue, 18 Apr 2017 15:25:50 GMT):
yes i found this https://mvnrepository.com/artifact/org.hyperledger.fabric-sdk-java/fabric-sdk-java but is on v0.6
ssaddem (Tue, 18 Apr 2017 15:26:50 GMT):
already i use v1.0.0-alpha for fabric
rickr (Tue, 18 Apr 2017 15:27:16 GMT):
it won't be there till we GA
what's there will be SNAPSHOT images but I don't think they show up in maven .. not sure
rickr (Tue, 18 Apr 2017 15:27:47 GMT):
We're trying to automate
ssaddem (Tue, 18 Apr 2017 15:28:45 GMT):
ok if i wanna query v1.0.0-alpha what tag i should use ?
ssaddem (Tue, 18 Apr 2017 15:29:56 GMT):
for this docker image hyperledger/fabric-peer:x86_64-1.0.0-alpha
rickr (Tue, 18 Apr 2017 15:31:16 GMT):
There's nothing I know of that works with it
ssaddem (Tue, 18 Apr 2017 15:31:28 GMT):
ok thx :)
pschnap (Tue, 18 Apr 2017 17:55:55 GMT):
HFCAClient looks for a "pemFile" property; what is this supposed to point to?
pschnap (Tue, 18 Apr 2017 18:15:34 GMT):
also, what version/commit of the java SDK should I be using?
pschnap (Tue, 18 Apr 2017 18:15:43 GMT):
(to test against v1 alpha of the fabric)
pschnap (Tue, 18 Apr 2017 18:20:02 GMT):
should I be using the fabric_v1 branch?
pschnap (Tue, 18 Apr 2017 20:12:44 GMT):
nvm, got it connecting with the latest master
venky.bandaru (Tue, 18 Apr 2017 21:39:14 GMT):
Has joined the channel.
Willson (Wed, 19 Apr 2017 01:18:04 GMT):
thanks @rickr
Willson (Wed, 19 Apr 2017 02:33:03 GMT):
It is working fine without TLS,
zhoupeiwen (Wed, 19 Apr 2017 02:41:41 GMT):
hi I update the sdk today , run the test ,got the following error:2017-04-19 10:37:40 ERROR Chain:2041 - Sending proposal to peer0 failed because of gRPC failure=Status{code=UNKNOWN, description=failed to obtain cds for lscc - transaction not found lscc/mychannel, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: failed to obtain cds for lscc - transaction not found lscc/mychannel
any idea for this error?
rickr (Wed, 19 Apr 2017 02:43:41 GMT):
yes -- bad timing on your part :)
They updated the Fabric that broke the SDK.. I think if you get the latest SDK AND the Fabric that's now in the README.md that should be fixed
zhoupeiwen (Wed, 19 Apr 2017 02:44:46 GMT):
OK, I'll try it..
Willson (Wed, 19 Apr 2017 02:50:56 GMT):
@rickr there is a WARN at peer1's logs :
`WARN 317 Deep probe of peer0:7051 failed: Remote peer 172.18.0.6:7051 didn't send TLS certificate`
rickr (Wed, 19 Apr 2017 02:59:04 GMT):
You'd be better off taking that to the fabric channel where the experts on that side can better understand what's happening with that
Willson (Wed, 19 Apr 2017 03:12:48 GMT):
ok. thanks
rickr (Wed, 19 Apr 2017 03:34:47 GMT):
Just curious is that the SDKs end2endIT and docker compose unchanged `out of the box` ? And you're seeing those errors just when you enable TLS ? Or are you trying something different ?
While I don't run with TLS locally it's enabled on all our verify and FIT tests and run each time code is sent to gerrit for review and also when it's merged into master so I have to think it's working
Willson (Wed, 19 Apr 2017 03:38:58 GMT):
Just enable the tls, nothing change.
Willson (Wed, 19 Apr 2017 03:41:34 GMT):
i think there are some problems about my tls certs, i am trying other ways
rickr (Wed, 19 Apr 2017 03:42:01 GMT):
so those are your own certs ?
Willson (Wed, 19 Apr 2017 03:42:15 GMT):
yeap
rickr (Wed, 19 Apr 2017 03:42:31 GMT):
your not using the ones pre setup with the end2end
Willson (Wed, 19 Apr 2017 03:47:23 GMT):
sorry, i use a former version of fabric and sdk that without your cas directory. i found it has been upgrate today. i remakeing the fabric now
rickr (Wed, 19 Apr 2017 03:49:41 GMT):
If you have the latest SDK and you'll need get the fabric updated too. You just need to set two env vars
export ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=true export ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS=--tls.enabled
rickr (Wed, 19 Apr 2017 03:49:41 GMT):
If you have the latest SDK and you'll need get the fabric updated too. You just need to set two env vars
export ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=true
export ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS=--tls.enabled
rickr (Wed, 19 Apr 2017 03:50:48 GMT):
set those before starting the docker-compose
and when you run the sdk
Willson (Wed, 19 Apr 2017 03:53:48 GMT):
ok thanks
Willson (Wed, 19 Apr 2017 04:36:24 GMT):
@rickr it is working fine both you certs and my certs at latest version :grin:
king3000 (Wed, 19 Apr 2017 09:17:29 GMT):
@zhoupeiwen I had this same problem. Then I git pull in fabric project and make, using new docker images I run End2endIT.java succeeded.
king3000 (Wed, 19 Apr 2017 09:17:59 GMT):
RUNNING: End2endIT.
Constructing chain foo
Created chain foo
Peer peer1 joined chain foo
queryBlockByHash returned block with blockNumber 1
queryBlockByTxID returned block with blockNumber 2
QueryTransactionByID returned TransactionInfo: txID 2150a9390e33fb2dc552fbd1090215c5638740b2c394c27c323164a8d58489c6
validation code 0
Running for Chain bar done
That's all folks!
choas (Wed, 19 Apr 2017 10:02:53 GMT):
Has joined the channel.
jongeun.park (Wed, 19 Apr 2017 10:35:58 GMT):
Has joined the channel.
rickr (Wed, 19 Apr 2017 10:45:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=LJyJ9kDPYRmeXMdtB) Glad to hear something works :) Can you say how you fixed the issue so that others may benefit ?
Willson (Wed, 19 Apr 2017 12:33:29 GMT):
i just remake the fabric and reclone the sdk, everything is fine after i do that
pschnap (Wed, 19 Apr 2017 15:10:04 GMT):
What version of the SDK should I be using to communicate with Bluemix?
pschnap (Wed, 19 Apr 2017 15:10:32 GMT):
I'm getting an EOF error on the orderer side of things when trying to commit an endorsed transaction
pschnap (Wed, 19 Apr 2017 15:15:18 GMT):
```2017-04-19 15:04:04.067 UTC [msp] Validate -> INFO 0f4[0m MSP OrdererMSP validating identity
2017-04-19 15:05:18.294 UTC [msp] Validate -> INFO 0f5[0m MSP PeerOrg1 validating identity
[33m2017-04-19 15:05:18.413 UTC [orderer/common/deliver] Handle -> WARN 0f6[0m Error reading from stream: EOF
2017-04-19 15:05:18.422 UTC [msp] Validate -> INFO 0f7[0m MSP PeerOrg1 validating identity
[33m2017-04-19 15:05:18.544 UTC [orderer/common/deliver] Handle -> WARN 0f8[0m Error reading from stream: EOF
2017-04-19 15:13:58.697 UTC [msp] Validate -> INFO 0f9[0m MSP OrdererMSP validating identity
[33m2017-04-19 15:13:58.897 UTC [orderer/common/deliver] Handle -> WARN 0fa[0m Error reading from stream: stream error: code = 1 desc = "context canceled"
2017-04-19 15:13:59.270 UTC [msp] Validate -> INFO 0fb[0m MSP OrdererMSP validating identity
[33m2017-04-19 15:13:59.483 UTC [orderer/common/deliver] Handle -> WARN 0fc[0m Error reading from stream: stream error: code = 1 desc = "context canceled"
2017-04-19 15:14:00.521 UTC [msp] Validate -> INFO 0fd[0m MSP OrdererMSP validating identity
2017-04-19 15:14:00.543 UTC [msp] Validate -> INFO 0fe[0m MSP OrdererMSP validating identity```
pschnap (Wed, 19 Apr 2017 15:15:30 GMT):
not sure if this is an SDK or orderer problem
pschnap (Wed, 19 Apr 2017 16:05:14 GMT):
this is using v1.0 btw
rickr (Wed, 19 Apr 2017 16:06:01 GMT):
v1.0 sdk does not work with bluemix
pschnap (Wed, 19 Apr 2017 16:07:25 GMT):
I'm using it against the HSBN v1.0 beta on Bluemix
pschnap (Wed, 19 Apr 2017 16:07:36 GMT):
(hyperledger 1.0 on bluemix)
pschnap (Wed, 19 Apr 2017 16:09:55 GMT):
@rickr the v1.0 SDK won't work against v1.0 hyperledger on Bluemix?
pschnap (Wed, 19 Apr 2017 16:09:55 GMT):
@rickr you're saying the v1.0 SDK won't work against v1.0 hyperledger on Bluemix?
pschnap (Wed, 19 Apr 2017 16:30:18 GMT):
it should work against all v1 alpha installs, right?
rickr (Wed, 19 Apr 2017 17:24:13 GMT):
The latest surely won't I'm not sure what they're running in bluemix
pschnap (Wed, 19 Apr 2017 18:49:02 GMT):
@rickr seems to be working now, had to add an eventhub to the peer
pschnap (Wed, 19 Apr 2017 18:49:23 GMT):
the version I'm using was from a few days to a week ago
pschnap (Wed, 19 Apr 2017 18:49:23 GMT):
the version of the SDK I'm using was from a few days to a week ago
dklesev (Wed, 19 Apr 2017 22:17:15 GMT):
Has joined the channel.
ada-wang (Thu, 20 Apr 2017 01:56:46 GMT):
Has joined the channel.
zhangmenghang (Thu, 20 Apr 2017 02:05:28 GMT):
Has joined the channel.
zhangmenghang (Thu, 20 Apr 2017 02:08:32 GMT):
Hi guys, anyone knows the difference between java sdk and fabric's cli container? I was using java sdk and I find sometimes java sdk can't find channel in fabric when invoke but invoke in cli container is ok.
zhangmenghang (Thu, 20 Apr 2017 02:10:47 GMT):
I was using fabric-alpha and java sdk in my application, all is ok in the beginning. But I found several days later, java sdk can't find channel when connecting to fabric, but channel is there! when I invoke through container cli, all is ok. When I recompose fabric network , java sdk connected to fabric successfully. Anyone suffered the same problem ?
leoleo (Thu, 20 Apr 2017 05:18:52 GMT):
Has joined the channel.
Souvik.Dey (Thu, 20 Apr 2017 06:36:45 GMT):
Has joined the channel.
cophey (Thu, 20 Apr 2017 07:35:29 GMT):
Has joined the channel.
AER_IoT (Thu, 20 Apr 2017 09:38:48 GMT):
Has joined the channel.
kelvinzhong (Thu, 20 Apr 2017 10:26:41 GMT):
hi, I wonder what would be the proper max num of the channel that a peer could join?
seand20tech (Thu, 20 Apr 2017 12:20:08 GMT):
Has joined the channel.
SotirisAlfonsos (Thu, 20 Apr 2017 14:24:40 GMT):
Has joined the channel.
zerppen (Fri, 21 Apr 2017 06:35:34 GMT):
@zhangmenghang u can put issues into JIRA
ryokawajp (Fri, 21 Apr 2017 07:36:22 GMT):
Hi everyone. Does anyone know whether there is a release plan or release strategy of fabric-sdk-java for v1.0 GA?
ada-wang (Fri, 21 Apr 2017 07:39:10 GMT):
hello guys. today I pull latest code and run End2endIT.java , got error
ada-wang (Fri, 21 Apr 2017 07:39:32 GMT):
2017-04-21 15:36:57 ERROR EventHub:206 - EventHub:peer1 terminated is false shutdown is false has error UNKNOWN: Error during Chat, stopping handler: stream error: code = 13 desc = "grpc: failed to unmarshal the received message proto: peer.Register: illegal tag 0 (wire type 2)"
org.hyperledger.fabric.sdk.exception.EventHubException: io.grpc.StatusRuntimeException: UNKNOWN: Error during Chat, stopping handler: stream error: code = 13 desc = "grpc: failed to unmarshal the received message proto: peer.Register: illegal tag 0 (wire type 2)"
ada-wang (Fri, 21 Apr 2017 07:40:27 GMT):
In docker container's log
ada-wang (Fri, 21 Apr 2017 07:40:28 GMT):
peer1 | 2017-04-21 07:36:57.796 UTC [eventhub_producer] Chat -> ERRO 02f Error during Chat, stopping handler: stream error: code = 13 desc = "grpc: failed to unmarshal the received message proto: peer.Register: illegal tag 0 (wire type 2)"
peer0 | 2017-04-21 07:36:57.825 UTC [eventhub_producer] Chat -> ERRO 030 Error during Chat, stopping handler: stream error: code = 13 desc = "grpc: failed to unmarshal the received message proto: peer.Register: illegal tag 0 (wire type 2)"
EricM (Fri, 21 Apr 2017 08:53:08 GMT):
Has joined the channel.
EricM (Fri, 21 Apr 2017 08:53:32 GMT):
Hey everyone, I am working on a property management application and need help with Java SDK calls to chaincode.
EricM (Fri, 21 Apr 2017 08:53:45 GMT):
We have already implemented and deployed our chaincode using HL v 0.6. We are now working on the Application server calls to chaincode, using Java SDK. The particular function I’d like help with is is getNextFeasibleActions. My question is, does any one have good example code of how to actually extract the list of next feasible actions?
EricM (Fri, 21 Apr 2017 08:54:43 GMT):
I have seen an example elsewhere that returns a DeferredResult object, and I’m wondering how to get the names of actions from that. Or any other ways of doing it
SotirisAlfonsos (Fri, 21 Apr 2017 15:49:33 GMT):
Hello everyone. I have set fabric v1.0 and fabric-ca on a remote server. I have everything set up running on docker containers. I want to download the java-sdk on my local machine and connect it to the dockers running on the server.
SotirisAlfonsos (Fri, 21 Apr 2017 15:49:33 GMT):
Hello everyone. I have set fabric v1.0 and fabric-ca on a remote server. I have everything set up running on docker containers. I want to download the java-sdk on my local machine and connect it to the dockers running on the server.
First of all. Is the current version of java-sdk compatible with fabric v1.0
Also, could someone provide any pointers on how to make the sdk connect to the docker components on the server?
indefire (Fri, 21 Apr 2017 18:26:57 GMT):
Has joined the channel.
indefire (Fri, 21 Apr 2017 18:28:09 GMT):
SampleUser fails in the test case because Enrollment and Set does not implement serializable. Should I submit a bug for this?
indefire (Fri, 21 Apr 2017 18:29:45 GMT):
Yes, Sotiris, the current java-sdk is compatible with fabric v1.0
clempo (Fri, 21 Apr 2017 20:31:23 GMT):
In End2endAndBackAgainIT.reconstructChain(), why do I need to run as admin to reconstruct the chain? I need to write client code that calls the chain just like End2EndAndBackAgainIT but with regular user credentials.
rickr (Fri, 21 Apr 2017 20:33:56 GMT):
Should be able to do that . But that code will also install new chain code which you'll have change to admin
rickr (Fri, 21 Apr 2017 20:34:18 GMT):
at least that's what that scenario does
clempo (Fri, 21 Apr 2017 20:35:54 GMT):
My code will reuse an existing chain, so that should work.
clempo (Fri, 21 Apr 2017 20:36:41 GMT):
I am getting this error, do you have a suggestion how to debug it
clempo (Fri, 21 Apr 2017 20:36:42 GMT):
ERROR (XDLog4J) W.file_fabric.1: [Chain - getConfigurationBlock()] - Bad newest block expected status 200 got 403, Chain foo
org.hyperledger.fabric.sdk.exception.TransactionException: Bad newest block expected status 200 got 403, Chain foo
clempo (Fri, 21 Apr 2017 20:37:42 GMT):
I changed the IntegrationSuite to only run End2EndIT and my code is supposed to act like End2EndAndBackAgainIT
clempo (Fri, 21 Apr 2017 20:38:17 GMT):
I run End2EndIT, then create a user3 manually in one of the ca containers, then move the cert and privkey to my client machine
clempo (Fri, 21 Apr 2017 20:38:24 GMT):
and then run my code
clempo (Fri, 21 Apr 2017 20:38:35 GMT):
do I have to give user3 perm to the chain?
clempo (Fri, 21 Apr 2017 20:41:22 GMT):
The point of my code is to replace the SampleStore with my own Enrollment built from the cert and priv key
rickr (Fri, 21 Apr 2017 20:43:11 GMT):
user 3 has to registered by the admin for the foo chain
rickr (Fri, 21 Apr 2017 20:43:34 GMT):
at the very least
clempo (Fri, 21 Apr 2017 20:44:59 GMT):
I had to enroll the admin on the command line
clempo (Fri, 21 Apr 2017 20:45:13 GMT):
maybe that's the problem
clempo (Fri, 21 Apr 2017 20:45:46 GMT):
how could I run CLI commands as the admin after I run End2EndIT?
clempo (Fri, 21 Apr 2017 20:45:54 GMT):
without reenrolling
clempo (Fri, 21 Apr 2017 20:48:32 GMT):
I looked for the msp dir of an admin in the test fixtures and I could not find it
clempo (Fri, 21 Apr 2017 20:51:41 GMT):
It would be a more realistic test if the admin user was pre-enrolled too
clempo (Fri, 21 Apr 2017 20:53:14 GMT):
Either that, or I write a program to reconstruct the msp from the admin user in the SampleStore
clempo (Fri, 21 Apr 2017 20:54:07 GMT):
or I write a program to load the sample store and create user3, then I output the cert and privkey
clempo (Fri, 21 Apr 2017 20:56:40 GMT):
but if I do the last thing, I might as well reuse user1 or user2
clempo (Fri, 21 Apr 2017 20:58:17 GMT):
403 suggests the server knows my user but he does not have perms
clempo (Fri, 21 Apr 2017 20:58:50 GMT):
I agree with you the creation of user3 is wrong
rickr (Fri, 21 Apr 2017 21:00:56 GMT):
why not in end2end register user3 save his secret .. then go to the other machine and use the secret to enroll
clempo (Fri, 21 Apr 2017 21:06:18 GMT):
because that requires admin creds
clempo (Fri, 21 Apr 2017 21:06:32 GMT):
or does it
clempo (Fri, 21 Apr 2017 21:06:52 GMT):
sorry, register needs admin, not enroll
rickr (Fri, 21 Apr 2017 21:07:00 GMT):
y
clempo (Fri, 21 Apr 2017 21:07:01 GMT):
yeah, that's easier
clempo (Fri, 21 Apr 2017 21:10:49 GMT):
Is it possible to do all the admin tasks of End2EndIT with the CLI or a GUI?
clempo (Fri, 21 Apr 2017 21:11:08 GMT):
obviously we can use CLI to manager users
clempo (Fri, 21 Apr 2017 21:12:08 GMT):
can you create a chain and install chaincode with CLI or a GUI?
clempo (Fri, 21 Apr 2017 21:15:00 GMT):
https://jira.hyperledger.org/browse/FAB-2587 seems relevant
clempo (Fri, 21 Apr 2017 21:16:24 GMT):
I have enough to progress, thanks
EricM (Fri, 21 Apr 2017 21:39:37 GMT):
Hey everyone, I am working on a property management application and need help with Java SDK calls to chaincode.
We have already implemented and deployed our chaincode using HL v 0.6. We are now working on the Application server calls to chaincode, using Java SDK. The particular function I’d like help with is is getNextFeasibleActions. My question is, does any one have good example code of how to actually extract the list of next feasible actions?
I have seen an example elsewhere that returns a DeferredResult object, and I’m wondering how to get the names of actions from that. Or any other ways of doing it
jimthematrix (Sat, 22 Apr 2017 21:32:11 GMT):
@rickr note https://gerrit.hyperledger.org/r/#/c/8173/ was merged that changed fabric-ca's REST API root
jimthematrix (Sat, 22 Apr 2017 21:32:40 GMT):
also for the admin policy update for the node SDK: https://gerrit.hyperledger.org/r/#/c/8011/
jimthematrix (Sun, 23 Apr 2017 19:39:24 GMT):
@Satheesh Kathamuthu @sanchezl https://gerrit.hyperledger.org/r/#/c/2975/ - can either of you rebase this so i can be reviewed and merged? missing chaincode events is pretty bad
jimthematrix (Sun, 23 Apr 2017 19:39:24 GMT):
@Satheesh Kathamuthu @sanchezl https://gerrit.hyperledger.org/r/#/c/2975/ - can either of you rebase this so i can be reviewed and merged? missing chaincode events is pretty bad
jimthematrix (Sun, 23 Apr 2017 19:39:24 GMT):
@satheeshk @sanchezl https://gerrit.hyperledger.org/r/#/c/2975/ - can either of you rebase this so i can be reviewed and merged? missing chaincode events is pretty bad
rickr (Sun, 23 Apr 2017 19:42:23 GMT):
No -- chain code shim has been removed from java sdk that CR is obsolete
rickr (Sun, 23 Apr 2017 19:44:58 GMT):
I thought @sanchezl was addressing it in fabric java shim
rickr (Sun, 23 Apr 2017 19:44:58 GMT):
I thought @sanchezl was addressing events in fabric java shim
sanchezl (Sun, 23 Apr 2017 20:27:44 GMT):
Its been addressed. That changeset should be abandoned.
rickr (Sun, 23 Apr 2017 20:41:05 GMT):
@satheeshk Can you please abandon
xiangyw (Mon, 24 Apr 2017 09:06:38 GMT):
Message Attachments
xiangyw (Mon, 24 Apr 2017 09:13:39 GMT):
@sanchezl can you help me?
xiangyw (Mon, 24 Apr 2017 09:15:42 GMT):
i want a small part of payload data like following picture
xiangyw (Mon, 24 Apr 2017 09:15:57 GMT):
Message Attachments
clempo (Mon, 24 Apr 2017 16:09:05 GMT):
@rickr, I did what you suggested to create user3. I am still getting the same TransactionException expecting 200 got 403. That occurs when initializing the chain, in Chain.getLatestBlock() when inspecting the DeliverResponse from the orderer. How do I debug this?
clempo (Mon, 24 Apr 2017 16:09:44 GMT):
The log in the docker-compose window has scrolled too much, in any case it scrolls too fast
clempo (Mon, 24 Apr 2017 16:13:51 GMT):
I tried entering the orderer container to find its log, but I can't find it.
clempo (Mon, 24 Apr 2017 16:13:52 GMT):
docker exec -i -t orderer0 bash
rickr (Mon, 24 Apr 2017 16:20:01 GMT):
Was the chain already created by the admin ?
clempo (Mon, 24 Apr 2017 16:20:17 GMT):
yes, I ran End2endIT
clempo (Mon, 24 Apr 2017 16:20:34 GMT):
and stopped there without running the other integration tests
rickr (Mon, 24 Apr 2017 16:22:23 GMT):
Can you try and see if the it's the Admin in the second process if it works to isolate if it's a permission issue ?
clempo (Mon, 24 Apr 2017 16:22:59 GMT):
I'm sorry, I don't understand what you mean
clempo (Mon, 24 Apr 2017 16:23:05 GMT):
which second process
rickr (Mon, 24 Apr 2017 16:23:38 GMT):
You were try to connect to the channel from another process or system right ?
clempo (Mon, 24 Apr 2017 16:23:48 GMT):
yes, from my app
rickr (Mon, 24 Apr 2017 16:24:04 GMT):
so what if that's admin
clempo (Mon, 24 Apr 2017 16:24:18 GMT):
how do I get the cert and the key of the admin
rickr (Mon, 24 Apr 2017 16:24:50 GMT):
you could just copy the property file it writes to right ?
clempo (Mon, 24 Apr 2017 16:25:07 GMT):
you mean reuse the SampleStore?
rickr (Mon, 24 Apr 2017 16:25:14 GMT):
y
clempo (Mon, 24 Apr 2017 16:25:32 GMT):
OK, I can write a program to read the store and give me the cert and key
clempo (Mon, 24 Apr 2017 16:25:53 GMT):
it's the point of the my app to try to run without the sample store
clempo (Mon, 24 Apr 2017 16:26:29 GMT):
Ideally, I would like to run with users created from the CLI
clempo (Mon, 24 Apr 2017 16:26:41 GMT):
or whatever admin GUI there is for the CA
rickr (Mon, 24 Apr 2017 16:27:16 GMT):
can you quickly change the end2endandbackAgain so its the user the initialize .. might be quciker
clempo (Mon, 24 Apr 2017 16:27:26 GMT):
sure
rickr (Mon, 24 Apr 2017 16:29:46 GMT):
remember ONLY the admin can create the chain and join the peers so you'll to have done that first. Then try and go to your app and see if it works.. If you bring down/up your docker image because it's not a persistent store the chain will be gone
clempo (Mon, 24 Apr 2017 16:30:58 GMT):
my use case assumes the admin tasks are already done, my app is just a regular client
clempo (Mon, 24 Apr 2017 16:31:09 GMT):
I am not running under docker
rickr (Mon, 24 Apr 2017 16:31:17 GMT):
k just making sure
clempo (Mon, 24 Apr 2017 16:31:33 GMT):
I'll try it after lunch and report back
clempo (Mon, 24 Apr 2017 16:31:42 GMT):
thanks
rickr (Mon, 24 Apr 2017 16:37:47 GMT):
IMO I'd also try running this first with docker supplied and see if it goes as expecting or not ... then move on from there ... just a thought
clempo (Mon, 24 Apr 2017 18:15:59 GMT):
End2endAndBackAgain works when user1 reconstructs the chain
clempo (Mon, 24 Apr 2017 18:16:32 GMT):
I will extract the cert and key of user1 from the sample store and try with that in my app
clempo (Mon, 24 Apr 2017 19:19:36 GMT):
My implementation of Enrollment.getPublicKey() returned it in PEM format but the format is different in the integration test
clempo (Mon, 24 Apr 2017 19:19:43 GMT):
what is the format of the public key?
clempo (Mon, 24 Apr 2017 19:19:56 GMT):
Why not return it as a POJO PublicKey?
clempo (Mon, 24 Apr 2017 19:20:39 GMT):
This is what the integration test is using: user1 pubkey:3059301306072a8648ce3d020106082a8648ce3d0301070342000404b33edb3ebc66d92b4c31b411b2e38e43d082ebdd7568475f72e4ad6b20edc04572feb48fab2218c0ca052efa9612da49347a4041adf87b5508e6b64e959241
clempo (Mon, 24 Apr 2017 19:21:02 GMT):
how do I encode the binary data after pubkey:?
rickr (Mon, 24 Apr 2017 19:33:45 GMT):
for now you should be just save that read it back in as string
clempo (Mon, 24 Apr 2017 19:41:25 GMT):
to be clear, the pubkey: prefix is part of my output, not part of the value
clempo (Mon, 24 Apr 2017 19:41:53 GMT):
your suggestion obviously works but it is not a step towards making this work with a user created on the CLI
clempo (Mon, 24 Apr 2017 19:42:13 GMT):
you are basically saying you are documenting how to implement Enrollment
clempo (Mon, 24 Apr 2017 19:42:18 GMT):
are -> are not
clempo (Mon, 24 Apr 2017 19:43:06 GMT):
it is not practical to force everyone to create their users in Java
rickr (Mon, 24 Apr 2017 19:46:17 GMT):
I have not looked at interoperablity between the various toolkit .
clempo (Mon, 24 Apr 2017 19:46:36 GMT):
that's fair, but the CLI is not another toolkit
clempo (Mon, 24 Apr 2017 19:47:22 GMT):
creating a user in an admin tool then referring to that existing user in your Java app is a common scenario
clempo (Mon, 24 Apr 2017 19:47:46 GMT):
I can probably try a few things to create the public key string
clempo (Mon, 24 Apr 2017 19:48:09 GMT):
I'm stressing the point because your answer should be in the comments of the Enrollment iface
rickr (Mon, 24 Apr 2017 19:50:54 GMT):
that's hex encoded pem you should be able to read it in as such. I'd like to try that scenario if I had the bandwidth .. bigger issues.
If you can get something to work with that I'd appreciate contributing it back .. even in the sample
That key is a hex encoded pemfile If you get the cli prublic key and read it in convert it. I think it would work
clempo (Mon, 24 Apr 2017 19:51:38 GMT):
pem is a text format
clempo (Mon, 24 Apr 2017 19:51:48 GMT):
maybe you mean simply pem encoded file
clempo (Mon, 24 Apr 2017 19:51:53 GMT):
pem already looks like hex
clempo (Mon, 24 Apr 2017 19:52:21 GMT):
cli produces a pem cert and a pem private key
clempo (Mon, 24 Apr 2017 19:52:32 GMT):
that's why I got the pub key wrong
clempo (Mon, 24 Apr 2017 19:52:46 GMT):
you have to extract the pub key from the cert
clempo (Mon, 24 Apr 2017 19:53:08 GMT):
it appears the priv key is actually a key pair, but without doc I could not be sure it was always the case
clempo (Mon, 24 Apr 2017 19:55:32 GMT):
maybe that's always true of RSA private keys
clempo (Mon, 24 Apr 2017 19:55:46 GMT):
again, not sure if only RSA is supported
clempo (Mon, 24 Apr 2017 19:56:08 GMT):
not that important for now since I have access through the cert
rickr (Mon, 24 Apr 2017 19:56:33 GMT):
I don't think at the moment we use the public key at all. I think it's a left over from the 0.6 - but not sure .. I think for now you'll be ok just setting to anything other than null or an empty string .. Feel free to open a Jira to clean that up
rickr (Mon, 24 Apr 2017 19:56:59 GMT):
I'd give that a shot
clempo (Mon, 24 Apr 2017 19:57:15 GMT):
that would mean my theory why this fails is moot
clempo (Mon, 24 Apr 2017 19:57:28 GMT):
I hope you are wrong and the public key is used
clempo (Mon, 24 Apr 2017 19:58:06 GMT):
a Jira to clean what exactly?
rickr (Mon, 24 Apr 2017 19:58:26 GMT):
remove the public key
clempo (Mon, 24 Apr 2017 19:59:07 GMT):
I don't think I know enough to request that change
clempo (Mon, 24 Apr 2017 19:59:24 GMT):
I don't know if it's used or not
clempo (Mon, 24 Apr 2017 19:59:31 GMT):
let me check in eclipse
clempo (Mon, 24 Apr 2017 20:00:02 GMT):
it is accessed in reenroll
clempo (Mon, 24 Apr 2017 20:00:42 GMT):
that probably means my pub key is not used in my app
clempo (Mon, 24 Apr 2017 20:00:57 GMT):
I will need to find another culprit
clempo (Mon, 24 Apr 2017 20:01:35 GMT):
any hint on where to see the log of the orderer?
rickr (Mon, 24 Apr 2017 20:02:29 GMT):
should be a log4j.properties you can set the sdk level there
clempo (Mon, 24 Apr 2017 20:03:56 GMT):
maybe there is only a console appender, that would explain the lack of a log file
clempo (Mon, 24 Apr 2017 20:04:07 GMT):
I'll take a look
clempo (Mon, 24 Apr 2017 20:04:16 GMT):
I need to step out.
clempo (Mon, 24 Apr 2017 20:04:18 GMT):
Thanks again
rickr (Mon, 24 Apr 2017 20:05:04 GMT):
sure --- WIP a lot of rough edges that need smoothing out --
clempo (Mon, 24 Apr 2017 21:00:35 GMT):
I found another potential diff between my app and the integration suite
clempo (Mon, 24 Apr 2017 21:00:51 GMT):
what value should I use for the MSPID?
clempo (Mon, 24 Apr 2017 21:21:10 GMT):
Clearly, I don't understand what is an MSPID
clempo (Mon, 24 Apr 2017 21:21:25 GMT):
It appears that value is constant for one particular organization
clempo (Mon, 24 Apr 2017 21:21:53 GMT):
but I thought an organization is a concept of the SampleStore only
clempo (Mon, 24 Apr 2017 21:22:00 GMT):
or the TestConfig
clempo (Mon, 24 Apr 2017 21:22:32 GMT):
seems like it is needed to get the genesis block
rickr (Mon, 24 Apr 2017 21:22:36 GMT):
yes -- it's just something you need to know .. I'm on thin ice but basically it like your org
clempo (Mon, 24 Apr 2017 21:23:09 GMT):
in the integration suite, it is poked on the SampleUser after it is enrolled
clempo (Mon, 24 Apr 2017 21:23:45 GMT):
does it have to show up in the cert?
rickr (Mon, 24 Apr 2017 21:23:55 GMT):
no
clempo (Mon, 24 Apr 2017 21:24:32 GMT):
I will hardcode it on my user in my app tomorrow
clempo (Mon, 24 Apr 2017 21:24:43 GMT):
so far, I was using the user name
clempo (Mon, 24 Apr 2017 21:24:49 GMT):
as the value of the mspid
clempo (Mon, 24 Apr 2017 21:25:35 GMT):
I also noticed we don't need any roles to make it work
clempo (Mon, 24 Apr 2017 21:25:54 GMT):
is that because authorization is turned off in your sample CAs?
rickr (Mon, 24 Apr 2017 21:27:52 GMT):
IMO when give the user their secret for enrollment probably should include their MSPID .. assume the admin knows this.
FengChen_1982 (Tue, 25 Apr 2017 02:00:21 GMT):
Has joined the channel.
FengChen_1982 (Tue, 25 Apr 2017 05:37:50 GMT):
Hello, To to the following operations: deploy&invoke the chaincode, proposal, transaction query, etc. I can use REST API in Fabric 0.6, but will have to use SDK now in Fabric 1.0 only, right?
bh4rtp (Tue, 25 Apr 2017 07:12:44 GMT):
the tls configuration of java sdk is different from fabric e2e_cli.
bh4rtp (Tue, 25 Apr 2017 07:13:28 GMT):
End2endIT.java cannot run correctly now.
rickr (Tue, 25 Apr 2017 11:58:22 GMT):
I think the Node sdk may have a REST wrapper around their sdk you might want ask on that channel
rickr (Tue, 25 Apr 2017 11:59:50 GMT):
Code was changed on the Fabric side that has caused end2endIt to break. Make sure for now that you are using the level that is in the README.md.
rickr (Tue, 25 Apr 2017 11:59:50 GMT):
****************************
*Code was changed on the Fabric side that has caused end2endIt to break. Make sure for now that you are using the level that is in the README.md.*
****************************
rickr (Tue, 25 Apr 2017 11:59:50 GMT):
****************************
*Code was changed on the Fabric side that has caused end2endIt to break. Make sure for now that you are using the level that is in the README.md.*
****************************
HubertYoung (Tue, 25 Apr 2017 15:06:08 GMT):
Has joined the channel.
HubertYoung (Tue, 25 Apr 2017 15:29:21 GMT):
I run the end2endit example,so the chain is initialized.How can i get the chain in java after that?
HubertYoung (Tue, 25 Apr 2017 15:31:30 GMT):
It seems HFClient only provides methods to new chain but no query or get chain.
pschnap (Tue, 25 Apr 2017 16:02:41 GMT):
Is there any way I can retrieve the transaction call that was made from BlockInfo after querying by transaction ID?
clempo (Tue, 25 Apr 2017 16:03:38 GMT):
@HubertYoung Check the End2endAndBackAgain sample. The sample uses an admin to recreate the chain but the user does not have to be admin.
pschnap (Tue, 25 Apr 2017 16:24:05 GMT):
hm, seems the transaction call is part of the payload of a processed transaction. Is there anyway to extract the call and arguments from that into a nice Java object?
zemtsov (Tue, 25 Apr 2017 19:53:49 GMT):
Has joined the channel.
chunhui (Wed, 26 Apr 2017 02:11:24 GMT):
Has joined the channel.
HubertYoung (Wed, 26 Apr 2017 03:33:36 GMT):
@clempo Thanks.
gujx (Wed, 26 Apr 2017 07:58:03 GMT):
hey guys, recently I've built the source code of fabric-sdk-java by maven and came across 'java.lang.NoSuchMethodError: io.grpc.protobuf.ProtoUtils.marshaller(Lcom/google/protobuf/Message;)Lio/grpc/MethodDescriptor$Marshaller;' when creating chain by HFClient. The class invoking this method is 'org.hyperledger.fabric.protos.orderer.AtomicBroadcastGrpc'. It seems that the code genereated by protobuf does not match the dependencies of fabric-sdk-java. Any ideas?
gujx (Wed, 26 Apr 2017 09:07:16 GMT):
Seems that the shim client I built dependends on the wrong version of grpc... It disappeared after I fix the version
hayato (Wed, 26 Apr 2017 10:43:40 GMT):
Has joined the channel.
HubertYoung (Wed, 26 Apr 2017 11:38:39 GMT):
I enable the tls option,then i get a timeout error.
HubertYoung (Wed, 26 Apr 2017 11:39:09 GMT):
2017-04-26 19:00:46 ERROR Chain:2041 - Sending proposal to peer1 failed because of gRPC failure=Status{code=UNKNOWN, description=Timeout expired while starting chaincode example_cc_go:1(networkid:dev,peerid:peer1,tx:c7927024fd914d06e0a90fc78a315d019488a9f9b9c4156a886c91ad325b61c4), cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Timeout expired while starting chaincode example_cc_go:1(networkid:dev,peerid:peer1,tx:c7927024fd914d06e0a90fc78a315d019488a9f9b9c4156a886c91ad325b61c4)
at org.hyperledger.fabric.sdk.Chain.sendProposalToPeers(Chain.java:2041)
at org.hyperledger.fabric.sdk.Chain.sendInstantiationProposal(Chain.java:1162)
at org.hyperledger.fabric.sdkintegration.End2endIT.runChain(End2endIT.java:276)
at org.hyperledger.fabric.sdkintegration.End2endIT.setup(End2endIT.java:175)
at org.hyperledger.fabric.sdkintegration.End2endIT.main(End2endIT.java:85)
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Timeout expired while starting chaincode example_cc_go:1(networkid:dev,peerid:peer1,tx:c7927024fd914d06e0a90fc78a315d019488a9f9b9c4156a886c91ad325b61c4)
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:439)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:428)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:514)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:431)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:546)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:152)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
HubertYoung (Wed, 26 Apr 2017 11:39:15 GMT):
Any ideas?
HubertYoung (Wed, 26 Apr 2017 12:04:13 GMT):
Another question.The end2end example runs correctly,but there are some errors in log.
HubertYoung (Wed, 26 Apr 2017 12:04:15 GMT):
2017-04-26 11:43:42.624 UTC [eventhub_producer] Chat -> ERRO 03d Error during Chat, stopping handler: stream error: code = 1 desc = "context canceled"
rickr (Wed, 26 Apr 2017 12:05:38 GMT):
Try docker-comopose down . Do a docker ps -a . Clean up all containers that have the chaincode name in them. Do do the same for: docker images
then restart your services and run again
HubertYoung (Wed, 26 Apr 2017 12:52:31 GMT):
@rickr I tried again and its the same.
HubertYoung (Wed, 26 Apr 2017 12:53:12 GMT):
as the you told
clempo (Wed, 26 Apr 2017 15:26:32 GMT):
@rickr, I got a transaction and a query to work for user1 using a rebuilt user and enrollment. The cert and key were read from files in the same format produced by fabric-ca-client.
clempo (Wed, 26 Apr 2017 15:27:12 GMT):
It took me a long time to figure out how to create the pem files and how to read them.
clempo (Wed, 26 Apr 2017 15:28:06 GMT):
I think the samples should at least read the enrollment for the admin
clempo (Wed, 26 Apr 2017 15:28:13 GMT):
instead of renrolling
clempo (Wed, 26 Apr 2017 15:29:05 GMT):
Recreating your admin in your client app would not work in real life
clempo (Wed, 26 Apr 2017 15:29:45 GMT):
I have a question regarding making a query
clempo (Wed, 26 Apr 2017 15:29:59 GMT):
What does it mean if I have multiple peers for a query?
clempo (Wed, 26 Apr 2017 15:30:13 GMT):
should I limit it to just one peer?
clempo (Wed, 26 Apr 2017 15:30:41 GMT):
Should I validate I get the same response?
clempo (Wed, 26 Apr 2017 15:30:54 GMT):
from all the peers
tsnyder (Wed, 26 Apr 2017 20:01:54 GMT):
When the chain's registered event listener receive method is invoked on a particular chain / channel, does the next invocation wait until the receive method returns, or are multiple parallel invocations possible?
rickr (Wed, 26 Apr 2017 20:49:07 GMT):
totally async
rickr (Wed, 26 Apr 2017 20:52:52 GMT):
@clempo In the real world I would think that to be a bogus check. There's no guarantee by the time you've your invocation starts to query for a value some other chaincode has not already changed it again. Probably if all you want to know is the value of something querying one peer I would think is fine
clempo (Wed, 26 Apr 2017 21:04:23 GMT):
Can you explain the purpose of the event hubs in the integration tests? Are the End2end sample apps actually affected by events?
clempo (Wed, 26 Apr 2017 21:05:03 GMT):
Would my app still be production quality if I recreate the chain without event hubs and attempted to query or invoke the chain?
rickr (Wed, 26 Apr 2017 21:11:55 GMT):
If you don't care when your change actually gets written to the ledger you probably wouldn't need any evenhubs
clempo (Wed, 26 Apr 2017 21:27:37 GMT):
would I know if the transaction succeeded without event hubs?
clempo (Wed, 26 Apr 2017 21:28:53 GMT):
Are you saying I need an event hub to know when my transaction is finished?
clempo (Wed, 26 Apr 2017 21:29:26 GMT):
is that why the samples have long sleeps instead of a more deterministic approach?
rickr (Wed, 26 Apr 2017 21:35:12 GMT):
There should be no sleep in the latest
rohitbordia (Thu, 27 Apr 2017 00:12:56 GMT):
Does any one know why in the java sample we have 1 instance of couchDB?
rohitbordia (Thu, 27 Apr 2017 00:13:54 GMT):
even though we have multiple peers .. shouldn't each peer have its own copy of couhDB
Willson (Thu, 27 Apr 2017 07:43:58 GMT):
hello @rickr , at chain.java 2122 i notice that the transactionBuilder just simply collects all endorsements and one responsePayload of the proposalResponses, how about the proposalResponses have a different payload? how can it determine which one is correct?
```
List
Willson (Thu, 27 Apr 2017 07:43:58 GMT):
hello @rickr , at chain.java 2122 i notice that the transactionBuilder just simply collects all endorsements and one responsePayload of the proposalResponses, how about the proposalResponses have a different payload? how can it determine which one is correct?
```
List
john2000 (Thu, 27 Apr 2017 07:54:24 GMT):
Has joined the channel.
bh4rtp (Thu, 27 Apr 2017 08:10:30 GMT):
@rohitbordia i don't know why have only one couchdb instance. but i remember when 1.0.0 alpha was released, it must configure one couchdb for each peer.
bh4rtp (Thu, 27 Apr 2017 08:51:33 GMT):
@rohitbordia the couchdb in java sample is only a demo and not really used by peers. i just tested, one couchdb must be configured for each peer.
kelvinzhong (Thu, 27 Apr 2017 09:22:34 GMT):
Message Attachments
kelvinzhong (Thu, 27 Apr 2017 09:23:48 GMT):
hi all, i have switch the project to this commit level, but it would return an error while sending the instantiateProposalRequest, and return "UNKNOWN: Transaction returned with failure: Failed extracting proposal fields. [Could not extract the channel header from the proposal: UnmarshalChannelHeader failed, err proto: bad wiretype for field common.ChannelHeader.Type: got wiretype 2, want 0]"
kelvinzhong (Thu, 27 Apr 2017 09:24:04 GMT):
any idea?
yecineoueslati (Thu, 27 Apr 2017 13:27:16 GMT):
Has joined the channel.
yecineoueslati (Thu, 27 Apr 2017 13:39:19 GMT):
hello everybody,
i m trying to run the End to end test scenario.
yecineoueslati (Thu, 27 Apr 2017 13:43:34 GMT):
Message Attachments
yecineoueslati (Thu, 27 Apr 2017 13:45:32 GMT):
hello everybody,
yecineoueslati (Thu, 27 Apr 2017 13:47:16 GMT):
Hello everybody,
I am trying to run the End to end test scenario.
But i am getting this exception.
yecineoueslati (Thu, 27 Apr 2017 13:47:30 GMT):
Message Attachments
yecineoueslati (Thu, 27 Apr 2017 13:49:10 GMT):
Message Attachments
yecineoueslati (Thu, 27 Apr 2017 13:50:43 GMT):
and thanks
tsnyder (Thu, 27 Apr 2017 14:29:01 GMT):
@rickr - In reviewing the code for chain.java the sendTransaction method returns a CompletableFuture
rickr (Thu, 27 Apr 2017 14:37:02 GMT):
yes :)
rickr (Thu, 27 Apr 2017 14:37:02 GMT):
yes :) When the eventhubs that are listening for events have all received that block associated with transaction have been received AND they are marked as valid
rickr (Thu, 27 Apr 2017 14:37:02 GMT):
yes :) When the eventhubs that are listening for events have all received that block associated with transaction have been received AND they the transaction is marked as valid
rickr (Thu, 27 Apr 2017 14:37:02 GMT):
yes :) When the eventhubs that are listening for events have all received that block associated with transaction have been received AND t the transaction is marked as valid
tsnyder (Thu, 27 Apr 2017 14:47:33 GMT):
@rickr - Is there a way of determining when the Orderer has successfully received the sendTransaction, and thus it is its responsibility to include it in a Block?
rickr (Thu, 27 Apr 2017 14:52:32 GMT):
AFAIK The orderer call to put the transaction in a batch for processing is synchronize so if I'm understanding your question that should be when get returned back from invoking the call. I don't think there's anyway of knowing when that batch/block is starting to be processed by the endorsers if that's what's your asking.
rickr (Thu, 27 Apr 2017 14:52:32 GMT):
AFAIK The orderer call to put the transaction in a batch for processing is synchronize so if I'm understanding your question that should be when get returned back from invoking the call. That happens in my experience almost _relativiely_ nstantly. I don't think there's anyway of knowing when that batch/block is starting to be processed by the endorsers if that's what's your asking.
tsnyder (Thu, 27 Apr 2017 14:54:19 GMT):
No - what I was asking is about the Orderer guarantee that it has the transaction and in some way persisted it. Meaning that the transaction will not be dropped or lost within the Orderer.
rickr (Thu, 27 Apr 2017 14:56:09 GMT):
I'm fairly certain that if we get back a 200 from the orderer it will be on it's queue to do
tsnyder (Thu, 27 Apr 2017 14:56:31 GMT):
Good. Thanks, that is what I needed to know.
rohitbordia (Thu, 27 Apr 2017 16:05:39 GMT):
@rickr : for the sdk example can we deploy that on a swarm cluster
rohitbordia (Thu, 27 Apr 2017 16:05:48 GMT):
@bh4rtp : ok, thanks
rickr (Thu, 27 Apr 2017 16:35:48 GMT):
I have no experience with running the sdk on a swarm cluster . The first issue I could imagine is sharing the user enrollements .
yecineoueslati (Thu, 27 Apr 2017 16:41:05 GMT):
it worked thx everybody
yecineoueslati (Thu, 27 Apr 2017 16:41:14 GMT):
Message Attachments
rohitbordia (Thu, 27 Apr 2017 16:49:02 GMT):
im keeping away fabric-ca sep
rohitbordia (Thu, 27 Apr 2017 16:49:20 GMT):
so only orderer and peers are in swarm cluster
rickr (Thu, 27 Apr 2017 16:52:54 GMT):
that's a different question :) Whats there now doesn't persist anything for Fabric .. You'd need to move to Kafka for consensus and make the ledger write to a real database
rickr (Thu, 27 Apr 2017 16:53:33 GMT):
that's just for starters
rohitbordia (Thu, 27 Apr 2017 16:53:41 GMT):
ok
rohitbordia (Thu, 27 Apr 2017 16:54:15 GMT):
I'm trying to install peer , orderer, kafka, couchdb on swarm cluster
rohitbordia (Thu, 27 Apr 2017 16:54:34 GMT):
but, didnt understand how they will sync
rickr (Thu, 27 Apr 2017 16:55:23 GMT):
For those questions you'll much better response on the fabric channel
rohitbordia (Thu, 27 Apr 2017 16:55:34 GMT):
just fabric
clempo (Thu, 27 Apr 2017 19:43:00 GMT):
The version should be updated in the sdk readme
clempo (Thu, 27 Apr 2017 19:43:06 GMT):
... The sdk jar is in target/fabric-sdk-java-1.0-SNAPSHOT.jar ...
clempo (Thu, 27 Apr 2017 19:43:14 GMT):
you now use 1.0.0
clempo (Thu, 27 Apr 2017 19:50:21 GMT):
I updated to the latest code, making sure to reset to the documented commitlevels
clempo (Thu, 27 Apr 2017 19:50:46 GMT):
I'm getting this error when I try to run the integration tests
clempo (Thu, 27 Apr 2017 19:50:52 GMT):
2017-04-27 15:47:58 ERROR HFCAClient:527 - POST request to http://localhost:7054/api/v1/enroll failed with status code: 404. Response: 404 page not found
clempo (Thu, 27 Apr 2017 19:51:19 GMT):
I rebuilt fabric and fabric-ca
clempo (Thu, 27 Apr 2017 19:51:50 GMT):
I got my docker images with
clempo (Thu, 27 Apr 2017 19:51:51 GMT):
cd /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli
clempo (Thu, 27 Apr 2017 19:52:00 GMT):
. download-dockerimages.sh
clempo (Thu, 27 Apr 2017 19:53:24 GMT):
I know the latest fabric broke the sdk not long ago
clempo (Thu, 27 Apr 2017 19:54:21 GMT):
That's why I was careful with the commit levels
clempo (Thu, 27 Apr 2017 19:54:57 GMT):
but I don't know how that relates to the docker images I downloaded
clempo (Thu, 27 Apr 2017 19:55:44 GMT):
how do I fix this?
HubertYoung (Fri, 28 Apr 2017 03:14:51 GMT):
I use fabric-sdk-java to submit 20 transactions at the same.But only one transaction commit successfully.Any ideas?Here is the log.
HubertYoung (Fri, 28 Apr 2017 03:14:51 GMT):
I use fabric-sdk-java to submit 20 transactions at the same time.But only one transaction commit successfully.Any ideas?Here is the log.
HubertYoung (Fri, 28 Apr 2017 03:14:52 GMT):
2017-04-28 03:08:16.005 UTC [kvledger] Commit -> INFO 19f Channel [foo]: Created block [29] with 10 transaction(s)
2017-04-28 03:08:18.271 UTC [statevalidator] ValidateAndPrepareBatch -> WARN 1a0 Block [30] Transaction index [1] TxId [d38ae316767f61502417ea2681c2c7d7fbf3898897bac14edcab2cd5df28362f] marked as invalid by state validator. Reason code [11]
HubertYoung (Fri, 28 Apr 2017 03:15:51 GMT):
2017-04-28 03:08:18.272 UTC [statevalidator] ValidateAndPrepareBatch -> WARN 1a1 Block [30] Transaction index [2] TxId [8aad508c2a92a093fc471ef9424a27dee8055eb72947a40296e03a31c0d262e6] marked as invalid by state validator. Reason code [11]
2017-04-28 03:08:18.272 UTC [statevalidator] ValidateAndPrepareBatch -> WARN 1a2 Block [30] Transaction index [3] TxId [aa0382a5a8021d35f871a7367ccc67e4771665066843f8a5eaa7365155ace1c3] marked as invalid by state validator. Reason code [11]
Willson (Fri, 28 Apr 2017 03:28:24 GMT):
your transactions operate the same key i guess
Willson (Fri, 28 Apr 2017 03:28:24 GMT):
your transactions operate with the same key i guess
HubertYoung (Fri, 28 Apr 2017 03:36:08 GMT):
The chaincode is the example in end2endIT ,github.com/example_cc.
HubertYoung (Fri, 28 Apr 2017 03:36:22 GMT):
What do you mean by the same key?
Willson (Fri, 28 Apr 2017 03:37:24 GMT):
like this `transactionProposalRequest.setArgs(new String[] {"move", "a", "b", "100"});` the key are a and b
HubertYoung (Fri, 28 Apr 2017 03:42:05 GMT):
I see.They are all the same key.What to do i want to send tx with the same key in my scenario?Is there some configuration?
HubertYoung (Fri, 28 Apr 2017 03:42:05 GMT):
I see.They are all the same key.What to do if i want to send tx with the same key in my scenario?Is there some configuration?
HubertYoung (Fri, 28 Apr 2017 03:43:51 GMT):
For example,batch transfer from A to B
Willson (Fri, 28 Apr 2017 03:52:15 GMT):
perhaps you can get a professional responce at fabric-consensus channel
Willson (Fri, 28 Apr 2017 03:55:41 GMT):
and get some information form http://fabric-rtd.readthedocs.io/en/latest/readwrite.html
HubertYoung (Fri, 28 Apr 2017 04:30:49 GMT):
Thanks.
Willson (Fri, 28 Apr 2017 04:37:21 GMT):
yw
wsh_bob (Fri, 28 Apr 2017 08:10:49 GMT):
Has joined the channel.
dorrakhribi (Fri, 28 Apr 2017 08:33:58 GMT):
hello, i'm trying to run the fabric sdk but i keep getting the following error:"failed to get a new tcert" can ony one help me please ?
Willson (Fri, 28 Apr 2017 09:38:20 GMT):
@Here can anybody clear me fot that ? thx, it puzzle me a lot [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=TocAoLZjHQuqqjjtK)
Willson (Fri, 28 Apr 2017 09:39:13 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=TocAoLZjHQuqqjjtK) @Here can anybody clear me fot that ? thx, it puzzle me a lot
clempo (Fri, 28 Apr 2017 14:00:37 GMT):
@dorrakhribi, not sure if that's still true, but the readme says: Known limitations
•TCerts are not supported: JIRA FAB-1401
clempo (Fri, 28 Apr 2017 14:09:23 GMT):
I am still looking for help to make the integration tests run again after I upgraded to the latest commit levels
clempo (Fri, 28 Apr 2017 14:09:45 GMT):
Is this a known issue: 2017-04-27 15:47:58 ERROR HFCAClient:527 - POST request to http://localhost:7054/api/v1/enroll failed with status code: 404. Response: 404 page not found
clempo (Fri, 28 Apr 2017 14:10:31 GMT):
latest commit levels -> latest recommended commit levels
clempo (Fri, 28 Apr 2017 14:33:33 GMT):
I rebuilt the docker images with make docker in $GOPATH/src/github.com/hyperledger/fabric
clempo (Fri, 28 Apr 2017 14:33:56 GMT):
I tried make docker in fabric-ca but it same there was nothing to build
clempo (Fri, 28 Apr 2017 14:34:14 GMT):
now I get: org.hyperledger.fabric.sdk.exception.EventHubException: io.grpc.StatusRuntimeException: UNKNOWN: Error during Chat, stopping handler: stream error: code = 13 desc = "grpc: failed to unmarshal the received message proto: peer.Register: illegal tag 0 (wire type 2)"
yecineoueslati (Fri, 28 Apr 2017 16:23:06 GMT):
@clempo are you running inside vagrant?
clempo (Fri, 28 Apr 2017 16:41:47 GMT):
no, I was able to run with just docker before
clempo (Fri, 28 Apr 2017 16:42:17 GMT):
the e2e_cli runs fine without vagrant
clempo (Fri, 28 Apr 2017 16:43:00 GMT):
I would like to know if the integration tests are passing
clempo (Fri, 28 Apr 2017 16:43:13 GMT):
if they are, this is obviously something wrong with my environment
clempo (Fri, 28 Apr 2017 16:43:41 GMT):
I'm not sure how to prove I'm running the right docker images
clempo (Fri, 28 Apr 2017 16:44:28 GMT):
Is there documentation somewhere that would explain why we need vagrant to run docker containers?
clempo (Fri, 28 Apr 2017 16:44:53 GMT):
isn't that a vm technology used to run another vm technology?
clempo (Fri, 28 Apr 2017 16:45:46 GMT):
In any case, my problems appear to be protocol errors, not incomplete file systems in the containers
yecineoueslati (Fri, 28 Apr 2017 17:08:57 GMT):
i posted the same issue yesterday
2017-04-27 14:36:05 ERROR HFCAClient:527 - POST request to http://localhost:7054/api/v1/enroll failed with status code: 404. Response: 404 page not found
and i was able to make it work with vagrant
yecineoueslati (Fri, 28 Apr 2017 17:09:09 GMT):
Message Attachments
yecineoueslati (Fri, 28 Apr 2017 17:11:36 GMT):
there is envirement variables who are present in vagrant config
for exemple
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/tls/key.pem
/etc/hyperledger/tls/key.pem do not exist in non vagrant config
yecineoueslati (Fri, 28 Apr 2017 17:12:40 GMT):
this is picked from docker-compose file in sdkintegration
yecineoueslati (Fri, 28 Apr 2017 17:14:20 GMT):
and finally i am not an expert maybe what i say is not correct
yecineoueslati (Fri, 28 Apr 2017 17:17:54 GMT):
i satrted playing with fabric last week i try to help with what i know
clempo (Fri, 28 Apr 2017 17:20:34 GMT):
@yecineoueslati where did you get your docker images?
clempo (Fri, 28 Apr 2017 17:21:50 GMT):
the link in the readme to setup the development environment is broken
clempo (Fri, 28 Apr 2017 17:30:17 GMT):
I don't understand the instructions to edit Vagrantfile
clempo (Fri, 28 Apr 2017 17:30:23 GMT):
what am I supposed to do with that line
clempo (Fri, 28 Apr 2017 17:30:24 GMT):
***config.vm.synced_folder "/home/user/fabric-sdk-java/src/test/fixture/sdkintegration", "/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration"***
clempo (Fri, 28 Apr 2017 21:00:26 GMT):
I would like to know if working with vagrant is required for the sdk, because the readme suggests you don't need to. Should the readme be changed?
Yiiinsh (Sat, 29 Apr 2017 14:23:55 GMT):
Has joined the channel.
Yiiinsh (Sat, 29 Apr 2017 14:26:55 GMT):
Hello , I have successfully build the e2e environment.I want to use the HFClient as a query & invoke client and I skip the join peer & instantiate process.When I add an EventHub and initialize the client, I got the ERROR from peer:2017-04-29 14:08:42.539 UTC [eventhub_producer] Chat -> ERRO b5b Error during Chat, stopping handler: stream error: code = 13 desc = "grpc: failed to unmarshal the received message proto: peer.Register: illegal tag 0 (wire type 2)"
Yiiinsh (Sat, 29 Apr 2017 14:28:44 GMT):
Chain chain = client.newChain(getConfig(TEST_CHAIN_NAME_KEY));
chain.addOrderer(client.newOrderer(getConfig(TEST_ORDERER_NAME_KEY), getConfig(TEST_ORDERER_LOCATION_KEY)));
config.getList(String.class, TEST_PEERS_NAME_KEY).stream().forEach((peer) -> {
try {
chain.addPeer(client.newPeer(peer, getConfig(TEST_PEERS_LOCATION_PREFIX + peer + TEST_PEERS_LOCATION_SUFFIX)));
chain.addEventHub(client.newEventHub(peer, getConfig(TEST_PEERS_LOCATION_PREFIX + peer + TEST_EVENTHUB_SUFFIX)));
} catch (Exception e) {
logger.error("[queryTest][add peer][fail]Peer:{}", peer, e);
fail();
}
});
chain.initialize();
Yiiinsh (Sat, 29 Apr 2017 14:32:55 GMT):
BTW, the query and invoke works fine, but I cannot get the return value for `BlockEvent.TransactionEvent res = client.getChain(getConfig(TEST_CHAIN_NAME_KEY)).sendTransaction(transactionResponses).get();` and I think this has something to do with the eventhub
svasilyev (Sat, 29 Apr 2017 14:39:15 GMT):
Has joined the channel.
clempo (Sat, 29 Apr 2017 16:50:11 GMT):
I got the same error yesterday. I'm interested if you find the solution.
rickr (Mon, 01 May 2017 12:02:53 GMT):
Ran a test build at levels in the readme.md and all tests passed. If you running exactly the same to check out your install and it fails fairly certain it's something in your setup.
rickr (Mon, 01 May 2017 12:04:19 GMT):
Vagrant is not needed it's just a vm. However it's the lowest common denominator that all platforms should be able to use and eliminates some os dependencies.
clempo (Mon, 01 May 2017 13:55:05 GMT):
I am working on learning git and vagrant to become productive.
clempo (Mon, 01 May 2017 13:55:50 GMT):
Can you repair this link in the readme. It leads to a 404.
clempo (Mon, 01 May 2017 13:55:51 GMT):
•Follow the instructions here to setup the development environment.
clempo (Mon, 01 May 2017 13:57:12 GMT):
Is it supposed to point here? https://hyperledger-fabric.readthedocs.io/en/latest/dev-setup/devenv.html
MrBuggySan (Mon, 01 May 2017 20:19:06 GMT):
Has joined the channel.
wwendy (Tue, 02 May 2017 03:38:47 GMT):
Has joined the channel.
chaitanya (Tue, 02 May 2017 08:42:59 GMT):
Has joined the channel.
Aleks-visser (Tue, 02 May 2017 09:11:02 GMT):
Has joined the channel.
chaitanya (Tue, 02 May 2017 09:29:05 GMT):
I've been trying to deploy a chaincode using the Java-SDK, but I'm getting the following error:
`java.lang.Exception: Not enough endorsers for invoke(move a,b,100):2 endorser error: Sending proposal to peer1 failed because of gRPC failure=Status{code=UNKNOWN, description=, cause=null}. Was verified: false`
This is despite me deploying a different chaincode altogether. Any thoughts on why `description=` blank?
kelvinzhong (Tue, 02 May 2017 11:12:01 GMT):
hi @rickr ,is the genesisBlock not the first block of the ledge? which the genesisBlock is nothing to do with the ledge, right?
kelvinzhong (Tue, 02 May 2017 11:12:01 GMT):
the genesisBlock is about the msp config, am i right?
Aleks-visser (Tue, 02 May 2017 11:30:48 GMT):
Hey is the sdk in java cmpatable with the dev version of fabric
rickr (Tue, 02 May 2017 11:47:58 GMT):
@chaitanya In many cases the error's don't come back to the sdk. Try to look at the peer or orderer logs from the docker containers to see if there's any hint to the issue. Also look at logs the chaincode container and see if there are any hints there.
rickr (Tue, 02 May 2017 11:48:58 GMT):
The genesis block is on the ledger its the first block in the chain
rickr (Tue, 02 May 2017 12:03:07 GMT):
To create build environment with vagrant :
**************************************
```
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric/devenv/
change the Vagrant file as suggested in the readme.md
vagrant up
vagrant ssh
make docker
cd ../fabric-ca
make docker```
rickr (Tue, 02 May 2017 12:03:07 GMT):
To create build environment with vagrant :
**************************************
```
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric/devenv/
change the Vagrant file as suggested in the readme.md
vagrant up
vagrant ssh
make docker
cd ../fabric-ca
make docker```
rickr (Tue, 02 May 2017 12:03:07 GMT):
To create build environment with vagrant :
**************************************
```
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric/devenv/
change the Vagrant file as suggested in the readme.md
vagrant up
vagrant ssh
make docker
cd ../fabric-ca
make docker```
If your OS supports docker and you have all the needed requirements installed you can buildrun without vagrant.
The steps are pretty much the same excluding the vagrant specific steps above.
rickr (Tue, 02 May 2017 12:03:07 GMT):
To create build environment with vagrant :
**************************************
```
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric/devenv/
change the Vagrant file as suggested in the readme.md
vagrant up
vagrant ssh
make docker
cd ../fabric-ca
make docker```
If your OS supports docker and you have all the needed requirements installed you can buildrun without vagrant.
The steps are pretty much the same excluding the vagrant specific steps above.
rickr (Tue, 02 May 2017 12:03:07 GMT):
To create Fabric environment with vagrant :
**************************************
```
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric/devenv/
change the Vagrant file as suggested in the readme.md
vagrant up
vagrant ssh
make docker
cd ../fabric-ca
make docker```
If your OS supports docker and you have all the needed requirements installed you can buildrun without vagrant.
The steps are pretty much the same excluding the vagrant specific steps above.
rickr (Tue, 02 May 2017 12:03:07 GMT):
To create Fabric environment with vagrant :
**************************************
```
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric/devenv/
change the Vagrant file as suggested in the readme.md
vagrant up
vagrant ssh
make docker
cd ../fabric-ca
make docker```
If your OS supports docker and you have all the needed requirements installed you can buildrun without vagrant.
The steps are pretty much the same excluding the vagrant specific steps above.
rickr (Tue, 02 May 2017 12:03:07 GMT):
To create Fabric environment with vagrant :
**************************************
```
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric/devenv/
change the Vagrant file as suggested in the readme.md
vagrant up
vagrant ssh
make docker
cd ../fabric-ca
make docker```
If your OS supports docker and you have all the needed requirements installed you can buildrun without vagrant.
The steps are pretty much the same excluding the vagrant specific steps above.
rickr (Tue, 02 May 2017 12:08:38 GMT):
rickr (Tue, 02 May 2017 12:10:43 GMT):
jingge (Tue, 02 May 2017 13:19:13 GMT):
Has joined the channel.
FengChen_1982 (Tue, 02 May 2017 13:55:16 GMT):
unlike Node SDK, java sdk is still not ready, right?
FengChen_1982 (Tue, 02 May 2017 14:07:29 GMT):
I'm the documents.
FengChen_1982 (Tue, 02 May 2017 14:07:45 GMT):
I mean the document level.
clempo (Tue, 02 May 2017 15:08:27 GMT):
I found this in the fabric devenv documentation.
clempo (Tue, 02 May 2017 15:08:30 GMT):
>> While we still maintain a Vagrant based approach that can be used for older versions of macOS and Windows that Docker does not support, we strongly encourage that the non-Vagrant development setup be used.
clempo (Tue, 02 May 2017 15:09:05 GMT):
This is the reason why I thought vagrant was unnecessary
clempo (Tue, 02 May 2017 15:09:53 GMT):
@rickr, are you able to make it work without vagrant as you suggest above?
rickr (Tue, 02 May 2017 15:52:42 GMT):
I always use vagrant because it allows me to more quickly switch between versions of the Fabric. The verify and merge builds do not use Vagrant. and Vagrant will be supported for some time to come probably always
clempo (Tue, 02 May 2017 15:58:40 GMT):
I don't have anything against vagrant. In fact, I find it pretty cool when it runs setup.sh and everything is installed.
clempo (Tue, 02 May 2017 15:59:36 GMT):
The reason I stress the point of vagrant is because the readmes told me not to use it and that cost me days in productivity
clempo (Tue, 02 May 2017 15:59:44 GMT):
In fact, I'm still down.
clempo (Tue, 02 May 2017 15:59:55 GMT):
This is costing my company money.
clempo (Tue, 02 May 2017 16:00:44 GMT):
I would prefer if the java sdk readme said: forget what the devenv readme says, use vagrant because that's the only thing we promise will work
clempo (Tue, 02 May 2017 16:01:34 GMT):
If we keep the readmes as is, then it should work as promised too.
clempo (Tue, 02 May 2017 16:03:03 GMT):
I am not complaining about my devenv setup. I'm trying to save days to all the other developers following me
cshields (Tue, 02 May 2017 17:18:08 GMT):
I've followed the instructions in https://github.com/hyperledger/fabric-sdk-java/blob/master/README.md
When I run 'docker-compose up -d --force-recreate' I get the following:
ubuntu@hyperledger-devenv:b2a2b3b:/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration$ docker-compose up -d --force-recreate
Pulling ca1 (hyperledger/fabric-ca:latest)...
ERROR: manifest for hyperledger/fabric-ca:latest not found
Do you have any suggestions as to the cause of this?
clempo (Tue, 02 May 2017 17:25:13 GMT):
@cshields, did you "make docker" as rickr explained at 8:10 above
clempo (Tue, 02 May 2017 17:25:55 GMT):
I'm not there yet, I'm still trying to fix my Vagrantfile
clempo (Tue, 02 May 2017 17:28:26 GMT):
@rickr, why are there stars around this line in the readme?
clempo (Tue, 02 May 2017 17:28:28 GMT):
***config.vm.synced_folder "/home/user/fabric-sdk-java/src/test/fixture/sdkintegration", "/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration"***
rickr (Tue, 02 May 2017 17:29:50 GMT):
Don't recall maybe it was an attempt to make it bold
clempo (Tue, 02 May 2017 17:30:38 GMT):
so the stars don't belong there, and the line must be added to Vagrantfile?
cshields (Tue, 02 May 2017 17:42:34 GMT):
@clempo I had run make docker for fabric-ca but got the following:
ubuntu@hyperledger-devenv:b2a2b3b:/opt/gopath/src/github.com/hyperledger/fabric-ca$ make docker
make: Nothing to be done for 'docker'.
I've now run 'make clean' followed by 'make docker' and it's fixed the problem, thanks.
clempo (Tue, 02 May 2017 17:45:14 GMT):
I've had that message before. Nice to know the fix.
clempo (Tue, 02 May 2017 17:45:40 GMT):
My vagrant VM is still booting. Takes a while to provision the first time.
clempo (Tue, 02 May 2017 17:45:48 GMT):
I'll reach your point soon.
rickr (Tue, 02 May 2017 18:19:27 GMT):
no stars all that line does is map a mount to the sdkintegration directory and then you can easily in vagrant go to fabric/sdkintegration
and you should have your docker-compose file and all the files it needs
rohitbordia (Tue, 02 May 2017 23:34:58 GMT):
Im getting this error : network sdkintegration_default not manually attachable
rohitbordia (Wed, 03 May 2017 01:43:51 GMT):
how to solve this
rohitbordia (Wed, 03 May 2017 01:43:52 GMT):
2017-05-02 18:42:38 ERROR Chain:1972 - Sending proposal to peer1 failed because of gRPC failure=Status{code=UNKNOWN, description=Timeout expired while starting chaincode example_cc_go:1(networkid:dev,peerid:peer1,tx:f4d624042db69eb9b463a86b6727e80121bd2444de1d89d69c27a98d07dffbc5), cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Timeout expired while starting chaincode example_cc_go:1(networkid:dev,peerid:peer1,tx:f4d624042db69eb9b463a86b6727e80121bd2444de1d89d69c27a98d07dffbc5)
at org.hyperledger.fabric.sdk.Chain.sendProposalToPeers(Chain.java:1972)
rohitbordia (Wed, 03 May 2017 01:45:47 GMT):
Message Attachments
kelvinzhong (Wed, 03 May 2017 03:48:20 GMT):
@rohitbordia if u r using vm make sure the port redirection is set properly
kelvinzhong (Wed, 03 May 2017 03:48:49 GMT):
also the eventhub using different port for communicate
clempo (Wed, 03 May 2017 04:05:16 GMT):
@rohitbordia, the java sdk readme tells you which line to manually add to your Vagrantfile to configure the port redirection. The readme says vagrant is optional, but the instructions to run without it are not available, so might as well run with vagrant. I learned that the hard way.
albert.lacambra (Wed, 03 May 2017 06:21:54 GMT):
Has joined the channel.
xuanyue202 (Wed, 03 May 2017 07:34:56 GMT):
Hi, I noticed that currently the organization of a user will not be passed to the fabric-ca in a RegistrationRequest. Why is that?
bh4rtp (Wed, 03 May 2017 08:21:06 GMT):
hi, does anyone pass End2endIT.java test using the latest built fabric images? i face this issue.
`ERROR OrdererClient:129 - sendTransaction error Send transactions failed. Reason: UNAVAILABLE`
kelvinzhong (Wed, 03 May 2017 08:22:01 GMT):
@bh4rtp check this https://github.com/hyperledger/fabric-sdk-java
bh4rtp (Wed, 03 May 2017 08:54:31 GMT):
@kelvinzhong i recloned java sdk, changed configtx.yaml, regenerated foo.tx, bar.tx and twoorgs.orderer.block. but End2endIT.java still cannot run correctly.
bh4rtp (Wed, 03 May 2017 08:54:31 GMT):
@kelvinzhong i recloned java sdk, modified configtx.yaml, regenerated foo.tx, bar.tx and twoorgs.orderer.block. but End2endIT.java still cannot run correctly.
kelvinzhong (Wed, 03 May 2017 08:56:52 GMT):
Message Attachments
kelvinzhong (Wed, 03 May 2017 08:57:04 GMT):
what's the error, have u use the proper images?
kelvinzhong (Wed, 03 May 2017 08:59:04 GMT):
but why u modified the configtx.yaml and the gensis block, it could run properly set as default in sdk
xixuejia (Wed, 03 May 2017 08:59:25 GMT):
Has joined the channel.
kelvinzhong (Wed, 03 May 2017 09:02:01 GMT):
i suggest u can use the v1.0 image publish by fabric
kelvinzhong (Wed, 03 May 2017 09:02:01 GMT):
i suggest u can use the v1.0 image published by fabric
bh4rtp (Wed, 03 May 2017 09:19:08 GMT):
@kelvinzhong got it. i used the latest fabric and ca images built from the latest committed sources.
kelvinzhong (Wed, 03 May 2017 09:24:49 GMT):
lol, u might ask rickr catch up to work with the latest build of fabric
mvkmvk (Wed, 03 May 2017 11:16:23 GMT):
Has joined the channel.
john2000 (Wed, 03 May 2017 13:11:36 GMT):
java.io.NotSerializableException: org.hyperledger.fabric.sdk.TestHFClient$1
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at org.hyperledger.fabric.sdkintegration.SampleUser.saveState(SampleUser.java:180)
at org.hyperledger.fabric.sdkintegration.SampleUser.setEnrollment(SampleUser.java:264)
at org.hyperledger.fabric.sdk.TestHFClient.newInstance(TestHFClient.java:51)
at org.hyperledger.fabric.sdk.ChainTest.setupClient(ChainTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
john2000 (Wed, 03 May 2017 13:14:30 GMT):
i run "mvn test" everything is ok, just this
john2000 (Wed, 03 May 2017 13:15:04 GMT):
the result is "Tests run: 66, Failures: 0, Errors: 0, Skipped: 2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:32.940s
[INFO] Finished at: Wed May 03 15:06:43 CEST 2017
[INFO] Final Memory: 25M/94M
[INFO] ------------------------------------------------------------------------"
rohitbordia (Wed, 03 May 2017 13:16:27 GMT):
@kelvinzhong / @clempo : i have set forwarding port in my files
rohitbordia (Wed, 03 May 2017 13:16:28 GMT):
manager.vm.network :forwarded_port, guest: 7051, host: 7051
manager.vm.network :forwarded_port, guest: 7056, host: 7056
manager.vm.network :forwarded_port, guest: 7054, host: 7054
manager.vm.network :forwarded_port, guest: 7050, host: 7050
manager.vm.network :forwarded_port, guest: 7053, host: 7053
clempo (Wed, 03 May 2017 13:18:41 GMT):
@rohitbordia, do you get any calls going, or it times out on the first call?
rohitbordia (Wed, 03 May 2017 13:19:12 GMT):
I have this working
rohitbordia (Wed, 03 May 2017 13:19:12 GMT):
Running Chain foo
Creating install proposal
Sending install proposal
Successful install proposal response Txid: 762c380646a5c17d4d9eb3728490e3b031dd06ed2ec8671a54bfc33d34284ccf from peer peer0
Successful install proposal response Txid: 762c380646a5c17d4d9eb3728490e3b031dd06ed2ec8671a54bfc33d34284ccf from peer peer1
rohitbordia (Wed, 03 May 2017 13:19:36 GMT):
sendign instantiateProposalRequest , thats when it dies
clempo (Wed, 03 May 2017 13:20:34 GMT):
Did you reboot your vagrant after the first run?
clempo (Wed, 03 May 2017 13:20:40 GMT):
My motd said to reboot
rohitbordia (Wed, 03 May 2017 13:21:10 GMT):
yes
rohitbordia (Wed, 03 May 2017 13:21:16 GMT):
im trying to run in peer in multiple machines..
rohitbordia (Wed, 03 May 2017 13:22:15 GMT):
I have seen this same here error but no resolution : http://stackoverflow.com/questions/41011379/launchandwaitforregister-failed-timeout-expired-while-starting-chaincode
clempo (Wed, 03 May 2017 13:26:11 GMT):
do you mean run peers in multiple virtual machines, or multiple physical machines
rohitbordia (Wed, 03 May 2017 13:27:01 GMT):
multiple virtual machines
clempo (Wed, 03 May 2017 13:27:19 GMT):
your list of forwarded ports is too short
clempo (Wed, 03 May 2017 13:27:31 GMT):
did you add the lines the readme tell you to add
rohitbordia (Wed, 03 May 2017 13:28:12 GMT):
yes, I have all the ports from 7050 to 8056
rohitbordia (Wed, 03 May 2017 13:28:24 GMT):
8058 also
rohitbordia (Wed, 03 May 2017 13:28:44 GMT):
i have manager node, 2 worker connected using docker
clempo (Wed, 03 May 2017 13:29:42 GMT):
is this repeatable at the same spot? Is your host busy? Does it have enough RAM?
rohitbordia (Wed, 03 May 2017 13:30:15 GMT):
I have provided 4 gb ram.. yes after running 3-4 times its the same place same error
clempo (Wed, 03 May 2017 13:32:43 GMT):
Are you saying your physical host has 4GB or RAM?
clempo (Wed, 03 May 2017 13:32:50 GMT):
or -> of
clempo (Wed, 03 May 2017 13:33:06 GMT):
isn't that tiny to run so many VMs?
rohitbordia (Wed, 03 May 2017 13:35:31 GMT):
4 GB RAM for each VM
clempo (Wed, 03 May 2017 13:35:32 GMT):
@john2000 I get exceptions too when I run the integration tests. I always thought they were negative tests but I never confirmed.
clempo (Wed, 03 May 2017 13:36:15 GMT):
My only theory so far is your host is thrashing or not powerful enough
rohitbordia (Wed, 03 May 2017 13:40:41 GMT):
@clempo : did you check this URL : http://stackoverflow.com/questions/41011379/launchandwaitforregister-failed-timeout-expired-while-starting-chaincode
clempo (Wed, 03 May 2017 13:44:12 GMT):
That provides more help than I can offer. I'm just a noobie like you
clempo (Wed, 03 May 2017 13:45:57 GMT):
Do you have the recommended commit levels for fabric and fabric-ca?
rohitbordia (Wed, 03 May 2017 13:49:49 GMT):
yes , I did updated with those.. but seems like in comment they say : if you're doing with with straight-up docker/swarm, I had to patch the base-image with the hyperledger codebase (including core.yaml) to get it to work.
rohitbordia (Wed, 03 May 2017 13:49:55 GMT):
which I don't get it
clempo (Wed, 03 May 2017 13:50:13 GMT):
I gave up trying to run with just docker
clempo (Wed, 03 May 2017 13:50:33 GMT):
the sdk lead only works with vagrant
clempo (Wed, 03 May 2017 13:51:27 GMT):
I made it work once without vagrant by luck and lost 1w trying to get it back to work after I pulled the latest code
clempo (Wed, 03 May 2017 13:52:39 GMT):
if you are studying how to make new channels, then you are ahead of me
clempo (Wed, 03 May 2017 13:54:23 GMT):
I saw it work with vagrant yesterday.
clempo (Wed, 03 May 2017 13:55:17 GMT):
to get rid of vagrant you could study setup.sh and do the equivalent on your host
clempo (Wed, 03 May 2017 13:55:41 GMT):
I hope to do that one day, but for now having it run was more important
john2000 (Wed, 03 May 2017 14:20:10 GMT):
i try to use ide "idea" run "End2endIT" test , but face this error "404 http://localhost:7050". vagrant config:" config.vm.network "forwarded_port", guest: 7050, host: 7050, host_ip: "127.0.0.1"
john2000 (Wed, 03 May 2017 14:24:09 GMT):
i see the same erro,in ssh"wget http://localhost:7050"
john2000 (Wed, 03 May 2017 14:25:52 GMT):
i had download images using "/apps/svr/golang/src/github.com/hyperledger/fabric/examples/e2e_cli/download-dockerimages.sh" docker ps -a show like this:
john2000 (Wed, 03 May 2017 14:26:05 GMT):
e05c9c88d29f hyperledger/fabric-peer "peer node start -..." 22 seconds ago Up 19 seconds 0.0.0.0:8056->7051/tcp, 0.0.0.0:8058->7053/tcp peer3
0b4bceff6f7e hyperledger/fabric-peer "peer node start -..." 22 seconds ago Up 19 seconds 0.0.0.0:7056->7051/tcp, 0.0.0.0:7058->7053/tcp peer1
527e0bf4f52b hyperledger/fabric-peer "peer node start -..." 25 seconds ago Up 22 seconds 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0
13ee2944c747 hyperledger/fabric-peer "peer node start -..." 25 seconds ago Up 22 seconds 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer2
6ca968bb78ee hyperledger/fabric-ca "sh -c 'fabric-ca-..." 30 seconds ago Up 26 seconds 0.0.0.0:8054->7054/tcp ca_peerOrg2
b28b9f7a07d5 hyperledger/fabric-orderer "orderer" 30 seconds ago Up 25 seconds 0.0.0.0:7050->7050/tcp orderer0
4aff0336a3be couchdb "tini -- /docker-e..." 30 seconds ago Up 26 seconds 0.0.0.0:5984->5984/tcp couchdb
f72d6ab717d0 hyperledger/fabric-ca "sh -c 'fabric-ca-..." 30 seconds ago Up 26 seconds 0.0.0.0:7054->7054/tcp ca_peerOrg1
clempo (Wed, 03 May 2017 14:26:41 GMT):
yeah, I once did that and got it to work, but not since then
clempo (Wed, 03 May 2017 14:26:54 GMT):
it's hard to prove the commit level of those images
clempo (Wed, 03 May 2017 14:27:34 GMT):
I suggest you use vagrant like the readme and rebuild the images following the instructions there
clempo (Wed, 03 May 2017 14:27:46 GMT):
don't forget to make clean before make docker
clempo (Wed, 03 May 2017 14:35:23 GMT):
@rickr, can you fix the typo with the extra e: getTransactioneWaitTime()
rohitbordia (Wed, 03 May 2017 16:39:02 GMT):
@clempo : i ditched vagrant and did setup swarm on vm's and it worked
clempo (Wed, 03 May 2017 21:05:31 GMT):
Can someone explain how to change docker-compose.yaml and the fabric-sdk-java pom to only listen on SSL?
rickr (Wed, 03 May 2017 22:34:31 GMT):
For the services look at the .env file in the same directory as docker-comp.yaml . reverse the comments.
For the SDK tests define a env var ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=true
rickr (Wed, 03 May 2017 22:34:31 GMT):
For the services look at the .env file in the same directory as docker-comp.yaml . reverse the comments.
For the SDK tests define a env var ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=true
When switch between TLS/nonTLS make sure you remove all docker containers that are chaincode deployments
rickr (Wed, 03 May 2017 22:34:31 GMT):
For the services look at the .env file in the same directory as docker-comp.yaml . reverse the comments.
For the SDK tests define a env var ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=true
When switching between TLS/nonTLS make sure to remove all docker containers that are chaincode deployments
kelvinzhong (Thu, 04 May 2017 02:01:28 GMT):
@rohitbordia check the TestConfig.class, default port setting, and remember to restart ur vm after modify the vagrantfile!
tsnyder (Thu, 04 May 2017 10:15:48 GMT):
I have gone through the TestConfig.java setup. Is it a fair statement that the property information contained within it is the responsibility of the client app to persist and provide the SDK? Examples would be the Peer information on the network (or associated with a channel), User Context, Enrollment Cert, channels authorized to?
rickr (Thu, 04 May 2017 10:53:28 GMT):
There is no persistence in the JDK
rickr (Thu, 04 May 2017 10:53:28 GMT):
There is no persistence in the JDK . Consider it like an http client except it forms request to Fabric blockchain.
rickr (Thu, 04 May 2017 10:53:28 GMT):
There is no persistence in the JDK . Consider it like an http client except it forms request to Fabric blockchain. Stated in the READM.md if you haven't taken a look
rickr (Thu, 04 May 2017 10:53:28 GMT):
There is no persistence in the JDK . Consider it like an http client except it forms request to Fabric blockchain. Stated in the READM.md
rickr (Thu, 04 May 2017 12:37:12 GMT):
The SampleOrg SampleStore SampleUser provide a reasonable starting point. End2endIT and End2endAndBackAgainIT try to demonstrate. Embedding apps can have numerous requirements for their persistence and this allows the maximum flexibility
clempo (Thu, 04 May 2017 20:15:02 GMT):
@rickr, I followed the instructions to turn on SSL. Now I'm getting a timeout. Took minutes to timeout so it's not the timeout value.
clempo (Thu, 04 May 2017 20:15:03 GMT):
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Timeout expired while starting chaincode example_cc_go:1(networkid:dev,peerid:peer1,tx:e802e38cfb6c28496fdd06791a22a3b390dba272957b0cc37221757cf5e28b29)
at org.hyperledger.fabric.sdk.Chain.sendProposalToPeers(Chain.java:2041)
clempo (Thu, 04 May 2017 20:26:23 GMT):
Are the prebuilt ssl artifacts enough to run the testsuite or I need to regenerate them?
clempo (Thu, 04 May 2017 20:46:24 GMT):
is it possible the peers listen to different ports when SSL is turned on?
clempo (Thu, 04 May 2017 20:46:55 GMT):
I would need to tell vagrant in the Vagrantfile
rickr (Thu, 04 May 2017 21:06:10 GMT):
Should have to nothing the run the standard tests
rickr (Thu, 04 May 2017 21:06:10 GMT):
Should have to do nothing the run the standard tests
rickr (Thu, 04 May 2017 21:08:13 GMT):
There has just been code merged in about an hour ago where the certs don't match. Something I'm actively working on.
rickr (Thu, 04 May 2017 21:10:25 GMT):
You need to remove with docker all containers AND their docker images that are deployed chaincode. If you don't you'll most likely see a timeout
greg.haskins (Fri, 05 May 2017 02:28:56 GMT):
did the need to run "gulp watch" go away recently?
greg.haskins (Fri, 05 May 2017 02:29:37 GMT):
no matter what/where I try, I am seeing this all of a sudden
greg.haskins (Fri, 05 May 2017 02:29:41 GMT):
```ubuntu@hyperledger-devenv:ea91a99:/local-dev/git/fabric-sdk-node/fabric-client$ gulp watch
[02:28:32] Local gulp not found in /local-dev/git/fabric-sdk-node
[02:28:32] Try running: npm install gulp```
greg.haskins (Fri, 05 May 2017 02:30:33 GMT):
oops apologies folks...thought I clicked on the sdk-node channel
kelvinzhong (Fri, 05 May 2017 02:35:05 GMT):
lol
ayinde (Fri, 05 May 2017 02:36:14 GMT):
Has joined the channel.
PushpalathaHiremath (Fri, 05 May 2017 07:55:08 GMT):
Has joined the channel.
PushpalathaHiremath (Fri, 05 May 2017 07:58:54 GMT):
Message Attachments
PushpalathaHiremath (Fri, 05 May 2017 07:58:58 GMT):
Hi All : I'm following the https://github.com/hyperledger/fabric-sdk-java documentation to set up java sdk.
When i execute the integration tests i get :
PushpalathaHiremath (Fri, 05 May 2017 07:58:58 GMT):
Hi All : I'm following the https://github.com/hyperledger/fabric-sdk-java documentation to set up java sdk.
When i execute the integration tests i get above error. Can anyone help me get a clue.. Thank you
PushpalathaHiremath (Fri, 05 May 2017 07:58:58 GMT):
Hi All : I'm following the https://github.com/hyperledger/fabric-sdk-java documentation to set up java sdk.
When i execute the integration tests i get above error.
In the maven dependency report i see there are some " Used but undeclared dependencies" Do we need to add these jars separately?
Can anyone help me get a clue.. Thank you
tom.appleyard (Fri, 05 May 2017 09:55:21 GMT):
Has joined the channel.
rickr (Fri, 05 May 2017 11:21:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=98qrsaxSYxxXf5fME) @greg.haskins Just tell those Node guys the need to fix their pom.xml LOL :)
rickr (Fri, 05 May 2017 11:33:26 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=FjXqcPzvahBxjTne3) @PushpalathaHiremath Nothing to add or remove. If you follow the README the integration test should all pass
clempo (Fri, 05 May 2017 14:34:05 GMT):
@PushpalathaHiremath, I got the same error trying to use docker directly. It worked when I used vagrant.
pschnap (Fri, 05 May 2017 15:06:14 GMT):
Did the CA interface change recently in the SDK? I'm trying the latest master against an earlier 1.0 alpha on Bluemix and it's erroring with a 404
szoghybe (Fri, 05 May 2017 15:42:29 GMT):
Has joined the channel.
clempo (Fri, 05 May 2017 15:54:55 GMT):
>>>You need to remove with docker all containers AND their docker images that are deployed chaincode. If you don't you'll most likely see a timeout
clempo (Fri, 05 May 2017 15:54:57 GMT):
I stopped docker, removed the containers, make clean, make docker, and I still get a timeout.
clempo (Fri, 05 May 2017 15:55:23 GMT):
also did rm -rf /var/hyperledger/*
clempo (Fri, 05 May 2017 15:55:39 GMT):
what's the trick to make it work with ssl?
clempo (Fri, 05 May 2017 15:56:15 GMT):
To remove the containers, I did docker rm $(docker ps -aq)
clempo (Fri, 05 May 2017 18:47:44 GMT):
Most likely my problem is due to this warning
clempo (Fri, 05 May 2017 18:47:45 GMT):
2017-05-05 18:47:08 WARN MacAddressUtil:139 - Failed to find a usable hardware address from the network interfaces; using random bytes: ff:94:f2:3b:04:b9:36:b7
clempo (Fri, 05 May 2017 18:48:04 GMT):
This was fixed in netty 4.1.9.Final
clempo (Fri, 05 May 2017 18:48:19 GMT):
but when I upgrade netty the integration test fails even more
clempo (Fri, 05 May 2017 18:48:48 GMT):
See https://github.com/ballerinalang/ballerina/issues/1981
kpkulkarni (Fri, 05 May 2017 18:55:27 GMT):
Has joined the channel.
rickr (Fri, 05 May 2017 19:45:09 GMT):
I see that all the time I think you're going down the wrong path pursuing that
kpkulkarni (Fri, 05 May 2017 19:51:12 GMT):
Hi,
I am trying to build the java example..
I am getting build failure as gradle is not able to download shim-client jar..
Any idea?>>
Here is the stacktrace:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':examples:chaincode:java:SimpleSample:compileClasspath'.
> Could not find org.hyperledger:shim-client:1.0.
Searched in the following locations:
file:/root/.m2/repository/org/hyperledger/shim-client/1.0/shim-client-1.0.pom
file:/root/.m2/repository/org/hyperledger/shim-client/1.0/shim-client-1.0.jar
https://repo1.maven.org/maven2/org/hyperledger/shim-client/1.0/shim-client-1.0.pom
https://repo1.maven.org/maven2/org/hyperledger/shim-client/1.0/shim-client-1.0.jar
Required by:
project :examples:chaincode:java:SimpleSample
rickr (Fri, 05 May 2017 19:52:28 GMT):
Best asked in #fabric-java-chaincode
kpkulkarni (Fri, 05 May 2017 19:53:07 GMT):
@rickr Thanks
anarancio (Fri, 05 May 2017 20:03:48 GMT):
Has joined the channel.
anarancio (Fri, 05 May 2017 20:08:04 GMT):
hi guys, anyone has succeed to connect the sdk with a fabric 1.0 running on bluemix?
pschnap (Fri, 05 May 2017 20:22:13 GMT):
@anarancio which language's SDK?
pschnap (Fri, 05 May 2017 20:22:33 GMT):
nevermind, just looked at what channel I was in :-D
anarancio (Fri, 05 May 2017 20:22:37 GMT):
@pschnap java :)
anarancio (Fri, 05 May 2017 20:22:50 GMT):
we are having some issue related to TLS
pschnap (Fri, 05 May 2017 20:22:54 GMT):
& yes; the latest version in the repo won't connect, you have to go back a few revisions
anarancio (Fri, 05 May 2017 20:23:08 GMT):
oh
anarancio (Fri, 05 May 2017 20:23:16 GMT):
do you know which version?
pschnap (Fri, 05 May 2017 20:23:57 GMT):
The most recent version i've been able to connect with was 590f07467f89f71213788c8f511b0b3ee72f0b35
anarancio (Fri, 05 May 2017 20:24:10 GMT):
great! I will try, thanks!
akapustin (Sat, 06 May 2017 12:55:15 GMT):
Has joined the channel.
stu2 (Sun, 07 May 2017 21:05:52 GMT):
Has joined the channel.
wouterraateland (Mon, 08 May 2017 08:30:01 GMT):
Has joined the channel.
yecineoueslati (Mon, 08 May 2017 10:07:47 GMT):
hello
i sucessfully run the End to end test
After that want to use the java chaincode instead of the go one
i tried to modify the path of chaincode to piont to pom.xml of the java chaincode but this dont work i get an error on invocation
if anyone knows the steps to run the java chancode
thx
yecineoueslati (Mon, 08 May 2017 10:09:15 GMT):
Message Attachments
CarlXK (Mon, 08 May 2017 11:28:43 GMT):
@here i got the error below(1.0alpha), can any one help please?
Bad newest block expected status 200 got 403, Chain xnChannel
org.hyperledger.fabric.sdk.exception.TransactionException: Bad newest block expected status 200 got 403, Chain xnChannel
at org.hyperledger.fabric.sdk.Chain.getLatestBlock(Chain.java:1029)
at org.hyperledger.fabric.sdk.Chain.getConfigurationBlock(Chain.java:866)
at org.hyperledger.fabric.sdk.Chain.parseConfigBlock(Chain.java:789)
at org.hyperledger.fabric.sdk.Chain.initialize(Chain.java:500)
chaitanya (Mon, 08 May 2017 12:14:59 GMT):
@ I am getting the following error:
```
2017-05-08 15:50:07.056 ERROR --- [ main] org.hyperledger.fabric.sdk.Chain : Sending proposal to peer1 failed because of gRPC failure=Status{code=INTERNAL, description=io.grpc.netty.NettyClientTransport$2: Frame size 88617868 exceeds maximum: 4194304. , cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: INTERNAL: io.grpc.netty.NettyClientTransport$2: Frame size 88617868 exceeds maximum: 4194304.
```
when I try to use the fabric-sdk-java against my set of chaincodes. How to get past this `frame size` error/limit?
chaitanya (Mon, 08 May 2017 12:14:59 GMT):
@here
I am getting the following error:
```
2017-05-08 15:50:07.056 ERROR --- [ main] org.hyperledger.fabric.sdk.Chain : Sending proposal to peer1 failed because of gRPC failure=Status{code=INTERNAL, description=io.grpc.netty.NettyClientTransport$2: Frame size 88617868 exceeds maximum: 4194304. , cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: INTERNAL: io.grpc.netty.NettyClientTransport$2: Frame size 88617868 exceeds maximum: 4194304.
```
when I try to use the fabric-sdk-java against my set of chaincodes. How to get past this `frame size` error/limit?
rickr (Mon, 08 May 2017 12:36:10 GMT):
That requires setting properties on the Nettty channel builder. At the moment the only way to do that is changing the code in EndorserClient.java.
There is in the pipeline a change so it can be changed at the SDK level
rickr (Mon, 08 May 2017 12:37:21 GMT):
AND please do not use ```@ here ```
zupan (Mon, 08 May 2017 12:50:38 GMT):
Has joined the channel.
sativ (Mon, 08 May 2017 13:02:19 GMT):
Has joined the channel.
zupan (Mon, 08 May 2017 13:14:46 GMT):
Hi, I am successfully running e2e example from `fabric-simple` and from self-generated docker images. I am trying to deploy custom chaincode similar to `java/chaincode_example02'. My problem is that after chaincode is successfully installed it fails when instantiating. In both examples I'm getting the same error...
From CLI:
```
Error: Error endorsing chaincode: rpc error: code = 2 desc = Error starting container: The command '/bin/sh -c cd /root/chaincode/src && gradle -b build.gradle clean && gradle -b build.gradle build' returned a non-zero code: 1
```
And logs from the failed image...
```
:compileJava
Download https://repo1.maven.org/maven2/org/glassfish/javax.json/1.1.0-M1/javax.json-1.1.0-M1.pom
Download https://repo1.maven.org/maven2/org/glassfish/json/1.1.0-M1/json-1.1.0-M1.pom
Download https://repo1.maven.org/maven2/net/java/jvnet-parent/5/jvnet-parent-5.pom
Download https://repo1.maven.org/maven2/org/glassfish/javax.json/1.1.0-M1/javax.json-1.1.0-M1.jar
/root/chaincode/src/src/main/java/example/Example01.java:46: error: cannot find symbol
final List
zupan (Mon, 08 May 2017 13:17:01 GMT):
And I'm not using any other dependency aside from what provided examples E.g.:`chaincode_example02`uses. Does anybody know of a resource that would show how to run simple java chaincode?
yecineoueslati (Mon, 08 May 2017 13:21:21 GMT):
i have got the same error
yecineoueslati (Mon, 08 May 2017 13:21:30 GMT):
Message Attachments
zupan (Mon, 08 May 2017 13:37:08 GMT):
@yecineoueslati I found out that my example was written before they changed interface.
zupan (Mon, 08 May 2017 13:38:06 GMT):
Try fist compiling code locally and make sure that you are deploying code following the interfaces that are used in your fabric deployment
yecineoueslati (Mon, 08 May 2017 13:39:28 GMT):
ok thx :slight_smile:
karumbas (Mon, 08 May 2017 16:28:46 GMT):
Message Attachments
karumbas (Mon, 08 May 2017 16:28:46 GMT):
@rickr
Message Attachments
karumbas (Mon, 08 May 2017 16:28:46 GMT):
@rickr
Message Attachments
zupan (Mon, 08 May 2017 17:24:10 GMT):
what are the resources needed to run test fabric with java blockchain
zupan (Mon, 08 May 2017 17:25:13 GMT):
Funny is that I can run base example (go) on vm with 2GB of RAM, but if I try java blockchain 4gb is not enough
zupan (Mon, 08 May 2017 17:25:49 GMT):
Has someone else this problem?
chaitanya (Mon, 08 May 2017 17:43:07 GMT):
We have a chaincode that deploys perfectly alright using the CLI, but is having issues when using SDK. The chaincode calls three other chaincodes during deploy. Is anyone else facing the same problem, or has any thoughts on what I could be missing here?
chaitanya (Mon, 08 May 2017 19:28:24 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=9CxJEeZgYwiiRt4LH) @rickr Could you tell me what is causing this issue, since I've only recently started seeing this; Also not everyone around me is getting it?
rickr (Mon, 08 May 2017 22:01:01 GMT):
Your chaincode has become too large for the defaults set by grpc `NettyClientTransport$2: Frame size 88617868 exceeds maximum: 4194304`
rickr (Mon, 08 May 2017 22:02:46 GMT):
@karumbas look at End2endAndBackAgainIT.java
rohitbordia (Mon, 08 May 2017 22:42:33 GMT):
Message Attachments
hdeakin (Tue, 09 May 2017 10:42:41 GMT):
Has joined the channel.
abaumhof (Tue, 09 May 2017 11:20:34 GMT):
Has joined the channel.
rickr (Tue, 09 May 2017 12:35:30 GMT):
Don't really ever see that. This I think should have been there when building the fabric best to ask on the #fabric-dev-env channel
rickr (Tue, 09 May 2017 12:37:47 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=N5rL4ZeAM9mqYnoew) @zupan java chaincode question are probably best asked in #fabric-java-chaincode
nickmelis (Tue, 09 May 2017 13:21:22 GMT):
is there any Maven repo for the Java SDK?
rickr (Tue, 09 May 2017 13:28:12 GMT):
Being worked on.
rickr (Tue, 09 May 2017 13:28:12 GMT):
Being worked on. for v 1.0.0
nickmelis (Tue, 09 May 2017 13:33:41 GMT):
is there an easy way I can import Java SDK with Gradle without having to build it myself?
nickmelis (Tue, 09 May 2017 13:42:51 GMT):
I'm trying jitpack, that will probably do the trick
nickmelis (Tue, 09 May 2017 13:47:54 GMT):
other question: in v0.6 Java chaincode shim was in the same SDK project. Is it still the case?
nickmelis (Tue, 09 May 2017 13:55:05 GMT):
looking at https://github.com/hyperledger/fabric-sdk-java/blob/4d7a4d1459713f87f95bb4cc1ee0707d964165c7/src/test/fixture/sdkintegration/javacc/example_cc/build.gradle
nickmelis (Tue, 09 May 2017 13:55:25 GMT):
where does `compile 'org.hyperledger:shim-client:1.0'` come from?
rickr (Tue, 09 May 2017 13:57:24 GMT):
Java chaincode example has not been addressed in the Java SDK .. WIP
abaumhof (Tue, 09 May 2017 14:03:05 GMT):
@nickmelis I think you simply do a gradle build in core/chaincode/shim/java, which gives you shim-client
nickmelis (Tue, 09 May 2017 14:05:10 GMT):
yes but I don't want to have to do it manually
nickmelis (Tue, 09 May 2017 14:21:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=87e7p9pa3nK2ppueu) @rickr does it mean shim client will be part of the Java SDK at some point? Or will it be a totally separate project/repo?
jojialex2 (Wed, 10 May 2017 03:57:57 GMT):
Has joined the channel.
jordipainan (Wed, 10 May 2017 08:13:15 GMT):
Has joined the channel.
phil.gower (Wed, 10 May 2017 10:35:06 GMT):
Has joined the channel.
gauravgiri (Wed, 10 May 2017 15:13:16 GMT):
Has joined the channel.
clempo (Wed, 10 May 2017 16:31:47 GMT):
I am getting this error when running the integration test.
clempo (Wed, 10 May 2017 16:31:48 GMT):
2017-05-10 16:23:24,152 ERROR HFCAClient:580 - POST request to http://localhost:7054/api/v1/enroll with request body: {"certificate_request":"-----BEGIN CERTIFICATE REQUEST-----\nMIHKMHICAQAwEDEOMAwGA1UEAxMFYWRtaW4wWTATBgcqhkjOPQIBBggqhkjOPQMB\nBwNCAATvjf5pr2DnT2iY9gIXsKrqP0vmM3pzplGk1+KFykOS+HiumTKFj28Q6JEH\nK390CRsGLi+VUBH13QRuPJLhZoiBoAAwCgYIKoZIzj0EAwIDSAAwRQIgGYwm+aFj\nKVLpRuHnWoNMT7wWnwttwJB61uKmJ1O2eUYCIQDzST31w+XdIoaY6TPxKRz85mBI\nTYdWoCjbDJtuqoDj/A==\n-----END CERTIFICATE REQUEST-----\n"}, failed with status code: 500. Response: {"success":false,"result":null,"errors":[{"code":0,"message":"open /etc/hyperledger/fabric-ca-server-config/peerOrg1-cert.pem: no such file or directory"}],"messages":[]}
clempo (Wed, 10 May 2017 16:31:58 GMT):
I updated to the recommended commit levels of May8/May7, rebuilt all of vagrant, rebuilt all of docker, rebuilt the sdk.
clempo (Wed, 10 May 2017 16:32:43 GMT):
Are you missing instructions to add a line in Vagrantfile or docker-compose.yml?
rickr (Wed, 10 May 2017 17:45:12 GMT):
https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/fixture/sdkintegration/docker-compose.yaml#l10
has /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
not /etc/hyperledger/fabric-ca-server-config/peerOrg1-cert.pem:
clempo (Wed, 10 May 2017 18:00:55 GMT):
I'm not sure what I'm supposed to conclude from that
clempo (Wed, 10 May 2017 18:05:41 GMT):
git reports my sdkintegration/docker-compose.yaml has no diff
rickr (Wed, 10 May 2017 18:09:45 GMT):
what happen if you do a git fetch
clempo (Wed, 10 May 2017 19:04:43 GMT):
git pull said I am up to date already
rickr (Wed, 10 May 2017 19:11:00 GMT):
did you do a git fetch ?
clempo (Wed, 10 May 2017 19:11:30 GMT):
I did a git pull before I compiled the sdk
clempo (Wed, 10 May 2017 19:11:37 GMT):
I thought git pull did a fetch
clempo (Wed, 10 May 2017 19:12:32 GMT):
I searched for peerOr1-cert in the sdk and did not find anything relevant
clempo (Wed, 10 May 2017 19:12:43 GMT):
I'm confused where it comes from
rickr (Wed, 10 May 2017 19:13:11 GMT):
have you done a git fetch ?
clempo (Wed, 10 May 2017 19:14:00 GMT):
no, I did git pull
clempo (Wed, 10 May 2017 19:16:07 GMT):
I typed git fetch and got no output
rickr (Wed, 10 May 2017 19:16:22 GMT):
now show me what git status says
clempo (Wed, 10 May 2017 19:20:08 GMT):
sdk-java$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add
clempo (Wed, 10 May 2017 19:20:43 GMT):
sdk-java$ git diff src/test/java/org/hyperledger/fabric/sdkintegration/IntegrationSuite.java
diff --git a/src/test/java/org/hyperledger/fabric/sdkintegration/IntegrationSuite.java b/src/test/java/org/hyperledger/fabric/sdkintegration/IntegrationSuite.java
index b00f795..c7fc706 100644
--- a/src/test/java/org/hyperledger/fabric/sdkintegration/IntegrationSuite.java
+++ b/src/test/java/org/hyperledger/fabric/sdkintegration/IntegrationSuite.java
@@ -8,8 +8,9 @@ import org.junit.runners.Suite;
@Suite.SuiteClasses({
End2endIT.class,
- End2endAndBackAgainIT.class,
- HFCAClientEnrollIT.class
+ DumpUser1.class,
+ //End2endAndBackAgainIT.class,
+ //HFCAClientEnrollIT.class
})
public class IntegrationSuite {
clempo (Wed, 10 May 2017 19:21:05 GMT):
I don't reach DumpUser1
rickr (Wed, 10 May 2017 19:29:01 GMT):
Does your docker-compose match this https://ctrlv.it/id/27677/287263883
rickr (Wed, 10 May 2017 19:30:19 GMT):
Make sure you're comparing that where you're actually staring the fabric / fabric ca
clempo (Wed, 10 May 2017 19:30:43 GMT):
checking
clempo (Wed, 10 May 2017 19:32:32 GMT):
sdk-java/src/test/fixture/sdkintegration$ diff docker-compose.yaml docker-compose.yaml.rickr
1,2d0
< version: '2'
<
132c130,131
< - peer0.org2.example.com
\ No newline at end of file
---
> - peer0.org2.example.com
>
rickr (Wed, 10 May 2017 19:37:44 GMT):
I'm at a loss at the moment as that error you show seems to I think reference something old
rickr (Wed, 10 May 2017 19:38:20 GMT):
dump your ca0 logs
clempo (Wed, 10 May 2017 19:41:49 GMT):
can you tell me how to do that
clempo (Wed, 10 May 2017 19:44:38 GMT):
docker exec -it ca_peerOrg1 bash
clempo (Wed, 10 May 2017 19:44:40 GMT):
then?
clempo (Wed, 10 May 2017 19:45:52 GMT):
root@802ba52acb14:/# cd /etc/hyperledger/
root@802ba52acb14:/etc/hyperledger# ls
ls: cannot access 'fabric-ca-server-config': No such file or directory
fabric-ca-server fabric-ca-server-config tls
clempo (Wed, 10 May 2017 19:46:11 GMT):
that's bizarre
rickr (Wed, 10 May 2017 20:05:22 GMT):
docker logs ca0 ?
clempo (Wed, 10 May 2017 20:06:44 GMT):
I guess you mean docker logs ca_peerOrg1
clempo (Wed, 10 May 2017 20:08:40 GMT):
ubuntu@hyperledger-devenv:e182390:/opt/gopath/src/github.com/hyperledger/fabric-sdk-java/src/test/fixture/sdkintegration$ docker logs ca_peerOrg1
2017/05/10 15:42:16 [INFO] Created default configuration file at /etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
2017/05/10 15:42:16 [INFO] Starting server in home directory: /etc/hyperledger/fabric-ca-server
2017/05/10 15:42:16 [DEBUG] Initializing default ca
2017/05/10 15:42:16 [DEBUG] CA initialization started
2017/05/10 15:42:16 [INFO] CA Home Directory: /etc/hyperledger/fabric-ca-server
2017/05/10 15:42:16 [DEBUG] Software key file store directory: /etc/hyperledger/fabric-ca-server/keystore
2017/05/10 15:42:16 [DEBUG] Init CA with home /etc/hyperledger/fabric-ca-server and config {CA:{Name: Keyfile:/etc/hyperledger/fabric-ca-server-config/d8a5b3cac1b821f6e4b487ceaf1fd239cdcfc310894150908b90f05e9179556a_sk Certfile:/etc/hyperledger/fabric-ca-server-config/peerOrg1-cert.pem Chainfile:ca-chain.pem} ParentServer:{URL: CAName:} Signing:0xc42024d950 CSR:{CN:fabric-ca-server Names:[{C:US ST:North Carolina L: O:Hyperledger OU:Fabric SerialNumber:}] Hosts:[802ba52acb14] KeyRequest:
clempo (Wed, 10 May 2017 20:08:58 GMT):
2017/05/10 15:42:16 [DEBUG] Created users table
2017/05/10 15:42:16 [DEBUG] Created affiliation table
2017/05/10 15:42:16 [DEBUG] Created certificates table
2017/05/10 15:42:16 [DEBUG] Successfully opened sqlite3 DB
2017/05/10 15:42:16 [DEBUG] Initializing identity registry
2017/05/10 15:42:16 [DEBUG] Initialized DB identity registry
2017/05/10 15:42:16 [DEBUG] Loading identity table
2017/05/10 15:42:16 [DEBUG] Loading identity 'admin'
2017/05/10 15:42:16 [DEBUG] DB: Getting identity admin
2017/05/10 15:42:16 [DEBUG] DB: Add identity admin
2017/05/10 15:42:16 [DEBUG] Successfully added Identity admin to the database
2017/05/10 15:42:16 [DEBUG] Registered identity: { Name:admin Pass:**** Type:client Affiliation: MaxEnrollments:0 Attrs:map[hf.Registrar.Roles:client,user,peer,validator,auditor,ca hf.Registrar.DelegateRoles:client,user,validator,auditor hf.Revoker:1 hf.IntermediateCA:1] }
2017/05/10 15:42:16 [DEBUG] Successfully loaded identity table
2017/05/10 15:42:16 [DEBUG] Loading affiliations table
2017/05/10 15:42:16 [DEBUG] Adding affiliation org1
2017/05/10 15:42:16 [DEBUG] DB: Add affiliation org1
2017/05/10 15:42:16 [DEBUG] Adding affiliation org1.department1
2017/05/10 15:42:16 [DEBUG] DB: Add affiliation org1.department1
2017/05/10 15:42:16 [DEBUG] Adding affiliation org1.department2
2017/05/10 15:42:16 [DEBUG] DB: Add affiliation org1.department2
2017/05/10 15:42:16 [DEBUG] Adding affiliation org2
2017/05/10 15:42:16 [DEBUG] DB: Add affiliation org2
2017/05/10 15:42:16 [DEBUG] Adding affiliation org2.department1
2017/05/10 15:42:16 [DEBUG] DB: Add affiliation org2.department1
2017/05/10 15:42:16 [DEBUG] Successfully loaded affiliations table
2017/05/10 15:42:16 [DEBUG] Successfully loaded groups table
2017/05/10 15:42:16 [INFO] Initialized sqlite3 database at /etc/hyperledger/fabric-ca-server/fabric-ca-server.db
2017/05/10 15:42:16 [DEBUG] Initializing enrollment signer
2017/05/10 15:42:16 [DEBUG] No key found in BCCSP keystore, attempting fallback
2017/05/10 15:42:16 [DEBUG] validating configuration
2017/05/10 15:42:16 [DEBUG] validate local profile
2017/05/10 15:42:16 [DEBUG] profile is valid
2017/05/10 15:42:16 [DEBUG] validate local profile
2017/05/10 15:42:16 [DEBUG] profile is valid
2017/05/10 15:42:16 [DEBUG] CA initialization successful
2017/05/10 15:42:16 [DEBUG] Adding CA to server
2017/05/10 15:42:16 [INFO] Home directory for CA '': /etc/hyperledger/fabric-ca-server
2017/05/10 15:42:16 [DEBUG] 1 CA instance(s) running on server
2017/05/10 15:42:16 [INFO] Listening at http://0.0.0.0:7054
2017/05/10 16:23:24 [DEBUG] Received request
POST /api/v1/enroll
Authorization: Basic YWRtaW46YWRtaW5wdw==
clempo (Wed, 10 May 2017 20:09:20 GMT):
{"certificate_request":"-----BEGIN CERTIFICATE REQUEST-----\nMIHKMHICAQAwEDEOMAwGA1UEAxMFYWRtaW4wWTATBgcqhkjOPQIBBggqhkjOPQMB\nBwNCAATvjf5pr2DnT2iY9gIXsKrqP0vmM3pzplGk1+KFykOS+HiumTKFj28Q6JEH\nK390CRsGLi+VUBH13QRuPJLhZoiBoAAwCgYIKoZIzj0EAwIDSAAwRQIgGYwm+aFj\nKVLpRuHnWoNMT7wWnwttwJB61uKmJ1O2eUYCIQDzST31w+XdIoaY6TPxKRz85mBI\nTYdWoCjbDJtuqoDj/A==\n-----END CERTIFICATE REQUEST-----\n"}
2017/05/10 16:23:24 [DEBUG] Directing traffic to default CA
2017/05/10 16:23:24 [DEBUG] DB: Getting identity admin
2017/05/10 16:23:24 [DEBUG] DB: Login identity admin with max enrollments of 0 and state of 0
2017/05/10 16:23:24 [DEBUG] DB: Successfully incremented state for identity admin to 1
2017/05/10 16:23:24 [DEBUG] DB: identity admin successfully logged in
2017/05/10 16:23:24 [DEBUG] Identity/Pass was correct
2017/05/10 16:23:24 [DEBUG] Received request for endpoint enroll
2017/05/10 16:23:24 [DEBUG] Enrollment request: {SignRequest:{Hosts:[] Request:-----BEGIN CERTIFICATE REQUEST-----
MIHKMHICAQAwEDEOMAwGA1UEAxMFYWRtaW4wWTATBgcqhkjOPQIBBggqhkjOPQMB
BwNCAATvjf5pr2DnT2iY9gIXsKrqP0vmM3pzplGk1+KFykOS+HiumTKFj28Q6JEH
K390CRsGLi+VUBH13QRuPJLhZoiBoAAwCgYIKoZIzj0EAwIDSAAwRQIgGYwm+aFj
KVLpRuHnWoNMT7wWnwttwJB61uKmJ1O2eUYCIQDzST31w+XdIoaY6TPxKRz85mBI
TYdWoCjbDJtuqoDj/A==
-----END CERTIFICATE REQUEST-----
Subject:
clempo (Wed, 10 May 2017 20:32:58 GMT):
any more suggestion how to debug this?
rickr (Wed, 10 May 2017 20:37:08 GMT):
It looks like it connects I don't see any errors .. maybe ask on the fabric-ca channel
rickr (Wed, 10 May 2017 20:38:12 GMT):
and the error on the client is still `500. Response: {"success":false,"result":null,"errors":[{"code":0,"message":"open /etc/hyperledger/fabric-ca-server-config/peerOrg1-cert.pem: no such file or directory"}],"m`
clempo (Wed, 10 May 2017 20:40:40 GMT):
we know from ls the dir itself does not exist
rickr (Wed, 10 May 2017 20:41:04 GMT):
something you can try .. but don't think it will be fruitfull is try in another directory to download a fresh copy of the java sdk .. do a directory compare make sure it's all in sync
clempo (Wed, 10 May 2017 20:41:26 GMT):
isn't it what git is supposed to solve
clempo (Wed, 10 May 2017 20:50:53 GMT):
I did docker stop ..., docker rm..., docker compose..., mvn failsafe:integration-test -DskipITs=false
clempo (Wed, 10 May 2017 20:51:04 GMT):
this time I got further but I'm back where I started
clempo (Wed, 10 May 2017 20:51:22 GMT):
2017-05-10 20:49:09,467 ERROR Chain:2146 - Sending proposal to peer0.org1.example.com failed because of timeout(60000 milliseconds) expiration
java.util.concurrent.TimeoutException
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:411)
at org.hyperledger.fabric.sdk.Chain.sendProposalToPeers(Chain.java:2133)
at org.hyperledger.fabric.sdk.Chain.sendInstantiationProposal(Chain.java:1289)
rickr (Wed, 10 May 2017 20:52:00 GMT):
so what fixed your other problem ?
clempo (Wed, 10 May 2017 20:52:21 GMT):
no idea
clempo (Wed, 10 May 2017 20:53:09 GMT):
any suggestion for the timeout?
clempo (Wed, 10 May 2017 20:53:18 GMT):
60sec is long enough
rickr (Wed, 10 May 2017 20:53:51 GMT):
look at the peer docker logs for errors
rickr (Wed, 10 May 2017 20:55:01 GMT):
When you went to a new fabric build ... did you start with a new vagrant envionrment .. or did you just do a git pull in each project and rebuilt ?
clempo (Wed, 10 May 2017 20:55:29 GMT):
git pull, make clean, make docker
clempo (Wed, 10 May 2017 20:56:42 GMT):
not quite
clempo (Wed, 10 May 2017 20:57:14 GMT):
pulled to get new Vagrantfile
clempo (Wed, 10 May 2017 20:57:22 GMT):
redid vagrant
clempo (Wed, 10 May 2017 20:57:32 GMT):
within vagrant, I did the makes
clempo (Wed, 10 May 2017 20:58:59 GMT):
what are these containers?
clempo (Wed, 10 May 2017 20:59:00 GMT):
41cba1210732 dev-peer1.org1.example.com-example_cc_go-1 "chaincode -peer.a..." 4 minutes ago Up 4 minutes dev-peer1.org1.example.com-example_cc_go-1
76230c270b49 dev-peer0.org1.example.com-example_cc_go-1 "chaincode -peer.a..." 4 minutes ago Up 4 minutes dev-peer0.org1.example.com-example_cc_go-1
rickr (Wed, 10 May 2017 20:59:54 GMT):
IMO I would start with a new vagrant to be make sure it was really all clean ..
AND if you are doing to do that .. you need to do a `make docker clean` first.
I would go to each project do that .. then do ..
a `docker images`
make sure NOTHING is there ... then do the builds
clempo (Wed, 10 May 2017 21:00:26 GMT):
that takes a whole day
clempo (Wed, 10 May 2017 21:00:49 GMT):
I thought that's what I tried to achieve
clempo (Wed, 10 May 2017 21:01:14 GMT):
I doubt you spend a whole day rebuilding vagrant every week
rickr (Wed, 10 May 2017 21:01:38 GMT):
I usually get that done in 30 min
clempo (Wed, 10 May 2017 21:02:16 GMT):
maybe my Linux box is VMed to begin with
rickr (Wed, 10 May 2017 21:02:29 GMT):
Like I said .. if you want to keep your Vagrant .. make sure there are NO docker images around
clempo (Wed, 10 May 2017 21:02:54 GMT):
I can do that
rickr (Wed, 10 May 2017 21:04:45 GMT):
Also double check when you do a clean ... that there is no `build` directory in each project .. just to make sure
rickr (Wed, 10 May 2017 21:09:21 GMT):
I should say in theory you shouldn't have to do this but I think it's best practice
rohitbordia (Wed, 10 May 2017 22:21:31 GMT):
@rickr: how does this get created : dev-peer1-example_cc_go-1
rohitbordia (Wed, 10 May 2017 22:22:44 GMT):
in my vagrant setup thats not getting created.. but standalone works
rickr (Wed, 10 May 2017 22:23:09 GMT):
when you instantiate chaincode that is
rohitbordia (Wed, 10 May 2017 22:23:32 GMT):
from my vagrant setup.. I think thats where its failing
rohitbordia (Wed, 10 May 2017 22:24:19 GMT):
im puzzled coz other setup works , I mean mac+ docker , ubuntu + docker works
rohitbordia (Wed, 10 May 2017 22:24:30 GMT):
only the moment i do vagrant im stuck
rickr (Wed, 10 May 2017 22:25:34 GMT):
does it fail when instantiating chaincode ?
rohitbordia (Wed, 10 May 2017 22:25:38 GMT):
yes
rickr (Wed, 10 May 2017 22:25:51 GMT):
you probably had a bad build
rohitbordia (Wed, 10 May 2017 22:26:13 GMT):
i tried twice .. cleaning vagrant ..cleaning docker images
rohitbordia (Wed, 10 May 2017 22:27:08 GMT):
Message Attachments
rickr (Wed, 10 May 2017 22:27:42 GMT):
in vagrant make sure nothing is running `docker ps -a`
rohitbordia (Wed, 10 May 2017 22:28:10 GMT):
yep..
rickr (Wed, 10 May 2017 22:28:19 GMT):
then do the make clean docker-clean
rickr (Wed, 10 May 2017 22:28:35 GMT):
then do docker images
rickr (Wed, 10 May 2017 22:28:53 GMT):
make sure no fabric images are there
rickr (Wed, 10 May 2017 22:29:02 GMT):
do make clean
rickr (Wed, 10 May 2017 22:29:12 GMT):
make sure no build directory is there
rickr (Wed, 10 May 2017 22:29:29 GMT):
then do make docker
rickr (Wed, 10 May 2017 22:30:13 GMT):
usually vagrant builds work where builds on native have issues . my experience
rohitbordia (Wed, 10 May 2017 22:30:45 GMT):
ok
rohitbordia (Thu, 11 May 2017 01:02:39 GMT):
didnt worked cleaned re created new vagrant
lenin.mehedy (Thu, 11 May 2017 01:29:11 GMT):
Has joined the channel.
kelvinzhong (Thu, 11 May 2017 02:40:56 GMT):
are u missing the ccenv image?
kelvinzhong (Thu, 11 May 2017 02:41:02 GMT):
@rohitbordia
rohitbordia (Thu, 11 May 2017 03:27:00 GMT):
hmm sdk example compose file .. does not have ccenv image
kelvinzhong (Thu, 11 May 2017 03:35:51 GMT):
it's not include in the compose file, it's called by the peer when u exec the instantiate, and put the chaincode into the ccenv container and make the chaincode container @rohitbordia
rohitbordia (Thu, 11 May 2017 03:36:06 GMT):
aah
rohitbordia (Thu, 11 May 2017 03:36:12 GMT):
thanks ..
kelvinzhong (Thu, 11 May 2017 03:36:31 GMT):
you could check docker images whether u have download the ccenv
rohitbordia (Thu, 11 May 2017 03:36:40 GMT):
yea i dont have it..
kelvinzhong (Thu, 11 May 2017 03:37:00 GMT):
then try it out, i think that is the problem
rohitbordia (Thu, 11 May 2017 03:37:49 GMT):
thanks.. you saved me start hating vagrant
kelvinzhong (Thu, 11 May 2017 03:38:07 GMT):
lol thats ok
kelvinzhong (Thu, 11 May 2017 06:09:06 GMT):
@rickr hi, i wonder is that possible to range query of the block, as currently we only have chain.queryBlockByNumber(), but sometimes we might need to go through all the block sequentially to check all data, and query only one block at a time is too inefficient for that
ermyas (Thu, 11 May 2017 06:50:39 GMT):
Has joined the channel.
bluefire (Thu, 11 May 2017 06:51:55 GMT):
Has joined the channel.
rickr (Thu, 11 May 2017 10:57:48 GMT):
Sound reasonable. You can open open a JIRA improvement for that..
nherbaut33 (Thu, 11 May 2017 13:27:24 GMT):
Has joined the channel.
nherbaut33 (Thu, 11 May 2017 13:32:32 GMT):
Hi I'm trying to follow the "Java SDK end to end" video. When trying to run docker compose, the fabric-ca container always fails with the following error
```
fabric-ca: not found
```
I've built the container from source:
```
~/work/src/github.com/hyperledger/fabric-ca$ git rev-parse HEAD
73a42156f637702b2ac8d4ceae0d663c4c688ed4
```
What do I got wrong?
nherbaut33 (Thu, 11 May 2017 13:32:32 GMT):
Hi I'm trying to follow the "Java SDK end to end" video. When trying to run docker compose, the fabric-ca container always fails with the following error
```
fabric-ca: not found
```
I've built the docker image from source:
```
~/work/src/github.com/hyperledger/fabric-ca$ git rev-parse HEAD
73a42156f637702b2ac8d4ceae0d663c4c688ed4
```
What do I got wrong?
webdaford (Thu, 11 May 2017 18:55:20 GMT):
Has joined the channel.
kelvinzhong (Fri, 12 May 2017 02:35:05 GMT):
okay, i have create a New Feature, hope it could be done XD
kelvinzhong (Fri, 12 May 2017 02:35:17 GMT):
https://jira.hyperledger.org/browse/FAB-3884
rmohta (Fri, 12 May 2017 05:00:00 GMT):
Has joined the channel.
rmohta (Fri, 12 May 2017 05:45:14 GMT):
@here In End2endIT.java, we are setting up admin, user1 and peerAdmin. Now this is done, by talking to fabric-ca. What if I would like to do all this *manually*?
What special goes into the cert creation and/or crypto-config.yaml and crypto-config.yaml files?
rmohta (Fri, 12 May 2017 05:45:52 GMT):
Also, what's the difference between an admin and peerAdmin, that we see in End2endIT.java?
zhangchao (Fri, 12 May 2017 09:29:19 GMT):
Has joined the channel.
zhangchao (Fri, 12 May 2017 09:32:26 GMT):
When a peer is joining the channel, will the chain check the peer's certificate to accept or reject it ? I cannot find where the peer's cert is used when joining a chain in End2EndIT.java , which codes like below:
for (String peerName : sampleOrg.getPeerNames()) {
String peerLocation = sampleOrg.getPeerLocation(peerName);
Peer peer = client.newPeer(peerName, peerLocation, testConfig.getPeerProperties(peerName));
newChain.joinPeer(peer);
out("Peer %s joined chain %s", peerName, name);
sampleOrg.addPeer(peer);
}
zhangchao (Fri, 12 May 2017 09:33:29 GMT):
can somebody give some advice?
CarlXK (Fri, 12 May 2017 09:46:20 GMT):
I got this error, anyone seen it? @here
```
Exception in thread "main" org.hyperledger.fabric.sdk.exception.TransactionException: Bad newest block expected status 200 got 403, Chain xnChannel
at org.hyperledger.fabric.sdk.Chain.getLatestBlock(Chain.java:1049)
at org.hyperledger.fabric.sdk.Chain.getConfigurationBlock(Chain.java:890)
at org.hyperledger.fabric.sdk.Chain.parseConfigBlock(Chain.java:815)
at org.hyperledger.fabric.sdk.Chain.initialize(Chain.java:531)
at com.xiangan.platform.chainserver.DeployChainCode.constructChain(DeployChainCode.java:132)
at com.xiangan.platform.chainserver.DeployChainCode.setUp(DeployChainCode.java:83)
at com.xiangan.platform.chainserver.DeployChainCode.main(DeployChainCode.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
```
szoghybe (Fri, 12 May 2017 13:43:24 GMT):
Hello, I've managed to follow the fabric-sdk-java instructions to the letter, have built my Linux Ubuntu virtual image, and successfully ran the following:
szoghybe (Fri, 12 May 2017 13:43:28 GMT):
make docker
cd ../fabric-ca
make docker
cd ../fabric/sdkintegration
docker-compose down; rm -rf /var/hyperledger/*; docker-compose up --force-recreate
Now, what quick Hyperledger Fabric Java test or demo can I run? Is there a procedure I can refer to?
szoghybe (Fri, 12 May 2017 13:43:55 GMT):
Preferably one that will impress mu manager.
szoghybe (Fri, 12 May 2017 13:43:57 GMT):
;)
szoghybe (Fri, 12 May 2017 13:52:35 GMT):
I seem to have 5 containers running, and I believe this corresponds to the 2 companies, each with two peers plus one solo container scebnario. Can anyone confirm?
2017-05-12 13:45:41.217 UTC [chaincode] launchAndWaitForRegister -> DEBU 056 start container with env:
peer1.org2.example.com | CORE_CHAINCODE_ID_NAME=cscc:1.0.0-snapshot-a39904a
peer1.org2.example.com | CORE_PEER_TLS_ENABLED=false
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_LEVEL=info
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_SHIM=warning
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_FORMAT=%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}
peer1.org2.example.com | 2017-05-12 13:45:41.220 UTC [chaincode] launchAndWaitForRegister -> DEBU 09a start container with env:
peer1.org2.example.com | CORE_CHAINCODE_ID_NAME=lscc:1.0.0-snapshot-a39904a
peer1.org2.example.com | CORE_PEER_TLS_ENABLED=false
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_LEVEL=info
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_SHIM=warning
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_FORMAT=%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}
peer1.org2.example.com | 2017-05-12 13:45:41.223 UTC [chaincode] launchAndWaitForRegister -> DEBU 0d5 start container with env:
peer1.org2.example.com | CORE_CHAINCODE_ID_NAME=escc:1.0.0-snapshot-a39904a
peer1.org2.example.com | CORE_PEER_TLS_ENABLED=false
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_LEVEL=info
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_SHIM=warning
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_FORMAT=%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}
peer1.org2.example.com | 2017-05-12 13:45:41.228 UTC [chaincode] launchAndWaitForRegister -> DEBU 110 start container with env:
peer1.org2.example.com | CORE_CHAINCODE_ID_NAME=vscc:1.0.0-snapshot-a39904a
peer1.org2.example.com | CORE_PEER_TLS_ENABLED=false
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_LEVEL=info
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_SHIM=warning
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_FORMAT=%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}
peer1.org2.example.com | 2017-05-12 13:45:41.233 UTC [chaincode] launchAndWaitForRegister -> DEBU 14a start container with env:
peer1.org2.example.com | CORE_CHAINCODE_ID_NAME=qscc:1.0.0-snapshot-a39904a
peer1.org2.example.com | CORE_PEER_TLS_ENABLED=false
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_LEVEL=info
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_SHIM=warning
peer1.org2.example.com | CORE_CHAINCODE_LOGGING_FORMAT=%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}
szoghybe (Fri, 12 May 2017 13:53:18 GMT):
What do I do next?
szoghybe (Fri, 12 May 2017 14:00:48 GMT):
Can anyone help me out? I've documented every step required to set this all up on Windows and would like to dump this to a Wordpress.com blog.
clempo (Fri, 12 May 2017 14:41:36 GMT):
@szoghybe, take a look at End2endIT and the other samples in fabric-sdk-java\src\test\java\org\hyperledger\fabric\sdkintegration
clempo (Fri, 12 May 2017 14:43:24 GMT):
@szoghybe, it's not clear if hyperledger fully supports development on Windows. It is a lot easier to work on Linux for now.
clempo (Fri, 12 May 2017 14:44:27 GMT):
They want to support Windows eventually, but my impression is you are a pioneer
szoghybe (Fri, 12 May 2017 14:45:04 GMT):
Thank you. I'm trying this out in a Linux virtual image successfully built with Vagrant and Cygwin.
szoghybe (Fri, 12 May 2017 14:45:15 GMT):
That was the easy part.
szoghybe (Fri, 12 May 2017 14:46:19 GMT):
I've done a find -name but cannot find fabric-sdk-java-1.0.0-SNAPSHOT.jar
clempo (Fri, 12 May 2017 14:46:28 GMT):
You are lucky that everything worked for you. I'm having all sorts of problems making my build work
szoghybe (Fri, 12 May 2017 14:46:32 GMT):
I guess I have to build it ?
clempo (Fri, 12 May 2017 14:47:02 GMT):
yes, vagrant sets up the test bed to run the hyperledger network you will call from Java
szoghybe (Fri, 12 May 2017 14:47:07 GMT):
I've documented all and will post to Wordpress. The Pluralsight course on Vagrant was very helpful.
clempo (Fri, 12 May 2017 14:47:21 GMT):
don't know that course
szoghybe (Fri, 12 May 2017 14:47:47 GMT):
pluralsight.com
szoghybe (Fri, 12 May 2017 14:47:49 GMT):
Pluralsight Introduction to Versioning Environments With Vagrant
clempo (Fri, 12 May 2017 14:48:03 GMT):
did you follow the fabric-sdk-java readme to edit your Vagrantfile?
szoghybe (Fri, 12 May 2017 14:48:16 GMT):
Yes. I have
szoghybe (Fri, 12 May 2017 14:48:52 GMT):
config.vm.network :forwarded_port, guest: 7056, host: 7056, id: "java7056", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 7058, host: 7058, id: "java7058", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 8051, host: 8051, id: "java8051", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 8053, host: 8053, id: "java8053", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 8054, host: 8054, id: "java8054", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 8056, host: 8056, id: "java8056", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 8058, host: 8058, id: "java8058", host_ip: "localhost", autocorrect: true
config.vm.synced_folder "..", "#{SRCMOUNT}"
config.vm.synced_folder "..", "/opt/gopath/src/github.com/hyperledger/fabric"
config.vm.synced_folder "fabric-sdk-java-master/src/test/fixture/sdkintegration", "/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration"
config.vm.synced_folder ENV.fetch('LOCALDEVDIR', ".."), "#{LOCALDEV}"
clempo (Fri, 12 May 2017 14:49:01 GMT):
I followed it too literally, it's missing an end quote
szoghybe (Fri, 12 May 2017 14:49:03 GMT):
I tested my synced folders worked
szoghybe (Fri, 12 May 2017 14:49:19 GMT):
Yes, an end quote was missing
clempo (Fri, 12 May 2017 14:49:49 GMT):
@rickr please fix the readme, it's missing an end quote here: config.vm.synced_folder "/home/<
szoghybe (Fri, 12 May 2017 14:50:16 GMT):
In Cygwin I did:
clempo (Fri, 12 May 2017 14:50:24 GMT):
please contribute your other findings
clempo (Fri, 12 May 2017 14:50:31 GMT):
rickr is pretty good at fixing things
szoghybe (Fri, 12 May 2017 14:50:32 GMT):
cd /cygdrive/c/gocode
git config --global core.autocrlf false
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric/devenv
wget https://github.com/hyperledger/fabric-sdk-java/archive/master.zip
unzip ./master.zip
vi Vagrantfile
clempo (Fri, 12 May 2017 14:50:59 GMT):
what's this master.zip thing?
clempo (Fri, 12 May 2017 14:51:31 GMT):
you are building from the master branch of fabric and fabric-ca
szoghybe (Fri, 12 May 2017 14:51:41 GMT):
The "download zip" at https://github.com/hyperledger/fabric-sdk-java
clempo (Fri, 12 May 2017 14:51:44 GMT):
you should use the recommended commit levels
szoghybe (Fri, 12 May 2017 14:52:06 GMT):
Which are (?)
clempo (Fri, 12 May 2017 14:52:20 GMT):
they change constantly, they are in the readme
clempo (Fri, 12 May 2017 14:52:50 GMT):
why not check out the source of the sdk with git?
clempo (Fri, 12 May 2017 14:53:05 GMT):
it will be easier to update the source that way
clempo (Fri, 12 May 2017 14:54:00 GMT):
@rickr, can you add the instructions to check out the sdk with git to avoid that kind of confusion
clempo (Fri, 12 May 2017 14:54:49 GMT):
the commit levels were updated recently so your master branch might work
clempo (Fri, 12 May 2017 14:54:57 GMT):
two weeks ago, that did not work
clempo (Fri, 12 May 2017 14:55:14 GMT):
when fabric makes incompatible changes, the sdk needs time to fix it
szoghybe (Fri, 12 May 2017 14:55:37 GMT):
Hmmm... I know you're talking about the commitlevel mentioned on https://github.com/hyperledger/fabric-sdk-java but I searched for it yesterday and again today. Haven't figured out where it is...
clempo (Fri, 12 May 2017 14:56:07 GMT):
search for "Valid builds of Fabric and Fabric-ca"
clempo (Fri, 12 May 2017 14:56:36 GMT):
then use the guid in the commands
szoghybe (Fri, 12 May 2017 14:56:36 GMT):
Anyhow, so far with the master I was able to make docker in fabri9c and fabric-ca
clempo (Fri, 12 May 2017 14:56:37 GMT):
git reset --hard fabric-ca_commitlevel from above
szoghybe (Fri, 12 May 2017 14:57:18 GMT):
Yes, that command. Shouldn't I replace "commitlevel" with a number?
clempo (Fri, 12 May 2017 14:57:21 GMT):
sure, that is supposed to work, but the sdk team cannot guarantee fabric did not break anything
clempo (Fri, 12 May 2017 14:57:29 GMT):
yes
clempo (Fri, 12 May 2017 14:57:43 GMT):
the one in the section I mentionned
clempo (Fri, 12 May 2017 14:58:43 GMT):
currently, that's: git reset --hard 73a42156f637702b2ac8d4ceae0d663c4c688ed4
clempo (Fri, 12 May 2017 14:59:02 GMT):
like I said, no big deal this week, but learn how to do it for later
szoghybe (Fri, 12 May 2017 14:59:54 GMT):
All right. I had no idea I was supposed to use a hash, I thought it was an integer. Suppose I now want to run End2endIT. What do I need to build first? The SDK? On the host or image?
clempo (Fri, 12 May 2017 15:00:52 GMT):
not clear in the instructions
clempo (Fri, 12 May 2017 15:01:07 GMT):
java is run anywhere, so that could be the host or within vagrant
szoghybe (Fri, 12 May 2017 15:01:31 GMT):
Tell me about it. It looks like a Penguin documented that bit. ;)
clempo (Fri, 12 May 2017 15:02:06 GMT):
I'm rebuilding my host, and when I get there I want to build the sdk directly on the host
clempo (Fri, 12 May 2017 15:02:22 GMT):
in any case, the instructions do not mount the source code within vagrant
clempo (Fri, 12 May 2017 15:03:16 GMT):
careful what you say, you might need rickr's help like we all do
clempo (Fri, 12 May 2017 15:03:33 GMT):
better to make specific suggestions
clempo (Fri, 12 May 2017 15:04:11 GMT):
I consider myself lucky the developer takes time to answer questions
clempo (Fri, 12 May 2017 15:04:29 GMT):
but at the same time, it's clear the product is not mature
szoghybe (Fri, 12 May 2017 15:05:37 GMT):
That's OK. My goal for now is to document the set up and run a Java test case. End2endIT. sounds about right.
clempo (Fri, 12 May 2017 15:06:00 GMT):
it's the first test in the integration suite, it's easier to run the full suite
clempo (Fri, 12 May 2017 15:06:28 GMT):
mvn install or mvn install -DskipTests
clempo (Fri, 12 May 2017 15:06:31 GMT):
to build
clempo (Fri, 12 May 2017 15:06:45 GMT):
mvn failsafe:integration-test -DskipITs=false
clempo (Fri, 12 May 2017 15:06:49 GMT):
to run the samples
clempo (Fri, 12 May 2017 15:07:48 GMT):
if you can make it work under windows, I might consider trying it
szoghybe (Fri, 12 May 2017 15:09:35 GMT):
Trying in parallel to built an image with the latest. Hava a syntax error with the Git command
szoghybe (Fri, 12 May 2017 15:09:37 GMT):
bszoghy@QDW-5115 /cygdrive/c/Golang/fabric_java_latest
$ cd fabric-ca
cd ../fabric
git reset --hard 73a42156f637702b2ac8d4ceae0d663c4c688ed4
bszoghy@QDW-5115 /cygdrive/c/Golang/fabric_java_latest/fabric-ca
$ git reset --hard e182390035ec207535c7ba0f5df70dc702057e18
fatal: Impossible d'analyser l'objet 'e182390035ec207535c7ba0f5df70dc702057e18'.
bszoghy@QDW-5115 /cygdrive/c/Golang/fabric_java_latest/fabric-ca
$ cd ../fabric
bszoghy@QDW-5115 /cygdrive/c/Golang/fabric_java_latest/fabric
$ git reset --hard 73a42156f637702b2ac8d4ceae0d663c4c688ed4
fatal: Impossible d'analyser l'objet '73a42156f637702b2ac8d4ceae0d663c4c688ed4'.
clempo (Fri, 12 May 2017 15:10:30 GMT):
you have to cd to the correct source dir
clempo (Fri, 12 May 2017 15:10:40 GMT):
you did both in fabric-ca
clempo (Fri, 12 May 2017 15:10:45 GMT):
follow the readme exactly
szoghybe (Fri, 12 May 2017 15:12:47 GMT):
Indeed.
szoghybe (Fri, 12 May 2017 15:12:49 GMT):
bszoghy@QDW-5115 /cygdrive/c/Golang/fabric_java_latest/fabric
$ cd ../fabric-ca
bszoghy@QDW-5115 /cygdrive/c/Golang/fabric_java_latest/fabric-ca
$ git reset --hard 73a42156f637702b2ac8d4ceae0d663c4c688ed4
HEAD est maintenant à 73a4215 Merge "[ FAB-1892 ] - Add LDAP to fvt test image"
bszoghy@QDW-5115 /cygdrive/c/Golang/fabric_java_latest/fabric-ca
$ cd ../fabric
bszoghy@QDW-5115 /cygdrive/c/Golang/fabric_java_latest/fabric
$ git reset --hard e182390035ec207535c7ba0f5df70dc702057e18
HEAD est maintenant à e1823900 Merge "[FAB-3698] def inst. policy needs to include channel"
bszoghy@QDW-5115 /cygdrive/c/Golang/fabric_java_latest/fabric
clempo (Fri, 12 May 2017 15:14:05 GMT):
This destroyed your changes to Vagrantfile, you have to reapply them
szoghybe (Fri, 12 May 2017 15:31:42 GMT):
Applied.
szoghybe (Fri, 12 May 2017 15:31:44 GMT):
cd /cygdrive/c/gocode
mkdir fabric_java_latest
cd /cygdrive/c/gocode/fabric_java_latest
git config --global core.autocrlf false
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric-ca
git reset --hard e182390035ec207535c7ba0f5df70dc702057e18
cd ../fabric
git reset --hard 73a42156f637702b2ac8d4ceae0d663c4c688ed4
cd devenv
git clone https://github.com/hyperledger/fabric-sdk-java.git
vi Vagrantfile
# Add:
config.vm.network :forwarded_port, guest: 7056, host: 7056, id: "java7056", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 7058, host: 7058, id: "java7058", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 8051, host: 8051, id: "java8051", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 8053, host: 8053, id: "java8053", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 8054, host: 8054, id: "java8054", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 8056, host: 8056, id: "java8056", host_ip: "localhost", autocorrect: true
config.vm.network :forwarded_port, guest: 8058, host: 8058, id: "java8058", host_ip: "localhost", autocorrect: true
# replace config.vm.synced block with:
config.vm.synced_folder "..", "#{SRCMOUNT}"
config.vm.synced_folder "..", "/opt/gopath/src/github.com/hyperledger/fabric"
config.vm.synced_folder "fabric-sdk-java-master/src/test/fixture/sdkintegration", "/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration"
config.vm.synced_folder ENV.fetch('LOCALDEVDIR', ".."), "#{LOCALDEV}"
# avoid duplicate virtual machine name by editing line:
vb.name = "hyperledger-java-latest"
# save in vi and exit:
:wq
szoghybe (Fri, 12 May 2017 15:32:06 GMT):
vagrant up
karumbas (Fri, 12 May 2017 15:42:36 GMT):
@here anyone who can help me with this. Only occurs when tls is enabled.
```
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.hyperledger.fabric.sdk.Chain]: Factory method 'reconstructChain' threw exception; nested exception is java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.
``
karumbas (Fri, 12 May 2017 15:42:36 GMT):
@here anyone who can help me with this. Only occurs when tls is enabled.
```
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.hyperledger.fabric.sdk.Chain]: Factory method 'reconstructChain' threw exception; nested exception is java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.
```
Willson (Fri, 12 May 2017 15:49:13 GMT):
@karumbas ```Currently, the pom.xml is set to use netty-tcnative-boringssl for TLS connection to Orderer and Peers, however you can change the pom.xml (uncomment a few lines) to use an alternative TLS connection via ALPN.```
Willson (Fri, 12 May 2017 15:49:13 GMT):
@karumbas `Currently, the pom.xml is set to use netty-tcnative-boringssl for TLS connection to Orderer and Peers, however you can change the pom.xml (uncomment a few lines) to use an alternative TLS connection via ALPN.`
karumbas (Fri, 12 May 2017 15:51:15 GMT):
@Willson ok thanks, let me try that.
clempo (Fri, 12 May 2017 16:05:11 GMT):
@szoghybe, here is how to check out the sdk using git: git clone ssh://clempo@gerrit.hyperledger.org:29418/fabric-sdk-java
szoghybe (Fri, 12 May 2017 16:07:10 GMT):
My understanding is that the difference between git clone https://github.com/hyperledger/fabric-sdk-java.git and git clone ssh://clempo@gerrit.hyperledger.org:29418/fabric-sdk-java is if you want to contribute to the SDK or not. The first is a read-only copy. Am I right?
szoghybe (Fri, 12 May 2017 16:08:49 GMT):
You must be right, tho, vagrant up failed with an auth error.> default: gpg: requesting key 2C52609D from hkp server p80.pool.sks-keyservers.net
==> default: gpgkeys: key 58118E89F3A912897C070ADBF76221572C52609D can't be retrieved
clempo (Fri, 12 May 2017 16:10:06 GMT):
you need to replace clempo with your LFID
clempo (Fri, 12 May 2017 16:10:26 GMT):
I followed the instructions to setup the devenv for fabric itself
clempo (Fri, 12 May 2017 16:10:52 GMT):
rickr added the calls to GitHub later in the readme
clempo (Fri, 12 May 2017 16:11:46 GMT):
yes, GitHub is read only
clempo (Fri, 12 May 2017 16:12:28 GMT):
though contributing would require a pull request anyway
clempo (Fri, 12 May 2017 16:12:36 GMT):
not sure there is a big diff
clempo (Fri, 12 May 2017 16:13:44 GMT):
@rickr, is this still exact in the readme: Read-only mirror of https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-java https://hyperledger.org
clempo (Fri, 12 May 2017 16:15:15 GMT):
what's the relation between gerrit.hyperledger.org:29418 and gerrit.hyperledger.org/r/#/admin/projects
szoghybe (Fri, 12 May 2017 16:16:02 GMT):
Looks like I needed to add GnuPG to my Cygwin. Retrying vagrant up...
rickr (Fri, 12 May 2017 16:43:34 GMT):
github is readonly copy but sometimes lags gerrit so you could but a commit level that my not be immediately in github.
rickr (Fri, 12 May 2017 16:43:34 GMT):
github is readonly copy but sometimes lags gerrit so you could put a commit level that my not be immediately in github.
rickr (Fri, 12 May 2017 16:46:46 GMT):
If there are small changes to the READM.md I'll gladly do minor changes.
Remember this is open source and if you're benefiting from this and feel you can improve on the READM.md that too is fair game to supply a patch to be merged and contribute something back.
rickr (Fri, 12 May 2017 16:55:46 GMT):
My thanks to @Willson and @clempo for trying to help others out
szoghybe (Fri, 12 May 2017 17:03:05 GMT):
vagrant up
szoghybe (Fri, 12 May 2017 17:05:06 GMT):
wrong window. ;)
clempo (Fri, 12 May 2017 18:27:38 GMT):
@rmohta, I have the same pet peeve with the integration test suite. Obviously, you can create your users ahead of time. That would be the normal use case. Unfortunately, the sdk as it stands delegates this problem to the app since it has no persistence. In practice, what this means is you have to implement your own User and your own Enrollment. I hope we can convince the sdk maintainers to make this simpler in the future because absolutely everyone is affected.
rmohta (Fri, 12 May 2017 18:31:28 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ffByDJQrAofBmuz93) @clempo Agreed. As we try to implement our first real-work use case out, we're searching for these answers.
clempo (Fri, 12 May 2017 18:33:26 GMT):
I was able to do this by reading the pem files created by the command line utility that creates users
rmohta (Fri, 12 May 2017 18:34:17 GMT):
Yep. We're doing the same :-) @clempo
clempo (Fri, 12 May 2017 18:34:50 GMT):
took me a while to figure out the format expected by the sdk
clempo (Fri, 12 May 2017 18:39:28 GMT):
it's simpler now that there is no public key in Enrollment
rmohta (Fri, 12 May 2017 18:40:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=DmjGC5wZeZG7HnEfs) @clempo What do you mean by that?
clempo (Fri, 12 May 2017 18:40:56 GMT):
PEMParser ecertParser = new PEMParser(new StringReader(pemECert));
X509Certificate ecert = null;
try
{
X509CertificateHolder certHolder = (X509CertificateHolder)ecertParser.readObject();
ecert = new JcaX509CertificateConverter().setProvider( "BC" )
.getCertificate(certHolder);
}
finally
{
ecertParser.close();
}
clempo (Fri, 12 May 2017 18:41:51 GMT):
FileInputStream privKeyStream = new FileInputStream(privKeyPath);
PEMParser keyParser = new PEMParser(new InputStreamReader(privKeyStream));
PrivateKey privKey = null;
try
{
Object object = keyParser.readObject();
if (object instanceof PEMKeyPair)
{
JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider("BC");
KeyPair kp = converter.getKeyPair((PEMKeyPair) object);
privKey = kp.getPrivate();
}
else
{
throw new XDException("Expecting a PEMKeyPair, got " + object.getClass().getName());
}
}
finally
{
keyParser.close();
}
clempo (Fri, 12 May 2017 18:42:19 GMT):
Enrollment has two methods, it used to have 3
rmohta (Fri, 12 May 2017 18:42:59 GMT):
ah.. okay. Haven't looked into that for long. Thank You for this @clempo
clempo (Fri, 12 May 2017 18:43:37 GMT):
you will need to change XDException to another Exception you have
rmohta (Fri, 12 May 2017 18:45:42 GMT):
Btw, what the minimum size requirement for the keys? Is it 256 or more? I remember reading somewhere - the golang pakcage supports 2 or 3 types of key size
clempo (Fri, 12 May 2017 18:46:46 GMT):
don't know, I would use the same as the sample. With this code, you can read the pem and find out
clempo (Fri, 12 May 2017 18:47:00 GMT):
it's an EC key
clempo (Fri, 12 May 2017 18:47:32 GMT):
I don't know the common sizes for EC keys
rmohta (Fri, 12 May 2017 18:47:42 GMT):
@clempo okies. Will do that. Using openssl, we could see all the test keys were ecdsa-with-SHA256
clempo (Fri, 12 May 2017 18:48:24 GMT):
openssl should be able to tell you too, is there a verbose mode
rmohta (Fri, 12 May 2017 18:49:18 GMT):
`openssl x509 -text -in
clempo (Fri, 12 May 2017 18:50:10 GMT):
that can give you the info on the public key
rmohta (Fri, 12 May 2017 18:50:32 GMT):
oh you're asking about private key?
clempo (Fri, 12 May 2017 18:51:03 GMT):
I guess the sizes of both keys are related
clempo (Fri, 12 May 2017 18:53:18 GMT):
I think you got confused by the output of openssl
clempo (Fri, 12 May 2017 18:53:30 GMT):
the algorithm you mention is for signatures
clempo (Fri, 12 May 2017 18:53:57 GMT):
the key algorithm is just ecdsa
clempo (Fri, 12 May 2017 18:54:29 GMT):
though openssl calls it id-ecPublicKey
clempo (Fri, 12 May 2017 18:55:23 GMT):
the size of the public key of the users created by the integration suite is 256
clempo (Fri, 12 May 2017 18:55:35 GMT):
just proved it
clempo (Fri, 12 May 2017 18:56:08 GMT):
using the command you gave
clempo (Fri, 12 May 2017 18:57:13 GMT):
@rickr, I rebuilt all my environment on a bigger box (now running Centos) and it worked.
clempo (Fri, 12 May 2017 19:04:26 GMT):
@rmohta notice you don't need to parse the cert to implement Enrollment, so the first piece of code is for debugging
clempo (Fri, 12 May 2017 19:07:08 GMT):
@rmohta, don't forget to return the right value for getMSPID() in your implementation of User
szoghybe (Fri, 12 May 2017 19:41:16 GMT):
@clempo Here are my complete setup notes on Windows, as discussed. I put them on a Wordpress blog: https://wordpress.com/post/bertrandszoghy.wordpress.com
szoghybe (Fri, 12 May 2017 19:41:31 GMT):
That's where I am at.
clempo (Fri, 12 May 2017 19:42:13 GMT):
thanks, I will save the link for later
szoghybe (Fri, 12 May 2017 19:42:24 GMT):
I used the commit level hashes on the Github page.
szoghybe (Fri, 12 May 2017 20:25:34 GMT):
Make that https://bertrandszoghy.wordpress.com/
szoghybe (Fri, 12 May 2017 20:25:42 GMT):
Natch.
szoghybe (Fri, 12 May 2017 20:25:50 GMT):
Have a nice weekend everyone!
Senthil1 (Sun, 14 May 2017 07:34:34 GMT):
Has joined the channel.
karumbas (Sun, 14 May 2017 15:49:12 GMT):
@here @Willson I added the TLS alternative dependency as directed and that resolved the ALPN config error but I am now getting a new error
```
Caused by: java.lang.IllegalArgumentException: No host in authority 'DigiCert SHA2 Secure Server CA'
```
This error occurs when adding a peer to the chain on this line
```
Peer peer = client.newPeer(peerName,org.getPeerLocation(peerName),channelConfig.getPeerProperties());
```
Maybe another thing to note; I am connecting to bluemix HSBN.
bmalavan (Sun, 14 May 2017 18:10:06 GMT):
Has joined the channel.
Willson (Mon, 15 May 2017 02:12:41 GMT):
@karumbas I have not used bluemix, my fabric network runs on centos7 and it is working fine
karumbas (Mon, 15 May 2017 08:42:24 GMT):
Thanks @Willson, @rickr any ideas how I can resolve this https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8rCFahTWoqvLBPHKM
m.qaimari (Mon, 15 May 2017 09:07:58 GMT):
Has joined the channel.
nharshita (Mon, 15 May 2017 09:14:58 GMT):
Has joined the channel.
rickr (Mon, 15 May 2017 14:03:52 GMT):
Not sure of that error. Only thing I can say is your certs CN name needs to match the host or you must provide and override as was done in the end2end samples
rickr (Mon, 15 May 2017 14:03:52 GMT):
Not sure of that error. Only thing I can say is your certs CN name needs to match the host or you must provide an override as was done in the end2end samples
rickr (Mon, 15 May 2017 14:03:52 GMT):
Not sure of that error. Only thing I can say is your certs CN name needs to match the host or you must provide an override as was done in the end2end samples.
Also from what I'll admit is limited exposure with ALPN I would prefer not to use it given it's bootloader requirements
simers (Mon, 15 May 2017 16:41:06 GMT):
Has joined the channel.
oooo (Tue, 16 May 2017 08:49:30 GMT):
Has joined the channel.
eetti (Tue, 16 May 2017 12:20:13 GMT):
Has joined the channel.
szoghybe (Tue, 16 May 2017 13:34:14 GMT):
Hello, I can vagrant ssh into my machine but can't SSH into it using Moba Xterm. I've been trying the various solutions described at: https://serverfault.com/questions/441431/cant-ssh-into-a-vagrant-virtual-machine
rocket.cat (Tue, 16 May 2017 13:34:14 GMT):
Marnin', szoghybe
szoghybe (Tue, 16 May 2017 13:34:37 GMT):
But none of them seem to work. What's the trick?
szoghybe (Tue, 16 May 2017 13:34:50 GMT):
TIA.
szoghybe (Tue, 16 May 2017 13:35:39 GMT):
Marnin' rocket.cat.
rocket.cat (Tue, 16 May 2017 13:35:39 GMT):
Good morning to you too, szoghybe
rickr (Tue, 16 May 2017 13:38:40 GMT):
Not sure why you do not want to use vagrant ssh since all your doing there is mostly some simple command lines stuff. But you'll probably get better luck asking on the #fabric-dev-env
szoghybe (Tue, 16 May 2017 13:43:01 GMT):
Hello rickr. Force of habit.
rocket.cat (Tue, 16 May 2017 13:43:01 GMT):
Hey szoghybe, Hello!
szoghybe (Tue, 16 May 2017 13:43:32 GMT):
Hello rocket.cat
rocket.cat (Tue, 16 May 2017 13:43:32 GMT):
Good day, szoghybe
clempo (Tue, 16 May 2017 16:17:23 GMT):
I am studying the security in End2endIT by comparing it to e2e_cli
clempo (Tue, 16 May 2017 16:17:35 GMT):
but there does not seem to be the notion of a user in e2e_cli
clempo (Tue, 16 May 2017 16:18:13 GMT):
what is different in End2endIT environment that requires users
clempo (Tue, 16 May 2017 16:19:07 GMT):
The end goal is to setup the environment of my own demo using command lines or static fixtures
clempo (Tue, 16 May 2017 16:19:37 GMT):
without requiring us to run End2endIT and dump the user enrollment as text output
rickr (Tue, 16 May 2017 16:20:22 GMT):
I have not done much with cli ... my understanding which could be wrong it always runs everything as the SDKs peer Admin
clempo (Tue, 16 May 2017 16:21:01 GMT):
I read somewhere security has to be turned on, is that still true?
rickr (Tue, 16 May 2017 16:21:26 GMT):
I'd ask that on fabric to make sure ... I'm not even it does enrollement of any type
rickr (Tue, 16 May 2017 16:21:26 GMT):
I'd ask that on fabric to make sure ... I'm not even sure it does enrollement of any type
clempo (Tue, 16 May 2017 16:22:09 GMT):
I thought the peer requests needed to be signed, so that would require keys
rickr (Tue, 16 May 2017 16:22:58 GMT):
Yes it has somewhere the peeradmin pkey and cert .. but I would ask on fabric they'd know for sure
clempo (Tue, 16 May 2017 16:23:53 GMT):
may try again, last time my newbie question on network topology got ignored
clempo (Tue, 16 May 2017 16:24:30 GMT):
I'll try to find the default user for the peer command
clempo (Tue, 16 May 2017 16:25:00 GMT):
I thought an envvar gave the dir of the key, but I can't find that var in e2e_cli either
clempo (Tue, 16 May 2017 16:25:57 GMT):
off topic, is there a hyperledger conf soon where there would be tutorial sessions?
clempo (Tue, 16 May 2017 16:26:35 GMT):
are you attending a conf soon?
rickr (Tue, 16 May 2017 16:27:20 GMT):
They don't let me leave my chair :)
clempo (Tue, 16 May 2017 16:28:54 GMT):
I hope they feed you intravenous pizza at least
rohitbordia (Tue, 16 May 2017 16:54:24 GMT):
@kelvinzhong : thanks for letting me know on ccenv container
rohitbordia (Tue, 16 May 2017 16:55:23 GMT):
finally it worked
VenuVemula (Tue, 16 May 2017 17:03:34 GMT):
Has joined the channel.
tmath (Wed, 17 May 2017 00:09:07 GMT):
Has joined the channel.
kelvinzhong (Wed, 17 May 2017 01:57:44 GMT):
congrats @rohitbordia
zhoupeiwen (Wed, 17 May 2017 08:08:58 GMT):
Hey All, does the java sdk work for the fabric alpha2 ?
dayubian (Wed, 17 May 2017 08:44:33 GMT):
@zhoupeiwen Yes, it works fine.
nickmelis (Wed, 17 May 2017 09:44:07 GMT):
@zhoupeiwen @dayubian a few days ago someone on #fabric-release said the Java SDK wouldn't be included in alpha2. Has it changed?
liuwenliang0632 (Wed, 17 May 2017 09:56:32 GMT):
Has joined the channel.
kelvinzhong (Wed, 17 May 2017 09:58:37 GMT):
@rickr hi, i found that the e2etestJava seems to be removed from the project, so currently the java chaincode could not work with the java sdk right?
liuwenliang0632 (Wed, 17 May 2017 10:01:00 GMT):
hi
rickr (Wed, 17 May 2017 10:02:04 GMT):
The java chain code test was removed because it was not up to date.
liuwenliang0632 (Wed, 17 May 2017 10:02:30 GMT):
i had fixed FAB-3969 ,please help me review.
liuwenliang0632 (Wed, 17 May 2017 10:02:50 GMT):
https://gerrit.hyperledger.org/r/#/c/9445/
rickr (Wed, 17 May 2017 10:04:04 GMT):
Code updates are momentarily locked down. No code changes are being added at the moment .
kelvinzhong (Wed, 17 May 2017 10:05:35 GMT):
so theoretically, it could work with the sdk?
rickr (Wed, 17 May 2017 10:06:18 GMT):
Haven tested it don't really know
rickr (Wed, 17 May 2017 10:06:18 GMT):
Haven't tested it don't really know
liuwenliang0632 (Wed, 17 May 2017 10:07:16 GMT):
@rickr are u talking me?
rickr (Wed, 17 May 2017 10:08:41 GMT):
Thanks for the update -- maybe a few days before I get a chance to look at it.
kelvinzhong (Wed, 17 May 2017 10:08:57 GMT):
okay... so the sdk could be worked, but what your concerned is whether the java chaincode could work?
kelvinzhong (Wed, 17 May 2017 10:09:26 GMT):
may be i could try it out
liuwenliang0632 (Wed, 17 May 2017 10:10:10 GMT):
@rickr ,can i add u to reviewer?
rickr (Wed, 17 May 2017 10:10:25 GMT):
yes
rickr (Wed, 17 May 2017 10:13:34 GMT):
If Java chaincode is working it should in theory work. May take some fixes in the SDK since that codepath has not been exercised in some time.
kelvinzhong (Wed, 17 May 2017 10:14:14 GMT):
okay~thx for the info
rickr (Wed, 17 May 2017 10:14:53 GMT):
Go ahead and give it a shot .. Tell me what's broken :)
kelvinzhong (Wed, 17 May 2017 10:15:15 GMT):
lol fine~
liuwenliang0632 (Wed, 17 May 2017 10:15:53 GMT):
i had add Rick Rine for https://gerrit.hyperledger.org/r/#/c/9445/
tmath (Wed, 17 May 2017 10:38:33 GMT):
is this tutorial for v1.0? http://hyperledger-fabric.readthedocs.io/en/latest/Setup/JAVAChaincode.html
rickr (Wed, 17 May 2017 10:41:14 GMT):
Best to ask that on #fabric-java-chaincode
tmath (Wed, 17 May 2017 10:43:15 GMT):
ok. What's the difference between the Java SDK and the Java fabric?
kelvinzhong (Wed, 17 May 2017 10:59:54 GMT):
description=Error starting container: API error (404): {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\"java\\\": executable file not found in $PATH\"\n
kelvinzhong (Wed, 17 May 2017 10:59:54 GMT):
i try to deploy the java chaincode and return this error
description=Error starting container: API error (404): {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\"java\\\": executable file not found in $PATH\"\n
kelvinzhong (Wed, 17 May 2017 10:59:54 GMT):
i try to deploy the java chaincode and return this error while i try to instantiate
description=Error starting container: API error (404): {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\"java\\\": executable file not found in $PATH\"\n
kelvinzhong (Wed, 17 May 2017 11:00:46 GMT):
i exec the Instantiate then return this error, but why would peer need jdk env.....
kelvinzhong (Wed, 17 May 2017 11:00:46 GMT):
but why would peer need jdk env.....
rickr (Wed, 17 May 2017 11:26:13 GMT):
For java chaincode issues when it's executing in the endorser the experts are #fabric-java-chaincode Make sure your source location is the full path to the java chaincode too.
kelvinzhong (Wed, 17 May 2017 12:59:25 GMT):
yes, i have the full path to the java chaincode project
kelvinzhong (Wed, 17 May 2017 13:00:12 GMT):
i would try to get some answer in #fabric-java-chaincode
hendry19901990 (Wed, 17 May 2017 16:59:47 GMT):
Has joined the channel.
dayubian (Thu, 18 May 2017 01:38:13 GMT):
@nickmelis @zhoupeiwen Fabric SDK Java works fine with alpha2, however Java Chaincode doesn't work in alpha2.
chenxuan (Thu, 18 May 2017 05:17:19 GMT):
Has joined the channel.
chenxuan (Thu, 18 May 2017 05:17:33 GMT):
client and server don't have same version (client : 1.22, server: 1.18)
chenxuan (Thu, 18 May 2017 05:17:39 GMT):
dockerlogfile
chenxuan (Thu, 18 May 2017 05:17:42 GMT):
show this
chenxuan (Thu, 18 May 2017 05:25:57 GMT):
Could not find the file "/root/test.properties"
chenxuan (Thu, 18 May 2017 05:38:37 GMT):
client and server don't have same version
xuanyue202 (Thu, 18 May 2017 06:01:10 GMT):
@rickr I saw from the chat history that Java sdk would go into maven repo for 1.0.0. Is it maven central? Still I cannot find it :frowning2:
chenxuan (Thu, 18 May 2017 06:10:24 GMT):
java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/eclipse/aether/RepositorySystemSession;
chenxuan (Thu, 18 May 2017 07:24:25 GMT):
jump tall blockchains in a single leap
chenxuan (Thu, 18 May 2017 07:24:26 GMT):
?
rickr (Thu, 18 May 2017 09:41:16 GMT):
v1.0.0 is not out
rickr (Thu, 18 May 2017 09:41:16 GMT):
v1.0.0 is not out . The Fabric itself is just now publishing alpha2
rickr (Thu, 18 May 2017 09:41:16 GMT):
v1.0.0 is not out . The Fabric itself is just now publishing alpha2 version.
rickr (Thu, 18 May 2017 09:44:03 GMT):
I'm not following where you see 1.22 vs 1.18 ?
liuwenliang0632 (Thu, 18 May 2017 10:18:45 GMT):
@rickr please review https://gerrit.hyperledger.org/r/#/c/9445/
rickr (Thu, 18 May 2017 11:08:31 GMT):
I do get notified of reviews so no need to ask here :)
MikeMayori (Thu, 18 May 2017 13:59:16 GMT):
Has joined the channel.
MikeMayori (Thu, 18 May 2017 14:01:01 GMT):
Hi all, anybody that can tell me if java sdk is table or what version i can play witch to start building a POC
MikeMayori (Thu, 18 May 2017 14:01:01 GMT):
Hi all, anybody that can tell me if java sdk is stable or what version i can play witch to start building a POC
bestbeforetoday (Thu, 18 May 2017 14:05:18 GMT):
Has joined the channel.
eetti (Thu, 18 May 2017 14:46:51 GMT):
The POM for org.hyperledger:shim-client:jar:1.0 is missing, no dependency information available
Could anyone help me point out what I might be missing?
rickr (Thu, 18 May 2017 14:48:17 GMT):
Where is that POM you're referencing ?
eetti (Thu, 18 May 2017 14:54:09 GMT):
eetti (Thu, 18 May 2017 14:54:09 GMT):
rickr (Thu, 18 May 2017 14:58:02 GMT):
What git repository ? what file ?
eetti (Thu, 18 May 2017 14:59:00 GMT):
RangeExample
eetti (Thu, 18 May 2017 14:59:54 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-java-chaincode?msg=gp8DtxYPRqxdCiNLB)
eetti (Thu, 18 May 2017 15:00:50 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=5xbWNcvTsiXxLZRxo) @sanchezl Suggested you do the following gradle build to get org.hyperledger.fabric.shim package
rickr (Thu, 18 May 2017 15:06:56 GMT):
I really think your looking for help with chaincode which is best asked on #fabric-java-chaincode
CarlXK (Fri, 19 May 2017 06:21:40 GMT):
```
Caused by: java.lang.Exception: Chain mychannel failed to place transaction a51333fcd500c067a94f46c3ffea2ae46b39dff1784b482f15d3b65f4f7ffacc on Orderer. Cause: UNSUCCESSFUL
at org.hyperledger.fabric.sdk.Chain.sendTransaction(Chain.java:2283)
```
when i use alpha2 java sdk with alpha2 images, i got this error @here
CarlXK (Fri, 19 May 2017 06:21:40 GMT):
```
Caused by: java.lang.Exception: Chain mychannel failed to place transaction a51333fcd500c067a94f46c3ffea2ae46b39dff1784b482f15d3b65f4f7ffacc on Orderer. Cause: UNSUCCESSFUL
at org.hyperledger.fabric.sdk.Chain.sendTransaction(Chain.java:2283)
```
when i use alpha2 java sdk with alpha2 images, i got this error @here
CarlXK (Fri, 19 May 2017 06:21:40 GMT):
```
Caused by: java.lang.Exception: Chain mychannel failed to place transaction a51333fcd500c067a94f46c3ffea2ae46b39dff1784b482f15d3b65f4f7ffacc on Orderer. Cause: UNSUCCESSFUL
at org.hyperledger.fabric.sdk.Chain.sendTransaction(Chain.java:2283)
```
when i use alpha2 java sdk with alpha2 images, i got this error @here
```
[36m2017-05-19 03:48:17.400 UTC [cauthdsl] func1 -> DEBU 161[0m Gate evaluation starts: (&{n:1 policies:
CarlXK (Fri, 19 May 2017 06:21:40 GMT):
```
Caused by: java.lang.Exception: Chain mychannel failed to place transaction a51333fcd500c067a94f46c3ffea2ae46b39dff1784b482f15d3b65f4f7ffacc on Orderer. Cause: UNSUCCESSFUL
at org.hyperledger.fabric.sdk.Chain.sendTransaction(Chain.java:2283)
```
when i use alpha2 java sdk with alpha2 images, i got this error @here
```
[36m2017-05-19 03:48:17.400 UTC [cauthdsl] func1 -> DEBU 161[0m Gate evaluation starts: (&{n:1 policies:
CarlXK (Fri, 19 May 2017 06:21:40 GMT):
```
Caused by: java.lang.Exception: Chain mychannel failed to place transaction a51333fcd500c067a94f46c3ffea2ae46b39dff1784b482f15d3b65f4f7ffacc on Orderer. Cause: UNSUCCESSFUL
at org.hyperledger.fabric.sdk.Chain.sendTransaction(Chain.java:2283)
```
when i use alpha2 java sdk with alpha2 images, i got this error @here
```
[36m2017-05-19 03:48:17.400 UTC [cauthdsl] func1 -> DEBU 161[0m Gate evaluation starts: (&{n:1 policies:
bluefire (Fri, 19 May 2017 06:51:35 GMT):
I notice after the lastest commit, when the SDK install chainchode, the chaincode will output to /tmp/mydata.tgz in InstallProposalBuilder.java, but window OS cannot access this path /tmp, so anybody can tell me what can i do for this? thx
rickr (Fri, 19 May 2017 10:11:47 GMT):
Created a JIRA for it https://jira.hyperledger.org/browse/FAB-4034
rickr (Fri, 19 May 2017 10:11:47 GMT):
Created a JIRA for it https://jira.hyperledger.org/browse/FAB-4034
If you don't want to change the code as a _work around_ I think on the drive you're on if you could create a \tmp.
rickr (Fri, 19 May 2017 10:11:47 GMT):
Created a JIRA for it https://jira.hyperledger.org/browse/FAB-4034
If you don't want to change the code as a _work around_ I think on the drive you're on you could create a \tmp directory.
bluefire (Fri, 19 May 2017 10:29:34 GMT):
@rickr thank you, I just change the path to system java tempdir, now it's work fine.
sophiemaichau (Fri, 19 May 2017 10:58:13 GMT):
Has joined the channel.
rickr (Fri, 19 May 2017 11:04:36 GMT):
@CarlXK Is that running _out of the box_ End2endIT ?
graphen (Fri, 19 May 2017 11:05:40 GMT):
Has joined the channel.
graphen (Fri, 19 May 2017 11:17:53 GMT):
Anyone that can point to an confirmed working tutorial for the JavaSDK, the tests can run and everything but how do I customize it to my needs etc.? is there such a tutorial around?
graphen (Fri, 19 May 2017 11:18:03 GMT):
Fabric-SDK***
graphen (Fri, 19 May 2017 11:18:26 GMT):
The java-fabric-sdk!!! :P
rickr (Fri, 19 May 2017 11:24:47 GMT):
I'm pretty sure there's not specific to Java SDK. There may be some general information in the works. @nickgaski anything you can recommend ?
nickgaski (Fri, 19 May 2017 11:24:47 GMT):
Has joined the channel.
rickr (Fri, 19 May 2017 11:31:33 GMT):
The End2endIT* test show how you would use the SDK. Where things start getting complicated is if you want to create you own organizations peer, orderers , policies, consortium et al.
rickr (Fri, 19 May 2017 11:31:33 GMT):
The End2endIT* test show how you would use the SDK. Where things start getting complicated is if you want to creating you own organizations peer, orderers , policies, consortium et al.
graphen (Fri, 19 May 2017 11:32:09 GMT):
That's exactly where I'm at - running the tests etc. is fantastic buuuuut from there it's like hitting a brick wall
kelvinzhong (Fri, 19 May 2017 11:33:13 GMT):
@rickr hi, seems the fabric has the aphla 2 released, does java sdk work with the aphla 2?
kelvinzhong (Fri, 19 May 2017 11:33:13 GMT):
@rickr hi, seems the fabric has the alpha 2 released, does java sdk work with the alpha 2?
rickr (Fri, 19 May 2017 11:35:08 GMT):
I you get the latest java sdk _AT THE MOMENT_ the end2endIT test's docker compose actually is pulling from alpha2
kelvinzhong (Fri, 19 May 2017 11:35:26 GMT):
cool!
ricarda.schueler (Fri, 19 May 2017 11:48:55 GMT):
Has joined the channel.
xuanchen (Fri, 19 May 2017 13:15:05 GMT):
Has joined the channel.
hendry19901990 (Fri, 19 May 2017 15:35:23 GMT):
Hello everyone, i would like to contribute here
ManjeetGambhir (Fri, 19 May 2017 15:44:32 GMT):
@rickr we have generated new config tx having 5 orgs , do you know for these orgs how to generate policy file for each channel
ManjeetGambhir (Fri, 19 May 2017 15:44:52 GMT):
Right now 3 orgs per channel
ManjeetGambhir (Fri, 19 May 2017 15:45:17 GMT):
When try to load chain its failing in orderer
hendry19901990 (Fri, 19 May 2017 16:08:33 GMT):
where is the repo fabric-sdk ?
rickr (Fri, 19 May 2017 17:51:07 GMT):
I think the only means to have policies for the channels are are through the configtx tool.
https://github.com/hyperledger/fabric/blob/master/docs/source/configtxgen.rst
Any specific question on that you'll need to ask on the fabric channel to get answer.
rickr (Fri, 19 May 2017 17:51:07 GMT):
I think the only means to have policies for the channels are are through the configtx tool.
https://github.com/hyperledger/fabric/blob/master/docs/source/configtxgen.rst
Any specific question on that you'll need to ask on the fabric channel to get answer
Since the developers of that don't really hang out here
rickr (Fri, 19 May 2017 17:59:27 GMT):
Development is done through gerrit you'll need a linux foundation id for that. https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-java
hendry19901990 (Fri, 19 May 2017 18:21:25 GMT):
yes i have a Linux ID
hendry19901990 (Fri, 19 May 2017 18:25:50 GMT):
ready
hendry19901990 (Fri, 19 May 2017 18:26:08 GMT):
who is the leader ??
szoghybe (Fri, 19 May 2017 18:52:08 GMT):
Hello, I set up the fabric-sdk-java in Eclipse imported as a Maven project and it's looking for import org.hyperledger.fabric.protos...
szoghybe (Fri, 19 May 2017 18:52:13 GMT):
Where is that?
szoghybe (Fri, 19 May 2017 19:07:16 GMT):
OK, I need to generate something and the sub-folders under this one is empty:
szoghybe (Fri, 19 May 2017 19:07:34 GMT):
"/opt/gopath/src/github.com/hyperledger/fabric/devenv/fabric-sdk-java/target/generated-sources/protobuf"
szoghybe (Fri, 19 May 2017 19:07:34 GMT):
\/opt/gopath/src/github.com/hyperledger/fabric/devenv/fabric-sdk-java/target/generated-sources/protobuf"
szoghybe (Fri, 19 May 2017 19:09:23 GMT):
ok, ok. I need to add the fabric-sdk-java-1.0.0-alpha2.jar somehow?
szoghybe (Fri, 19 May 2017 19:14:13 GMT):
OK, I crated a lib folder and copied fabric-sdk-java-1.0.0-alpha2.jar into it, added it to the Build Path and 500 errors are gone.
szoghybe (Fri, 19 May 2017 19:14:40 GMT):
Only 2 errs left, it is complaining about com.google.protobuf
szoghybe (Fri, 19 May 2017 19:18:03 GMT):
Do I have to download https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-java-3.3.0.zip and build the darn thing ?
szoghybe (Fri, 19 May 2017 19:23:59 GMT):
@graphen I wrote a blog post last week where I set up the Ubuntu virtual machine from scratch on Windows and run all the java integration tests end to end successfully. Please take a look at:
szoghybe (Fri, 19 May 2017 19:24:01 GMT):
https://bertrandszoghy.wordpress.com/2017/05/12/first-blog-post/
szoghybe (Fri, 19 May 2017 19:25:49 GMT):
I will step through the building of the recommended Linux Virtual machine on a Windows host, start Docker microservices running Hyperledger Fabric on that virtual image, build the fabric-sdk-java which can be found at https://github.com/hyperledger/fabric-sdk-java and run the java unit tests. Next, we will run the end to end Java integration tests. Finally, we will build the HTML documentation with Sphinx.
szoghybe (Fri, 19 May 2017 19:26:22 GMT):
I just did a second blog post where I install Eclipse on the Hyperledger virtual image at:
szoghybe (Fri, 19 May 2017 19:27:37 GMT):
https://bertrandszoghy.wordpress.com/2017/05/19/setting-up-eclipse-neon-for-java-development-on-the-hyperledger-fabric-virtual-image/
szoghybe (Fri, 19 May 2017 19:30:54 GMT):
Bummed out, I leave in an hour and am out of the country for a few days. I wanted to finish this...
szoghybe (Fri, 19 May 2017 19:32:14 GMT):
My last hurdle is:
szoghybe (Fri, 19 May 2017 19:32:16 GMT):
1 required artifact is missing.
for artifact:
org.hyperledger.fabric-sdk-java:fabric-sdk-java:jar:1.0.0-alpha2
from the specified remote repositories:
central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.resolveBinaryArtifact(AbstractProtocMojo.java:962)
at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.execute(AbstractProtocMojo.java:489)
at org.xolstice.maven.plugin.protobuf.AbstractProtocCompileMojo.execute(AbstractProtocCompileMojo.java:31)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360)
at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52)
at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:487)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:406)
at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:285)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
----------
1) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.0.0
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.0.0 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.0.0 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.hyperledger.fabric-sdk-java:fabric-sdk-java:jar:1.0.0-alpha2
2) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.0.0
gdinhof (Sun, 21 May 2017 07:30:45 GMT):
Has joined the channel.
richard.holzeis (Sun, 21 May 2017 20:09:18 GMT):
Has joined the channel.
CarlXK (Mon, 22 May 2017 01:31:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=E7aa9z9JdFqWcpDvF) @rickr yes, i write my own channel and java code to connect
rodger0514 (Mon, 22 May 2017 01:47:09 GMT):
Has joined the channel.
trilochanachary (Mon, 22 May 2017 01:47:46 GMT):
Has joined the channel.
trilochanachary (Mon, 22 May 2017 01:48:48 GMT):
can u plz help
You are using Gradle 2.10: This version of the protobuf plugin works with Gradle version 2.12+
FAILURE: Build failed with an exception.
* Where:
Build file '/src/github.com/hyperledger/fabric/core/chaincode/shim/java/build.gradle' line: 29
* What went wrong:
An exception occurred applying plugin request [id: 'java']
> Failed to apply plugin [id 'org.gradle.java']
> Could not create an instance of type com.google.protobuf.gradle.ProtobufSourceDirectorySet_Decorated.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Calvin_Heo (Mon, 22 May 2017 02:51:06 GMT):
Has joined the channel.
rickr (Mon, 22 May 2017 11:26:44 GMT):
Looks like you should ask on #fabric-java-chaincode
rickr (Mon, 22 May 2017 11:30:04 GMT):
@CarlXK Did get first the standard end2end working to validate your setup ?
At first glance looks like user is not recognized for the channel you're creating.
hendry19901990 (Mon, 22 May 2017 20:40:16 GMT):
for what is this channel
hendry19901990 (Mon, 22 May 2017 20:40:20 GMT):
??
rickr (Mon, 22 May 2017 22:31:43 GMT):
Fabric SDK Java see the readme:
https://github.com/hyperledger/fabric-sdk-java
hendry19901990 (Mon, 22 May 2017 22:33:30 GMT):
i asked because i would like to develop in fabric-sdk-java my friend
rickr (Mon, 22 May 2017 22:37:55 GMT):
Need to be clear you want to work on it or develop using it ?
hendry19901990 (Mon, 22 May 2017 22:40:06 GMT):
contribute to sdk
hendry19901990 (Mon, 22 May 2017 22:43:11 GMT):
i want to work in the sdk
rickr (Mon, 22 May 2017 22:43:37 GMT):
Ok have gotten and started looking at it any ?
rickr (Mon, 22 May 2017 22:43:37 GMT):
Ok have gotten it and started looking at it any ?
rickr (Mon, 22 May 2017 22:44:23 GMT):
Run the test cases ? Studied the end2end code, followed what it does in the fabric ?
rickr (Mon, 22 May 2017 22:46:46 GMT):
?
hendry19901990 (Mon, 22 May 2017 22:48:58 GMT):
ok
hendry19901990 (Mon, 22 May 2017 22:49:19 GMT):
are you leader of the team ?
rickr (Mon, 22 May 2017 22:51:47 GMT):
I'm a _maintainer_ and for better or worse committed mot of the code.
rickr (Mon, 22 May 2017 22:51:47 GMT):
I'm a _maintainer_ and for better or worse committed most of the code.
hendry19901990 (Mon, 22 May 2017 22:54:18 GMT):
umm ok
rickr (Mon, 22 May 2017 22:54:42 GMT):
FYI Months past there was *LOTS* to do. At the moment we're frozen for V1 for any _major changes_ . Significant changes are probably not going to go in till after V 1.0 is released.
https://jira.hyperledger.org/secure/RapidBoard.jspa?rapidView=99&view=planning.nodetail&versions=visible&epics=visible
rickr (Mon, 22 May 2017 22:57:02 GMT):
Lot of working we'll need to do is write more test, do more testing .. bug fixing till we can finally release. Targeted about end of June .. but that's not locked in stone
hendry19901990 (Mon, 22 May 2017 22:58:27 GMT):
ok
rickr (Mon, 22 May 2017 23:17:38 GMT):
I have an idea if you're so inclined to help out. First you need get up to speed with the end2ende as I suggested. Then construct the channel use just the peer admin user for now. Once the channel is created create two threads .. each thread using that same user, same client, same channel deploy chaincode,, invoke it many times validate results .. ideally be able to that a thousand time. we've not done much MT testing
rickr (Mon, 22 May 2017 23:17:38 GMT):
I have an idea if you're so inclined to help out. First you need get up to speed with the end2ende as I suggested. Then construct the channel use just the peer admin user for now. Once the channel is created create two threads .. each thread using that same user, same client, same channel deploy different chaincode,, invoke it many times validate results .. ideally be able to that a thousand time. we've not done much MT testing
rickr (Mon, 22 May 2017 23:17:38 GMT):
I have an idea if you're so inclined to help out. First you need get up to speed with the end2ende as I suggested. Then construct the channel use just the peer admin user for now. Once the channel is created create two threads .. each thread using that same user, same client, same channel deploy different chaincode,, invoke it many times validate results .. ideally be able to do that a thousand time. we've not done much MT testing
rickr (Mon, 22 May 2017 23:20:37 GMT):
If your're not... I'll open it up for anyone .. really need to see if this holds up
IanSparkes (Tue, 23 May 2017 08:31:44 GMT):
Has joined the channel.
yecineoueslati (Tue, 23 May 2017 14:30:55 GMT):
Hi,
is there any example application developped by this sdk.
i saw this app https://github.com/IBM-Blockchain/marbles but it's with node sdk.
thx.
rickr (Tue, 23 May 2017 14:34:59 GMT):
look over the READM.md
rickr (Tue, 23 May 2017 14:35:55 GMT):
end2endIT samples will show you how to use the sdk
rickr (Tue, 23 May 2017 14:37:42 GMT):
If you want your welcome to port the the marbles demo to use the JSDK :)
garMobTest (Tue, 23 May 2017 17:38:06 GMT):
Has joined the channel.
garMobTest (Tue, 23 May 2017 17:39:10 GMT):
Hi All, is java sdk ready for version 1.0?
rickr (Tue, 23 May 2017 20:34:58 GMT):
@Willson FYI > https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L380
Willson (Wed, 24 May 2017 02:33:27 GMT):
thanks @rickr ^^
chrism28 (Wed, 24 May 2017 11:16:33 GMT):
Has joined the channel.
jimthematrix (Wed, 24 May 2017 12:09:13 GMT):
@chrism28 hi Chris, this is Jim, welcome back to working on java SDK!
trilochanachary (Wed, 24 May 2017 13:24:55 GMT):
did u guys encounter npm-pre-gyp error while executing demo... even though its installed...
rickr (Wed, 24 May 2017 13:28:18 GMT):
are you sure you didn't want to post that on #fabric-sdk-node ?
trilochanachary (Wed, 24 May 2017 13:32:12 GMT):
sorry...i will post in other channel...
lenin.mehedy (Wed, 24 May 2017 14:15:12 GMT):
Any idea why the build is failing with the following errors?
```
Running org.hyperledger.fabric.sdk.ChannelTest
2017-05-24 10:43:21,953 WARN SampleStore:74 - Could not find the file "/Users/lenin/test.properties"
2017-05-24 10:43:21,958 WARN SampleStore:74 - Could not find the file "/Users/lenin/test.properties"
java.io.NotSerializableException: org.hyperledger.fabric.sdk.TestHFClient$1
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java
......
```
rickr (Wed, 24 May 2017 14:18:21 GMT):
Try this again :
mvn clean install -DskipITs=false -Dmaven.test.failure.ignore=false
rickr (Wed, 24 May 2017 14:49:10 GMT):
Any one interested in Java CC can see discussion on it here :
https://chat.hyperledger.org/channel/fabric?msg=KjL3pfAwGZtgp7rXr
szoghybe (Wed, 24 May 2017 15:52:17 GMT):
FYI,
In my new blog post, I describe in detail how to install Eclipse Neon on the Hyperledger Fabric virtual machine, import the fabric-sdk-java as a Maven project, build it and step through the Java code of the integration End2E test. It's at:
https://bertrandszoghy.wordpress.com/2017/05/19/setting-up-eclipse-neon-for-java-development-on-the-hyperledger-fabric-virtual-image/
clempo (Wed, 24 May 2017 16:02:09 GMT):
What's the purpose of ./e2e-2Orgs/channel/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp if that user is registered and enrolled from scratch in End2endIT?
clempo (Wed, 24 May 2017 16:03:01 GMT):
In fact, it would help my demo if End2endIT would reconstruct that user like it does for the peer admin
rickr (Wed, 24 May 2017 16:59:19 GMT):
I've pressed for that but it's AFAIK it's a _no can do_. Feel free to ask on the #fabric or #fabric-crypto
clempo (Wed, 24 May 2017 17:11:46 GMT):
what is a no can do? Is that answering my question on the unused msp dir?
jordipainan (Wed, 24 May 2017 17:38:10 GMT):
@szoghybe looks really nice, great tutorial ! :D
rickr (Wed, 24 May 2017 22:01:54 GMT):
Answered in haste. Thinking of the wrong user --- I've not tried using that credentials. I'm fairly certain it's just a regular user. Please try and tell us all :) I'm assuming you took the Sample _stuff_ and ran with it so why not just do same as done with peer admin ?
lenin.mehedy (Thu, 25 May 2017 01:11:01 GMT):
@rickr Thanks. I finally got it working, however there is still an exception log as below. but there is no test failure. I suppose the CLI exception log can be ignored?
```
java.lang.Exception: POST request to http://localhost:7054/api/v1/reenroll failed request body {"certificate_request":"-----BEGIN CERTIFICATE REQUEST-----\nMIHKMHICAQAwEDEOMAwGA1UEAxMFdXNlcjMwWTATBgcqhkjOPQIBBggqhkjOPQMB\nBwNCAATeVV8T3snRj3t1JuuOnZAzyT6fc2Wi9IdtDpEeVNoD+X2s1IzKV769K8l8\n06qXn/+ZBcJXIeIEz0ujp4yiNgXIoAAwCgYIKoZIzj0EAwIDSAAwRQIgBh41milC\nbS7Z5kyOIqJ33WcUQ1xTRY3z9TG68km8w48CIQDwva9sEJS+FxRMG4U6Ca0OqEip\n9pmAmO0jinKR4XsIGg==\n-----END CERTIFICATE REQUEST-----\n"} with status code: 400. Response: {"success":false,"result":null,"errors":[{"code":400,"message":"Authorization failure"}],"messages":[]}
at org.hyperledger.fabric_ca.sdk.HFCAClient.httpPost(HFCAClient.java:612)
at org.hyperledger.fabric_ca.sdk.HFCAClient.reenroll(HFCAClient.java:409)
at org.hyperledger.fabric_ca.sdk.HFCAClient.reenroll(HFCAClient.java:364)
at org.hyperledger.fabric_ca.sdkintegration.HFCAClientEnrollIT.testUserRevoke(HFCAClientEnrollIT.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 109.188 sec - in org.hyperledger.fabric.sdkintegration.IntegrationSuite
Results :
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
```
kelvinzhong (Thu, 25 May 2017 02:04:33 GMT):
@rickr u try hard bro, but seems the boss would not take the risk to enable the java cc:joy:
kelvinzhong (Thu, 25 May 2017 02:07:08 GMT):
but indeed it sucks to writing go cc as a java developer.....
kelvinzhong (Thu, 25 May 2017 02:07:08 GMT):
but indeed it sucks to write go cc as a java developer.....
aaronzheng (Thu, 25 May 2017 09:01:12 GMT):
Has joined the channel.
aaronzheng (Thu, 25 May 2017 09:03:16 GMT):
hi everyone. may i know where to setup the affiliation?
i am using fabric-sdk-java now. when i want to enroll a member, i have to specified the affiliation, but i can't specify as i want. i only can input 'org1.department1'.
rickr (Thu, 25 May 2017 09:10:55 GMT):
@lenin.mehedy I wish it didn't show up like that but it's a test that validates we can't reenroll a user we've revoked which throws an expected exception.
aaronzheng (Thu, 25 May 2017 10:12:00 GMT):
i am creating my channel via fabric-sdk-java, but it display below error. any idea for it? (i have attached two log, one is fabric, another is java)
fabric log:
orderer.example.com | 2017-05-25 10:06:30.936 UTC [orderer/main] Broadcast -> DEBU 80b Starting new Broadcast handler
orderer.example.com | 2017-05-25 10:06:30.937 UTC [orderer/common/broadcast] Handle -> DEBU 80c Starting new broadcast loop
orderer.example.com | 2017-05-25 10:06:30.937 UTC [orderer/common/broadcast] Handle -> DEBU 80d Preprocessing CONFIG_UPDATE
orderer.example.com | 2017-05-25 10:06:30.937 UTC [orderer/configupdate] Process -> DEBU 80e Processing channel reconfiguration request for channel
foo
orderer.example.com | 2017-05-25 10:06:30.937 UTC [common/configtx] addToMap -> DEBU 80f Adding to config map: [Groups] /Channel
orderer.example.com | 2017-05-25 10:06:30.937 UTC [common/configtx] addToMap -> DEBU 810 Adding to config map: [Groups] /Channel/Application
orderer.example.com | 2017-05-25 10:06:30.937 UTC [common/configtx] addToMap -> DEBU 811 Adding to config map: [Groups] /Channel/Application/Org2MS
P
orderer.example.com | 2017-05-25 10:06:30.937 UTC [common/configtx] addToMap -> DEBU 812 Adding to config map: [Groups] /Channel/Application/Org1MS
P
orderer.example.com | 2017-05-25 10:06:30.937 UTC [common/configtx] addToMap -> DEBU 813 Adding to config map: [Values] /Channel/Consortium
orderer.example.com | 2017-05-25 10:06:30.937 UTC [orderer/common/broadcast] Handle -> WARN 814 Rejecting CONFIG_UPDATE because: Error authorizing
update: Error validating ReadSet: Readset expected key [Groups] /Channel/Application at version 0, but got version 1
java log:
org.hyperledger.fabric.sdk.exception.TransactionException: New channel foo error. StatusValue 400. Status BAD_REQUEST
at org.hyperledger.fabric.sdk.Channel.
lenin.mehedy (Thu, 25 May 2017 10:46:29 GMT):
@rickr Thanks. got it.
rickr (Thu, 25 May 2017 10:51:50 GMT):
@aaronzheng I'm assuming you ran the configtx tool at the same level of code that you are running the Fabric with
lenin.mehedy (Thu, 25 May 2017 11:00:19 GMT):
@rickr can you point me to a sample testutil.properties file. It seems to be missing the repo.
lenin.mehedy (Thu, 25 May 2017 11:00:28 GMT):
in*
rickr (Thu, 25 May 2017 11:16:01 GMT):
test.properties is created and deleted by the tests
szoghybe (Thu, 25 May 2017 13:44:44 GMT):
Hello, I now have three blog posts about fabric-sdk-java which you might find useful:
Java SDK for Hyperledger Fabric 1.0 (IBM Blockchain) — Setting Up the Environment
https://bertrandszoghy.wordpress.com/2017/05/12/fabric-sdk-java/
Setting up Eclipse Neon for Enterprise Java development on the Hyperledger Fabric virtual image
https://bertrandszoghy.wordpress.com/2017/05/19/setting-up-eclipse-neon-for-java-development-on-the-hyperledger-fabric-virtual-image/
And a new one this morning:
Backing up your Hyperledger virtual image and restoring it on another computer
https://bertrandszoghy.wordpress.com/2017/05/25/backing-up-and-restoring-your-hyperledger-virtual-image-on-another-computer/
jordipainan (Thu, 25 May 2017 15:38:18 GMT):
I love your posts <3
jordipainan (Thu, 25 May 2017 15:39:28 GMT):
thx for doing this
clempo (Thu, 25 May 2017 16:41:26 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=HGoYNTmD3vWuD8pqj)
clempo (Thu, 25 May 2017 16:42:25 GMT):
indeed, the test should use the creds, or the creds should not be there to simplify learning the example
clempo (Thu, 25 May 2017 16:43:52 GMT):
I thought you would simply remove the creds, but reloading User1 seems a better goal
clempo (Thu, 25 May 2017 16:44:10 GMT):
if we do that, then looping over all users of the SampleStore becomes somewhat moot
clempo (Thu, 25 May 2017 16:44:47 GMT):
and End2endAndBackAgain now seems strange if it gets its users from the SampleStore
clempo (Thu, 25 May 2017 16:45:20 GMT):
I never felt the SampleStore was a realistic example
clempo (Thu, 25 May 2017 16:46:19 GMT):
Maybe the examples should show two ways to implement user stores
clempo (Thu, 25 May 2017 16:46:51 GMT):
The fabric-ca CLI way with files like the peer admin, and the previous way
rickr (Thu, 25 May 2017 16:58:47 GMT):
The only creds you need on the file system is the peer Admin. You have the org admin which is really just a regular user with registrar rights to allow enrolling other users. At the moment the default policies created by configtx `regular users` can only invoke chaincode.
clempo (Thu, 25 May 2017 17:08:48 GMT):
I'm stressing the point because the example should be as simple as possible to make it easy to learn fabric.
clempo (Thu, 25 May 2017 17:10:18 GMT):
We should state the goal is to use that cred in the example eventually, or we should remove it
rickr (Thu, 25 May 2017 17:32:27 GMT):
I use the peer Admin (creds only on the filesystem created by crytpogen) --- which can not be at the moment gotten from the FabricCA in end2end to construct the channel and install, instantiate CC only those creds are able to do that.
I would assume after reading it from the filesystem you would delete those credentials and they would now be is "secure store"
End2endIT shows the CA admin registering a regular user.
In End2endIT line 353 I switch usercontext that shows that reg. user registered by the admin can invoke CC.
End2endAndBackAgainIT gets all user from the SampleStore no registering no enrolling.
It then goes on using the peerAdmin to upgrade CC which is only that credentials can do and later around line 337 it uses once again the regular user `TESTUSER_1_NAME` to invoke a `move`
This seems to be good mix of using/restoring those credentials.
rickr (Thu, 25 May 2017 17:32:27 GMT):
I use the peer Admin (creds only on the filesystem created by crytpogen) --- which can not be at the moment gotten from the FabricCA in end2end to construct the channel and install, instantiate CC only those creds are able to do that.
I would assume after reading it from the filesystem you would delete those credentials (files)and they would now be is "secure store"
End2endIT shows the CA admin registering a regular user.
In End2endIT line 353 I switch usercontext that shows that reg. user registered by the admin can invoke CC.
End2endAndBackAgainIT gets all user from the SampleStore no registering no enrolling.
It then goes on using the peerAdmin to upgrade CC which is only that credentials can do and later around line 337 it uses once again the regular user `TESTUSER_1_NAME` to invoke a `move`
This seems to be good mix of using/restoring those credentials.
clempo (Thu, 25 May 2017 18:01:45 GMT):
It's a good mix for a test suite, but it's not a very good example if your goal is to learn how to write production code
clempo (Thu, 25 May 2017 18:04:05 GMT):
there is a comment in the example about the peeradmin, but this was a better explanation why it's done differently
clempo (Thu, 25 May 2017 18:04:44 GMT):
could be useful to update that comment
rickr (Thu, 25 May 2017 18:08:10 GMT):
Be specific .. tell me how it think it should read or provide a patch.
I don't think you'll find in most 'samples' being offered in open source is "production code". It is a compromise to one test our own code.
Validate if it runs your setup is ok. And can does I think a _resonable_ job at showing you how to use the API.
clempo (Thu, 25 May 2017 18:09:59 GMT):
I thought I was specific when I said: We should state the goal is to use that cred (User1) in the example eventually, or we should remove it
clempo (Thu, 25 May 2017 18:10:55 GMT):
I think using the cred from the file system is more real life
rickr (Thu, 25 May 2017 18:19:08 GMT):
no cryptogen is Just dev tool to bootstrap you with all the credentials needed that work with FabricCA and have all credentials produced that it needs for the organizations you ask it to create. I think it's important for those that want to use fabricCA would want to see how to have an certificate signing authority being used. Seeing it register and enroll users that can invoke CC. It's cryptogen that's actually 'fake' no one would create many organizations certs keys etc in that manner.
rickr (Thu, 25 May 2017 18:19:08 GMT):
no cryptogen is just dev tool to bootstrap you with all the credentials needed that work with FabricCA and have all credentials produced that it needs for the organizations you ask it to create. I think it's important for those that want to use fabricCA would want to see how to have an certificate signing authority being used. Seeing it register and enroll users that can invoke CC. It's cryptogen that's actually 'fake' no one would create many organizations certs keys etc in that manner.
clempo (Thu, 25 May 2017 18:20:49 GMT):
I did not study cryptogen. I studied the fabric-ca user's guide which promotes the fabric-ca CLI
clempo (Thu, 25 May 2017 18:23:18 GMT):
I'm not sure what the argument is about. I said you have an unused file in your example. Your answers do not seem to address that original point
clempo (Thu, 25 May 2017 18:23:56 GMT):
more like an unused dir
rickr (Thu, 25 May 2017 18:26:09 GMT):
That unused file is a by product of cryptogen .. Yes I could delete it. I think there are other too. I don't see that as diminishing what End2End test show.
wyanglau (Thu, 25 May 2017 18:28:58 GMT):
Has joined the channel.
aaronzheng (Fri, 26 May 2017 01:22:43 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=97egu3hptu9re6bAL) @rickr thanks for your reply. after i checked the code again, i found that if i created the channel twice, then i will get BAD_REQUEST error. if i only create it one, it it ok. i think it should have a validation checking for duplicate channel, and meaningful message.
liuwenliang0632 (Fri, 26 May 2017 03:39:17 GMT):
@rickr i had fixed FAB-4170, please help me review
liuwenliang0632 (Fri, 26 May 2017 04:12:21 GMT):
11f
liuwenliang0632 (Fri, 26 May 2017 04:12:22 GMT):
f
liuwenliang0632 (Fri, 26 May 2017 04:12:22 GMT):
as
liuwenliang0632 (Fri, 26 May 2017 04:12:22 GMT):
f
liuwenliang0632 (Fri, 26 May 2017 05:17:28 GMT):
i am sorry , There's something wrong with the keyboard
guruce (Fri, 26 May 2017 06:14:18 GMT):
Has joined the channel.
aaronzheng (Fri, 26 May 2017 06:56:06 GMT):
after creating my channel and install my chaincode, i want to instantiate the chaincode, but i got below error. any idea for it? or how can i check whether the Org1MSP exists or not ? thanks!
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Failed to deserialize creator identity, err MSP Org1MSP is unknown
zhangchao (Fri, 26 May 2017 06:59:57 GMT):
@aaronzheng , I opened a issue FAB-4001, looks like your errors is same as this one
aaronzheng (Fri, 26 May 2017 07:09:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=sCCdzwpWzpKWQ3vR9) @zhangchao do you know in the docker how to check whether Org1MSP exists or not?
zhangchao (Fri, 26 May 2017 07:10:21 GMT):
it's in the channel tx file
MikkelPetersen (Fri, 26 May 2017 12:03:46 GMT):
Has joined the channel.
BhavishaDawda (Fri, 26 May 2017 18:49:16 GMT):
Has joined the channel.
HansDeLeenheer (Fri, 26 May 2017 21:02:33 GMT):
Has joined the channel.
HansDeLeenheer (Fri, 26 May 2017 21:25:32 GMT):
Hi all, allow me to introduce myself briefly; I'm leading the product roadmap at Gospel, a London based startup building a platform on top of HyperLedger. Currently we are using Fabric v0.6 since we are using JAVA-SDK. It has come to my attention lately that there would be timing issues to get JAVA-SDK into Fabric v1.0 which has lead me to stall the migration of our backend (that was planned for this release). Can someone update me on the chances of JAVA-SDK making it to Fabric v1.0 release and what is the blocking factor please?
rickr (Fri, 26 May 2017 22:45:41 GMT):
". It has come to my attention lately that there would be timing issues to get JAVA-SDK into Fabric v1.0" how has that come to your attention ?
rickr (Fri, 26 May 2017 22:45:41 GMT):
"It has come to my attention lately that there would be timing issues to get JAVA-SDK into Fabric v1.0" how has that come to your attention ?
rickr (Fri, 26 May 2017 22:45:41 GMT):
"It has come to my attention lately that there would be timing issues to get JAVA-SDK into Fabric v1.0"
How has that come to your attention ?
liuwenliang0632 (Sat, 27 May 2017 01:30:46 GMT):
@rickr can u help me review https://gerrit.hyperledger.org/r/#/c/9857/
rickr (Sat, 27 May 2017 02:26:59 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8YSea7sA7tieDwoJf) Basically the SDK just uses the user that is set in the usercontext's user' MSPID and the certificate used in the enrollment, privatekey to sign. Did you use the same user for instantiate cc as the the operations ?
rickr (Sat, 27 May 2017 02:26:59 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8YSea7sA7tieDwoJf) Basically the SDK just uses the user that is set in the usercontext's user' MSPID and the certificate used in the enrollment, privatekey to sign. Did you use the same user for instantiate cc as the the operations ? If no, try that one. If yes, then maybe ask on the #fabric-consensus IMO should work.
rickr (Sat, 27 May 2017 02:26:59 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8YSea7sA7tieDwoJf) Basically the SDK just uses the user that is set in the usercontext's user' MSPID and the certificate used in the enrollment, privatekey to sign. Did you use the same user for instantiate cc as the other operations listed ? If no, try that one. If yes, then maybe ask on the #fabric-consensus IMO should work.
liuwenliang0632 (Sat, 27 May 2017 02:40:08 GMT):
aha, @rickr waiting for u
rickr (Sat, 27 May 2017 02:41:36 GMT):
really why?
liuwenliang0632 (Sat, 27 May 2017 02:41:57 GMT):
please help me review https://gerrit.hyperledger.org/r/#/c/9857
rickr (Sat, 27 May 2017 02:42:45 GMT):
As I said I get notified when they are ready for review .. asking here won't make it go faster. I have thing waiting in the queue too :)
rickr (Sat, 27 May 2017 02:42:45 GMT):
As I said I get notified when they are ready for review .. asking here won't make it go faster. I have CS waiting in the queue too :)
liuwenliang0632 (Sat, 27 May 2017 02:47:58 GMT):
okay, i join in the queue after you:blush:
rickr (Sat, 27 May 2017 02:48:43 GMT):
Thanks for helping btw -- not at a computer now so maybe a few days
liuwenliang0632 (Sat, 27 May 2017 03:13:59 GMT):
Dragon Boat Festival
HansDeLeenheer (Sat, 27 May 2017 06:34:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=FYTxD4bbeHJhZnzDs) @rickr From our own engineers, conversations with people on the Fabric release team and the fact that it is not included in `alpha2` - for the record, not here to stir the pot, just to show my concerns if this is the case or be comforted if not. There is a lot ofr us that depends on this.
rickr (Sat, 27 May 2017 09:32:32 GMT):
Where do you see it's not part of alpha2 ?
rickr (Sat, 27 May 2017 09:32:32 GMT):
Where do you see it's not part of alpha2 ? It's true, there has not been a release to Maven which is something that is beyond my control and needs to be done by the Linux Foundation. Last I've heard they've not been able to get that accomplished. @rjones @cbf
rickr (Sat, 27 May 2017 09:32:32 GMT):
Where do you see it's not part of alpha2 ? There's has been on release to Maven which is something that is beyond my control and needs to be done by the Linux Foundation which does seem to be able to get that accomplished @rjones @cbf
rickr (Sat, 27 May 2017 09:32:32 GMT):
Where do you see it's not part of alpha2 ? It's true, there's has not been a to release to Maven which is something that is beyond my control and needs to be done by the Linux Foundation. Last Ive they've not been able get that accomplished. @rjones @cbf
rickr (Sat, 27 May 2017 09:32:32 GMT):
Where do you see it's not part of alpha2 ? It's true, there's has not been a to released to Maven which is something that is beyond my control and needs to be done by the Linux Foundation. Last I've they've not been able get that accomplished. @rjones @cbf
rickr (Sat, 27 May 2017 09:32:32 GMT):
Where do you see it's not part of alpha2 ? It's true, there's has not been a to released to Maven which is something that is beyond my control and needs to be done by the Linux Foundation. Last I've heard they've not been able get that accomplished. @rjones @cbf
rickr (Sat, 27 May 2017 09:32:32 GMT):
Where do you see it's not part of alpha2 ? It's true, there's has not been a to released to Maven which is something that is beyond my control and needs to be done by the Linux Foundation. Last I've heard they've not been able to get that accomplished. @rjones @cbf
rickr (Sat, 27 May 2017 09:32:32 GMT):
Where do you see it's not part of alpha2 ? It's true, there has not been a to released to Maven which is something that is beyond my control and needs to be done by the Linux Foundation. Last I've heard they've not been able to get that accomplished. @rjones @cbf
liuwenliang0632 (Mon, 29 May 2017 01:54:51 GMT):
build error after https://gerrit.hyperledger.org/r/#/c/9891/ merged
dushyant (Mon, 29 May 2017 08:57:07 GMT):
Has joined the channel.
IanSparkes (Mon, 29 May 2017 12:24:03 GMT):
I'm looking to deploy Java chaincode on alpha2, but get the message that it's not working yet. Did I read the message right that this is a feature for later and we should use Go chaincode for the moment?
svasilyev (Mon, 29 May 2017 15:29:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6oJZFugY9f9Rjojcx) @IanSparkes
svasilyev (Mon, 29 May 2017 15:29:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6oJZFugY9f9Rjojcx) @IanSparkes
svasilyev (Mon, 29 May 2017 15:29:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6oJZFugY9f9Rjojcx) @IanSparkes
Java chaincode is disabled atm by https://jira.hyperledger.org/browse/FAB-3850
IanSparkes (Tue, 30 May 2017 05:59:42 GMT):
@svasilyev Thx!
lenin.mehedy (Tue, 30 May 2017 07:45:48 GMT):
I got the e2e integration test working. I am trying to isolate user enrolment and channel creation since in practice once the chaincode is deployed in the fabric, you wouldn't need to redeploy every time you update your application backend. However, I could not find any way to load existing channel (although I could reload the users) such that the backend can straight away start doing query/invoke chaincode. Is there a way to load/initialize already deployed channel? OR, any suggestion on ideally how should someone use this sdk to build the backend without requiring deployment of the chaincode every time the backend is restarted?
IanSparkes (Tue, 30 May 2017 10:25:20 GMT):
@lenin.mehedy Long answer: You can look at my example here https://bitbucket.org/isparkes/fabric-sdk-spring-boot-rest-poc which I created to start exploring the e2e test case some more. I just split up the 2e2 test case into "reasonable" chunks that you can execute via a REST call. I don't say it's ideal, I just say it works.
IanSparkes (Tue, 30 May 2017 10:26:35 GMT):
Short answer: Chain newChain = client.newChain(FOO_CHAIN_NAME);
lenin.mehedy (Tue, 30 May 2017 10:32:11 GMT):
@IanSparkes Thanks a lot. I was actually trying to build something like your REST api. Great work.
rickr (Tue, 30 May 2017 11:32:24 GMT):
End2endAndBackAgainIT show's basically how to recreate a channel and reuse. It cheats a little in that it does not actually store/retrieve the channel artifacts something I've never got around to. However I think it would be a fairly trivial l task.
rickr (Tue, 30 May 2017 11:35:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=2Kg49wgtvFR5EQbyW) Yes it was a catch 22 situation I was told fixed in the fabric would address. You may have to temporarily restore src/test/fixture/sdkintegration/peer-base/peer-base.yaml line 26
to `command: peer node start --peer-defaultchain=false`
rickr (Tue, 30 May 2017 11:47:04 GMT):
Java CC will most likely not be V1.0 from what I know. I've pushed to make it easy to enable via settings that indicate `let the user beware`
but doesn't seem to be making any traction https://jira.hyperledger.org/browse/FAB-4072
rickr (Tue, 30 May 2017 11:47:04 GMT):
Java CC will most likely not be V1.0 from what I know. I've pushed to make it easy to enable via settings that indicate `let the user beware`
but doesn't seem to be making any traction https://jira.hyperledger.org/browse/FAB-4072
Chime if you really want it
rickr (Tue, 30 May 2017 11:47:04 GMT):
Java CC will most likely not be V1.0 from what I know. I've pushed to make it easy to enable via settings that indicate `let the user beware`
but doesn't seem to be making any traction https://jira.hyperledger.org/browse/FAB-4072
Chime in if you really want it
rasmustrew (Tue, 30 May 2017 11:48:37 GMT):
Has joined the channel.
rasmustrew (Tue, 30 May 2017 11:48:43 GMT):
Hi! I have a question about starting a new chain and enrolling users. I am using the Java SDK. I have been looking at the Getting Started tutorial on readthedocs, there they use the cryptogen tool to generate keys, and use these keys to start a new chain. However, by doing this they completely bypass the CA? Is this a good way to do it? Should the CA not be used to create the keys/certificates for this?
rickr (Tue, 30 May 2017 11:58:59 GMT):
Cryptogen is a boot up development tool that generates all certs including TLS. In theory if you didn't care about CA you could use just certs/keys it generates. The Fabric/FabricCA use it's output in the end2end scenario. With the CA you can register additional user to invoke chain code. At the moment the only credentials that can create the channel and install, instantiate CC is the peerAdmin in the End2endIT. End2endIT ireads directly from the output cryptogen generates.
rickr (Tue, 30 May 2017 11:58:59 GMT):
Cryptogen is a boot up development tool that generates all certs including TLS. In theory if you didn't care about CA you could use just certs/keys it generates. The Fabric/FabricCA use it's output in the end2end scenario. With the CA you can register additional user to invoke chain code. At the moment the only credentials that can create the channel and install, instantiate CC is the peerAdmin in the End2endIT. End2endIT reads directly from the output cryptogen generates.
rickr (Tue, 30 May 2017 11:58:59 GMT):
Cryptogen is a boot up development tool that generates all certs including TLS. In theory if you didn't care about CA you could use just certs/keys it generates. The Fabric/FabricCA use it's output in the end2end scenario. With the CA you can register additional user to invoke chain code. At the moment the only credentials that can create the channel and install, instantiate CC is the peerAdmin in the End2endIT. End2endIT reads directly from the output cryptogen generates.
There is no strict requirement to use the FabricCA You should be able to use some other CA too.
lenin.mehedy (Tue, 30 May 2017 12:20:40 GMT):
Hi @rickr , I can see Cryptogen generates all certs including TLS in crypto-config. However, in your fixture folder there is a separate tls folder with additional certificates. How can we generate those for any new setup?
rickr (Tue, 30 May 2017 12:22:44 GMT):
The latest code should only use cryptogen artirfacts for TLS ..
rickr (Tue, 30 May 2017 12:22:44 GMT):
The latest code should only use cryptogen artifacts for TLS ..
rasmustrew (Tue, 30 May 2017 12:35:03 GMT):
Thanks @rickr ! Is it also possible to not use the cryptogen tool at all, and only rely on the CA? How would i go about creating the credentials for the admin in this way?
rickr (Tue, 30 May 2017 12:39:53 GMT):
The SDK had an alpha2 git tag that should work with the alpha2 Fabric. It's documented in the README.md
I will not speculate when the Java SDK will be V1.0.0
Here is the exit critera: https://wiki.hyperledger.org/projects/fabric/release_exit_criteria
Here is the Jira Board https://jira.hyperledger.org/secure/RapidBoard.jspa?rapidView=99&view=planning&selectedIssue=FAB-648&versions=visible&epics=visible
Anything not marked V1.0.0 will *not* be there for V1.0.0 when it happens.
I think probably the biggest impediment to declaring V1.0.0 is sufficient test coverage.
_In my opinion_ if you depend on this the time is starting to run out to get it and actively work with to see if it suits your needs.
rickr (Tue, 30 May 2017 12:45:33 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=82riSbCScDbzXEdMK)
Don't want to mislead you on that --- I think the best place to ask that would be on #fabric or #fabric-crypto .
rickr (Tue, 30 May 2017 12:49:50 GMT):
I probably should say you can not use cryptogen but how to do it I'm thinking is not for the faint of heart. Not sure how well documented it is. Like I said better channels to ask that on as it's really not central to the SDK itself
lenin.mehedy (Tue, 30 May 2017 12:49:51 GMT):
Thanks @rickr
rasmustrew (Tue, 30 May 2017 12:53:39 GMT):
alright thanks, i'l look around :)
rickr (Tue, 30 May 2017 14:27:12 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rjrkfcTCpftmLX8fA) I think this has been addressed now.
rickr (Tue, 30 May 2017 14:28:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=vE5TKC8ne5dTq8YPf) Should be addressed now
livespotty (Tue, 30 May 2017 15:41:39 GMT):
Has joined the channel.
anarancio (Tue, 30 May 2017 19:54:28 GMT):
hi guys, I have a running instance of fabric 1.0 running. Is there a tutorial somewhere that explains how to setup and use the SDK? https://github.com/hyperledger/fabric-sdk-java/tree/v1.0.0-alpha2 is enough? or there is some other place to look?
rickr (Tue, 30 May 2017 19:56:55 GMT):
README.md ?
anarancio (Tue, 30 May 2017 20:04:33 GMT):
yes I follow it but didn't had luck I will try all over again and ask some specific question in case it continue to fail
rickr (Tue, 30 May 2017 20:06:32 GMT):
if all you're doing is trying it out best to follow the alpha2 path initially Should be very quick to get up and running
anarancio (Tue, 30 May 2017 20:09:16 GMT):
yes we need it for a project we're working right now.. we had it on .6 but need to move to 1.0... I will start all over again with a fresh fabric 1.0 installation too
lenin.mehedy (Wed, 31 May 2017 05:31:59 GMT):
I am getting some warning in the fabric console log as below. Is that something to worry about?
```
peer1.org1.example.com | 2017-05-31 05:30:49.161 UTC [gossip/gossip] Gossip -> WARN b62 Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
peer0.org1.example.com | 2017-05-31 05:30:51.261 UTC [gossip/gossip] Gossip -> WARN e7d Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
peer0.org2.example.com | 2017-05-31 05:30:52.457 UTC [gossip/gossip] Gossip -> WARN 60b Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
peer1.org2.example.com | 2017-05-31 05:30:54.163 UTC [gossip/gossip] Gossip -> WARN 60b Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
peer1.org1.example.com | 2017-05-31 05:30:54.164 UTC [gossip/gossip] Gossip -> WARN b63 Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
peer0.org1.example.com | 2017-05-31 05:30:56.263 UTC [gossip/gossip] Gossip -> WARN e7e Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
peer0.org2.example.com | 2017-05-31 05:30:57.459 UTC [gossip/gossip] Gossip -> WARN 60c Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
```
chenxuan (Wed, 31 May 2017 08:05:01 GMT):
36;1mpeer1.org1.example.com |[0m [33m2017-05-31 08:04:42.684 UTC [gossip/gossip] Gossip -> WARN 3e3[0m Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
[33;1mpeer1.org2.example.com |[0m [33m2017-05-31 08:04:42.745 UTC [gossip/gossip] Gossip -> WARN 3e3[0m Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
[34mpeer0.org2.example.com |[0m [33m2017-05-31 08:04:47.131 UTC [gossip/gossip] Gossip -> WARN 3e4[0m Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
[31mpeer0.org1.example.com |[0m [33m2017-05-31 08:04:47.176 UTC [gossip/gossip] Gossip -> WARN 3e4[0m Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
[36;1mpeer1.org1.example.com |[0m [33m2017-05-31 08:04:47.686 UTC [gossip/gossip] Gossip -> WARN 3e4[0m Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
[33;1mpeer1.org2.example.com |[0m [33m2017-05-31 08:04:47.746 UTC [gossip/gossip] Gossip -> WARN 3e4[0m Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
chenxuan (Wed, 31 May 2017 08:05:04 GMT):
me too
chenxuan (Wed, 31 May 2017 08:05:23 GMT):
[34mpeer0.org2.example.com |[0m [31m2017-05-31 08:03:35.118 UTC [deliveryClient] connect -> ERRO 3cb[0m Failed obtaining connection: Could not connect to any of the endpoints: [orderer:7050]
chenxuan (Wed, 31 May 2017 08:05:31 GMT):
@rickr
rasmustrew (Wed, 31 May 2017 08:10:40 GMT):
@chenxuan Might i ask what version of docer you are running? I ran into a similar issue with docker toolbox, for me it was because i had forgotten to forward ports on the VM created by docker toolbox.
rasmustrew (Wed, 31 May 2017 08:10:53 GMT):
docker*
chenxuan (Wed, 31 May 2017 08:11:19 GMT):
Docker version 1.12.5, build 7392c3b
rasmustrew (Wed, 31 May 2017 08:15:08 GMT):
Are you using docker toolbox? (needed on Windows 7).
chenxuan (Wed, 31 May 2017 08:15:38 GMT):
o
chenxuan (Wed, 31 May 2017 08:15:39 GMT):
no
chenxuan (Wed, 31 May 2017 08:15:44 GMT):
i use the ubuntu
rasmustrew (Wed, 31 May 2017 08:16:23 GMT):
What is the output of "docker ps -a" ?
chenxuan (Wed, 31 May 2017 08:16:26 GMT):
the test can not run @lenin.mehedy
chenxuan (Wed, 31 May 2017 08:16:52 GMT):
e1cdf5476ddc hyperledger/fabric-peer "peer node start" 13 minutes ago Up 13 minutes 0.0.0.0:8056->7051/tcp, 0.0.0.0:8058->7053/tcp peer1.org2.example.com
cbbf1c7a498e hyperledger/fabric-peer "peer node start" 13 minutes ago Up 13 minutes 0.0.0.0:7056->7051/tcp, 0.0.0.0:7058->7053/tcp peer1.org1.example.com
1924d646eb5b hyperledger/fabric-peer "peer node start" 13 minutes ago Up 13 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
5ac14d678743 hyperledger/fabric-peer "peer node start" 13 minutes ago Up 13 minutes 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer0.org2.example.com
6e2ed2928952 hyperledger/fabric-ca "sh -c 'fabric-ca-ser" 13 minutes ago Up 13 minutes 0.0.0.0:8054->7054/tcp ca_peerOrg2
80ef9e688ccf hyperledger/fabric-ca "sh -c 'fabric-ca-ser" 13 minutes ago Up 13 minutes 0.0.0.0:7054->7054/tcp ca_peerOrg1
fe2fabe5970f hyperledger/fabric-ccenv "/bin/bash" 13 minutes ago Exited (0) 13 minutes ago sdkintegration_ccenv_1
ddcef6149791 hyperledger/fabric-orderer "orderer" 13 minutes ago Up 13 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
rasmustrew (Wed, 31 May 2017 08:19:57 GMT):
In your browser, if you go to "localhost:7050" Do you succesfully reach the orderer?
chenxuan (Wed, 31 May 2017 08:20:40 GMT):
docker exec -it orderer.example.com bash
chenxuan (Wed, 31 May 2017 08:21:01 GMT):
i use the cmd to get into the orderer.example.com is ok
chenxuan (Wed, 31 May 2017 08:21:34 GMT):
where the console tell me the orderer:7050
chenxuan (Wed, 31 May 2017 08:22:02 GMT):
[34mpeer0.org2.example.com |[0m [31m2017-05-31 08:08:14.122 UTC [ConnProducer] NewConnection -> ERRO 412[0m Failed connecting to orderer:7050 , error: grpc: timed out when dialing
rasmustrew (Wed, 31 May 2017 08:28:48 GMT):
Sorry, really not sure what the problem is then :/
lenin.mehedy (Wed, 31 May 2017 08:41:24 GMT):
@chenxuan I rebuilt the fabric and fabric-ca docker images based on the commit hash that fabric-sdk-java has been built upon. That solved those issues and integration tests worked
rasmustrew (Wed, 31 May 2017 08:52:18 GMT):
Hey i have another question :) I just pulled java-sdk master. And now i am getting errors related to the import of protos. specifically here: "import static org.hyperledger.fabric.protos."
rasmustrew (Wed, 31 May 2017 08:52:31 GMT):
.whatever :)
rasmustrew (Wed, 31 May 2017 08:53:56 GMT):
How might i go about fixing this?
rasmustrew (Wed, 31 May 2017 09:07:54 GMT):
am i perhaps missing a dependency?
aaronzheng (Wed, 31 May 2017 09:09:26 GMT):
hi i have created my channel and have 'install' and 'instantiate' the 'example_cc_go' successfully. however when i try to query the result from the peer, i got below error. any idea or suggestion for it?
2017-05-31 08:57:24,271 ERROR Channel:2167 - Sending proposal to peer0.org1.example.com failed because of gRPC failure=Status{code=UNKNOWN, description=failed to obtain cds for example_cc_go - could not find chaincode with name 'example_cc_go', cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: failed to obtain cds for example_cc_go - could not find chaincode with name 'example_cc_go'
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2167)
at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:2101)
at org.hyperledger.fabric.sdk.Channel.queryByChaincode(Channel.java:2064)
at org.hyperledger.fabric.aaron.NormalScenario.test(NormalScenario.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: failed to obtain cds for example_cc_go - could not find chaincode with name 'example_cc_go'
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:439)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:428)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:514)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:431)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:546)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:152)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
nickmelis (Wed, 31 May 2017 09:12:28 GMT):
hi folks, is the Java chaincode shim going to be included in the SDK, like it was in v0.6?
aaronzheng (Wed, 31 May 2017 09:13:01 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=7dRqxy8JnXmqCWNgK) @rasmustrew i would recommend you to set the release version after you download the java-sdk master. e.g. you can use this command to choose alpha 2 version. git checkout tags/
nickmelis (Wed, 31 May 2017 09:13:24 GMT):
@rasmustrew have you tried building the project?
aaronzheng (Wed, 31 May 2017 09:14:39 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=3684R6EAKqvfibQ4b) @nickmelis as i know at this moment, you have to compile the project to get the shim jar.
nickmelis (Wed, 31 May 2017 09:15:07 GMT):
@aaronzheng with 'the project', do you mean the main fabric?
rasmustrew (Wed, 31 May 2017 09:20:57 GMT):
@aaronzheng Ok just did, didnt fix the issue :/
rasmustrew (Wed, 31 May 2017 09:22:57 GMT):
or it sort of did. Eclipse is still telling me there is a compilation error before i run. It runs just fine though so i guess it's fine :)
rasmustrew (Wed, 31 May 2017 09:23:09 GMT):
thanks!
aaronzheng (Wed, 31 May 2017 09:26:39 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ZeBJZRqw4NinJMLwN) @nickmelis yes. the main fabric project (not fabric-sdk-java)!!! go to github.com/hyperledger/fabric/core/chaincode/shim/java and execute the command 'gradle build'. then it will generate a shim.jar~ you can import it into your project.
nickmelis (Wed, 31 May 2017 09:30:08 GMT):
although it seems like java chaincode has been disabled for the release of alpha2, am I right?
aaronzheng (Wed, 31 May 2017 09:47:39 GMT):
@aaronzheng i got my root cause of my question! ha. every time sending the query chaincode request, we have to put it into channel transaction.
rasmustrew (Wed, 31 May 2017 11:39:07 GMT):
I have a new question, this time about joining a peer to a new chain. I have a network consisting of just one peer and one orderer and i want to create a channel and add my one peer to it.
I just created a chain, which went well, and then attempt to join a peer to it with channel.joinPeer(peer). That throws an exception:
org.hyperledger.fabric.sdk.exception.ProposalException: Join peer to chain mychannel failed. Status FAILURE, details: Sending proposal to peer0.org1.example.com failed because of gRPC failure=Status{code=INTERNAL, description=null, cause=io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002.
As far as i can tell, the code=INTERNAL, means that the response could not be decompressed, i.e. it was malformed in some way. The hex dump means:
Not Acknowledged, End of text, Start of Header, NUL, Start of Text.
I am not quite sure what that error means. Neither the Orderer or the Peer print anything at all to their logs. Any ideas?
rasmustrew (Wed, 31 May 2017 11:53:32 GMT):
I am also curious as to why there is both a public addPeer() and joinPeer().
rickr (Wed, 31 May 2017 12:03:13 GMT):
Only join once it really does join the peer to the channel. Add is later you reconstruct the chain. Add really does not grpc calls at all.
rickr (Wed, 31 May 2017 12:04:36 GMT):
Ive never once so far seen the join peer fail like that.
rasmustrew (Wed, 31 May 2017 12:37:28 GMT):
I find it really odd aswell, especially because neither the orderer or the peer prints anything to the log when i do this.
lenin.mehedy (Wed, 31 May 2017 12:40:46 GMT):
@rasmustrew various things could have gone wrong (based on my latest experience). I assume you are using the latest code and have built the containers locally. However, I would recommend you to get the EndToEnd integration test working again. Below are some of my notes to get it working (with latest commit levels)
```
# build fabric and fabric-ca
cd $GOPATH/src/github.com
mkdir hyperledger
cd hyperledger
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric
make dist-clean
git checkout -b java-sdk d2bfa744059e68d2e50d2cb01d285e3c6e1f2757
make native docker
cd ../fabric-ca
make clean
git checkout -b java-sdk ac2ee79ce8a1f80d5ae9c1ec84968882f45fd0e7
make docker
# clone fabric-sdk-java locally
cd $GOPATH/src/github.com
mkdir hyperledger
cd hyperledger
git clone https://github.com/hyperledger/fabric-sdk-java.git
git checkout -b java-sdk 1b72c0eb9ae5bc1a6dc6402fee9befb8803feab4
# run network
cd test/fixture/sdkintegration
./fabric restart
# build and run integration test
mvn clean install -DkipITs=false -Dmaven.test.failure.ignore=false
```
Once you are back to a working state, start modifying the config gradually.
rasmustrew (Wed, 31 May 2017 12:57:32 GMT):
I will try this, thank you :)
rasmustrew (Wed, 31 May 2017 13:08:50 GMT):
@lenin.mehedy I get errors when i clone the fabric-ca.git. "unable to create file vendor/....SHA1WithRSA.crt: Invalid Argument"
rasmustrew (Wed, 31 May 2017 13:09:17 GMT):
also with SHA1WithRSA_2.crt
rasmustrew (Wed, 31 May 2017 13:09:59 GMT):
I dont think i have ever gotten an error during a git pull before.
rasmustrew (Wed, 31 May 2017 13:10:06 GMT):
git clone rather
lenin.mehedy (Wed, 31 May 2017 13:10:48 GMT):
yeah, that error does not make sense. particularly during git clone.
lenin.mehedy (Wed, 31 May 2017 13:11:09 GMT):
do you have enough disk space?
rasmustrew (Wed, 31 May 2017 13:12:29 GMT):
I have 110 GB free, i'm thinking that should easily be enough.
lenin.mehedy (Wed, 31 May 2017 13:12:45 GMT):
yeah, try doing the git clone again...
lenin.mehedy (Wed, 31 May 2017 13:14:24 GMT):
by the way, I assume you are running each of those commands separately? I didn't try running those in a single setup script though.
rasmustrew (Wed, 31 May 2017 13:14:36 GMT):
i am running them seperately yes
rasmustrew (Wed, 31 May 2017 13:14:41 GMT):
same thing this time.
lenin.mehedy (Wed, 31 May 2017 13:14:58 GMT):
ok, let me clone on my machine...
rasmustrew (Wed, 31 May 2017 13:15:24 GMT):
i will try ssh aswell
rasmustrew (Wed, 31 May 2017 13:17:13 GMT):
same thing for ssh
lenin.mehedy (Wed, 31 May 2017 13:17:16 GMT):
what OS are you using?
rasmustrew (Wed, 31 May 2017 13:17:23 GMT):
Windows 7
lenin.mehedy (Wed, 31 May 2017 13:17:36 GMT):
man! get a linux breed...
rasmustrew (Wed, 31 May 2017 13:17:56 GMT):
It is the computer provided to me by my work ;)
lenin.mehedy (Wed, 31 May 2017 13:18:14 GMT):
anyway, my git clone seems to be working (I am currently with a slow internet though...)
rasmustrew (Wed, 31 May 2017 13:18:49 GMT):
Very strange, i will try updating git i suppose.
lenin.mehedy (Wed, 31 May 2017 13:19:11 GMT):
yeah, try to get the git clone working....
lenin.mehedy (Wed, 31 May 2017 13:23:03 GMT):
@rasmustrew I suppose you can install vagrant and try there...
lenin.mehedy (Wed, 31 May 2017 13:23:39 GMT):
you will need to install various other things to build the docker containers locally...
lenin.mehedy (Wed, 31 May 2017 13:24:10 GMT):
follow this: https://github.com/hyperledger/fabric-sdk-java#working-with-the-fabric-vagrant-environment
rasmustrew (Wed, 31 May 2017 13:28:07 GMT):
updating git did nothing sadly :/
rasmustrew (Wed, 31 May 2017 13:30:07 GMT):
I just had a friend on widnows 10 try aswell, same issue.
https://jira.hyperledger.org/browse/FAB-2771?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aworklog-tabpanel
Seems to be a known issue, but "won fix".
rasmustrew (Wed, 31 May 2017 13:30:13 GMT):
wont*
rasmustrew (Wed, 31 May 2017 13:36:40 GMT):
i think i have found the cause, ":" is not an allowed char in filenames on windows.
rasmustrew (Wed, 31 May 2017 14:01:56 GMT):
perhaps i should go ahead and install linux on it over the weekend. though i imagine IBM has some fairly stric guidelines on that ^^
rasmustrew (Wed, 31 May 2017 14:12:24 GMT):
@lenin.mehedy Cloning the java-sdk worked fine, so i ran the ./fabric restart as suggested. Now i am getting the same issue as @chenxuan :joy:
lenin.mehedy (Wed, 31 May 2017 14:13:09 GMT):
did you build the container?
lenin.mehedy (Wed, 31 May 2017 14:13:20 GMT):
containers*
rasmustrew (Wed, 31 May 2017 14:14:09 GMT):
the fabric script runs docker compose which builds the containers.
lenin.mehedy (Wed, 31 May 2017 14:14:37 GMT):
no it doesn't. It pulls the official containers of alpha2.
lenin.mehedy (Wed, 31 May 2017 14:15:12 GMT):
I got working with containers built based on the latest code
rasmustrew (Wed, 31 May 2017 14:15:12 GMT):
Then i am not sure what you mean with build the containers.
rasmustrew (Wed, 31 May 2017 14:15:18 GMT):
ah ok
lenin.mehedy (Wed, 31 May 2017 14:15:37 GMT):
Did you follow all my instructions? or you skipped as you liked?
rasmustrew (Wed, 31 May 2017 14:16:07 GMT):
i had to skip since the git clone did not work.
lenin.mehedy (Wed, 31 May 2017 14:16:17 GMT):
okay, I see.
rasmustrew (Wed, 31 May 2017 14:17:25 GMT):
hmm i suppose i could just bypass git and download as zip, il try that
lenin.mehedy (Wed, 31 May 2017 14:27:23 GMT):
yeah, sounds good.
BhavishaDawda (Wed, 31 May 2017 20:25:57 GMT):
I am trying to run `Example02` ( fabric/examples/chaincode/java/chaincode_example02) and seeing the following error,
```May 31, 2017 3:36:13 PM org.hyperledger.fabric.shim.ChaincodeBase newPeerClientConnection
INFO: Configuring channel connection to peer.
May 31, 2017 3:36:13 PM org.hyperledger.fabric.shim.ChaincodeBase chatWithPeer
INFO: Connecting to peer.
May 31, 2017 3:36:13 PM io.grpc.internal.TransportSet$1 call
INFO: Created transport io.grpc.netty.NettyClientTransport@26391a21(/127.0.0.1:7051) for /127.0.0.1:7051
May 31, 2017 3:36:13 PM org.hyperledger.fabric.shim.ChaincodeBase chatWithPeer
INFO: Registering as 'chaincode-example-2' ... sending REGISTER
May 31, 2017 3:36:13 PM io.grpc.internal.TransportSet$TransportListener transportShutdown
INFO: Transport io.grpc.netty.NettyClientTransport@26391a21(/127.0.0.1:7051) for /127.0.0.1:7051 is being shutdown
May 31, 2017 3:36:13 PM io.grpc.internal.TransportSet$TransportListener transportTerminated
INFO: Transport io.grpc.netty.NettyClientTransport@26391a21(/127.0.0.1:7051) for /127.0.0.1:7051 is terminated
May 31, 2017 3:36:13 PM org.hyperledger.fabric.shim.ChaincodeBase$1 onError
SEVERE: Unable to connect to peer server: INTERNAL```
The Fabric is running,
```CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2b6b5a46851b dev-peer1.org2.example.com-mycc-1.0 "chaincode -peer.a..." 21 minutes ago Up 21 minutes dev-peer1.org2.example.com-mycc-1.0
fd2f83dd79ca dev-peer0.org1.example.com-mycc-1.0 "chaincode -peer.a..." 21 minutes ago Up 21 minutes dev-peer0.org1.example.com-mycc-1.0
d20c242c1afe dev-peer0.org2.example.com-mycc-1.0 "chaincode -peer.a..." 21 minutes ago Up 21 minutes dev-peer0.org2.example.com-mycc-1.0
f4db47edb01b hyperledger/fabric-peer "/bin/bash -c './s..." 22 minutes ago Up 22 minutes cli
f134a53f8ccf hyperledger/fabric-peer "peer node start -..." 22 minutes ago Up 22 minutes 0.0.0.0:8051->7051/tcp, 0.0.0.0:8054->7053/tcp peer1.org1.example.com
3fa23773c7b4 hyperledger/fabric-peer "peer node start -..." 22 minutes ago Up 22 minutes 0.0.0.0:10051->7051/tcp, 0.0.0.0:10053->7053/tcp peer1.org2.example.com
27f6fd0dfce1 hyperledger/fabric-peer "peer node start -..." 22 minutes ago Up 22 minutes 0.0.0.0:9051->7051/tcp, 0.0.0.0:9053->7053/tcp peer0.org2.example.com
d03377b735b5 hyperledger/fabric-peer "peer node start -..." 22 minutes ago Up 22 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
0938c1177692 hyperledger/fabric-orderer "orderer" 22 minutes ago Up 22 minutes 0.0.0.0:7050->7050/tcp orderer.example.com```
rickr (Wed, 31 May 2017 20:28:25 GMT):
Java CC is not supported
BhavishaDawda (Wed, 31 May 2017 20:31:22 GMT):
Java CC is not supproted for fabric 1.0?
BhavishaDawda (Wed, 31 May 2017 20:31:22 GMT):
Java CC is not supported for fabric 1.0?
BhavishaDawda (Wed, 31 May 2017 20:31:29 GMT):
Is it supported in 0.6?
BhavishaDawda (Wed, 31 May 2017 20:31:29 GMT):
Can I use 0.6 for Java CC?
BhavishaDawda (Wed, 31 May 2017 20:31:29 GMT):
~Can I use 0.6 for Java CC?~ - Following discussion on https://chat.hyperledger.org/channel/fabric?msg=KjL3pfAwGZtgp7rXr
chrism28 (Wed, 31 May 2017 23:50:39 GMT):
@rasmustrew I had the same "Invalid Argument" error. I was using a GitBash shell under Windows. Apparently the Windows version of Git is the problem. I installed Git under cygwin64 and used it from a cygwin shell. That allowed me to clone the repository.
aaronzheng (Thu, 01 Jun 2017 01:57:42 GMT):
hi all, i have installed and instantiated my chaincode. when i use 'thenApply' to query after i invoke the channel.sendTransaction, i got nothing. in the debug mode, i still can't invoke the 'theApply' . any idea of it?
aaronzheng (Thu, 01 Jun 2017 01:58:15 GMT):
Message Attachments
tomsorgie (Thu, 01 Jun 2017 02:29:47 GMT):
Has joined the channel.
kelvinzhong (Thu, 01 Jun 2017 08:32:49 GMT):
@rickr hi, i found that in the e2e test, the endorsement policy is using the syntax like n of n, but as I know it is like AND OR expression. Is both syntax could work? or currently policy is all unified to n of n syntax?
kelvinzhong (Thu, 01 Jun 2017 08:44:48 GMT):
okay i found the readme.me has description for it
MDBijman (Thu, 01 Jun 2017 09:09:21 GMT):
Has joined the channel.
rasmustrew (Thu, 01 Jun 2017 09:16:17 GMT):
@chrism28 Thanks!
ccorley (Thu, 01 Jun 2017 12:35:37 GMT):
Has joined the channel.
slugmandrew (Thu, 01 Jun 2017 13:11:21 GMT):
Has joined the channel.
sqwerrels (Thu, 01 Jun 2017 14:03:40 GMT):
Has joined the channel.
sqwerrels (Thu, 01 Jun 2017 14:20:42 GMT):
Hi, I am trying to set up the fabric-sdk-java in eclipse and I'm running into an issue while trying to run the End2EndIT JUnit, where I get the message
```2017-06-01 14:18:46,259 ERROR Channel:419 - org.hyperledger.fabric.sdk.exception.ProposalException: Join peer to channel foo failed. Status FAILURE, details: Sending proposal to peer0.org1.example.com failed because of gRPC failure=Status{code=UNIMPLEMENTED, description=unknown service protos.Endorser, cause=null}
org.hyperledger.fabric.sdk.exception.ProposalException: Join peer to channel foo failed. Status FAILURE, details: Sending proposal to peer0.org1.example.com failed because of gRPC failure=Status{code=UNIMPLEMENTED, description=unknown service protos.Endorser, cause=null}```
sqwerrels (Thu, 01 Jun 2017 14:21:22 GMT):
I've tried recloning the fabric-sdk-java, and if I try this out on a different computer, I don't have this issue, anyone know what this means?
sqwerrels (Thu, 01 Jun 2017 14:44:25 GMT):
Scratch the last question! I had an issue with peer when i was trying some things out in a different location, so I re-cloned fabric-sample and ran the network setup to fix the peer issue
sqwerrels (Thu, 01 Jun 2017 15:52:04 GMT):
So, I'm still trying to run End2EndIT.java test and the code just gets stuck at ```channel.sendTransaction(successful, orderers).thenApply(transactionEvent -> {
waitOnFabric(0);
assertTrue(transactionEvent.isValid()); // must be valid to be here.
out("Finished instantiate transaction with transaction id %s", transactionEvent.getTransactionID());
try {``` and while it manages to preform sendTransaction and return sret fine, it doesn't do the thenApply and doesn't enter the brackets to assertTrue
sqwerrels (Thu, 01 Jun 2017 15:52:54 GMT):
Any one have an idea why it is stopping here?
rohitbordia (Thu, 01 Jun 2017 16:44:10 GMT):
has anyone received 404 with v1.0.0-Alpha2
rohitbordia (Thu, 01 Jun 2017 16:44:32 GMT):
enrol request fails with 404
rickr (Thu, 01 Jun 2017 20:01:06 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=o97w84vSxmLXvn7GH) Check orderer and peer logs for errors. At that point the sdk is waiting for an event .. via the event hub that the transaction has been committed.
rickr (Thu, 01 Jun 2017 20:03:54 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=gEMZrQpJZtACYv2iQ) @rohitbordia No other message along with that? Look at the ca logs for any errors
sqwerrels (Thu, 01 Jun 2017 20:50:19 GMT):
hey rick I was checking the logs for /tcp peer1.org1.example.com in fabric peer and I got
```2017-06-01 20:47:18.830 UTC [ConnProducer] NewConnection -> ERRO 3f3 Failed connecting to orderer:7050 , error: grpc: timed out when dialing
2017-06-01 20:47:18.830 UTC [deliveryClient] connect -> ERRO 3f4 Failed obtaining connection: Could not connect to any of the endpoints: [orderer:7050]
2017-06-01 20:47:22.865 UTC [gossip/gossip] Gossip -> WARN 3f5 Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
2017-06-01 20:47:27.866 UTC [gossip/gossip] Gossip -> WARN 3f6 Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
2017-06-01 20:47:32.868 UTC [gossip/gossip] Gossip -> WARN 3f7 Failed obtaining gossipChannel of [116 101 115 116 99 104 97 105 110 105 100] aborting
```
sqwerrels (Thu, 01 Jun 2017 20:50:47 GMT):
Any thoughts?
karumbas (Thu, 01 Jun 2017 21:14:07 GMT):
hey @rickr @here any idea why am getting this error
Caused by: io.grpc.StatusRuntimeException: UNIMPLEMENTED: unknown service protos.Events
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:392)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:428)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:514)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:431)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:546)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:152)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
karumbas (Thu, 01 Jun 2017 21:14:07 GMT):
hey @rickr @here any idea why am getting this error
```Caused by: io.grpc.StatusRuntimeException: UNIMPLEMENTED: unknown service protos.Events
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:392)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:428)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:514)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:431)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:546)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:152)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```
MikeGardiner (Fri, 02 Jun 2017 13:01:38 GMT):
Has joined the channel.
SandySun2000 (Fri, 02 Jun 2017 19:42:07 GMT):
Has joined the channel.
SahilKapoor (Fri, 02 Jun 2017 20:42:04 GMT):
Has joined the channel.
SahilKapoor (Fri, 02 Jun 2017 20:43:23 GMT):
@here How can we create peers with sdk. I want to create in a new VM where default fabric network i.e 2 peers and orderer service are not running
SahilKapoor (Fri, 02 Jun 2017 20:43:39 GMT):
Any guidance would really help
ffilozov1 (Fri, 02 Jun 2017 21:51:52 GMT):
Has joined the channel.
caiqiming (Mon, 05 Jun 2017 01:17:42 GMT):
Has joined the channel.
Willson (Mon, 05 Jun 2017 09:16:30 GMT):
hello @rickr when i send a install request with my own chaincode to peers, it returns an error:
` [ERROR] (Sending proposal to peer0 failed because of gRPC failure=Status{code=INTERNAL, description=null, cause=io.netty.handler.codec.http2.Http2Exception$StreamException: Header size exceeded max allowed size (8192)}) [2017-06-05 17:01:30][org.hyperledger.fabric.sdk.Channel] ` ,
but it working fine with the default chaincode of the sdk, anything wrong with this?
FengChen_1982 (Mon, 05 Jun 2017 09:31:19 GMT):
@sqwerrels where do you get the End2EndIT.java?
Willson (Mon, 05 Jun 2017 09:52:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=CMWbNHRKuWYZzwrKG) just ignore it. i was forgeting to set the UserContext
HansDeLeenheer (Mon, 05 Jun 2017 11:39:26 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=WkDDP5ASaWTHSmd3p) @BhavishaDawda please upvote https://jira.hyperledger.org/browse/FAB-4072 for 'experimental' Java CC
RezwanKabir (Mon, 05 Jun 2017 13:13:05 GMT):
Has joined the channel.
sqwerrels (Mon, 05 Jun 2017 14:18:03 GMT):
@FengChen_1982 https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java
jtsiros (Mon, 05 Jun 2017 20:40:11 GMT):
Has joined the channel.
jtsiros (Mon, 05 Jun 2017 20:40:36 GMT):
Hello! Not sure if anyone is able to help, but would there be any reason why sendTransaction on a channel object (using Java SDK) would block indefinitely? After the transaction proposal comes back, sending the transaction makes it to the orderer and subsequently the peers, but the SDK seems to block on this call: `channel.sendTransaction(pRes, channel.getOrderers()).get()`
```
2017-06-05 20:37:23.645 UTC [orderer/common/deliver] Handle -> DEBU f26 Delivering block for (0xc420820100) channel: mychannel
2017-06-05 20:37:23.645 UTC [fsblkstorage] newBlockfileStream -> DEBU f2a newBlockfileStream(): filePath=[/var/hyperledger/production/orderer/chains/mychannel/blockfile_000000], startOffset=[54775]
2017-06-05 20:37:23.646 UTC [fsblkstorage] nextBlockBytesAndPlacementInfo -> DEBU f2b Remaining bytes=[6069], Going to peek [8] bytes
2017-06-05 20:37:23.646 UTC [fsblkstorage] nextBlockBytesAndPlacementInfo -> DEBU f2c Returning blockbytes - length=[6067], placementInfo={fileNum=[0], startOffset=[54775], bytesOffset=[54777]}
2017-06-05 20:37:23.647 UTC [orderer/common/deliver] Handle -> DEBU f2d Delivering block for (0xc4201f8200) channel: mychannel
jtsiros (Mon, 05 Jun 2017 20:44:41 GMT):
I'm using the e2e_cli example that's included in the code base
jtsiros (Mon, 05 Jun 2017 20:45:53 GMT):
I've also configured the event hub location to receive the event that the SDK is expecting: ``` c.addEventHub(client.newEventHub(PEER0, PEER0_EH_LOCATION));
c.addEventHub(client.newEventHub(PEER1, PEER1_EH_LOCATION));```
eddie.allen (Mon, 05 Jun 2017 20:51:28 GMT):
Has left the channel.
SandySun2000 (Mon, 05 Jun 2017 20:51:56 GMT):
I got the problem when I run docker ps
Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.22)
SandySun2000 (Mon, 05 Jun 2017 20:53:26 GMT):
Install docker-machine is the only solution?
sqwerrels (Mon, 05 Jun 2017 21:22:43 GMT):
@jtsiros Are you on the version of the code that is on the github currently or on v1.0.0Alpha2
jtsiros (Mon, 05 Jun 2017 21:23:28 GMT):
latest - pulled master 4 days ago
sqwerrels (Mon, 05 Jun 2017 21:23:42 GMT):
Try setting the commit back to v1.0.0Alpha2
jtsiros (Mon, 05 Jun 2017 21:23:43 GMT):
commit `a01b2f93081c68def7fa960acbb0c3ff60ce1c79`
sqwerrels (Mon, 05 Jun 2017 21:23:47 GMT):
If you check the docker logs
sqwerrels (Mon, 05 Jun 2017 21:24:00 GMT):
you will likely see grpc is denied on orderer:7050
sqwerrels (Mon, 05 Jun 2017 21:24:42 GMT):
commit `dec17727ddb6b269f8fb30930e10d89bc185225f`
jtsiros (Mon, 05 Jun 2017 21:25:42 GMT):
Ok, i'll checkout that commit and try again
jtsiros (Mon, 05 Jun 2017 21:32:38 GMT):
@sqwerrels what about the java-sdk? Is latest from master OK?
jtsiros (Mon, 05 Jun 2017 21:34:30 GMT):
unless you meant both fabric and the sdk for Alpha 2
rohitbordia (Mon, 05 Jun 2017 21:59:32 GMT):
started working with alpha 2: I see below error
rohitbordia (Mon, 05 Jun 2017 21:59:33 GMT):
Failed connecting to orderer:7050 , error: grpc: timed out when dialing
peer0.org1.example.com | 2017-06-05 21:58:53.385 UTC [deliveryClient] connect -> ERRO 5c4 Failed obtaining connection: Could not connect to any of the endpoints: [orderer:7050]
rohitbordia (Mon, 05 Jun 2017 22:02:56 GMT):
is this message ok?
rohitbordia (Mon, 05 Jun 2017 22:09:21 GMT):
alpha2 : Channel:2254 - Channel foo successful sent to Orderer transaction id and the java code hangs here
jtsiros (Mon, 05 Jun 2017 22:38:38 GMT):
@sqwerrels reverting to Alpha2 fixed the issue, thanks!
jtsiros (Mon, 05 Jun 2017 22:43:43 GMT):
If I query transaction by Transaction ID, is there a way I can pull out the data from `TransactionInfo`? ex `chain.queryTransactionByID(dataHash.getTxnID());`
chrism28 (Mon, 05 Jun 2017 23:33:02 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=vBe6EHah2NAepCpP9) @szoghybe Thanks for the setup guides they were most helpful. FYI: I have found a fix for the `os.detected.classifier` issue in pom.xml. Just install the os-maven plugin, It's detailed here: https://github.com/trustin/os-maven-plugin#issues-with-eclipse-m2e-or-other-ides
FengChen_1982 (Tue, 06 Jun 2017 08:09:46 GMT):
@here I want to start testing the fabric-java-sdk, should I use 1.0.0 alpha1 or 1.0.0 alpha environment?
aaronzheng (Tue, 06 Jun 2017 08:35:50 GMT):
i have tested e2e with fabric-alpha2 and fabric-java-sdk-appha2. to me, alpha2 are fine.
FengChen_1982 (Tue, 06 Jun 2017 09:08:17 GMT):
Great, thanks so much.
SandySun2000 (Tue, 06 Jun 2017 14:33:47 GMT):
When I run sample tests and issue 'mvn package' I got the following error.
SandySun2000 (Tue, 06 Jun 2017 14:33:59 GMT):
Running org.hyperledger.fabric.sdk.ChannelTest
2017-06-06 14:18:47,997 WARN SampleStore:75 - Could not find the file "/home/ibmadmin/test.properties"
2017-06-06 14:18:47,997 WARN SampleStore:75 - Could not find the file "/home/ibmadmin/test.properties"
java.io.NotSerializableException: org.hyperledger.fabric.sdk.TestHFClient$1
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at org.hyperledger.fabric.sdkintegration.SampleUser.saveState(SampleUser.java:147)
at org.hyperledger.fabric.sdkintegration.SampleUser.setEnrollment(SampleUser.java:201)
at org.hyperledger.fabric.sdk.TestHFClient.newInstance(TestHFClient.java:51)
at org.hyperledger.fabric.sdk.ChannelTest.setupClient(ChannelTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
2017-06-06 14:18:48,000 DEBUG HFClient:272 - Setting user context to MSPID: testMSPID? user: someTestUSER
SandySun2000 (Tue, 06 Jun 2017 14:34:42 GMT):
but my test.properties file was there
SandySun2000 (Tue, 06 Jun 2017 14:34:44 GMT):
/home/ibmadmin
ibmadmin@blockchain:~$ ls -ltr
total 1600
drwxr-xr-x 2 ibmadmin ibmadmin 4096 Apr 22 2016 Videos
drwxr-xr-x 2 ibmadmin ibmadmin 4096 Apr 22 2016 Templates
drwxr-xr-x 2 ibmadmin ibmadmin 4096 Apr 22 2016 Public
drwxr-xr-x 2 ibmadmin ibmadmin 4096 Apr 22 2016 Pictures
drwxr-xr-x 2 ibmadmin ibmadmin 4096 Apr 22 2016 Music
drwxr-xr-x 2 ibmadmin ibmadmin 4096 Apr 22 2016 Downloads
drwxr-xr-x 2 ibmadmin ibmadmin 4096 Apr 22 2016 Documents
-rw------- 1 root root 8 Apr 25 2016 x11vnc.pass
drwxr-xr-x 2 ibmadmin ibmadmin 4096 Apr 28 2016 Desktop
-rw-r--r-- 1 root root 1595408 May 18 18:30 get-pip.py
-rw-rw-r-- 1 ibmadmin ibmadmin 802 Jun 6 10:18 test.properties
SandySun2000 (Tue, 06 Jun 2017 14:34:56 GMT):
any idea what's the cause?
sqwerrels (Tue, 06 Jun 2017 15:33:34 GMT):
The warning about the test properties isn't the error, thats just if you wanted to change properties in the code
sqwerrels (Tue, 06 Jun 2017 15:33:51 GMT):
Your error lies in that your testHFClient is not serializable
sqwerrels (Tue, 06 Jun 2017 15:34:18 GMT):
Check your classes again and see if any of them are throwing errors
pvrbharg (Tue, 06 Jun 2017 16:56:52 GMT):
Has joined the channel.
pvrbharg (Tue, 06 Jun 2017 18:09:12 GMT):
@rohitbordia This very same issue was reported previously under https://jira.hyperledger.org/browse/FAB-4204
rohitbordia (Tue, 06 Jun 2017 20:50:24 GMT):
thanks
rickr (Tue, 06 Jun 2017 21:33:56 GMT):
Current commit levels are passing. Alpha2 SDK tag was working with apha2 fabric no hang. That JIRA if memory serves correct was due to a change in fabric and then a fix in fabric. There is no guarantee of mixing current code with alpha2 levels assuming that's what's being done.
lenin.mehedy (Wed, 07 Jun 2017 00:57:36 GMT):
@rickr Any idea when (or whether) Java CC will be supported?
rickr (Wed, 07 Jun 2017 04:01:36 GMT):
Message Attachments
rickr (Wed, 07 Jun 2017 04:01:42 GMT):
@sanchezl Fairly certain it did not make the cut for V1.0 not even to make it easy to enable.
rickr (Wed, 07 Jun 2017 04:03:46 GMT):
BTW AFAIK @sanchezl I think really got it working so not his fault.
bluefireH (Wed, 07 Jun 2017 06:31:18 GMT):
Has joined the channel.
mpigmans (Wed, 07 Jun 2017 07:45:10 GMT):
Has joined the channel.
mpigmans (Wed, 07 Jun 2017 07:54:41 GMT):
Hey, when running the End2EndIT test I get the following message, but all tests do pass;
```Jun 07, 2017 9:42:54 AM org.hyperledger.fabric.sdk.Chain getGenesisBlock
WARNING: Bad deliver expected status 200 got 404, Chain bar
```
Can I just ignore this warning, or does it indicate a problem with my setup?
zupan (Wed, 07 Jun 2017 10:30:40 GMT):
Hello, I'm running e2e sdk test and In the code I see java cc included, but docker images are go based. How could I run java cc?
zupan (Wed, 07 Jun 2017 10:32:03 GMT):
Also, I'm aware of the java cc being disabled in alpha2, but what does this really means for the usability in the timeframe of next two months?
zupan (Wed, 07 Jun 2017 10:33:33 GMT):
Would you recommend rewrite in GO or stay on java? All of this is for experimental purposes, but it is still important that I get it to work.
zupan (Wed, 07 Jun 2017 10:35:26 GMT):
Any input is appreciated event personal preferences on is it easier to develop in go or java (from the perspective of the project status, not language based :) ).
mastersingh24 (Wed, 07 Jun 2017 11:17:50 GMT):
@zupan -
- Java chaincode will likely make a comeback in the post 1.0.0 timeframe - so probably over the next couple of months
- technically there's no real difference in complexity between Go and Java chaincode - it's more of a language preference
- community wise there's more experience with Go chaincode at this point
- you might also want to take a look at the Hyperledger Composer project as well - it makes developing fabric applications very easy - https://www.hyperledger.org/projects/composer
zupan (Wed, 07 Jun 2017 11:29:19 GMT):
@mastersingh24 thank you for a detailed overview.
mastersingh24 (Wed, 07 Jun 2017 12:06:10 GMT):
sure thing
pvrbharg (Wed, 07 Jun 2017 16:31:49 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=MX2ccZBhnFvJ4mwPT) @rickr Is your response applicable to fabric-sdk-java? We can replicate the hang issue on multiple work stations at will in our environment - alpha2 SDK and alpha2 fabric. We uploaded a set of additional debug traces to the reported issue. This is holding us up as of now and the use case worked previously for our customer. Please clarify and as we know - it needs to work in our environment in the end. Thanks.
rickr (Wed, 07 Jun 2017 16:40:06 GMT):
Whats the scenario .. e2e hanging ? Something you developed hangs ?
rohitbordia (Wed, 07 Jun 2017 18:10:03 GMT):
@rickr : Nothing we developed which hangs. We switched to alpha2 and E2E test does not work hangs and we have to kill
rickr (Wed, 07 Jun 2017 18:16:39 GMT):
simple direct connect ? nothing like a load balancer ?
rickr (Wed, 07 Jun 2017 18:17:48 GMT):
We have noticed hangs with LB in the middle
rickr (Wed, 07 Jun 2017 18:18:28 GMT):
Fix coming that implements a grpc keep alive
pvrbharg (Wed, 07 Jun 2017 18:51:36 GMT):
@rickr out-of-box ibm sample as is, running in ibm recommended fabric-sdk-java sandbox. alpha2 refresh and no longer works. Prior to refresh - the same sample worked for this customer team on multiple machines. We are using e2e out-of-box sample as a kind of IVT validation/quick check to make sure we are on stable platform... Hope this helps.
rickr (Wed, 07 Jun 2017 20:23:01 GMT):
Anything on orderer or peer sides ? client side env ORG_HYPERLEDGER_FABRIC_SDK_LOGLEVEL set to TRACE can show some diagnostic
rickr (Wed, 07 Jun 2017 20:23:40 GMT):
gut tells me you need to look an errors on the peer or orderer
rohitbordia (Wed, 07 Jun 2017 22:16:21 GMT):
@rickr: the only thing, I see in docker logs : UTC [ConnProducer] NewConnection -> ERRO 5ee Failed connecting to orderer:7050 , error: grpc: timed out when dialing
rickr 3:18 PM
rickr (Thu, 08 Jun 2017 11:19:48 GMT):
Pretty good bet that's your issue.
rickr (Thu, 08 Jun 2017 11:22:18 GMT):
If you're running the untouched docker-compose not sure why you would be getting that. I assume you did a docker ps -a see that orderer is running.
thoduerr (Thu, 08 Jun 2017 13:33:33 GMT):
Has joined the channel.
rohitbordia (Thu, 08 Jun 2017 14:18:47 GMT):
yes , I see logs also its working fine
rohitbordia (Thu, 08 Jun 2017 14:19:23 GMT):
curiosity is , we ran in 3 machines and all have same issues
KouichiUme (Thu, 08 Jun 2017 15:33:25 GMT):
Has joined the channel.
pvrbharg (Thu, 08 Jun 2017 19:20:45 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=tMG23btYZXWBcPb8u) @rohitbordia [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=zxzDkJRKyxnF2d76y) @rickr In an apples to oranges comparison - on the same alpha2 driver level - we have not seen this UTC [ConnProducer] NewConnection -> ERRO 5ee Failed connecting to orderer:7050 , error: grpc: timed out when dialing with Go sandbox on my own laptop - just fyi
pvrbharg (Thu, 08 Jun 2017 19:26:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=zxzDkJRKyxnF2d76y) @rickr So would the suggestion be to increase grpc time out tunable parameter? Network latency can be unknown and defaults may not be good for every setting. Should we look into network insights - as to why timing out [increase timeout param or open a firewall or whatever else - domain of wireshark?]
rickr (Thu, 08 Jun 2017 19:41:27 GMT):
Maybe ask on the fabric forum .. You while its up and running docker exec into a peer .
you'll need to do an apt-get to get the package that has ping .. and then you could try to see if you can ping the orderer or get telnet and see if you can get to port 7050 .. just some ideas
rickr (Thu, 08 Jun 2017 19:41:27 GMT):
Maybe ask on the fabric forum .. You can while its up and running docker exec into a peer .
you'll need to do an apt-get to get the package that has ping .. and then you could try to see if you can ping the orderer or get telnet and see if you can get to port 7050 .. just some ideas
kontos (Thu, 08 Jun 2017 19:45:23 GMT):
Has joined the channel.
jyg007 (Thu, 08 Jun 2017 20:30:39 GMT):
Has joined the channel.
bh4rtp (Fri, 09 Jun 2017 01:11:57 GMT):
@here ···Running the unit tests
To run the unit tests, please use mvn test or mvn install which will run the unit tests and build the jar file. You must be running a local peer and orderer to be able to run the unit tests.···
the doc says running a local peer, does this mean run `src/test/fixture/sdkintegration#docker-compose up` first?
bh4rtp (Fri, 09 Jun 2017 01:11:57 GMT):
@here ```Running the unit tests
To run the unit tests, please use mvn test or mvn install which will run the unit tests and build the jar file. You must be running a local peer and orderer to be able to run the unit tests.```
the doc says running a local peer, does this mean run `src/test/fixture/sdkintegration#docker-compose up` first?
cbf (Fri, 09 Jun 2017 01:12:50 GMT):
@bh4rtp do you want a full run or targeted?
cbf (Fri, 09 Jun 2017 01:13:26 GMT):
oh sorry, you want @rickr
cbf (Fri, 09 Jun 2017 01:13:39 GMT):
I didn't know what channel I was in;-)
bh4rtp (Fri, 09 Jun 2017 01:13:53 GMT):
never mind.
bh4rtp (Fri, 09 Jun 2017 01:19:04 GMT):
@rickr based on the eclipse neon.2, i did the following steps:
1. build latest fabric and fabric-ca. examples/e2e_cli runs ok.
2. run docker-compose -f src/test/fixture/sdkintegration/docker-compose.yaml up
3. in the eclipse neon.2, run maven clean and maven install
but there are a number of errors remain.
torresjeff (Fri, 09 Jun 2017 02:38:45 GMT):
Has joined the channel.
lenin.mehedy (Fri, 09 Jun 2017 05:09:07 GMT):
@rickr What would be the process to enable TLS for both CA and orderers?
lenin.mehedy (Fri, 09 Jun 2017 05:10:03 GMT):
@rickr I did the following to enable TLS and CA:
1. enable TLS on ca
```
ca0:
image: hyperledger/fabric-ca${IMAGE_TAG_FABRIC_CA}
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/bbb1df5d64a2477f94c718a384db675cf23ac22364b157a492bf2a952bf26be2_sk
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/bbb1df5d64a2477f94c718a384db675cf23ac22364b157a492bf2a952bf26be2_sk -b admin:adminpw ${ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS} --tls.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --tls.keyfile /etc/hyperledger/fabric-ca-server-config/bbb1df5d64a2477f94c718a384db675cf23ac22364b157a492bf2a952bf26be2_sk -d'
volumes:
- ./e2e-2Orgs/channel/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config:ro
container_name: ca0.org1.example.com
ca1:
image: hyperledger/fabric-ca${IMAGE_TAG_FABRIC_CA}
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/f32d52f74d7607ab296e612c7dd7fa09cba597b1cb8b7c3ad81742205d5f0666_sk
ports:
- "8054:7054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/f32d52f74d7607ab296e612c7dd7fa09cba597b1cb8b7c3ad81742205d5f0666_sk -b admin:adminpw ${ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS} --tls.certfile /etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem --tls.keyfile /etc/hyperledger/fabric-ca-server-config/f32d52f74d7607ab296e612c7dd7fa09cba597b1cb8b7c3ad81742205d5f0666_sk -d'
volumes:
- ./e2e-2Orgs/channel/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config:ro
container_name: ca0.org2.example.com
```
2. enable TLS on orderers
```
orderer.example.com:
container_name: orderer.example.com
image: hyperledger/fabric-orderer${IMAGE_TAG_FABRIC}
environment:
- ORDERER_GENERAL_LOGLEVEL=debug
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/orderer.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer/msp
#- ORDERER_GENERAL_TLS_ENABLED=${ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS}
- ORDERER_GENERAL_TLS_ENABLED=true
- ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/msp/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/msp/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/msp/orderer/tls/ca.crt]
# - ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/msp/orderer/tls/ca.crt, /etc/hyperledger/msp/peer0Org1/tls/ca.crt, /etc/hyperledger/msp/peer1Org1/tls/ca.crt, /etc/hyperledger/msp/peer0Org2/tls/ca.crt, /etc/hyperledger/msp/peer1Org2/tls/ca.crt]
- GRPC_TRACE=all=true,
- GRPC_VERBOSITY=debug
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
volumes:
- ./e2e-2Orgs/channel:/etc/hyperledger/configtx:ro
- ./e2e-2Orgs/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/:/etc/hyperledger/msp/orderer:ro
ports:
- 7050:7050
```
Then I have set ``` defaultProperty(INTEGRATIONTESTSTLS, "yes");``` in TestConfig.
lenin.mehedy (Fri, 09 Jun 2017 05:14:47 GMT):
@rickr However I am getting some SSL error as below:
```
15:13:54.164 [grpc-default-worker-ELG-2-2] DEBUG io.netty.handler.codec.http2.Http2ConnectionHandler - [id: 0xa6c533e0, L:/0:0:0:0:0:0:0:1:60122 ! R:localhost/0:0:0:0:0:0:0:1:7051] Sending GOAWAY failed: lastStreamId '0', errorCode '0', debugData ''. Forcing shutdown of the connection.
javax.net.ssl.SSLException: SSLEngine closed already
at io.netty.handler.ssl.SslHandler.wrap(...)(Unknown Source)
15:13:54.168 [com.ibm.blueaudit.fabric.deploy.DeployApp.main()] ERROR org.hyperledger.fabric.sdk.Channel - Sending proposal to peer0.org1.example.com failed because of gRPC failure=Status{code=UNAVAILABLE, description=null, cause=io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 000000040000000000000004080000000000000efff1
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1057)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:748)
}
```
kelvinzhong (Fri, 09 Jun 2017 07:50:43 GMT):
Message Attachments
kelvinzhong (Fri, 09 Jun 2017 07:50:45 GMT):
Message Attachments
kelvinzhong (Fri, 09 Jun 2017 07:51:32 GMT):
seems the coding in such a hurry :) @rickr
kelvinzhong (Fri, 09 Jun 2017 07:53:04 GMT):
Message Attachments
kelvinzhong (Fri, 09 Jun 2017 07:53:56 GMT):
also here should provide List
chenxuan (Fri, 09 Jun 2017 08:29:25 GMT):
instantiate
chenxuan (Fri, 09 Jun 2017 08:29:31 GMT):
Sending proposal to peer1.org1.example.com failed because of gRPC failure=Status{code=UNKNOWN, description=failed to obtain cds for cc_go_1 - could not find chaincode with name 'cc_go_1', cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: failed to obtain cds for cc_go_1 - could not find chaincode with name 'cc_go_1'
kelvinzhong (Fri, 09 Jun 2017 08:35:53 GMT):
description=failed to obtain cds for cc_go_1 - could not find chaincode with name 'cc_go_1', cause=null
kelvinzhong (Fri, 09 Jun 2017 08:36:23 GMT):
base on the message, u haven't install the chaincode successfully
kelvinzhong (Fri, 09 Jun 2017 08:39:00 GMT):
check your path to your chaincode is correct
kelvinzhong (Fri, 09 Jun 2017 08:39:00 GMT):
check the path of your chaincode file which used for installing the chaincode
chenxuan (Fri, 09 Jun 2017 08:48:55 GMT):
i see the container have been started
chenxuan (Fri, 09 Jun 2017 08:53:30 GMT):
Successful install proposal response Txid: f7a14ff6cf60152562e3a1f69d70adc037a6624c360ac1b00de3e796911bba5f from peer peer0.org1.example.com
Successful install proposal response Txid: f7a14ff6cf60152562e3a1f69d70adc037a6624c360ac1b00de3e796911bba5f from peer peer1.org1.example.com
Succesful instantiate proposal response Txid: 74a79ea46b763d05e5d3c7f837495e07411408f2e605cc363ef42e09cf1fe8fe from peer peer0.org1.example.com
Succesful instantiate proposal response Txid: 74a79ea46b763d05e5d3c7f837495e07411408f2e605cc363ef42e09cf1fe8fe from peer peer1.org1.example.com
交易开始时间:1496998313008
chenxuan (Fri, 09 Jun 2017 08:56:26 GMT):
the chaincode install,instantiate is ok
chenxuan (Fri, 09 Jun 2017 08:56:46 GMT):
but when i start to take transaction the error occur
kelvinzhong (Fri, 09 Jun 2017 09:50:47 GMT):
is the chaincode container still functional when you execute the transaction ?
kelvinzhong (Fri, 09 Jun 2017 09:51:06 GMT):
or the name of the chaincode container is "cc_go_1"?
chenxuan (Fri, 09 Jun 2017 10:08:13 GMT):
yes
kelvinzhong (Fri, 09 Jun 2017 11:00:25 GMT):
that's weird, i'm not sure what's the scenario
MDBijman (Fri, 09 Jun 2017 11:28:12 GMT):
In the SampleOrg.java file used in the end-to -nd tests there's a peerAdmin and an admin. What is the difference between the two?
MDBijman (Fri, 09 Jun 2017 11:28:12 GMT):
In the SampleOrg.java file used in the end-to-end tests there's a peerAdmin and an admin. What is the difference between the two?
chenxuan (Fri, 09 Jun 2017 11:34:40 GMT):
@kelvinzhong the e2e channel.sendTransaction(successful, orderers).thenApply(transactionEvent -> {
chenxuan (Fri, 09 Jun 2017 11:34:52 GMT):
successful
chenxuan (Fri, 09 Jun 2017 11:34:53 GMT):
?
chenxuan (Fri, 09 Jun 2017 11:34:58 GMT):
parameter is?
chenxuan (Fri, 09 Jun 2017 11:41:50 GMT):
the e2e channel.sendTransaction(successful, orderers).thenApply(transactionEvent -> {
chenxuan (Fri, 09 Jun 2017 11:44:12 GMT):
the e2e runChannel method flow the install Instantiate and take transaction but i want to part it
laliux (Fri, 09 Jun 2017 16:15:23 GMT):
Has joined the channel.
MikeGardiner (Fri, 09 Jun 2017 18:21:41 GMT):
Hello Gentlepeople, I just entered an issue in the JIRA FAB-4508 and wanted to kick off some discussion here.
rickr (Fri, 09 Jun 2017 18:29:06 GMT):
Hi Mike - I think it would be better to as much as possible put the discussions in the JIRA itself so it all stays in one place instead of scattered around in this chat. That way we'll always have the full context of decisions in one place
rickr (Fri, 09 Jun 2017 18:44:15 GMT):
Also we are really focused on v1.0 at moment so I hope you understand if we're a little slow in responding on it
jpatchell (Fri, 09 Jun 2017 18:56:06 GMT):
Has joined the channel.
xuanchen (Fri, 09 Jun 2017 23:57:01 GMT):
@rickr can you answer me
rickr (Sat, 10 Jun 2017 08:00:04 GMT):
Missing the question
rickr (Sat, 10 Jun 2017 08:01:25 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=wvqxChMNf8xAyFH2T) look at the `.env` file in the sdkintegration directory
MikeGardiner (Sun, 11 Jun 2017 00:45:39 GMT):
@rickr No worries on keeping the discussion in Jira.
lenin.mehedy (Mon, 12 Jun 2017 00:59:44 GMT):
thanks @rickr Got it working...
kelvinzhong (Mon, 12 Jun 2017 02:47:15 GMT):
hi rickr, i wonder what is the different between the admin and peerAdmin in the e2e test, they seems to be the same...
kelvinzhong (Mon, 12 Jun 2017 02:47:15 GMT):
hi rickr, i wonder what is the different between the admin and peerAdmin in the e2e test, they seems to be the same... @rickr
Mnorberto (Mon, 12 Jun 2017 04:16:45 GMT):
Has joined the channel.
rickr (Mon, 12 Jun 2017 11:16:09 GMT):
With the default policy by configtx peerAdmin can do anything. The rest of the credentials can only invoke chaincode. The admin which would probably be better named as registrar can register additional users that can invoke the chaincode.
dayubian (Mon, 12 Jun 2017 12:21:15 GMT):
@rickr Hi Rickr, I found that, after upgraded to 1.0.0beta, TEST_USER1 could not invoke the chaincode.
rickr (Mon, 12 Jun 2017 12:45:44 GMT):
I think in the End2endIt.java test roughly around line 353 there's a line `client.setUserContext(sampleOrg.getUser(TESTUSER_1_NAME));`
before the move.
Seems to me the user is doing an invoke move there
dayubian (Mon, 12 Jun 2017 13:16:24 GMT):
thanks @rickr Got it.
kelvinzhong (Mon, 12 Jun 2017 15:19:32 GMT):
so the peerAdmin could also register additional user, right? in fact the admin could replaced with the peerAdmin
kelvinzhong (Mon, 12 Jun 2017 15:21:43 GMT):
is the admin an intermediate ca? also the peerAdmin is an intermediate ca but also set as the real admin, so the peerAdmin could do any thing @rickr
kelvinzhong (Mon, 12 Jun 2017 15:21:43 GMT):
is the admin an intermediate ca? also the peerAdmin is an intermediate ca but also set as the real admin, so the peerAdmin could do anything @rickr
rickr (Mon, 12 Jun 2017 15:39:23 GMT):
good question -- Have not tried that :)
WHATISOOP (Tue, 13 Jun 2017 02:30:06 GMT):
Has joined the channel.
kelvinzhong (Tue, 13 Jun 2017 02:43:02 GMT):
well, i have tried that just now, turn out that the peerAdmin could not register a user, and I look into the config file of the admin, it should also have the right to register a peer too, would you please provide a template to register peer in the e2e test? seems the cryptogen tool could not generate the crypto file for the additional peer/orderer
Rachitga (Tue, 13 Jun 2017 08:49:16 GMT):
Has joined the channel.
absingh0 (Tue, 13 Jun 2017 08:59:17 GMT):
Has joined the channel.
adc (Tue, 13 Jun 2017 13:06:57 GMT):
Has joined the channel.
adc (Tue, 13 Jun 2017 13:22:06 GMT):
Hello, where do I get this dependency (import org.hyperledger.fabric.protos.common.Common.Block) from?
adc (Tue, 13 Jun 2017 13:22:22 GMT):
IntelliJ is not able to find it but when I compile using maven it works
rasmustrew (Tue, 13 Jun 2017 13:42:07 GMT):
Hi! Can anyone provide some insight on this error?
2178 [main] DEBUG org.hyperledger.fabric.sdk.Channel - Channel mychannel send proposal to peer peer0.org1.example.com at url grpc://localhost:7051
2179 [main] DEBUG org.hyperledger.fabric.sdk.Peer - peer.sendProposalAsync name: peer0.org1.example.com, url: grpc://localhost:7051
2195 [grpc-default-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler -
----------------OUTBOUND--------------------
[id: 0x8c85cc56, L:/127.0.0.1:60539 - R:localhost/127.0.0.1:7051] SETTINGS: ack=false, settings={ENABLE_PUSH=0, MAX_CONCURRENT_STREAMS=0, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
------------------------------------
2196 [grpc-default-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler -
----------------OUTBOUND--------------------
[id: 0x8c85cc56, L:/127.0.0.1:60539 - R:localhost/127.0.0.1:7051] WINDOW_UPDATE: streamId=0, windowSizeIncrement=983041
------------------------------------
2204 [grpc-default-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler -
----------------OUTBOUND--------------------
[id: 0x8c85cc56, L:/127.0.0.1:60539 - R:localhost/127.0.0.1:7051] GO_AWAY: lastStreamId=0, errorCode=1, length=77, bytes=4669727374207265636569766564206672616d6520776173206e6f742053455454494e47532e204865782064756d7020666f7220666972737420352062797465...
------------------------------------
2207 [grpc-default-worker-ELG-1-2] DEBUG io.netty.handler.codec.http2.Http2ConnectionHandler - [id: 0x8c85cc56, L:/127.0.0.1:60539 - R:localhost/127.0.0.1:7051] Sent GOAWAY: lastStreamId '0', errorCode '1', debugData 'First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002'. Forcing shutdown of the connection.
2209 [main] ERROR org.hyperledger.fabric.sdk.Channel - Sending proposal to peer0.org1.example.com failed because of gRPC failure=Status{code=INTERNAL, description=null, cause=io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002
at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:309)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:217)
at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:401)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Unknown Source)
rasmustrew (Tue, 13 Jun 2017 13:43:05 GMT):
Seems to maybe be related to the order in which the messages arrive? The peer seems to be expecting SETTINGS to arrive first, but instead sees GO_AWAY First?
rickr (Tue, 13 Jun 2017 13:46:54 GMT):
If you are not connecting though a load balancer you can search through the End2xxx samples and remove keepAliveTime statements
rickr (Tue, 13 Jun 2017 13:47:59 GMT):
I think that would address it
rasmustrew (Tue, 13 Jun 2017 13:48:36 GMT):
I am trying to use the End2End samples as a starting point, right now i am attempting to join a single peer to a network. I dont have any keepAliveTime statements anywhere right now.
rasmustrew (Tue, 13 Jun 2017 13:49:03 GMT):
i am running local containers
rickr (Tue, 13 Jun 2017 13:49:24 GMT):
if you're running the end2end and have not changed anything you are running with keepalive
rasmustrew (Tue, 13 Jun 2017 13:51:05 GMT):
i have changed many things :) What i am doing is trying to make the most basic network, 1 ca, 1 orderer, 1 peer, so i am copying the relevant parts from end2end
rasmustrew (Tue, 13 Jun 2017 13:51:24 GMT):
specifically from End2endIT.java
rasmustrew (Tue, 13 Jun 2017 13:52:01 GMT):
i can make a channel just fine, but when i attempt to join the first peer i get this
rasmustrew (Tue, 13 Jun 2017 13:58:21 GMT):
any ideas?
rasmustrew (Tue, 13 Jun 2017 13:58:54 GMT):
chainConfig = new ChannelConfiguration(new File("C:/Users/IBM_ADMIN/Desktop/blockchain_test/channel-artifacts/channel.tx"));
hf = HFClient.createNewInstance();
hf.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
ca = new MyCA();
admin = ca.enrollAdmin();
hf.setUserContext(admin);
Properties ordererProperties = new Properties();
ordererProperties.setProperty("pemFile", "C:/Users/IBM_ADMIN/Desktop/blockchain_test/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca.example.com-cert.pem");
orderer = hf.newOrderer("orderer.example.com", "grpc://localhost:7050", ordererProperties);
Properties peerProperties = new Properties();
peer = hf.newPeer("peer0.org1.example.com", "grpc://localhost:7053", peerProperties);
byte[] signers = hf.getChannelConfigurationSignature(chainConfig, admin);
Channel mychannel = hf.newChannel("mychannel", orderer, chainConfig, signers);
mychannel.joinPeer(peer);
mychannel.initialize();
rasmustrew (Tue, 13 Jun 2017 13:59:05 GMT):
This is the code i am running, anything seem off?
chenxuan (Wed, 14 Jun 2017 03:35:25 GMT):
New channel foo error. StatusValue 400. Status BAD_REQUEST
CarlXK (Wed, 14 Jun 2017 07:59:30 GMT):
@rickr @here 1.0-beta java sdk, invoke SDKUtils.getProposalConsistencySets method sometimes throws exception, but the result from peers are same, and i change the code to below it works
```
public Collection
CarlXK (Wed, 14 Jun 2017 07:59:30 GMT):
@rickr @here 1.0-beta java sdk, invoke SDKUtils.getProposalConsistencySets method sometimes throws exception, but the result from peers are same, and i change the code to below it works
```
public Collection
CarlXK (Wed, 14 Jun 2017 07:59:30 GMT):
@rickr @here 1.0-beta java sdk, invoke SDKUtils.getProposalConsistencySets method sometimes throws exception, but the result from peers are same, and i change the code to below it works
```
public Collection
CarlXK (Wed, 14 Jun 2017 07:59:30 GMT):
@rickr @here 1.0-beta java sdk, invoke SDKUtils.getProposalConsistencySets method sometimes throws exception, but the result from peers are same, and i change the code to below it works, it's a bug?
```
public Collection
CarlXK (Wed, 14 Jun 2017 07:59:30 GMT):
@rickr @jimthematrix @here 1.0-beta java sdk, invoke SDKUtils.getProposalConsistencySets method sometimes throws exception, but the result from peers are same, and i change the code to below it works, it's a bug?
```
public Collection
rickr (Wed, 14 Jun 2017 11:36:18 GMT):
@CarlXK I don't think that's the same thing to cover just the rwsets are identical but if that works for you now ok.
You seem to be the first to report this. I'd would prefer a JIRA with details if you could. How can this be reproduced ?
What is stacktrace ? Can you enable logging and make this happen ? set env var `ORG_HYPERLEDGER_FABRIC_SDK_LOGLEVEL=DEBUG`
rickr (Wed, 14 Jun 2017 11:36:18 GMT):
@CarlXK I don't think that's the same thing to cover just the rwsets are identical but if that works for you now ok.
You seem to be the first to report this. I'd would prefer a JIRA with details if you could. How can this be reproduced ?
What is stacktrace ? Can you enable logging and make this happen ? set env var `ORG_HYPERLEDGER_FABRIC_SDK_LOGLEVEL=DEBUG`
Thanks
CarlXK (Wed, 14 Jun 2017 11:38:11 GMT):
OK, i will enable log debug and submit a JIRA
gauravgiri (Wed, 14 Jun 2017 12:05:31 GMT):
While using fabric-sdk-java with v1.0.0-beta, what is the best practice/method to store the user enrollment keys/certificates in a database store. Currently a utility class SampleStore is provided, which is based on File store.
ada-wang (Wed, 14 Jun 2017 15:21:35 GMT):
Hi All, I'm confused for newChannel's actions in the End2EndIT.java. In Channel Class, I can find queryChannels function. I read the code and test it, it runs well. BUT, after I HFClient.newChannel and shutdown the program, I cannot get the channel object again, SO the persistence of Channel is not implemented yet ??? Thus, how to get the channel created before, we need it to sendTransaction ..😭
svasilyev (Wed, 14 Jun 2017 15:35:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jw6YESrW5XYoEAmFu) @ada-wang
Take a look at End2endAndBackAgainIT.reconstructChannel method
ManjeetGambhir (Wed, 14 Jun 2017 15:41:03 GMT):
@rickr Is there a way that channel can automatically reconnect to fabric ecosystem after restart (orderer went down and comes back up)
rickr (Wed, 14 Jun 2017 16:49:32 GMT):
I think if you get an error and try again it should work. I'm not going to put retry for orderer in the SDK for v1.0 timeline
ManjeetGambhir (Wed, 14 Jun 2017 16:49:44 GMT):
@rickr ok
rickr (Wed, 14 Jun 2017 16:50:08 GMT):
Feel free to create JIRA for an improvement
ManjeetGambhir (Wed, 14 Jun 2017 16:50:18 GMT):
@rickr one more question, can you please suggest me , how to increase sdk endorsement timeout
ManjeetGambhir (Wed, 14 Jun 2017 16:51:05 GMT):
@rickr Now sending big # of trades for chaincode endorsement , it's getting timeout
rickr (Wed, 14 Jun 2017 16:56:26 GMT):
On the request is there a setProposalWaitTime ?
larsf (Wed, 14 Jun 2017 20:59:35 GMT):
Has joined the channel.
ada-wang (Thu, 15 Jun 2017 00:50:59 GMT):
@svasilyev Thank you very much!!! I forget that ...:sob: THX!!!
kyle1234 (Thu, 15 Jun 2017 01:12:27 GMT):
Has joined the channel.
lijiajun1979 (Thu, 15 Jun 2017 01:19:45 GMT):
Has joined the channel.
yahtoo (Thu, 15 Jun 2017 03:00:39 GMT):
Has joined the channel.
Ashish (Thu, 15 Jun 2017 09:49:23 GMT):
Hi Can anyone tell me how to get the jars required to connect to the Fabric from my java code ?
Ashish (Thu, 15 Jun 2017 09:50:36 GMT):
My fabric is running on dockers in my local pc.
Ashish (Thu, 15 Jun 2017 09:51:21 GMT):
and i saw the video and I read the docs. but no where its mentioned how to download the jars - may be someone can guide me, pls ?
rickr (Thu, 15 Jun 2017 12:04:55 GMT):
The alpha2 and Beta were published to Maven so you should be able to just reference it in your pom.xml
https://mvnrepository.com/artifact/org.hyperledger.fabric-sdk-java/fabric-sdk-java/1.0.0-beta
Ashish (Thu, 15 Jun 2017 12:22:50 GMT):
Thank you @rickr
Ashish (Thu, 15 Jun 2017 12:52:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=hsLWMts74czaG9pdK) @szoghybe Thanks
nickmelis (Thu, 15 Jun 2017 14:34:56 GMT):
how do I know if a channel is already existent before trying to create it?
SahilKapoor (Thu, 15 Jun 2017 16:49:27 GMT):
Hi,
SahilKapoor (Thu, 15 Jun 2017 16:52:10 GMT):
I am new to using this SDK. Can some one help me to setup the dev environment if I already have a fabric network running in the cloud. Do I need to set some config file somewhere so that it can get connection profile or do I mention the grpc urls soemwhere?
How can I create a new peers on other vm ?
Please help..
rickr (Fri, 16 Jun 2017 00:26:48 GMT):
There is no way no to determine if a channel already exists at the moment. If it does, the creation will fail - guess you'll know then.
I think a JIRA should be opened for that and the SDK really needs _proper_ Fabric API for this. However even when then API exists there would be no guarantee that between the time you queried and the time you attempted to create it's not be already created by someone else.
rickr (Fri, 16 Jun 2017 00:26:48 GMT):
There is no way now to determine if a channel already exists at the moment. If it does, the creation will fail - guess you'll know then.
I think a JIRA should be opened for that and the SDK really needs _proper_ Fabric API for this. However even when then API exists there would be no guarantee that between the time you queried and the time you attempted to create it's not be already created by someone else.
rickr (Fri, 16 Jun 2017 00:26:48 GMT):
There is no way to determine if a channel already exists at the moment. If it does, the creation will fail - guess you'll know then.
I think a JIRA should be opened for that and the SDK really needs _proper_ Fabric API for this. However even when then API exists there would be no guarantee that between the time you queried and the time you attempted to create it's not be already created by someone else.
rickr (Fri, 16 Jun 2017 00:39:22 GMT):
I would run locally first now that the beta is published and there is a version that matches that fabric. Getting the fabric is just letting docker pull images that matches. Read the full README.md Then study the end2endxxx.java samples how it sets up the peers/orderers/eventhubs / creates channels etc. Once you understand that you should be able transfer that knowledge to using the _cloud deployment_. Just my 2 cents :)
lenin.mehedy (Fri, 16 Jun 2017 05:36:18 GMT):
@rickr Any idea on this error, why would it look for that specific ccenv container tag? I do have the container hyperledger/ccenv:latest
```
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Error starting container: Failed to generate platform-specific docker build: Failed to pull hyperledger/fabric-ccenv:x86_64-1.0.0-alpha3-snapshot-d2bfa744: API error (404): {"message":"manifest for hyperledger/fabric-ccenv:x86_64-1.0.0-alpha3-snapshot-d2bfa744 not found"}
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2129)
at org.hyperledger.fabric.sdk.Channel.sendInstantiationProposal(Channel.java:1251)
at com.ibm.blueaudit.fabric.deploy.AbstractChaincodeManager.instantiateChaincode(AbstractChaincodeManager.java:290)
at com.ibm.blueaudit.fabric.deploy.DefaultChaincodeManager.deployChaincode(DefaultChaincodeManager.java:69)
at com.ibm.blueaudit.fabric.deploy.DeployApp.main(DeployApp.java:317)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.lang.Thread.run(Thread.java:748)
```
nickmelis (Fri, 16 Jun 2017 07:55:52 GMT):
Running a query against my chaincode. With v0.6 ChaincodeResponse used to contain the response payload from the chaincode, now ProposalResponse extends ChaincodeResponse and the latter does not contain any payload with the chaincode response message. Why is that?
chenxuan (Fri, 16 Jun 2017 08:19:17 GMT):
org.hyperledger.fabric.sdk.exception.ProposalException: IO Error while creating install transaction
chenxuan (Fri, 16 Jun 2017 08:19:23 GMT):
@rickr
chenxuan (Fri, 16 Jun 2017 08:27:48 GMT):
the chaincode method init must assign the parameter otherwise occur the error
chenxuan (Fri, 16 Jun 2017 08:27:53 GMT):
org.hyperledger.fabric.sdk.exception.ProposalException: IO Error while creating install transaction
bestbeforetoday (Fri, 16 Jun 2017 14:44:30 GMT):
Has left the channel.
VickyWang (Mon, 19 Jun 2017 05:30:39 GMT):
Has joined the channel.
sfukazu (Mon, 19 Jun 2017 06:37:10 GMT):
Has joined the channel.
FengChen_1982 (Mon, 19 Jun 2017 07:35:02 GMT):
@here I just want to use chaincode query/invoke function of the SDK, is there a simpler test case than the End2EndIT.java? There are too many classes(Test*, Sampe*) involved here.
guruce (Mon, 19 Jun 2017 07:37:47 GMT):
See this, same sample code explain written differently, helped me to understand ;)
https://bitbucket.org/isparkes/fabric-sdk-spring-boot-rest-poc/overview
FengChen_1982 (Mon, 19 Jun 2017 07:40:55 GMT):
oh, that's really great!
FengChen_1982 (Mon, 19 Jun 2017 07:41:08 GMT):
@guruce thanks so much!
IanSparkes (Mon, 19 Jun 2017 12:11:48 GMT):
@nickmelis Determine channel existence: The only way I have found so far is to try to create it and catch the exception that is thrown when the initialize() call is done. You get "org.hyperledger.fabric.sdk.exception.TransactionException: Bad newest block expected status 200 got 404, Chain foo" if it does not exist.
IanSparkes (Mon, 19 Jun 2017 12:12:10 GMT):
The code looks a bit like this: ``` try {
existingChain.initialize();
ChainInfo chainInfo = new ChainInfo();
chainInfo.setChainName(existingChain.getName());
return chainInfo;
} catch (TransactionException ex) {
// looks like we are not intialised - construct the chain
Chain newChain = clientService.constructChain(client, chainName, getTopology(clientName));
newChain.initialize();
ChainInfo chainInfo = new ChainInfo();
chainInfo.setChainName(newChain.getName());
return chainInfo;
}
```
IanSparkes (Mon, 19 Jun 2017 12:12:55 GMT):
Don't worry about the ChainInfo class, that's just something I made to have a response
IanSparkes (Mon, 19 Jun 2017 12:14:22 GMT):
It would be nice to be able to expose/wrap the "parseConfigBlock()" call which does the work of seeing if the channel is configured: Perhaps this is already done, I am on alpha2 still...
IanSparkes (Mon, 19 Jun 2017 12:15:34 GMT):
Still feeling the way on this... Perhaps I will find a better way. We will see.
stanacton (Mon, 19 Jun 2017 14:06:16 GMT):
Has joined the channel.
ManjeetGambhir (Mon, 19 Jun 2017 15:34:25 GMT):
@rickr Hi Rick, in multihost environment, fabric Event listener got stale after 10 minute..Is there a way in sdk to keep the connection alive between peer and sdk ?
ManjeetGambhir (Mon, 19 Jun 2017 15:35:50 GMT):
@rickr now gari singh has put fix to make orderer to peer keep alive in beta version , it's working fine but issue is now between application listener to peer
rickr (Mon, 19 Jun 2017 15:37:00 GMT):
Example of that in the End2end.java
rickr (Mon, 19 Jun 2017 15:37:00 GMT):
Example of that in the End2end.java search for keepAlive
ManjeetGambhir (Mon, 19 Jun 2017 15:54:49 GMT):
Thanks ..i can see that..let me implement
msoumeit (Mon, 19 Jun 2017 16:45:14 GMT):
Query: Is it possible to connect to external sources( URL/DB) from chaincode? How can I achieve this function and whether this needs to be deterministic? Thanks.
tallharish (Mon, 19 Jun 2017 19:55:56 GMT):
Has joined the channel.
dongqi (Tue, 20 Jun 2017 08:38:45 GMT):
Has joined the channel.
chenxuan (Tue, 20 Jun 2017 09:38:09 GMT):
i have a question about the HFClient.java that means the per channel has a HFClient but if the HFClient destroy that means no one can access to the channel by the java sdk
chenxuan (Tue, 20 Jun 2017 09:38:14 GMT):
@rickr
smfaizalkhan (Tue, 20 Jun 2017 10:48:29 GMT):
Hello All ,I have my chaincode running in GO and i have to acces the chaincode from our web application using JAVA ,What is that docs that i should be referrring to ,also any examples ?
nickmelis (Tue, 20 Jun 2017 11:05:39 GMT):
@smfaizalkhan have a look at End2EndIT and the other integration tests in the SDK project
smfaizalkhan (Tue, 20 Jun 2017 11:09:03 GMT):
Thanks @nickmelis
rickr (Tue, 20 Jun 2017 16:48:41 GMT):
No destroy method on the HFClient. If you loose a reference to the client but have references in your code to the channels the channels will not go away. The channel has a shutdown method which will cleanup all it's resources. After that the channel _object_ should no longer be usable. To invoke methods against that channel you need to reconstruct it like the End2endAndBckAgainIT does. Not sure if this answers your question.
sqwerrels (Tue, 20 Jun 2017 16:55:54 GMT):
Is the database by default running on leveldb? If I wanted to change it to couchdb, is it possible to do it in for example the End2EndIT.java class
Raje (Tue, 20 Jun 2017 19:02:28 GMT):
Has joined the channel.
Raje (Tue, 20 Jun 2017 19:03:13 GMT):
I'm getting an error * What went wrong:
Error resolving plugin [id: 'com.google.protobuf', version: '0.8.0']
> Could not GET 'https://plugins.gradle.org/api/gradle/4.0/plugin/use/com.google.protobuf/0.8.0'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Any thoughts?
FengChen_1982 (Wed, 21 Jun 2017 03:08:06 GMT):
I get the following error, when I try to run the End2EndIT test. I'm using the 1.0.0-beta tag:
FengChen_1982 (Wed, 21 Jun 2017 03:08:08 GMT):
org.hyperledger.fabric_ca.sdk.exception.EnrollmentException: Url:http://localhost:7054, Failed to enroll user admin
at org.hyperledger.fabric_ca.sdk.HFCAClient.enroll(HFCAClient.java:351)
2017-06-21 03:01:58,486 ERROR HFCAClient:352 - null
at org.hyperledger.fabric_ca.sdk.HFCAClient.enroll(HFCAClient.java:264)
org.apache.http.client.ClientProtocolException
FengChen_1982 (Wed, 21 Jun 2017 03:08:47 GMT):
Looks like org.apache.http.client.ClientProtocolException occured when I want to access the CA Server.
FengChen_1982 (Wed, 21 Jun 2017 03:09:03 GMT):
Any one got ideas about what's wrong here?
FengChen_1982 (Wed, 21 Jun 2017 03:10:01 GMT):
And I can see that the CA Server is listening on my machine: netstat -an | grep 7054
tcp6 0 0 ::1.7054 *.* LISTEN
tcp4 0 0 *.7054 *.* LISTEN
FengChen_1982 (Wed, 21 Jun 2017 04:31:28 GMT):
When I check out the CA Server logs, I can see erros like the following:
FengChen_1982 (Wed, 21 Jun 2017 04:31:29 GMT):
2017/06/21 00:38:34 http: TLS handshake error from 172.21.0.1:48794: tls: first record does not look like a TLS handshake
2017/06/21 00:38:51 http: TLS handshake error from 172.21.0.1:48796: tls: oversized record received with length 21536
rickr (Wed, 21 Jun 2017 11:15:14 GMT):
First looks it appears your client is using http and where you're connecting to is expecting https. If you're using the SDK with *NO* changes neither the client nor the fabric/ca should be expecting TLS. In the sdkintegration directory where your docker compose file is there should be an .env file TLS should be commented out.
pschnap (Wed, 21 Jun 2017 20:25:53 GMT):
can the enrollment of the user be null?
pschnap (Wed, 21 Jun 2017 20:26:23 GMT):
or does one have to enroll with a CA before one can interact w/ the fabric?
rickr (Wed, 21 Jun 2017 20:26:54 GMT):
it has to have an enrollment which needs a certificate and a private key
pschnap (Wed, 21 Jun 2017 20:27:25 GMT):
ok that's what I thought, thanks @rickr
guruce (Thu, 22 Jun 2017 11:55:29 GMT):
can anyone help to retrieve ChainCodeEvents from fabric network via java-sdk, I can able to get the same in go sdk with EventHub.RegisterChaincodeEvent(), but the same api is not available in java sdk. :(
adc (Thu, 22 Jun 2017 15:55:41 GMT):
Hi All, I get this error ```2017-06-22 15:55:04,250 ERROR OrdererClient:287 - UNAVAILABLE: Channel closed while performing protocol negotiation
```
adc (Thu, 22 Jun 2017 15:55:52 GMT):
when connecting to the ordering service with TLS enabled
adc (Thu, 22 Jun 2017 15:56:12 GMT):
the properties I'm using are the following: ``` testprops.setProperty("trustServerCertificate", "true");
testprops.setProperty("pemFile", "../fabric/examples/tracking_cli/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca.example.com-cert.pem");
testprops.setProperty("sslProvider", "openSSL");
// testprops.setProperty("hostnameOverride", "override");
testprops.setProperty("negotiationType", "TLS");
```
adc (Thu, 22 Jun 2017 15:56:14 GMT):
any idea?
adc (Thu, 22 Jun 2017 15:57:45 GMT):
btw, if I disable TLS on my fabric network and on the java-sdk, everything works just fine
adc (Thu, 22 Jun 2017 15:57:57 GMT):
Am I missing some property?
adc (Thu, 22 Jun 2017 16:00:21 GMT):
also, this is what I see at the orderer side: ```2017-06-22 15:55:04.094 UTC [grpc] Printf -> DEBU de2 grpc: Server.Serve failed to complete security handshake from "172.18.0.1:39948": EOF
2017-06-22 15:55:04.098 UTC [grpc] Printf -> DEBU de3 grpc: Server.Serve failed to complete security handshake from "172.18.0.1:39950": EOF```
mastersingh24 (Fri, 23 Jun 2017 02:49:47 GMT):
@adc - did you figure this out?
mastersingh24 (Fri, 23 Jun 2017 02:50:44 GMT):
What version of openssl is on your host system?
kevinsong (Fri, 23 Jun 2017 04:16:48 GMT):
Has joined the channel.
adc (Fri, 23 Jun 2017 06:12:32 GMT):
not yet. I have OpenSSL 0.9.8zh 14 Jan 2016, probably a bit old :)
adc (Fri, 23 Jun 2017 06:12:36 GMT):
let me upgrade then
adc (Fri, 23 Jun 2017 06:28:10 GMT):
So, I have now *OpenSSL 1.0.2l 25 May 2017* and I see the same error
adc (Fri, 23 Jun 2017 06:54:41 GMT):
I have also tried to upgrade netty-tcnative-boringssl-static and grpc to the latest but still it does not work :(
adc (Fri, 23 Jun 2017 07:56:36 GMT):
aha, got the issue
adc (Fri, 23 Jun 2017 07:56:54 GMT):
I was specifying the wrong certificate :)
Ashish (Fri, 23 Jun 2017 10:29:45 GMT):
Has left the channel.
rickr (Fri, 23 Jun 2017 13:27:57 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=7vJ3d9rNaSWxh9TLK)
registerBlockListener on Channel ?
SahilKapoor (Fri, 23 Jun 2017 17:06:49 GMT):
How can we create new peer on a vm and make it join fabric on new machine? Is it possible with java sdk?
SahilKapoor (Fri, 23 Jun 2017 17:06:49 GMT):
How can we create new peer on a vm and make it join fabric on new machine? Is it possible with java sdk?
chenxuan (Sat, 24 Jun 2017 05:46:12 GMT):
New channel mychannel error. StatusValue 400. Status BAD_REQUEST
chenxuan (Sun, 25 Jun 2017 04:54:28 GMT):
(status: 500, message: Cannot create ledger from genesis block, due to LedgerID already exists), cause=null}
chenxuan (Sun, 25 Jun 2017 04:54:32 GMT):
@rickr
chenxuan (Sun, 25 Jun 2017 05:41:45 GMT):
org.hyperledger.fabric.sdk.exception.TransactionException: Getting genesis block time exceeded 5 seconds for channel mychannel
chenxuan (Sun, 25 Jun 2017 05:41:49 GMT):
@rickr
rickr (Mon, 26 Jun 2017 11:36:38 GMT):
Almost all of the time it's not an issue with the SDK itself. You'll need to dig into the Peer and Orderer logs.
chenxuan (Mon, 26 Jun 2017 12:20:33 GMT):
ok
chenxuan (Mon, 26 Jun 2017 12:20:45 GMT):
i have a question about the fabric-java-sdk
chenxuan (Mon, 26 Jun 2017 12:21:00 GMT):
one channel have one client to operation?
chenxuan (Mon, 26 Jun 2017 12:21:28 GMT):
i use the java to provide restful interface to other
chenxuan (Mon, 26 Jun 2017 12:21:53 GMT):
i store the HFClient use the private static final HashMap
chenxuan (Mon, 26 Jun 2017 12:22:03 GMT):
but if the web is down
chenxuan (Mon, 26 Jun 2017 12:22:21 GMT):
i can't do it anymore?
rickr (Mon, 26 Jun 2017 12:27:14 GMT):
Should have multiple channels to a client. Restoring client/channels should be possible as in End2endAndBackAgainIT
chenxuan (Mon, 26 Jun 2017 12:37:43 GMT):
but if the web shutdown
chenxuan (Mon, 26 Jun 2017 12:37:55 GMT):
HFClient client = HFClient.createNewInstance();
chenxuan (Mon, 26 Jun 2017 12:37:59 GMT):
the client is lost
chenxuan (Mon, 26 Jun 2017 12:38:18 GMT):
every time is different
chenxuan (Mon, 26 Jun 2017 12:38:40 GMT):
but if the web shutdown
HFClient client = HFClient.createNewInstance();
chenxuan (Mon, 26 Jun 2017 12:38:58 GMT):
the client is lost
every time is different
chenxuan (Mon, 26 Jun 2017 12:39:20 GMT):
you use the HFClient.createNewInstance()
chenxuan (Mon, 26 Jun 2017 12:42:02 GMT):
the client can't be serializ
rickr (Mon, 26 Jun 2017 12:45:36 GMT):
Would this not work : Create a new instance of the client and the peers, Orderers, and event hubs that you had when shutdown ? Continue running ?
chenxuan (Mon, 26 Jun 2017 13:06:53 GMT):
in the e2e the client can not be store
chenxuan (Mon, 26 Jun 2017 13:07:09 GMT):
but i use it in the web
chenxuan (Mon, 26 Jun 2017 13:07:43 GMT):
if the web shutdown the client is lost
chenxuan (Mon, 26 Jun 2017 13:08:11 GMT):
i can not reconnect to the channel
nickmelis (Mon, 26 Jun 2017 13:47:11 GMT):
what's the purpose of the transientMap in a transaction request?
nickmelis (Mon, 26 Jun 2017 13:47:43 GMT):
it's data that doesn't get written into the ledger, then why do we ever need to send transient data within a transaction?
nickmelis (Mon, 26 Jun 2017 13:48:33 GMT):
and also why in the tests something like `"HyperLedgerFabric", "TransactionProposalRequest:JavaSDK"` gets sent?
rickr (Mon, 26 Jun 2017 13:51:05 GMT):
The API allows it so the SDK exposes it. It could really anything .. If you don't see a need for it in your application there's no requirement to use it
rickr (Mon, 26 Jun 2017 13:51:05 GMT):
The API allows it so the SDK exposes it. It could really be anything .. If you don't see a need for it in your application there's no requirement to use it
nickmelis (Mon, 26 Jun 2017 14:12:23 GMT):
thanks @rickr . I don't personally see a need for it in my app, that's why I was curious about a possible use case. What happens to that information once the transaction reaches the ledger?
rickr (Mon, 26 Jun 2017 14:25:00 GMT):
Any CC arguments are part of the proposal they have to be signed and in the end passed to the orderer. The transient data is not part of the signed data and is never sent to the Orderer and thus can never be sent to a committer. Just think of it as metadata for your CC .. and most likely many CC will never need any metadata
nickmelis (Mon, 26 Jun 2017 14:28:27 GMT):
so chaincode can read transient data?
rickr (Mon, 26 Jun 2017 14:29:07 GMT):
y
rickr (Mon, 26 Jun 2017 14:29:07 GMT):
y I don't think anything else really cares about what's in the meta data
rickr (Mon, 26 Jun 2017 14:29:07 GMT):
y I don't think anything else really cares about what's in the transient map
chenxuan (Mon, 26 Jun 2017 15:01:26 GMT):
java.lang.Exception: io.grpc.StatusRuntimeException: INTERNAL: Connection closed with unknown cause
chenxuan (Mon, 26 Jun 2017 15:01:43 GMT):
@rickr
chenxuan (Mon, 26 Jun 2017 15:01:55 GMT):
2c408f50a89d hyperledger/fabric-orderer:x86_64-1.0.0-beta "orderer" 4 minutes ago Up 4 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
460b9aa5a905 hyperledger/fabric-kafka:x86_64-1.0.0-beta "/docker-entrypoint.s" 4 minutes ago Up 4 minutes 9093/tcp, 0.0.0.0:32846->9092/tcp kafka2.example.com
b543e436968b hyperledger/fabric-kafka:x86_64-1.0.0-beta "/docker-entrypoint.s" 4 minutes ago Up 4 minutes 9093/tcp, 0.0.0.0:32845->9092/tcp kafka3.example.com
67d4f1f0456c hyperledger/fabric-kafka:x86_64-1.0.0-beta "/docker-entrypoint.s" 4 minutes ago Up 4 minutes 9093/tcp, 0.0.0.0:32844->9092/tcp kafka1.example.com
8f6e3d239b1d hyperledger/fabric-kafka:x86_64-1.0.0-beta "/docker-entrypoint.s" 4 minutes ago Up 4 minutes 9093/tcp, 0.0.0.0:32843->9092/tcp kafka0.example.com
51aadf389417 hyperledger/fabric-peer:x86_64-1.0.0-beta "peer node start" 4 minutes ago Up 4 minutes 0.0.0.0:8051->8051/tcp, 0.0.0.0:8053->8053/tcp peer1.org1.example.com
1ac0c4a80d98 hyperledger/fabric-peer:x86_64-1.0.0-beta "peer node start" 4 minutes ago Up 4 minutes 0.0.0.0:9051->9051/tcp, 0.0.0.0:9053->9053/tcp peer0.org2.example.com
08b8ea82e93a hyperledger/fabric-ca "sh -c 'fabric-ca-ser" 4 minutes ago Up 4 minutes 0.0.0.0:7054->7054/tcp ca_peerOrg1
6572f7e7af98 hyperledger/fabric-ca "sh -c 'fabric-ca-ser" 4 minutes ago Up 4 minutes 0.0.0.0:8054->7054/tcp ca_peerOrg2
b02e9fd939d3 hyperledger/fabric-peer:x86_64-1.0.0-beta "peer node start" 4 minutes ago Up 4 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
b8d3dd1b10e8 hyperledger/fabric-peer:x86_64-1.0.0-beta "peer node start" 4 minutes ago Up 4 minutes 0.0.0.0:10051->10051/tcp, 0.0.0.0:10053->10053/tcp peer1.org2.example.com
8181617d1a93 hyperledger/fabric-zookeeper:x86_64-1.0.0-beta "/docker-entrypoint.s" 4 minutes ago Up 4 minutes 0.0.0.0:32842->2181/tcp, 0.0.0.0:32841->2888/tcp, 0.0.0.0:32840->3888/tcp zookeeper0.example.com
2e91d28a673f hyperledger/fabric-zookeeper:x86_64-1.0.0-beta "/docker-entrypoint.s" 4 minutes ago Up 4 minutes 0.0.0.0:32836->2181/tcp, 0.0.0.0:32835->2888/tcp, 0.0.0.0:32834->3888/tcp zookeeper1.example.com
c930305e05ef hyperledger/fabric-zookeeper:x86_64-1.0.0-beta "/docker-entrypoint.s" 4 minutes ago Up 4 minutes 0.0.0.0:32839->2181/tcp, 0.0.0.0:32838->2888/tcp, 0.0.0.0:32837->3888/tcp zookeeper2.example.com
chenxuan (Mon, 26 Jun 2017 15:02:11 GMT):
the contain runs successfully
chenxuan (Tue, 27 Jun 2017 02:46:54 GMT):
org.hyperledger.fabric.sdk.exception.TransactionException: Getting genesis block time exceeded 5 seconds for channel mychannel
chenxuan (Tue, 27 Jun 2017 02:47:01 GMT):
@rickr
chenxuan (Tue, 27 Jun 2017 04:55:02 GMT):
how to use the event?
chenxuan (Tue, 27 Jun 2017 04:55:04 GMT):
@rickr
bluefireH (Tue, 27 Jun 2017 08:06:35 GMT):
I got an error likes: Bad last configuation block type 3, expected 1
I'm confuse about the https://github.com/hyperledger/fabric-sdk-java/blob/master/src/main/java/org/hyperledger/fabric/sdk/Channel.java
line 902: Metadata metaData = Metadata.parseFrom(blockMetadata.getMetadata(1));
why get the second metadata from the block? I modify this to blockMetadata.getMetadata(0) and rebuild the project then it work fine
bluefireH (Tue, 27 Jun 2017 08:08:05 GMT):
So why blockMetadata.getMetadata(0) can get the correct configuation block in my project?
DeutscheBahn-BlockchainDev (Tue, 27 Jun 2017 08:35:10 GMT):
Has joined the channel.
DeutscheBahn-BlockchainDev (Tue, 27 Jun 2017 08:51:49 GMT):
Gents, is it possible to run the Java Client SDK with the Fabric having no CA running in the network, but just having "static" MSP with files on the "server side"? Do we always need a CA to deal with ECERTS and TCERTS (as it did in v0.6) or there is a way to get around running CA?
DeutscheBahn-BlockchainDev (Tue, 27 Jun 2017 08:53:07 GMT):
for instance the e2e-cli example does not start with any CA running, and we can interact with the Fabric from the CLI, can I access this network via the Java SDK or not?
chenxuan (Tue, 27 Jun 2017 09:15:14 GMT):
2017-06-27 17:14:43,777:ERROR http-nio-8080-exec-1 (Util.java:41) - Transaction failed with java.util.concurrent.CompletionException exception java.lang.Exception: Channel mychannel failed to place transaction fe8061d930f9da4a3936c3b52674466b4ea40cf5f3e154728e4e76fd8e39440d on Orderer. Cause: UNSUCCESSFUL
chenxuan (Tue, 27 Jun 2017 09:15:45 GMT):
@rickr
Ashish (Tue, 27 Jun 2017 09:22:49 GMT):
Has joined the channel.
guruce (Tue, 27 Jun 2017 10:57:03 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jwcttKfpTA9Q7GmcH) @rickr App got triggers but couldn't able to get the payload with BlockEvent object, plz help to derive the payload
rickr (Tue, 27 Jun 2017 12:09:45 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=TrCrTYaNkQwb6ri6Q) look at org/hyperledger/fabric/protos/common/Common.java LAST_CONFIG_VALUE probably should change it for that define may not have been there when the code was first created.
rickr (Tue, 27 Jun 2017 12:38:30 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=eQGFnJyHnztYQP2Mj)
You can run with no CA if you look at the End2endIT samples there is a peer admin who's certs are in a file generated by cryptogen. The user can do all operations and is not created/enrolled by the CA. Currently, TCERTS are not supported but when they are you'll need a CA that can support generating them.
rickr (Tue, 27 Jun 2017 12:59:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6ieyZh7YecHmemb9x) Was there anything in the orderer logs ?
I'm fairly certain the SDK is only reporting what it's getting back from the Orderer You'll best report that on the #fabric-consensus channel where the experts on that can best help you.
rickr (Tue, 27 Jun 2017 12:59:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6ieyZh7YecHmemb9x) Was there anything in the orderer logs ?
I'm fairly certain the SDK is only reporting what it's getting back from the Orderer Better to report that on the #fabric-consensus channel where the experts on that can best help you.
chenxuan (Tue, 27 Jun 2017 13:04:07 GMT):
@rickr the peer show the log
chenxuan (Tue, 27 Jun 2017 13:04:15 GMT):
i have resolved
chenxuan (Tue, 27 Jun 2017 13:05:05 GMT):
but i have question about the fabric java sdk
chenxuan (Tue, 27 Jun 2017 13:05:30 GMT):
that's the HFClient is a object to operation the fabric
chenxuan (Tue, 27 Jun 2017 13:05:57 GMT):
but the HFClient is lost
chenxuan (Tue, 27 Jun 2017 13:05:59 GMT):
there are no way to operation the fabric ?
chenxuan (Tue, 27 Jun 2017 13:11:48 GMT):
i use the sdk in a web programmer
chenxuan (Tue, 27 Jun 2017 13:11:54 GMT):
if the web shutdown
chenxuan (Tue, 27 Jun 2017 13:12:17 GMT):
how can i to get the client to operate the fabric
chenxuan (Tue, 27 Jun 2017 14:40:00 GMT):
@rickr
michaeldowling (Tue, 27 Jun 2017 21:46:30 GMT):
Has joined the channel.
michaeldowling (Tue, 27 Jun 2017 21:49:32 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Xc7tvMJCg25jCn2uA) @rasmustrew Hey there - just curious if you found any solutions to your issue re: a java-sdk connection to a peer returning the error "First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002"
michaeldowling (Tue, 27 Jun 2017 21:50:11 GMT):
@rasmustrew I'm running into the exact same issue right now, and I'm totally confused as to why I'm getting it.
rickr (Tue, 27 Jun 2017 22:01:21 GMT):
Not sure I understand your question. When your webapp starts back up create a new instance of the client follow the reconstructChannel in End2endAndBackAgainIT
chenxuan (Tue, 27 Jun 2017 23:44:56 GMT):
@rickr thx
lenin.mehedy (Wed, 28 Jun 2017 04:52:55 GMT):
any idea how to send a JSON payload as argument to chaincode invoke function?
lenin.mehedy (Wed, 28 Jun 2017 05:03:20 GMT):
@rickr Does the below example code-snipped look okay to send a json payload for chaincode function args?
```
ObjectMapper mapper = new ObjectMapper();
String jsonArg = mapper.writeValueAsString(myObj);
String[] funcArgs = new String[]{jsonArg}
```
JohnDC (Wed, 28 Jun 2017 07:27:53 GMT):
Has joined the channel.
yihuang518 (Wed, 28 Jun 2017 07:46:01 GMT):
Has joined the channel.
yihuang518 (Wed, 28 Jun 2017 12:43:23 GMT):
hi experts, just a quick question, in End2endIT.java, there is out(" Transaction number %d has %d actions", i, transactionEnvelopeInfo.getTransactionActionInfoCount());, in the comment, it says for now there is only 1 action per transaction. Does that mean in the future release, we can combine several invoke into one transaction?
michaeldowling (Wed, 28 Jun 2017 17:59:57 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=M2WrketiKzdNXHh83) @lenin.mehedy JSON is just a string, right? So you should be able to pass it as payload to chaincode as an argument.
michaeldowling (Wed, 28 Jun 2017 18:01:44 GMT):
@rickr Hey Rick - I'm going nuts with this TLS issue over grpc. I've tried stepping through the code and it simply looks like the java GRPC client libs are expecting a SETTINGS frame of a certain config from the golang grpc server in Fabric.
michaeldowling (Wed, 28 Jun 2017 18:02:09 GMT):
@rickr The error I'm getting is: "First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002"
michaeldowling (Wed, 28 Jun 2017 18:03:27 GMT):
@rickr The code attempting to (simply) connect is: this.client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
this.peer = this.client.newPeer(options.getPeerName(), options.getPeerUrl().toString());
this.orderer = this.client.newOrderer(options.getOrdererName(), options.getOrdererUrl().toString());
GFTNUser user = GFTNUser.loadUser("User1", "ODFI", "ODFIMSP", new File(options.getUserCertificatePath()), new File(options.getUserPrivateKeyPath()));
this.client.setUserContext(user);
Set
michaeldowling (Wed, 28 Jun 2017 18:03:41 GMT):
@rickr any ideas of where I should look?
rickr (Wed, 28 Jun 2017 18:10:15 GMT):
src/test/fixture/sdkintegration/.env Reverse the TLS lines in that file. in sdkintegration directory do `./fabric restart`
Sets the fabric up for TLS
export ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=true
Sets the integration test suite for TLS.
rickr (Wed, 28 Jun 2017 18:11:28 GMT):
Looking at what's done there should give you hints on setting up TLS
michaeldowling (Wed, 28 Jun 2017 18:13:16 GMT):
@rickr ah, thanks. I will take a look. Note, I'm starting a fresh network, NOT using the integration tests or the examples.
rickr (Wed, 28 Jun 2017 18:14:22 GMT):
IMO start with the examples End2endXXXIT get a good feel what's done there. THEN move on
michaeldowling (Wed, 28 Jun 2017 18:15:29 GMT):
@rickr I did start with the examples, now I need to move on to more interesting use cases, which means looking beyond the fabric integration tests.
michaeldowling (Wed, 28 Jun 2017 18:17:55 GMT):
@rickr so that script simple sets environment variables for TLS to true, which I've already got set up. So that's not the source of the issue.
michaeldowling (Wed, 28 Jun 2017 18:19:36 GMT):
@rickr my docker-compose sets the followng already for orderer and peers: ORDERER_GENERAL_TLS_ENABLED=true and CORE_PEER_TLS_ENABLED=true
michaeldowling (Wed, 28 Jun 2017 18:20:01 GMT):
@rickr So I'm wondering if there might be a mismatch between the GRPC version in Fabric and the GRPC libs in the java SDK?
rickr (Wed, 28 Jun 2017 18:23:36 GMT):
And an env var makes it work for the End2endIT tests to run TLS ?
michaeldowling (Wed, 28 Jun 2017 18:46:32 GMT):
@rickr yeah the End2End tests are fine.
michaeldowling (Wed, 28 Jun 2017 18:47:49 GMT):
But when setting up my own network, following all the exact same instructions as in http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html, connecting to it with the java SDK gives me "io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002"
michaeldowling (Wed, 28 Jun 2017 18:48:32 GMT):
@rickr if this were a matter of improper TLS setup, I would expect a different error message around authentication. But this is beyond authentication and into the wire protocol for GRPC.
michaeldowling (Wed, 28 Jun 2017 19:16:06 GMT):
@rickr FYI: https://github.com/grpc/grpc-java/issues/2068
michaeldowling (Wed, 28 Jun 2017 19:16:15 GMT):
@rickr In there, he's referencing this commit: https://github.com/hyperledger/fabric/commit/d39194ce97d8debc9e38b6eff0972a9404a5fd71
rezamt (Thu, 29 Jun 2017 04:24:29 GMT):
Has joined the channel.
FabricWhiskey (Thu, 29 Jun 2017 07:26:08 GMT):
Has joined the channel.
chenxuan (Thu, 29 Jun 2017 08:08:39 GMT):
@rickr the EventHub how to use
guruce (Thu, 29 Jun 2017 10:58:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bCqZju6uwyB6uQZ8X) @guruce
guruce (Thu, 29 Jun 2017 11:07:46 GMT):
Message Attachments
guruce (Thu, 29 Jun 2017 11:07:46 GMT):
Message Attachments
guruce (Thu, 29 Jun 2017 11:07:46 GMT):
Message Attachments
guruce (Thu, 29 Jun 2017 11:07:46 GMT):
Message Attachments
guruce (Thu, 29 Jun 2017 11:07:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bCqZju6uwyB6uQZ8X) @guruce
I can see the message contents with signature characters, when do like this on BlockEvent object *new String(blockEvent.getBlock().toByteArray()*
attached response string
rickr (Thu, 29 Jun 2017 12:04:14 GMT):
There should many methods on BlockEvent a lot of them are shown in End2end blockWalker method.
rickr (Thu, 29 Jun 2017 12:04:14 GMT):
There should many methods on BlockEvent a lot of them are shown in End2endIT blockWalker method.
rbv (Thu, 29 Jun 2017 14:19:13 GMT):
Has joined the channel.
rbv (Thu, 29 Jun 2017 14:19:32 GMT):
Hello everyone, I am currently trying to set up fabric for java following the example that's on the fabric GitHub. Once I clone the repository, I tried to start up docker-compose so that I could install javacc and it's giving me the following *error: 2017-06-29 14:11:38.828 UTC [main] main -> ERRO 001 Cannot run peer because error when setting up MSP from directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp: err admin 0 is invalid, validation error Could not obtain certification chain, err A CA certificate cannot be used directly by this MSP*
jmcnevin (Thu, 29 Jun 2017 17:23:18 GMT):
Has joined the channel.
chenxuan (Fri, 30 Jun 2017 00:32:04 GMT):
End2endIT blockWalker method just to get block info
DeutscheBahn-BlockchainDev (Fri, 30 Jun 2017 08:03:33 GMT):
Hello All, how can I retrieve an already created channel in Fabric and initialize the Channel object with it?
DeutscheBahn-BlockchainDev (Fri, 30 Jun 2017 08:04:35 GMT):
creating channels is staright forward, but obviously I do want to reuse them at any point of time, so there has to be some mechanism for that
DeutscheBahn-BlockchainDev (Fri, 30 Jun 2017 08:05:04 GMT):
there is queryChannels for the HFC Client, but it only returns a String, channel name
DeutscheBahn-BlockchainDev (Fri, 30 Jun 2017 08:05:24 GMT):
how can I use the channel name and initialize a Channel object
dayubian (Fri, 30 Jun 2017 08:56:47 GMT):
@DeutscheBahn-BlockchainDev refer to End2endAndBackAgainIT.java
DeutscheBahn-BlockchainDev (Fri, 30 Jun 2017 10:10:18 GMT):
@dayubian thanks :) problem solved
wayneg (Fri, 30 Jun 2017 11:59:40 GMT):
Has joined the channel.
wayneg (Fri, 30 Jun 2017 11:59:45 GMT):
Bad newest block expected status 200 got 403,
wayneg (Fri, 30 Jun 2017 11:59:56 GMT):
who have same error?
wayneg (Fri, 30 Jun 2017 12:00:13 GMT):
How to get a existing channel over java sdk?
guruce (Fri, 30 Jun 2017 12:21:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rpXCu6MuW7A3kShCA) @wayneg can use same as constructChannel in End2endIT, use addPeer method instead of joinPeer.. worked for me
dayubian (Fri, 30 Jun 2017 13:23:41 GMT):
@guruce @wayneg refer to End2endAndBankAgainIT.java
wayneg (Fri, 30 Jun 2017 13:49:46 GMT):
@guruce @dayubian thank you! I will try
wayneg (Sat, 01 Jul 2017 14:04:55 GMT):
End2EndIT run successfully, could I run query in command in peer (peer0.org1)?
wayneg (Sat, 01 Jul 2017 14:11:02 GMT):
peer chaincode query -C bar -n example_cc_go -c '{"Args":["query","b"]}' I get error after run this command in container
wayneg (Sat, 01 Jul 2017 14:11:28 GMT):
Error: Error endorsing query: rpc error: code = Unknown desc = chaincode error (status: 500, message: Unknown function call) -
rishabh1102 (Mon, 03 Jul 2017 13:17:42 GMT):
Has joined the channel.
rishabh1102 (Mon, 03 Jul 2017 13:21:31 GMT):
Is there documentation on how to use the java sdk from scratch?
rishabh1102 (Mon, 03 Jul 2017 13:22:11 GMT):
I'm running my peers and orderers on docker containers and want to query/invoke instantiated chaincode
rishabh1102 (Mon, 03 Jul 2017 13:22:16 GMT):
How can I achieve this?
rishabh1102 (Mon, 03 Jul 2017 14:15:10 GMT):
git reset --hard fabric-ca_commitlevel from above -> this gives me an error
rishabh1102 (Mon, 03 Jul 2017 14:15:23 GMT):
fatal: ambiguous argument 'fabric-ca_commitlevel': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git
rishabh1102 (Mon, 03 Jul 2017 14:15:39 GMT):
Anyone know how to fix this?
awattez (Mon, 03 Jul 2017 16:04:15 GMT):
Has joined the channel.
rishabh1102 (Mon, 03 Jul 2017 21:35:41 GMT):
Can anyone please explain how I could issue multiple invokes to an instantiated (deployed) chaincode using either nodeJS or Java SDK
By multiple invokes, I mean, that they should be issued in parallel, at a frequency of 60Hz
At least 60Hz*
guruce (Tue, 04 Jul 2017 06:23:52 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=eGvQgaEp3CW4ZSaZo) @rickr I managed to get the ChainCode event details by modifying sdk code,
guruce (Tue, 04 Jul 2017 06:23:52 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=eGvQgaEp3CW4ZSaZo) @rickr I managed to get the ChainCode event details with below code change in sdk,
org/hyperledger/fabric/sdk/ChaincodeActionDeserializer.java
ByteString getChainEvent() {
return getChaincodeAction().getEvents();
}
org/hyperledger/fabric/sdk/BlockInfo.java
public byte[] getCCEventPayload() throws InvalidProtocolBufferException {
ByteString eventByteString = transactionAction.getPayload().getAction().getProposalResponsePayload().getExtension().getChainEvent();
if (null != eventByteString) {
return ChaincodeEventOuterClass.ChaincodeEvent.parseFrom(eventByteString).getPayload().toByteArray();
}
return null;
}
zaishengming (Tue, 04 Jul 2017 07:01:11 GMT):
Has joined the channel.
smfaizalkhan (Tue, 04 Jul 2017 09:31:25 GMT):
Hello All,
smfaizalkhan (Tue, 04 Jul 2017 09:32:54 GMT):
I tried cloning github.com/hyperledger/fabric-sdk-java and run the unit Test
When i run using mvn test,i get the following error
Caused by: java.io.FileNotFoundException: /home/faizal/Projekcts/sample/fabric-sdk-java/target/protoc-dependencies/89c38d9d9690c5948055933a19673654/google/type/timeofday.proto (No such file or directory)
smfaizalkhan (Tue, 04 Jul 2017 09:33:33 GMT):
Can anyone let me know what mistake is it ?
rishabh1102 (Tue, 04 Jul 2017 10:05:31 GMT):
Is there any way of using the java sdk without vagrant (using the docker images)
rishabh1102 (Tue, 04 Jul 2017 10:05:54 GMT):
the docker images which are installed without the vm
nickmelis (Tue, 04 Jul 2017 12:39:43 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=nE6WsarcpKgD9JNAz)
nickmelis (Tue, 04 Jul 2017 12:40:09 GMT):
@adc how did you solve this? What certificate did you specify in the end?
liuwenliang0632 (Wed, 05 Jul 2017 05:39:54 GMT):
@rickr my change is not success . the error is not related to my change
liuwenliang0632 (Wed, 05 Jul 2017 05:40:05 GMT):
https://gerrit.hyperledger.org/r/#/c/11375/
rameshthoomu (Wed, 05 Jul 2017 13:47:20 GMT):
java e2e tests are failing intermittently in CI.. Some one please look into this issue https://jira.hyperledger.org/browse/FAB-5182
nickmelis (Wed, 05 Jul 2017 14:07:42 GMT):
any idea what's causing this error while running TLS? ```
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target```
nickmelis (Wed, 05 Jul 2017 14:07:57 GMT):
I can see someone had it before, but it's not clear what the solution was
nickmelis (Wed, 05 Jul 2017 14:08:53 GMT):
googling around, it seems that the fix for it is just to add the certificate in the "cacerts" to tell the JVM we trust it, but in my case it hasn't solved the problem
nickmelis (Wed, 05 Jul 2017 14:09:25 GMT):
also connection with the CA (https over TLS) works, problem is only with GRPCs
nickmelis (Wed, 05 Jul 2017 14:09:25 GMT):
also connection with the CA (https over TLS) works, problem appears to be only with GRPCs
nickmelis (Wed, 05 Jul 2017 14:09:43 GMT):
any hint anyone?
bdufour (Wed, 05 Jul 2017 14:38:19 GMT):
Has joined the channel.
SubbaBachina (Wed, 05 Jul 2017 20:11:27 GMT):
Has joined the channel.
wayneg (Thu, 06 Jul 2017 09:54:24 GMT):
I am running End2EndIT based RC1 code, got following error:
wayneg (Thu, 06 Jul 2017 09:54:24 GMT):
Order.sendTransaction name: orderer.example.com, url: grpc://localhost:7050
2017-07-06 09:51:58,040 ERROR OrdererClient:164 - sendTransaction error Send transactions failed. Reason: timeout
wayneg (Thu, 06 Jul 2017 09:54:24 GMT):
anyone can help?
IanSparkes (Thu, 06 Jul 2017 14:00:30 GMT):
Hi All, we're trying to finalise a client using the SDK, and we're seeing a lot of stack traces thrown out of the SDK from statements like this: ```} catch (TransactionException e) {
//logger.error(e.getMessage(), e);
throw e;
```
IanSparkes (Thu, 06 Jul 2017 14:01:03 GMT):
I've commented out the logger statements for the moment, but clearly that's not a good solution.
IanSparkes (Thu, 06 Jul 2017 14:02:25 GMT):
Is there already a task to clean up the exception handling?
nickmelis (Thu, 06 Jul 2017 17:06:16 GMT):
@here is any of you running the SKD on OSX?
pschnap (Thu, 06 Jul 2017 18:49:27 GMT):
I'm having trouble connecting the Java SDK to the orderer, it gives me the following errors when I try to initialize the channel in the SDK:
SDK-side:
> [TransactionException] UNAVAILABLE: Channel closed while performing protocol negotiation
and on the orderer side:
> orderer.example.com | 2017-07-06 17:48:29.474 UTC [grpc] Printf -> DEBU cc4 grpc: Server.Serve failed to complete security handshake from "10.0.2.2:64226": EOF
I've been poking around looking at the certificates but haven't found anything glaring yet; any help would be appreciated :)
chaitanya (Thu, 06 Jul 2017 18:50:33 GMT):
Hi, is there an example or some documentation/pointers to get me started on writing a BlockEvent listener using the JavaSDK ?
pschnap (Thu, 06 Jul 2017 19:07:55 GMT):
@chaitanya I was pointed to the End2endIT.java test file (under org.hyperledger.fabric.sdkintegration) when I requested an example; there might be something there using the BlockListener; there's also BlockEventTest.java under org.hyperledger.fabric.sdk in testing too
ffilozov1 (Thu, 06 Jul 2017 19:29:57 GMT):
Is anyone seeing an Eclipse error related to a modified .project file when import a newly cloned fabric-sdk-java repo?
ffilozov1 (Thu, 06 Jul 2017 19:29:57 GMT):
Is anyone seeing an Eclipse error related to a modified .project file when importing a newly cloned fabric-sdk-java repo?
ffilozov1 (Thu, 06 Jul 2017 19:29:57 GMT):
Is anyone seeing an Eclipse (Neon) error related to a modified .project file when importing a newly cloned fabric-sdk-java repo?
ffilozov1 (Thu, 06 Jul 2017 19:29:57 GMT):
Is anyone seeing an Eclipse (Neon) error related to a modified .project file when importing a newly cloned fabric-sdk-java repo?
jmcnevin (Thu, 06 Jul 2017 20:00:30 GMT):
Has left the channel.
SasagawaHiroshi (Fri, 07 Jul 2017 02:09:43 GMT):
Has joined the channel.
chaitanya (Fri, 07 Jul 2017 05:09:33 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=MaF5sEsFtiyKEJ9X3) @pschnap Thanks! Also, have you had a chance to test it against alpha-2 Fabric images?
Gaurav_Impro (Fri, 07 Jul 2017 08:13:40 GMT):
Has joined the channel.
pschnap (Fri, 07 Jul 2017 12:37:52 GMT):
@chaitanya I have not, I've been on the beta and planning to move to the rc once I get things worked out with what I'm currently doing (which isn't using the block events at all).
chaitanya (Fri, 07 Jul 2017 12:38:41 GMT):
@pschnap Sure no problem. Thanks anyway :)
pschnap (Fri, 07 Jul 2017 12:41:27 GMT):
:-D
tqumhieh (Fri, 07 Jul 2017 16:31:16 GMT):
Has joined the channel.
tqumhieh (Fri, 07 Jul 2017 16:32:45 GMT):
Hello guys, I'm getting started with Blockchain, and I have my network setup and running on docker over MAC, but I'm kind of lost in finding the needed steps to compile and java-idk, any hints are highly appreciated.
tqumhieh (Fri, 07 Jul 2017 16:32:45 GMT):
Hello guys, I'm getting started with Blockchain, and I have my network setup and running on docker over MAC, but I'm kind of lost in finding the needed steps to compile and java-sdk, any hints are highly appreciated.
yecineoueslati (Fri, 07 Jul 2017 16:49:41 GMT):
hello everybody
i want to get the error response from java chaincode but i dont know how
yecineoueslati (Fri, 07 Jul 2017 16:50:12 GMT):
Message Attachments
yecineoueslati (Fri, 07 Jul 2017 16:50:27 GMT):
Message Attachments
yecineoueslati (Fri, 07 Jul 2017 16:51:23 GMT):
i get the exception above invalidArgument
yecineoueslati (Fri, 07 Jul 2017 16:51:28 GMT):
thank you
blockcloud (Sat, 08 Jul 2017 03:00:02 GMT):
Has joined the channel.
blockcloud (Sat, 08 Jul 2017 03:02:16 GMT):
@rishabh1102 Have you find some guidelines about the fabric-sdk-java? I'm also confusing about how to use it in a java project.
blockcloud (Sat, 08 Jul 2017 03:39:14 GMT):
@yecineoueslati Hi yecineoueslati, could you teach me how to use fabric-sdk-java in a java project? Thank you
dushyant (Sat, 08 Jul 2017 13:48:55 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=TAchL8EDM2vjhkeC7) @ffilozov1 yes, I fixed this error by running the following command in my fabric-sdk-java directory - mvn eclipse:clean eclipse:eclipse
smfaizalkhan (Sun, 09 Jul 2017 07:14:11 GMT):
Hello All,
I tried cloning github.com/hyperledger/fabric-sdk-java and run the unit test from IDE ,When i clcik on End2endIt and tried to run as Junit,it says No Junint test found.What am i missing ?
smfaizalkhan (Sun, 09 Jul 2017 07:49:52 GMT):
But other projects Junit Testing running
chenxuan (Sun, 09 Jul 2017 13:29:57 GMT):
you should
chenxuan (Sun, 09 Jul 2017 13:30:06 GMT):
learn java
chenxuan (Mon, 10 Jul 2017 03:15:50 GMT):
INTERNAL: io.grpc.netty.NettyClientTransport$3: Frame size 4666139 exceeds maximum: 4194304.
hime-cn (Mon, 10 Jul 2017 06:38:20 GMT):
Has joined the channel.
bh4rtp (Mon, 10 Jul 2017 08:21:19 GMT):
does the latest java sdk not support eclipse neon.2 any longer? i import the pom.xml in the root path of java sdk using eclipse neon.2, and there is only a demo chaincode project created.
bh4rtp (Mon, 10 Jul 2017 08:41:30 GMT):
sorry i found the reason. i deleted previous version from eclipse and re-cloned the latest sdk. the previous remained information must be cleaned.
yecineoueslati (Mon, 10 Jul 2017 09:22:16 GMT):
hi @blockcloud,
the first step is to run the endToEnd test case of the fabric-sdk-java
for this you must follow these steps
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric-ca
git reset --hard fabric-ca_commitlevel from above
cd ../fabric
git reset --hard fabric_commitlevel from above
cd devenv
change the Vagrant file as suggested below:
vagrant up
vagrant ssh
make docker
cd ../fabric-ca
make docker
cd ../fabric/sdkintegration
docker-compose down; rm -rf /var/hyperledger/*; docker-compose up --force-recreate
yecineoueslati (Mon, 10 Jul 2017 09:22:55 GMT):
after that there is a hack to run java chaincode
yecineoueslati (Mon, 10 Jul 2017 10:45:51 GMT):
It appears that handling errors in invoke fuctions is possible by events
but i dont find an example with the java sdk
if anybody havean exxample
thx
rishabh1102 (Mon, 10 Jul 2017 12:22:29 GMT):
@blockcloud , no, not yet
chaitanya (Mon, 10 Jul 2017 12:35:19 GMT):
@pschnap I'm having trouble connecting the JavaSDK to an existing network that I set up using docker-compose. The error I see on the docker logs of the orderer is `grpc: Server.Serve failed to complete security handshake from "172.22.0.1:59256": tls: first record does not look like a TLS handshake`
chaitanya (Mon, 10 Jul 2017 12:35:29 GMT):
Any idea, what's the problem here?
chaitanya (Mon, 10 Jul 2017 13:41:12 GMT):
Ah, I figured. My SDK properties had tls disabled for some reason.
pschnap (Mon, 10 Jul 2017 13:51:19 GMT):
glad you got it figured out! I'm still transitioning to RC1 and haven't gotten communication with the ledger from the SDK worked out yet
pschnap (Mon, 10 Jul 2017 13:52:05 GMT):
I was seeing a similar error that I was debugging and wanted to wait to respond until I'd worked that out in case it was related, but it turns out it wasn't
FollowingGhosts (Mon, 10 Jul 2017 14:57:41 GMT):
Has joined the channel.
pschnap (Mon, 10 Jul 2017 15:09:21 GMT):
Which certificate do I need to pass to the CA when trying to enroll a user? The cacert?
pschnap (Mon, 10 Jul 2017 17:56:14 GMT):
nvm, it was a config issue
pschnap (Mon, 10 Jul 2017 17:57:06 GMT):
How do I add TLS certs for the SDK to use? I'm having trouble getting it to talk to my orderer
pschnap (Mon, 10 Jul 2017 18:30:30 GMT):
I can talk to the CA but when I go to initialize a channel it errors with:
> TransactionException: UNAVAILABLE: Channel closed while performing protocol negotiation
and the orderer gives me:
> orderer.example.com | 2017-07-10 18:29:43.372 UTC [grpc] Printf -> DEBU d2d grpc: Server.Serve failed to complete security handshake from "10.0.2.2:53973": EOF
pschnap (Mon, 10 Jul 2017 18:31:18 GMT):
any ideas?
liuwenliang0632 (Tue, 11 Jul 2017 06:00:28 GMT):
@rickr please help me review https://gerrit.hyperledger.org/r/#/c/11375
chenxuan (Tue, 11 Jul 2017 12:35:48 GMT):
hi everyoen
chenxuan (Tue, 11 Jul 2017 12:35:50 GMT):
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: could not find chaincode with name 'example_cc_go' - make sure the chaincode example_cc_go has been successfully instantiated and try again
chenxuan (Tue, 11 Jul 2017 12:36:16 GMT):
when i want to the runChannel
chenxuan (Tue, 11 Jul 2017 12:36:21 GMT):
it tell me the error
chenxuan (Tue, 11 Jul 2017 12:36:33 GMT):
however the chaincode starts successfully
chenxuan (Tue, 11 Jul 2017 12:36:50 GMT):
Collection
chenxuan (Tue, 11 Jul 2017 12:44:55 GMT):
the peer
chenxuan (Tue, 11 Jul 2017 12:44:56 GMT):
peer1.org1.example.com | 2017-07-11 12:43:32.949 UTC [lscc] Invoke -> ERRO 3d3 error getting chaincode example_cc_go on channel: foo(err:could not find chaincode with name 'example_cc_go')
chenxuan (Tue, 11 Jul 2017 12:45:07 GMT):
show me the log
chaitanya (Tue, 11 Jul 2017 13:17:12 GMT):
@pschnap Check your certificate paths in the SDK code. Are you using the right cryptogen/configtxgen to generate crypto stuff? (seems obvious, but turns out I had them mismatched myself)
tsnyder (Tue, 11 Jul 2017 13:17:52 GMT):
@rickr How can a client which is encapsulating the fabric java sdk be notified / determine when a Peer connection is dropped (ie. a connection exception is encountered? Same for the Event Hub connections?
pschnap (Tue, 11 Jul 2017 13:27:53 GMT):
@chaitanya essentially I added CAs to the first-network example; I assume the crypto stuff was complete for that example. The SDK connects to one of the CAs I set up ok using the certificate I copied from the crypto stuff (into the VM where I'm developing with the SDK) but then it can't connect to the orderer
pschnap (Tue, 11 Jul 2017 13:38:42 GMT):
@chaitanya I'll poke around; thanks for the suggestions!
ymchee (Tue, 11 Jul 2017 15:16:20 GMT):
Has joined the channel.
chaitanya (Tue, 11 Jul 2017 15:44:47 GMT):
I'm seeing the error `Failed to deserialize creator identity, err MSP Org1MSP is unknown` when I'm trying to get a block from the network. My hunch is perhaps my `peerOrg1.mspid` property value is wrong. Has anyone handled this before?
One of the lines in the orderer logs reads: ```2017-07-11 12:56:20.589 UTC [msp/identity] newIdentity -> DEBU 8a9 Creating identity instance for ID &{Org1MSP ebd50bcc9fcf04a8874b5f1de558cc833b4b67474b46a25b2158b0c72fcb1cc6}
2017-07-11 12:56:20.589 UTC [cauthdsl] func2 -> DEBU 8aa 0xc42011c1e8 identity 0 does not satisfy principal: The identity is a member of a different MSP (expected OrdererMSP, got Org1MSP)```
sqwerrels (Tue, 11 Jul 2017 16:21:48 GMT):
Hi, Im poking around the End2EndIT tests and currently both channels are predefined at the start. Is there a way to dynamically add new orgs and peers that weren't previously defined after the channels have been installed?
rickr (Tue, 11 Jul 2017 18:02:02 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=fzffbbAYPfqpBfpQe) Nothing is being merged now till we decide how we'll be handling V1.1 branching in git and gerrit ... stay tuned
pschnap (Tue, 11 Jul 2017 18:11:26 GMT):
@chaitanya looks like it wants you to use "OrdererMSP" instead of "Org1MSP", can't say why though
rickr (Tue, 11 Jul 2017 18:16:09 GMT):
The Peer is not a streaming API. I have not seen a way to be asynchronously notified _reliably_ if it's connection drops (grpc maintains a connection) That said, I think when you try to send the next request to the Peer you should see an exception. Any exception _should_ cause Peer or Orderer to abandon current grpc connection and try a new connection.
The event hub is a streaming api with a call back. If it detects a disconnect it *should* by default try to reconnect. I did some _limited_ testing on this but not exhaustive. See on EventHub.java setEventHubDisconnectHandler
chaitanya (Wed, 12 Jul 2017 08:00:53 GMT):
@pschnap I'm still getting the `Failed to deserialize creator identity, err MSP Org1MSP is unknown` when I'm trying to get a block from the network, at my JavaSDK end, but no errors on the docker logs of the orderer.
Any pointers on how to fix this? @rickr
MingChaoWAN (Wed, 12 Jul 2017 08:11:03 GMT):
Has joined the channel.
HugoPu (Wed, 12 Jul 2017 08:24:54 GMT):
Has joined the channel.
HugoPu (Wed, 12 Jul 2017 08:25:58 GMT):
@chaitanya I got the same problem when I try to create a new channel, how did you fix this issue?
chaitanya (Wed, 12 Jul 2017 08:27:17 GMT):
@HugoPu If you're getting it on trying to create a Channel, it is likely that your certificate paths aren't correct...What errors does docker logs orderer.example.com show?
HugoPu (Wed, 12 Jul 2017 08:35:47 GMT):
@chaitanya sorry, I forgot to mention the problem is 'grpc: Server.Serve failed to complete security handshake from "172.22.0.1:59256": tls: first record does not look like a TLS handshake'. I got this problem when I try to create a new channel. The way I tried to create a new channel was the same as the unit test 'End2endIT', and when I trid to run 'End2endIT', I got the same problem
chaitanya (Wed, 12 Jul 2017 08:36:36 GMT):
@HugoPu Sure, in that case, I think your SDK doesn't have tls enabled ...check if the parameter is false/null, instead of true?
HugoPu (Wed, 12 Jul 2017 08:44:12 GMT):
@chaitanya Thank you, will come back to ask you if I can't find how to enable tls.
HugoPu (Wed, 12 Jul 2017 09:08:45 GMT):
@chaitanya `Properties ordererProperties = testConfig.getOrdererProperties(orderName);Properties ret = new Properties();
ret.setProperty("pemFile", cert.getAbsolutePath());
// ret.setProperty("trustServerCertificate", "true"); //testing environment only NOT FOR PRODUCTION!
ret.setProperty("hostnameOverride", name);
ret.setProperty("sslProvider", "openSSL");
ret.setProperty("negotiationType", "TLS");
`
HugoPu (Wed, 12 Jul 2017 09:08:45 GMT):
@chaitanya ```Properties ordererProperties = testConfig.getOrdererProperties(orderName);Properties ret = new Properties();
ret.setProperty("pemFile", cert.getAbsolutePath());
// ret.setProperty("trustServerCertificate", "true"); //testing environment only NOT FOR PRODUCTION!
ret.setProperty("hostnameOverride", name);
ret.setProperty("sslProvider", "openSSL");
ret.setProperty("negotiationType", "TLS");
```
HugoPu (Wed, 12 Jul 2017 09:08:45 GMT):
@chaitanya ```Properties ordererProperties = testConfig.getOrdererProperties(orderName);Properties ret = new Properties();
ret.setProperty("pemFile", cert.getAbsolutePath());
// ret.setProperty("trustServerCertificate", "true"); //testing environment only NOT FOR PRODUCTION!
ret.setProperty("hostnameOverride", name);
ret.setProperty("sslProvider", "openSSL");
ret.setProperty("negotiationType", "TLS");
```
It looks like it has already set "TLS", could you give me some help?
HugoPu (Wed, 12 Jul 2017 09:10:18 GMT):
@chaitanya It looks like it has already set "TLS", could you give me some help?
chaitanya (Wed, 12 Jul 2017 09:36:04 GMT):
@HugoPu From what I have at my end, there's a property "integrationtests.tls" that I had to set to "true"
chaitanya (Wed, 12 Jul 2017 09:36:04 GMT):
@HugoPu From what I have at my end, there's a property "integrationtests.tls" that I had to set to "true". I'm working with beta
chaitanya (Wed, 12 Jul 2017 09:44:25 GMT):
I have been following TestConfig.java https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdk/testutils/TestConfig.java
chaitanya (Wed, 12 Jul 2017 09:47:02 GMT):
>It looks like it has already set "TLS", could you give me some help?
The change I suggested is to be made in the Config() constructor, not in the orderer properties
riancu (Wed, 12 Jul 2017 10:09:08 GMT):
Has joined the channel.
Rachitga (Wed, 12 Jul 2017 13:09:31 GMT):
Hello All,
Am using sdk-java at the client,
I was trying to generate a channel creation request, but for some reason the channel creation is taking much longer due to some changes I have made at the fabric side.
I wanted to know how I could increase my timeout for which the client is sending a deliver request to the orderer, its presently showing 5 seconds as the timeout in the log at my client.
rickr (Wed, 12 Jul 2017 13:26:10 GMT):
On the Orderer set a property "ordererWaitTimeMilliSecs" to "ordererWaitTimeMilliSecs" then set the system property to "ordererWaitTimeMilliSecs" to "10000" .. for 10 seconds actually a bug but that's what you need to do for now :(
cjvkrishna (Wed, 12 Jul 2017 13:27:21 GMT):
Has joined the channel.
cjvkrishna (Wed, 12 Jul 2017 13:30:18 GMT):
Hi All, I am trying to get a POC done with java-sdk. I am getting the following error: "org.hyperledger.fabric.sdk.exception.ProposalException: Peer peer0.org1.example.com channel query return with empty fabric response". I couldn't find anything related to this proposal in the peer0.org1 docker instance. How do I debug this?
Rachitga (Wed, 12 Jul 2017 13:31:23 GMT):
@rickr, so the property should exist at the client side, what do you mean by change on the orderer, can you point me to the specific file you are mentioning the change in
Rachitga (Wed, 12 Jul 2017 13:36:18 GMT):
presently I have changed the file fabric-sdk-java/src/main/java/org/hyperledger/fabric/sdk/Channel.java in function getGenesisBlock,
```
if (duration > config.getGenesisBlockWaitTime()) {
throw new TransactionException(format("Getting genesis block time exceeded %s seconds for channel %s", Long.toString(TimeUnit.MILLISECONDS.toSeconds(duration)), name));
}
```
to
```
if (duration > config.getGenesisBlockWaitTime()+300000) {
throw new TransactionException(format("Getting genesis block time exceeded %s seconds for channel %s", Long.toString(TimeUnit.MILLISECONDS.toSeconds(duration)), name));
}
```
Rachitga (Wed, 12 Jul 2017 13:37:04 GMT):
i know my set value for the timeout is too huge, but i wanted to be sure that my changes in the fabric code wern't the issue
Rachitga (Wed, 12 Jul 2017 13:37:04 GMT):
the code seems to be working now
Rachitga (Wed, 12 Jul 2017 13:37:49 GMT):
but i still wanted to know in which file i should make this change to
Rachitga (Wed, 12 Jul 2017 13:37:49 GMT):
but i still wanted to know in which file i should make the change to the wait time
rickr (Wed, 12 Jul 2017 14:45:51 GMT):
That's different wait time. You can set env var ORG_HYPERLEDGER_FABRIC_SDK_CHANNEL_GENESISBLOCK_WAIT_TIME=40000
or There is a config.properties org.hyperledger.fabric.sdk.channel.genesisblock_wait_time=40000 for like 40 seconds
cjvkrishna (Wed, 12 Jul 2017 23:50:54 GMT):
Okay I got past my previous error .. Now I am stuck on another error:
[ERROR] Enrollment failure: open /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem: input/output error
cjvkrishna (Wed, 12 Jul 2017 23:51:52 GMT):
Looks like the CA for peerOrg1 can not find the certificate pem file. Is the path incorrect? How do I correct this in docker-compose file?
zhangmenghang (Thu, 13 Jul 2017 01:39:27 GMT):
hi,i‘m using sdk 1.0 for fabric 10. release, channel is successfully created and chaincode is initialized, but when invoke the chaincode,it fails:
zhangmenghang (Thu, 13 Jul 2017 01:39:29 GMT):
2017-07-13 01:32:30,296 ERROR Channel:2029 - Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate has expired or is not yet valid, cause=null}
zhangmenghang (Thu, 13 Jul 2017 01:39:47 GMT):
all things is ok when i use cli
Rachitga (Thu, 13 Jul 2017 06:03:30 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ofHd49YukwQGaXKYj) @rickr thanks!
HugoPu (Thu, 13 Jul 2017 06:38:01 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=sHuLnPz83xEMtuAc9) @chaitanya Thanks for helping, After I set runningFabricTLS to be true, I got another problem ```Received error on channel foo, orderer orderer.example.com, url grpcs://192.168.53.20:7050, UNAVAILABLE: Channel closed while performing protocol negotiation
io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation``` . The logs of orderer.example.com is ```grpc: Server.Serve failed to complete security handshake from "192.168.54.233:48721": EOF```. Do you have any idea?
HugoPu (Thu, 13 Jul 2017 06:38:01 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=sHuLnPz83xEMtuAc9) @chaitanya Thanks for helping, After I set runningFabricTLS to be true, I got another problem ```Received error on channel foo, orderer orderer.example.com, url grpcs://192.168.53.20:7050, UNAVAILABLE: Channel closed while performing protocol negotiation
io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation``` . The logs of orderer.example.com is ```grpc: Server.Serve failed to complete security handshake from "192.168.54.233:48721": EOF``` . Do you have any idea?
HugoPu (Thu, 13 Jul 2017 06:38:01 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=sHuLnPz83xEMtuAc9) @chaitanya Thanks for helping, After I set runningFabricTLS to be true, I got another problem ```Received error on channel foo, orderer orderer.example.com, url grpcs://192.168.53.20:7050, UNAVAILABLE: Channel closed while performing protocol negotiation
io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation``` . The logs of orderer.example.com is `grpc: Server.Serve failed to complete security handshake from "192.168.54.233:48721": EOF` . Do you have any idea?
HugoPu (Thu, 13 Jul 2017 06:38:01 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=sHuLnPz83xEMtuAc9) @chaitanya Thanks for helping, After I set runningFabricTLS to be true, I got another problem ```Received error on channel foo, orderer orderer.example.com, url grpcs://192.168.53.20:7050, UNAVAILABLE: Channel closed while performing protocol negotiation
io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation``` . The log on orderer.example.com is `grpc: Server.Serve failed to complete security handshake from "192.168.54.233:48721": EOF` . Do you have any idea?
HugoPu (Thu, 13 Jul 2017 06:38:01 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=sHuLnPz83xEMtuAc9) @chaitanya Thanks for helping, After I set runningFabricTLS to be true, I got another problem ```Received error on channel foo, orderer orderer.example.com, url grpcs://192.168.53.20:7050, UNAVAILABLE: Channel closed while performing protocol negotiation
io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation``` The log on orderer.example.com is `grpc: Server.Serve failed to complete security handshake from "192.168.54.233:48721": EOF` . Do you have any idea?
moulali308 (Thu, 13 Jul 2017 09:11:54 GMT):
Has joined the channel.
moulali308 (Thu, 13 Jul 2017 09:12:08 GMT):
Hello all
moulali308 (Thu, 13 Jul 2017 09:12:50 GMT):
Can I any link to know about Fabric SDK in detail
CarlXK (Thu, 13 Jul 2017 10:29:06 GMT):
@rickr @jimthematrix could the sdk attach to a overlay network, i use docker swarm and create a overlay network xnqkl, set CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=xnqkl,
when i use java sdk to connect , report error
```
07-13 10:16:39.825 ERROR o.h.f.s.Channel - Sending proposal to peer0.org1.xnqkl.com failed because of: gRPC failure=Status{code=UNKNOWN, description=Error starting container: API error (500): {"message":"Could not attach to network xnqkl: rpc error: code = 7 desc = network xnqkl not manually attachable"}
, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Error starting container: API error (500): {"message":"Could not attach to network xnqkl: rpc error: code = 7 desc = network xnqkl not manually attachable"}
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2029)
at org.hyperledger.fabric.sdk.Channel.sendInstantiationProposal(Channel.java:1174)
at com.xiangan.platform.deploy.DeployChainCode.deployChainCode(DeployChainCode.java:282)
at com.xiangan.platform.deploy.DeployChainCode.deploy(DeployChainCode.java:122)
at com.xiangan.platform.deploy.DeployChainCode.deployChaincode(DeployChainCode.java:89)
at com.xiangan.platform.deploy.DeployChainCode.main(DeployChainCode.java:64)
```
CarlXK (Thu, 13 Jul 2017 10:29:06 GMT):
@rickr @jimthematrix could the sdk attach to a overlay network, i use docker swarm and create a overlay network xnqkl, set CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=xnqkl,
when i use java sdk to connect , report error
```
07-13 10:16:39.825 ERROR o.h.f.s.Channel - Sending proposal to peer0.org1.xnqkl.com failed because of: gRPC failure=Status{code=UNKNOWN, description=Error starting container: API error (500): {"message":"Could not attach to network xnqkl: rpc error: code = 7 desc = network xnqkl not manually attachable"}
, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Error starting container: API error (500): {"message":"Could not attach to network xnqkl: rpc error: code = 7 desc = network xnqkl not manually attachable"}
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2029)
at org.hyperledger.fabric.sdk.Channel.sendInstantiationProposal(Channel.java:1174)
at com.xiangan.platform.deploy.DeployChainCode.deployChainCode(DeployChainCode.java:282)
at com.xiangan.platform.deploy.DeployChainCode.deploy(DeployChainCode.java:122)
at com.xiangan.platform.deploy.DeployChainCode.deployChaincode(DeployChainCode.java:89)
at com.xiangan.platform.deploy.DeployChainCode.main(DeployChainCode.java:64)
```
and the network info
```
root@VM-2-43-ubuntu:~# docker network ls
NETWORK ID NAME DRIVER SCOPE
72fd6ca5eafe bridge bridge local
09146bfa58db docker_gwbridge bridge local
6b14314ea011 host host local
nodb6iz8dgn3 ingress overlay swarm
f632f6af0801 none null local
ebohqg2uovtb xnqkl overlay swarm
```
rickr (Thu, 13 Jul 2017 12:45:13 GMT):
I don't think that an error of the SDK I'm first _guess_ is it's an issue with the peer starting the container for the chaincode. From the SDK perspective I think the if it can send requests to peers and orderers it should be ok. I'm thinking this best would be posted on the #fabric-peer-endorser-committer channel.
rickr (Thu, 13 Jul 2017 12:45:13 GMT):
I don't think that an error of the SDK. My first _guess_ is it's an issue with the peer starting the container for the chaincode. From the SDK perspective I think if it can send requests to peers and orderers it should be ok. I'm thinking this best would be posted on the #fabric-peer-endorser-committer channel. Provide a full link to the peer logs via some pastit utility.
jordan.k.miles (Thu, 13 Jul 2017 14:50:34 GMT):
Has joined the channel.
jordan.k.miles (Thu, 13 Jul 2017 14:50:53 GMT):
has anyone tried using the fabric-sdk-java with ivy/ant?
liuwenliang0632 (Thu, 13 Jul 2017 17:03:03 GMT):
hi @rickr u can reply me on FAB-5178 .
chenxuan (Fri, 14 Jul 2017 08:26:55 GMT):
import org.hyperledger.fabric.protos.orderer.AtomicBroadcastGrpc;
chenxuan (Fri, 14 Jul 2017 08:26:55 GMT):
the class
chenxuan (Fri, 14 Jul 2017 08:26:55 GMT):
@rickr don't find
liuwenliang0632 (Fri, 14 Jul 2017 09:57:04 GMT):
using maven update
jordan.k.miles (Fri, 14 Jul 2017 13:29:02 GMT):
will the sdk build break if I exclude the jacoco plugin? I don't want all those libraries cluttering up my path.
rickr (Fri, 14 Jul 2017 13:41:08 GMT):
If you're building an application on top the SDK you shouldn't even be downloading it. Your application should be pulling it down from Maven.
rickr (Fri, 14 Jul 2017 13:42:26 GMT):
Only reason to get the SDK is to see the samples (End2end...IT.java) and if you plan to develop the SDK itself.
jordan.k.miles (Fri, 14 Jul 2017 14:09:55 GMT):
I pulled the org.hyperledger.fabric-sdk-java jar from the maven repo, but the project is an ivy/ant build. When I pulled it in, I got a few errors about missing maven dependencies (coming from the jacoco plugin).
jordan.k.miles (Fri, 14 Jul 2017 14:10:24 GMT):
I ended up pulling in those dependencies, then pulling in the fabric-sdk-java jar, then excluding them. everything built so that may work.
rickr (Fri, 14 Jul 2017 14:37:50 GMT):
Right now the only dependency shouldn't be there is jacoco-maven-plugin. Need to figure out how to exclude
ssaddem (Fri, 14 Jul 2017 14:57:10 GMT):
hi i have not tested yet but does java sdk support permitted users (can i from chaincode retreive getcreator) ? if not do you plan to add support in the next version ?
ssaddem (Fri, 14 Jul 2017 14:57:10 GMT):
hi i have not tested yet but does java sdk support permitted users (can i from chaincode retreive getcreator) in v1.0.0 ? if not do you plan to add support in the next version ?
ssaddem (Fri, 14 Jul 2017 14:57:10 GMT):
@rickr hi i have not tested yet but does java sdk support permitted users (can i from chaincode retreive getcreator) in v1.0.0 ? if not do you plan to add support in the next version ?
kustrun (Fri, 14 Jul 2017 15:25:10 GMT):
Has joined the channel.
rickr (Fri, 14 Jul 2017 15:27:23 GMT):
I don't think this would be an SDK todo. Something the chaincode stub should provide if I'm understanding your question. Probably best asked in #fabric channel
kustrun (Fri, 14 Jul 2017 18:29:47 GMT):
Hi! Does there exists a tutorial how to connect to channel which is already running? I would like to use existing peer credentials which are already generated in folder crypto-config?
clempo (Fri, 14 Jul 2017 20:07:27 GMT):
@kustrun, did you look at the End2endAndBackAgainIT sample?
clempo (Fri, 14 Jul 2017 20:07:48 GMT):
@rickr, there is a typo in this method name: nsRwsetInfo.getNaamespace()
clempo (Fri, 14 Jul 2017 20:10:14 GMT):
I am looking at the blockWalker in End2EndIT, I think the principle of iteration should be standardized. The walker loops in at least 3 different ways because the underlying classes forces different ways
clempo (Fri, 14 Jul 2017 20:11:00 GMT):
I think the block info classes are getting confused between an Endorser and an Endorsement
clempo (Fri, 14 Jul 2017 20:11:51 GMT):
The thing that contains the endorser signature should be an Endorsement, not an Endorser
clempo (Fri, 14 Jul 2017 20:13:00 GMT):
The SDK should make up its mind if it spells Envelop or Envelope
clempo (Fri, 14 Jul 2017 20:17:23 GMT):
I like that we now call newChannel instead of newChain, this is much clearer
xinpei8 (Fri, 14 Jul 2017 22:34:02 GMT):
Has joined the channel.
xinpei8 (Fri, 14 Jul 2017 22:39:12 GMT):
Hi all, I am trying to update the channel configuration to add a new org onto the channel. To do so, it seems that we need the SDK to retrieve the latest config. Is there any public method in the java-sdk that can return the latest configuration block? I see there are getConfigurationBlock() and getGenesisBlock() in Channel.java but they're all private. Thank you!
guo (Sat, 15 Jul 2017 07:45:39 GMT):
Has joined the channel.
guo (Sat, 15 Jul 2017 07:50:59 GMT):
hi guys , in release 1.0.0, i saw" [FAB-3850] disable java chaincode as its WIP", my question is: if i use fabric java sdk 1.0.0, can i install/deploy/run the java version chaincode ?
chenxuan (Sat, 15 Jul 2017 10:06:30 GMT):
@rickr do you test the tps use the sdk
smfaizalkhan (Sun, 16 Jul 2017 08:08:23 GMT):
Hello All,My understanding is each peer ,orderer will be seprate physical machines which will have the chaicode as an image installed on top of hyperledger fabric ,thats how they maintain the world
state.Now how to form a network between these all physical machines using docker.Help appreciated
sajeevkhan (Sun, 16 Jul 2017 08:33:11 GMT):
Has joined the channel.
sajeevkhan (Sun, 16 Jul 2017 08:35:33 GMT):
Hi, I am using the JAVA SDK to enroll a user. On enrolling the user, I get the enrollment certificate (Key and Certificate) and I want to save this on the local database at the client. It would be great if you can let me know the best practice to store and retrieve the private key and certificate. Thanks, Sajeev
chaitanya (Sun, 16 Jul 2017 17:28:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dzrPQ5LvN7mPS2XPY) @HugoPu I haven't got the channel closed error so far, but I have only tried connecting the SDK to an existing network. See if your certs are alright and pointed to correctly in your SDK code (for the EOF error). Also, check for any other channel.shutdown() calls that may have missed your eye. That's all I can think of, sorry..
chaitanya (Sun, 16 Jul 2017 18:14:47 GMT):
Hi, can anyone point me to an example that I could use to get BlockEvents as and when blocks are committed to the ledger, using the JavaSDK? I've seen the blockwalker() function in End2EndIT.java, but I need something that works as a listener, and not by querying the height of the chain always. I can think of a naive infinite loop solution using the blockwalker() calls, but I guess there might be a better way to do this?
chaitanya (Sun, 16 Jul 2017 18:14:47 GMT):
Hi, can anyone point me to an example that I could use to get BlockEvents as and when blocks are committed to the ledger, using the JavaSDK? I've seen the blockwalker() function in End2EndIT.java, but I need something that works as a listener, and not by querying the height of the chain always. I can think of a naive infinite loop solution using the blockwalker() calls, but is there a better way to do this?
chaitanya (Sun, 16 Jul 2017 18:14:47 GMT):
Hi, can anyone point me to an example that I could use to get BlockEvents as and when blocks are committed to the ledger, using the JavaSDK? I've seen the blockwalker() function in End2EndIT.java, but I need something that works as a listener, and not by querying the height of the chain always. I can think of a naive infinite loop solution using the blockwalker() calls, but is there a better way to do this?
@pschnap @rickr
jordan.k.miles (Sun, 16 Jul 2017 19:07:16 GMT):
using just the test membersrvc:
membersrvc:
image: hyperledger/fabric-membersrvc
ports:
- "7054:7054"
command: membersrvc
is it possible to connect to it with the java sdk? I
jordan.k.miles (Sun, 16 Jul 2017 19:08:23 GMT):
I'm trying to enroll an existing user with `caClient.enroll( "test_vp0", "MwYpmSRjupbT" )` but all I'm getting back from the Docker container is `received bogus greeting from client: "POST /api/v1/enroll HTTP"`
dushyant (Sun, 16 Jul 2017 22:19:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=kvG8beTBQ7wPYr72D) @chaitanya I think you could add a listener to a channel via Channel.registerBlockListener function which will give you event notifications.
chaitanya (Mon, 17 Jul 2017 04:52:07 GMT):
@dushyant I tried doing that-- defined a BlockListener, passed that into the registerBlockListener() function, wrote out the `received` method for the BlockListener I had defined, but that didn't quite do it. Could you point me to an example or snippet on these lines?
paapighoda (Mon, 17 Jul 2017 05:47:29 GMT):
Has joined the channel.
paapighoda (Mon, 17 Jul 2017 05:48:14 GMT):
Is there a Java tutorial on the Fabric?
dushyant (Mon, 17 Jul 2017 06:28:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RLRDbLcjDrzncgqNa) @chaitanya I don't know of an example which shows this but I tried doing this inside End2EndIT itself and it worked, are you getting any errors when you register your listener?
chaitanya (Mon, 17 Jul 2017 07:23:00 GMT):
@dushyant I'm not getting any errors on trying to register my listener. I think I fixed it, using threads.
dushyant (Mon, 17 Jul 2017 07:46:42 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=T8WNCmxfPCNryD7CZ) @chaitanya are you running a listener in another thread or using blockwalker() calls in a thread to query blocks?
dushyantbehl (Mon, 17 Jul 2017 07:56:18 GMT):
Has joined the channel.
Codegidi (Mon, 17 Jul 2017 12:25:46 GMT):
Has joined the channel.
mescoba1 (Mon, 17 Jul 2017 17:03:57 GMT):
Has joined the channel.
jordan.k.miles (Mon, 17 Jul 2017 18:45:12 GMT):
anybody?
rickr (Mon, 17 Jul 2017 19:18:04 GMT):
Where are you seeing `hyperledger/fabric-membersrvc` ?
rickr (Mon, 17 Jul 2017 19:20:48 GMT):
JSDK has a client for connecting to Fabaric-CA which is a replacement for membersrvc
jordan.k.miles (Tue, 18 Jul 2017 00:25:01 GMT):
it's the image in my docker-compose.yaml from following this guide: https://www.ibm.com/developerworks/java/library/j-chaincode-for-java-developers/index.html?ca=drs-
Rachitga (Tue, 18 Jul 2017 08:09:52 GMT):
Hello All,
I was changing some code at the java-sdk side, specifically this part in the code, in file
https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java
```
channel.sendTransaction(successful, orderers).thenApply(transactionEvent -> {
waitOnFabric(0);
assertTrue(transactionEvent.isValid()); // must be valid to be here.
out("Finished instantiate transaction with transaction id %s", transactionEvent.getTransactionID());
try {
successful.clear();
failed.clear();
.......
.......
.......
client.setUserContext(sampleOrg.getUser(TESTUSER_1_NAME));
////////////////////////////
// Send Transaction Transaction to orderer
out("Sending chaincode transaction(move a,b,100) to orderer.");
return channel.sendTransaction(successful).get(testConfig.getTransactionWaitTime(), TimeUnit.SECONDS);
}
```
I am getting the following error, can someone explain me the possible reasons for this?
java.util.concurrent.ExecutionException: org.hyperledger.fabric.sdk.exception.TransactionEventException: Received invalid transaction event. Transaction ID d7e8cbacfd1b66fd3827b7dd282bd98932afeefafbfc5fd75f7819b7b9da47d8 status 11
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
at org.hyperledger.fabric.sdkintegration.End2endIT.lambda$runChannel$0(End2endIT.java:386)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
at org.hyperledger.fabric.sdk.Channel$TL.lambda$fire$1(Channel.java:2555)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Rachitga (Tue, 18 Jul 2017 08:10:57 GMT):
I was looking for someone to explain me the specifics of return channel.sendTransaction(successful).get(testConfig.getTransactionWaitTime(), TimeUnit.SECONDS);, and the transactionEvent variables
chenxuan (Tue, 18 Jul 2017 08:43:38 GMT):
@rickr the txId may be same
chenxuan (Tue, 18 Jul 2017 08:43:39 GMT):
?
chenxuan (Tue, 18 Jul 2017 08:43:57 GMT):
i think you should have a good way to create the txid
chenxuan (Tue, 18 Jul 2017 08:44:37 GMT):
public TransactionContext(Channel channel, User user, CryptoSuite cryptoPrimitives) {
this.user = user;
this.channel = channel;
//TODO clean up when public classes are interfaces.
this.verify = !"".equals(channel.getName()); //if name is not blank not system channel and need verify.
// this.txID = transactionID;
this.cryptoPrimitives = cryptoPrimitives;
identity = ProtoUtils.createSerializedIdentity(getUser());
ByteString no = getNonce();
ByteString comp = no.concat(identity.toByteString());
byte[] txh = cryptoPrimitives.hash(comp.toByteArray());
// txID = Hex.encodeHexString(txh);
txID = new String(Utils.toHexString(txh));
}
chenxuan (Tue, 18 Jul 2017 08:44:46 GMT):
i think txID = new String(Utils.toHexString(txh));
chenxuan (Tue, 18 Jul 2017 08:44:56 GMT):
is not a good method to produce the txid
chenxuan (Tue, 18 Jul 2017 08:45:16 GMT):
because i use the multiple thread to test
chenxuan (Tue, 18 Jul 2017 08:45:19 GMT):
find the txid
chenxuan (Tue, 18 Jul 2017 08:46:24 GMT):
is duplicate
DeutscheBahn-BlockchainDev (Tue, 18 Jul 2017 09:50:43 GMT):
Dear All, is there any way I may dynamically ask the Fabric which are the Peers who are registered on a Channel?
ShobhitSrivastava (Tue, 18 Jul 2017 13:22:13 GMT):
Has joined the channel.
ShobhitSrivastava (Tue, 18 Jul 2017 13:22:19 GMT):
Hi Team
ShobhitSrivastava (Tue, 18 Jul 2017 13:23:13 GMT):
While running my application from java-sdk I am getting below exception:Error is: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: The proposal responses do not have consistent read write sets
ShobhitSrivastava (Tue, 18 Jul 2017 13:23:28 GMT):
Please reply, what should be the cause of this?
rickr (Tue, 18 Jul 2017 13:27:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=cjTcp6WAj5JcC5amM) [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=cjTcp6WAj5JcC5amM) Any reason you're not using the docker image provided by v1.0.0 ? https://github.com/hyperledger/fabric-sdk-java/releases
rickr (Tue, 18 Jul 2017 13:30:45 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RnM9RS9tuvSrRwksj) Means you have proposals which have produced in the chaincode readwrite sets that were not consistent (what's would be written to the ledger would not be the same in both cases).
rickr (Tue, 18 Jul 2017 13:30:45 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RnM9RS9tuvSrRwksj) Means you have proposals which have produced in the chaincode readwrite sets that were not consistent (what would be written to the ledger would not be the same for each proposal).
ShobhitSrivastava (Tue, 18 Jul 2017 13:40:38 GMT):
Yes, correct @rickr I am not able to store the value, PutState method is not working. Where could the error be? Any suggestion
ShobhitSrivastava (Tue, 18 Jul 2017 13:41:56 GMT):
I am able to see the logs after putstate method but getting this exception in eclipse console
rickr (Tue, 18 Jul 2017 15:00:50 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=JzqWo5bhuktXRkJmk) There is a means to determine which Anchor peers _can_ join the channel. There's no means that I'm aware of that determine which peers have actually joined the channel. Can I ask for some details for your use case ?
rickr (Tue, 18 Jul 2017 15:00:50 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=JzqWo5bhuktXRkJmk) There is a means to determine which Anchor peers _can_ join the channel. There's no means that I'm aware of to determine which peers have actually joined the channel. Can I ask for some details for your use case ?
pschnap (Tue, 18 Jul 2017 15:40:47 GMT):
In the "first-network" example, which cert in the `crypto-config` directory am I supposed to use for TLS to the peer for org1 peer0?
I'm getting the following error from the orderer with all the certs I've tried:
```
ERRO 108f Principal deserialization failure (The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority) for identity ...
```
pschnap (Tue, 18 Jul 2017 15:40:47 GMT):
In the "first-network" example, which cert in the `crypto-config` directory am I supposed to use for TLS to org1's peer0?
I'm getting the following error from the orderer with all the certs I've tried:
```
ERRO 108f Principal deserialization failure (The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority) for identity ...
```
xinpei8 (Tue, 18 Jul 2017 16:10:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=DDRPJNx5oZqPadMgt) @rickr Is it what you're looking for?
Collection
clempo (Tue, 18 Jul 2017 17:20:54 GMT):
@rickr, I did not get any feedback on my previous comment, do I need to log a full fledged Jira for this? double a in nsRwsetInfo.getNaamespace(); missing e in block.getEnvelopCount(); missing implementation of transactionActionInfo.getEndorsementInfos(); missing getChaincodeInputArgs() with no args; and an equivalent of transactionActionInfo.getTxReadWriteSet() that would return an Iterable.
clempo (Tue, 18 Jul 2017 17:22:13 GMT):
This method signature is strange, I think the method name is better than the return type
clempo (Tue, 18 Jul 2017 17:22:15 GMT):
BlockInfo.EndorserInfo endorserInfo = transactionActionInfo.getEndorsementInfo(n);
rickr (Tue, 18 Jul 2017 17:29:19 GMT):
sure
rickr (Tue, 18 Jul 2017 17:29:19 GMT):
Please create seperate JIRAs
rickr (Tue, 18 Jul 2017 17:29:48 GMT):
I got the Naamespace
pschnap (Tue, 18 Jul 2017 17:31:06 GMT):
fixed my issue, wasn't updating the private keys pointed to by my docker-compose file for the CAs
pschnap (Tue, 18 Jul 2017 17:31:23 GMT):
needed to re-point to those files after regenerating the crypto material
pschnap (Tue, 18 Jul 2017 17:31:50 GMT):
(FYI for folks in the future)
clempo (Tue, 18 Jul 2017 17:45:50 GMT):
I created https://jira.hyperledger.org/browse/FAB-5366
rickr (Tue, 18 Jul 2017 17:47:25 GMT):
Now wheres the RC patch ?
rickr (Tue, 18 Jul 2017 17:47:25 GMT):
Now wheres the CR patch ?
clempo (Tue, 18 Jul 2017 17:49:44 GMT):
what is CR?
clempo (Tue, 18 Jul 2017 17:51:03 GMT):
you changed your response after I created the Jira
clempo (Tue, 18 Jul 2017 17:51:14 GMT):
do you still want me to split the Jira?
clempo (Tue, 18 Jul 2017 17:53:55 GMT):
Is it possible to do the equivalent of ChaincodeStubInterface.GetStateByRange() in Java outside of Chaincode?
clempo (Tue, 18 Jul 2017 17:54:21 GMT):
The only way I know is to query all BlockInfos and traverse them all
rickr (Tue, 18 Jul 2017 18:07:03 GMT):
Changed what response ?
rickr (Tue, 18 Jul 2017 18:07:03 GMT):
Changed what response ?
Better to open JIRAs for specific items as we may or may not accept them as a whole.
rickr (Tue, 18 Jul 2017 18:08:26 GMT):
CR := change request with your fixes
clempo (Tue, 18 Jul 2017 18:43:11 GMT):
You first typed "sure", then you changed it to "Please create seperate JIRAs"
clempo (Tue, 18 Jul 2017 18:44:36 GMT):
you did the two easy ones, then there is the bunch on BlockInfo iterables, the last one I bet will get killed because the datatype is likely baked into the grpc proto files
clempo (Tue, 18 Jul 2017 18:44:58 GMT):
I consider the iterables a single item
rickr (Tue, 18 Jul 2017 19:06:47 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=vjjS8XdrhLpowo8Z7) No. Write chaincode that returns that information
jordan.k.miles (Tue, 18 Jul 2017 19:43:47 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=W28QXurnkz3b43XaF) @rickr Well, I was trying to get around having to configure the CA myself. It may be best practice though.
clempo (Tue, 18 Jul 2017 20:11:35 GMT):
Were the chain code custom event implemented? Will they appear as regular events in my BlockEvent listener? If not, how can I listen to them? How can I emit a chaincode custom event within my chaincode?
clempo (Tue, 18 Jul 2017 20:11:35 GMT):
Were the chain code custom event implemented? Will they appear as regular events in my BlockEvent listener? If not, how can I listen to them? How can I emit a chaincode custom event within my chaincode? [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dwBe3M6pBng5aKQJe)
Just opened a JIRA for that https://jira.hyperledger.org/browse/FAB-5387
clempo (Tue, 18 Jul 2017 20:11:35 GMT):
Were the chain code custom event implemented? Will they appear as regular events in my BlockEvent listener? If not, how can I listen to them? How can I emit a chaincode custom event within my chaincode? [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dwBe3M6pBng5aKQJe)
kelvinzhong (Wed, 19 Jul 2017 03:07:46 GMT):
@rickr hi, can the sdk
kelvinzhong (Wed, 19 Jul 2017 03:07:46 GMT):
@rickr hi, can the sdk now register a new peer? i saw there have some comment there says could also peer be registered, but have no sample for this
kelvinzhong (Wed, 19 Jul 2017 03:07:46 GMT):
@rickr hi, can the sdk register a new peer now? i saw there have some comments says could also the peer be registered, but have no sample for this
lenin.mehedy (Wed, 19 Jul 2017 08:01:27 GMT):
@rickr Any idea on the below error?
```
api | Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Failed to deserialize creator identity, err Thesupplied identity is not valid, Verify() returned x509: certificate signed by unknown authority
api | at io.grpc.Status.asRuntimeException(Status.java:540) ~[grpc-core-1.3.0.jar:1.3.0]
api | at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:439) ~[grpc-stub-1.3.0.jar:1.3.0]
api | at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426) ~[grpc-core-1.3.0.jar:1.3.0]
api | at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76) ~[grpc-core-1.3.0.jar:1.3.0]
api | at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512) ~[grpc-core-1.3.0.jar:1.3.0]
api | at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429) ~[grpc-core-1.3.0.jar:1.3.0]
api | at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544) ~[grpc-core-1.3.0.jar:1.3.0]
api | at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52) ~[grpc-core-1.3.0.jar:1.3.0]
api | at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117) ~[grpc-core-1.3.0.jar:1.3.0]
api | ... 3 common frames omitted
api | 07:33:32.962 [LargeThreadPool-thread-22] ERROR org.hyperledger.fabric.sdk.Channel - Sending proposal to peer1.org1.example.com failed because of gRPC failure=Status{code=UNKNOWN, description=Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority, cause=null}
api | java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority
api | at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2138) [fabric-sdk-java-1.0.0-beta.jar:na]
api | at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:2072) [fabric-sdk-java-1.0.0-beta.jar:na]
api | at org.hyperledger.fabric.sdk.Channel.sendTransactionProposal(Channel.java:2005) [fabric-sdk-java-1.0.0-beta.jar:na]
```
kelvinzhong (Wed, 19 Jul 2017 09:01:43 GMT):
@rickr since the tag of rc version, eclipse could not normally import the project as the eclipse report .project file is damaged
kelvinzhong (Wed, 19 Jul 2017 09:03:00 GMT):
i have to delete the .project file and import as the maven project, eclipse would automatically generate the new .project file
ssaddem (Wed, 19 Jul 2017 14:20:07 GMT):
@rickr java sdk does he support querry with cert ?
rickr (Wed, 19 Jul 2017 16:45:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dwBe3M6pBng5aKQJe) Just opened a JIRA for that https://jira.hyperledger.org/browse/FAB-5387
rickr (Wed, 19 Jul 2017 16:48:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=tbbrSr7ceg9s3vwHx) Usually means you're using the wrong MSPID or certificate in User context
Shubham1109 (Wed, 19 Jul 2017 20:12:49 GMT):
Has joined the channel.
pschnap (Wed, 19 Jul 2017 20:27:58 GMT):
The example code in this test uses a `setCAName` method on the `EnrollmentRequest` class, but I don't find it in either the 1.0.0 release of the SDK _or_ the RC1 release
https://github.com/hyperledger/fabric-sdk-java/blob/v1.0.0/src/test/java/org/hyperledger/fabric_ca/sdk/EnrollmentRequestTest.java
pschnap (Wed, 19 Jul 2017 20:28:23 GMT):
Where can I find it in the SDK?
pschnap (Wed, 19 Jul 2017 20:33:39 GMT):
hm, it seems to be in the RegistrationRequest but this user is already registered
atomti (Thu, 20 Jul 2017 06:44:38 GMT):
Has joined the channel.
Dalf (Thu, 20 Jul 2017 13:20:41 GMT):
Has joined the channel.
DeutscheBahn-BlockchainDev (Thu, 20 Jul 2017 13:50:29 GMT):
Dear All, can we read the Genesis and Config blocks of a Channel via the API?
rickr (Thu, 20 Jul 2017 14:07:19 GMT):
There is update coming to let you get the channel config bytes. That's needed for doing an upgrade to the channel. Till now, I've not directly exposed others unless I've seen a use case.
rickr (Thu, 20 Jul 2017 14:23:13 GMT):
There is queryBlockByNumber on channel and the Genesis block is always 0
DeutscheBahn-BlockchainDev (Thu, 20 Jul 2017 14:33:18 GMT):
Hi @rickr thanks for update!
rishabh1102 (Thu, 20 Jul 2017 16:27:14 GMT):
Hey, is there any way to use the java sdk without using mvn?
rishabh1102 (Thu, 20 Jul 2017 16:27:33 GMT):
Like having a set of files and compiling them using javac and executing them using java?
rishabh1102 (Thu, 20 Jul 2017 16:27:40 GMT):
I just want to invoke my chaincode
rishabh1102 (Thu, 20 Jul 2017 16:28:06 GMT):
@here
ssaddem (Thu, 20 Jul 2017 16:30:36 GMT):
why ?
rishabh1102 (Thu, 20 Jul 2017 16:32:20 GMT):
I've installed it using mvn install
rishabh1102 (Thu, 20 Jul 2017 16:32:41 GMT):
And all that i see are the end to end tests which work with specific examples
rishabh1102 (Thu, 20 Jul 2017 16:33:05 GMT):
I want to run invoke on my own network which is deployed natively across multiple machines
rishabh1102 (Thu, 20 Jul 2017 16:33:26 GMT):
Chaincode has already been instantiated on it
rishabh1102 (Thu, 20 Jul 2017 16:33:58 GMT):
Just basic invoking and querying are my requirements
rishabh1102 (Thu, 20 Jul 2017 16:34:46 GMT):
I'm basically looking for the java equivalent of this.
rishabh1102 (Thu, 20 Jul 2017 16:35:25 GMT):
invoke.js in the fabcar example of fabric-samples
rickr (Thu, 20 Jul 2017 16:36:16 GMT):
IMO Much easier if you just create your own application's pom.xml an reference the SDK and let it manage the dependencies
rishabh1102 (Thu, 20 Jul 2017 16:37:07 GMT):
Hmm, that sounds okay
rishabh1102 (Thu, 20 Jul 2017 16:37:16 GMT):
But how do I go about coding?
rishabh1102 (Thu, 20 Jul 2017 16:37:29 GMT):
I mean, I can try breaking down End2EndIT.java
rishabh1102 (Thu, 20 Jul 2017 16:37:34 GMT):
And picking up what I need from there
rishabh1102 (Thu, 20 Jul 2017 16:37:45 GMT):
But is there an easier way to do this?
rickr (Thu, 20 Jul 2017 16:37:52 GMT):
yeah -- that's the idea
rishabh1102 (Thu, 20 Jul 2017 16:38:13 GMT):
Breaking down End2EndIT.java?
rickr (Thu, 20 Jul 2017 16:38:22 GMT):
pick what you need from it
rickr (Thu, 20 Jul 2017 16:41:49 GMT):
maybe this is a better starting point https://github.com/venugopv/FabricJavaSDKSample/blob/master/pom.xml
rickr (Thu, 20 Jul 2017 16:41:49 GMT):
maybe this is a better starting point https://github.com/venugopv/FabricJavaSDKSample
ssaddem (Thu, 20 Jul 2017 16:57:12 GMT):
@rickr does fabric v1.0.0 support cert enroll ?
wangpan22 (Fri, 21 Jul 2017 01:57:40 GMT):
Has joined the channel.
rishabh1102 (Fri, 21 Jul 2017 07:05:26 GMT):
So I tried getting invoke and query to work without using a CA
rishabh1102 (Fri, 21 Jul 2017 07:06:07 GMT):
And I'm getting an VSCC Error, Authentication failure
rishabh1102 (Fri, 21 Jul 2017 07:06:14 GMT):
Anyone know how to fix this?
inaki (Fri, 21 Jul 2017 08:50:15 GMT):
Has joined the channel.
smita0709 (Fri, 21 Jul 2017 12:48:42 GMT):
Has joined the channel.
smita0709 (Fri, 21 Jul 2017 12:48:47 GMT):
Hi,
In the example in the below link the configtxlator takes the configuration
block in .pb (protobuf) format.
https://hyperledger-fabric.readthedocs.io/en/latest/configtxlator.html
The getConfigurationBlock() method in Channel class in fabric-sdk-java
returns a Block (org.hyperledger.fabric.protos.common.Common$Block).
How to I retrieve a configuration block from fabric sdk java in protobuf
format so that I can pass it to the configtxlator?
rickr (Fri, 21 Jul 2017 12:51:45 GMT):
Method to do this should be in V1.0.1 https://jira.hyperledger.org/browse/FAB-5368
rickr (Fri, 21 Jul 2017 12:55:39 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=gtDdaex5t5q5rKnD2) See End2endIT.java for ca.enroll
rickr (Fri, 21 Jul 2017 13:01:22 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bettLxPaco2NeNvP5) See the End2endIT.java samples the user that is a user `peerAdmin`
(search for setPeerAdmin) All the End2endxxIT could be rewritten removing the Fabric-ca client, enrollment parts and just using that user.
pschnap (Fri, 21 Jul 2017 14:57:11 GMT):
I'm getting an error when trying to invoke, it's giving me the following on the `ProposalResponse` verification:
```
verify: Cannot retrieve peer identity from ProposalResponse. Error is: Cannot verify signature. Error is: Wrong key usage
```
pschnap (Fri, 21 Jul 2017 14:57:14 GMT):
Any ideas?
rickr (Fri, 21 Jul 2017 15:09:52 GMT):
The response is failing to verify with any peer certificate. I've not see this before must be a stacktrace with that. Use something like `pasteit` post url here. _might help_
pschnap (Fri, 21 Jul 2017 15:16:03 GMT):
```
DEBUG 2017-07-21 10:01:02,984 6098 org.hyperledger.fabric.sdk.Channel [main] Channel testing got back from peer PEER status: 200, message: OK
ERROR 2017-07-21 10:01:02,991 6105 org.hyperledger.fabric.sdk.security.CryptoPrimitives [main] Cannot verify signature. Error is: Wrong key usage
Certificate: 2D...2D0A
org.hyperledger.fabric.sdk.exception.CryptoException: Cannot verify signature. Error is: Wrong key usage
Certificate: 2D...2D0A
at org.hyperledger.fabric.sdk.security.CryptoPrimitives.verify(CryptoPrimitives.java:187)
at org.hyperledger.fabric.sdk.ProposalResponse.verify(ProposalResponse.java:106)
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2040)
at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:1955)
at org.hyperledger.fabric.sdk.Channel.sendTransactionProposal(Channel.java:1889)
...
at com.COMPANY.hyperledger.Main.main(Main.java:20)
Caused by: java.security.InvalidKeyException: Wrong key usage
at java.security.Signature.initVerify(Signature.java:501)
at org.hyperledger.fabric.sdk.security.CryptoPrimitives.verify(CryptoPrimitives.java:180)
... 7 more
ERROR 2017-07-21 10:01:02,993 6107 org.hyperledger.fabric.sdk.ProposalResponse [main] verify: Cannot retrieve peer identity from ProposalResponse. Error is: Cannot verify signature. Error is: Wrong key usage
Certificate: 2D...2D0A
org.hyperledger.fabric.sdk.exception.CryptoException: Cannot verify signature. Error is: Wrong key usage
Certificate: 2D...2D0A
at org.hyperledger.fabric.sdk.security.CryptoPrimitives.verify(CryptoPrimitives.java:187)
at org.hyperledger.fabric.sdk.ProposalResponse.verify(ProposalResponse.java:106)
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2040)
at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:1955)
at org.hyperledger.fabric.sdk.Channel.sendTransactionProposal(Channel.java:1889)
...
at com.COMPANY.hyperledger.Main.main(Main.java:20)
Caused by: java.security.InvalidKeyException: Wrong key usage
at java.security.Signature.initVerify(Signature.java:501)
at org.hyperledger.fabric.sdk.security.CryptoPrimitives.verify(CryptoPrimitives.java:180)
... 7 more
```
pschnap (Fri, 21 Jul 2017 15:18:16 GMT):
@rickr ^
pschnap (Fri, 21 Jul 2017 15:18:46 GMT):
btw, I'm using the 1.0.0 release of the SDK against the RC1 of the fabric
pschnap (Fri, 21 Jul 2017 15:20:22 GMT):
it works against a local 1.0.0; the error is occurring against the RC1 on Bluemix
pschnap (Fri, 21 Jul 2017 15:30:55 GMT):
It could be that my configuration is not correct, or I'm missing setting something up in the SDK
clempo (Fri, 21 Jul 2017 19:39:24 GMT):
The Readme is still missing a closing quote in the instructions to update the Vagrantfile
clempo (Fri, 21 Jul 2017 19:39:27 GMT):
config.vm.synced_folder "/home/<
clempo (Fri, 21 Jul 2017 19:39:46 GMT):
This creates a very cryptic error message and it takes a while to figure it out
clempo (Fri, 21 Jul 2017 19:40:33 GMT):
I reported this mistake before, I'm not sure if this is a new regression
clempo (Fri, 21 Jul 2017 19:41:09 GMT):
The error message I got was:
clempo (Fri, 21 Jul 2017 19:43:28 GMT):
undefined method gsub
rickr (Fri, 21 Jul 2017 20:05:18 GMT):
K thought I had addressed that at one time.
jordan.k.miles (Fri, 21 Jul 2017 20:20:09 GMT):
trying to create a new channel in accordance with the End2endIT test and I'm getting this error:
`Principal deserialization failure (The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com")) for identity`
Has anyone else come across this? All of my certs were generated with cryptogen, my admin's enrollment is set and channel configuration looks correct.
rishabh1102 (Sat, 22 Jul 2017 10:21:12 GMT):
Hey guys, how can I turn off logging in the java sdk?
rishabh1102 (Sat, 22 Jul 2017 10:21:23 GMT):
@rickr
sajeevkhan (Sat, 22 Jul 2017 12:42:04 GMT):
Hi There, We are trying to instantiate a chaincode that was already installed. However, I am wondering how the Channel Object can be fetched using the JAVA SDK
tarunc (Sat, 22 Jul 2017 21:14:42 GMT):
Has joined the channel.
takagimasanobu (Sun, 23 Jul 2017 11:56:24 GMT):
Has joined the channel.
CarlXK (Mon, 24 Jul 2017 02:28:22 GMT):
@rickr i m using the java sdk to deploy cc & invoke , now got a problem:
1. startup ca& order
2. startup Peer root, install & instantiate cc
3. startup Peer ttt, install cc
4. invoke cc of peer root succeed, invoke cc of peer ttt failed
error in Peer below
```
2017-07-21 17:54:30.948 CST [chaincode] ExecuteChaincode -> ERRO 460 Error executing chaincode: Could not get deployment transaction from LSCC for account_cc_go:1 - Get ChaincodeDeploymentSpec for account_cc_go/xnchannel from LSCC error: chaincode fingerprint mismatch data mismatch
2017-07-21 17:54:30.948 CST [endorser] callChaincode -> DEBU 461 Exit
```
could you please help and give a workaround?
CarlXK (Mon, 24 Jul 2017 02:28:22 GMT):
@rickr i m using the java sdk to deploy cc & invoke , now got a problem:
1. startup ca& order
2. startup Peer root, install & instantiate cc, use container1
3. startup Peer ttt, install cc , use container2
4. invoke cc of peer root succeed, invoke cc of peer ttt failed
error in Peer below
```
2017-07-21 17:54:30.948 CST [chaincode] ExecuteChaincode -> ERRO 460 Error executing chaincode: Could not get deployment transaction from LSCC for account_cc_go:1 - Get ChaincodeDeploymentSpec for account_cc_go/xnchannel from LSCC error: chaincode fingerprint mismatch data mismatch
2017-07-21 17:54:30.948 CST [endorser] callChaincode -> DEBU 461 Exit
```
could you please help and give a workaround?
jrui (Mon, 24 Jul 2017 09:39:58 GMT):
Has joined the channel.
rickr (Mon, 24 Jul 2017 11:20:31 GMT):
I've not seen that error before. I think you'd get a better answer on the #fabric-consensus channel as to what that error means.
rickr (Mon, 24 Jul 2017 11:58:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=sqWpLFKyBoXwjcwCy) try with env. var ORG_HYPERLEDGER_FABRIC_SDK_LOGLEVEL=INFO. for now. DEBUG got checked in ... looking to fix to make default INFO.
chaitanya (Mon, 24 Jul 2017 17:46:44 GMT):
Hi, I've been trying to run invoke and query using the Java-SDK against an already setup network, but lately I've been getting the following error:
```java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert(Properties.java:574)
at java.util.Properties.load0(Properties.java:390)
at java.util.Properties.load(Properties.java:341)
at com.ibm.in.offchain.models.SampleStore.loadProperties(SampleStore.java:73)
at com.ibm.in.offchain.models.SampleStore.getValue(SampleStore.java:66)
at com.ibm.in.offchain.models.SampleUser.
chaitanya (Mon, 24 Jul 2017 17:46:44 GMT):
Hi, I've been trying to run invoke and query using the Java-SDK against an already setup network, but lately I've been getting the following error:
```java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert(Properties.java:574)
at java.util.Properties.load0(Properties.java:390)
at java.util.Properties.load(Properties.java:341)
at com.ibm.in.offchain.models.SampleStore.loadProperties(SampleStore.java:73)
at com.ibm.in.offchain.models.SampleStore.getValue(SampleStore.java:66)
at com.ibm.in.offchain.models.SampleUser.
chaitanya (Mon, 24 Jul 2017 17:46:44 GMT):
Hi, I've been trying to run invoke and query using the Java-SDK against an already setup network, but lately I've been getting the following error:
```java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert(Properties.java:574)
at java.util.Properties.load0(Properties.java:390)
at java.util.Properties.load(Properties.java:341)
at com.ibm.in.offchain.models.SampleStore.loadProperties(SampleStore.java:73)
at com.ibm.in.offchain.models.SampleStore.getValue(SampleStore.java:66)
at com.ibm.in.offchain.models.SampleUser.
sajeevkhan (Tue, 25 Jul 2017 02:46:55 GMT):
Hi, How do we fetch the channel details from the peer so that we can use the channel to send a transaction later.
smita0709 (Tue, 25 Jul 2017 06:08:55 GMT):
Hi, Is there a way to update the configuration block of a channel in fabric sdk java?
smita0709 (Tue, 25 Jul 2017 06:30:07 GMT):
also when is fabric sdk java v1.0.1 due for release?
anik (Tue, 25 Jul 2017 06:55:34 GMT):
Is there any to generate orderer block to work with 3 organizations in end2endIT example? what changes are needed in configtx.yaml. would appreciate any pointer
tallharish (Tue, 25 Jul 2017 12:54:02 GMT):
I am familiar enough with JDK to do invoke and query transactions. How do I listen for endorsements? Could someone please point me to relevant code in End2endIT.java or other project ?
tallharish (Tue, 25 Jul 2017 12:54:02 GMT):
I am familiar enough with JDK to do invoke and query transactions. How do I listen for endorsement proposal from other peers? Could someone please point me to relevant code in End2endIT.java or other project ?
tallharish (Tue, 25 Jul 2017 12:54:02 GMT):
I am familiar enough with JDK to do invoke and query transactions. How do I listen for endorsement proposal from other peers? Could someone please point me to relevant code in End2endIT.java or other project? Thanks
tallharish (Tue, 25 Jul 2017 12:54:02 GMT):
I am familiar enough with java JDK to do invoke and query transactions. How do I listen for endorsement proposal from other peers? Could someone please point me to relevant code in End2endIT.java or other project? Thanks
tallharish (Tue, 25 Jul 2017 14:56:16 GMT):
I am developing appln using Java JDK in Eclipse. how do I change the trace level of messages? I have enabled the DEBUG level a while back and would like to switch it off but forgot how to. Thanks.
clempo (Tue, 25 Jul 2017 16:36:48 GMT):
Why does the Channel complains there are no orderers if all I want to do is register a block listener? I would expect defining eventHubs is all I need.
clempo (Tue, 25 Jul 2017 18:48:15 GMT):
What's the purpose of TxReadWriteSetInfo if all it contains is an iterable list of TxReadWriteSetInfo.NsRwsetInfo?
clempo (Tue, 25 Jul 2017 18:49:49 GMT):
are there missing or planned members in TxReadWriteSetInfo?
clempo (Tue, 25 Jul 2017 18:54:30 GMT):
TxReadWriteSetInfo.getNsRwsetInfos() is empty in my BlockEvent but that block has rw sets if I call Channel.queryBlockByNumber(nbr), is that normal?
rickr (Tue, 25 Jul 2017 20:03:42 GMT):
yes -- It's costly for the event hub to include that for all events. The out is if you need it when you get the event is to query to do the queryBlockByNumber to then get it.
clempo (Tue, 25 Jul 2017 20:04:55 GMT):
is that part of the documentation?
rickr (Tue, 25 Jul 2017 20:06:33 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=aAvLQjAkqAyEiTfWa) bug in the SDK was delivered with DEBUG on will be changed in v1.0.1 to INFO. for now set ORG_HYPERLEDGER_FABRIC_SDK_LOGLEVEL=INFO.
rickr (Tue, 25 Jul 2017 20:08:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=sMQWy7MHm3HikXuwY) Should be in v1.0.1
rickr (Tue, 25 Jul 2017 20:14:31 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=pCWZyZNBgcnxqthmv) Not sure what you're asking here. The SDK's don't listen for proposals from other peers.
clempo (Tue, 25 Jul 2017 20:20:38 GMT):
@rickr, do you know the answer to this? [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=4QTXXgmk35os5aLwA)
pschnap (Tue, 25 Jul 2017 20:21:44 GMT):
my `ProposalResponse.isVerified()` method calls keep throwing an error:
> Cannot verify signature. Error is: Wrong key usage
any ideas?
clempo (Tue, 25 Jul 2017 20:26:33 GMT):
@pschnap, did you change the UserContext between the TransactionProposal and ProposalResponse?
pschnap (Tue, 25 Jul 2017 20:32:24 GMT):
@clempo I don't think so, I create the `TransactionProposalRequest`, set the CCID/Fn/Args, send it via `Channel.sendTransactionProposal`, then check the `ProposalResponse`s and get the error
clempo (Tue, 25 Jul 2017 20:50:53 GMT):
Maybe your certificate contains a Usage extension that does not allow the crypto operation you are attempting
clempo (Tue, 25 Jul 2017 20:51:57 GMT):
I would put a breakpoint where that error is generated. It might be all happening locally in the SDK.
pschnap (Tue, 25 Jul 2017 20:56:25 GMT):
good call on the breakpoint; I hadn't noticed that the `sendTransactionProposal` is actually throwing the same error
pschnap (Tue, 25 Jul 2017 21:00:55 GMT):
bah, looks like it was all `sendTransactionProposal`; I'll investigate more tomorrow, thanks @clempo !
Hangyu (Wed, 26 Jul 2017 00:35:02 GMT):
when I try to create channel, I always encounter this error
```
org.hyperledger.fabric.sdk.exception.TransactionException: Send transactions failed. Reason: timeout
at org.hyperledger.fabric.sdk.OrdererClient.sendTransaction(OrdererClient.java:163)
at org.hyperledger.fabric.sdk.Orderer.sendTransaction(Orderer.java:133)
at org.hyperledger.fabric.sdk.Channel.
Hangyu (Wed, 26 Jul 2017 01:48:34 GMT):
I have found your answer, thanks very much! @rickr
szlaci1983 (Wed, 26 Jul 2017 08:44:12 GMT):
Has joined the channel.
JanRzepecki (Wed, 26 Jul 2017 09:52:13 GMT):
Has joined the channel.
ohupalo (Wed, 26 Jul 2017 09:52:30 GMT):
Has joined the channel.
ohupalo (Wed, 26 Jul 2017 09:53:14 GMT):
Hello. How deploy chaincode on java using fabric sdk
ohupalo (Wed, 26 Jul 2017 09:53:14 GMT):
Hello. How deploy chaincode on java using fabric sdk?
ohupalo (Wed, 26 Jul 2017 09:54:51 GMT):
Message Attachments
ohupalo (Wed, 26 Jul 2017 09:55:57 GMT):
I've tried do it like with go example, unfortunately it failed.
sajeevkhan (Wed, 26 Jul 2017 11:13:20 GMT):
Hi, What is the JAVA SDK equivalent for the command "peer channel fetch -c chainID"
sajeevkhan (Wed, 26 Jul 2017 11:51:39 GMT):
Hi,
We have successfully created a new channel and also installed and instantiated a chaincode on this . The network is using CouchDB for State management. We are using JAVA SDK to construct and install chain code.
Now, after restarting the network, we would want JAVA SDK to connect to the channel and perform queries on the chain code. On executing a query in JAVA SDK using channel.queryByChaincode(queryByChaincodeRequest, channel.getPeers());
“org.hyperledger.fabric.sdk.exception.InvalidArgumentException: Channel foo has not been initialized.”
However, when we try to initialize the channel, channel.initialize(),
we get the following exception
org.hyperledger.fabric.sdk.Channel : Bad newest block expected status 200 got 404, Channel foo
I guess, what we are missing the JAVA equivalent of the following peer command:
“peer channel fetch -c chainID “
It would be great if someone can help us with this issue.
Regards
Sajeev
n91 (Wed, 26 Jul 2017 12:16:54 GMT):
Has joined the channel.
rickr (Wed, 26 Jul 2017 13:20:48 GMT):
Not sure why you're seeing that error. End2endAndBackAgainIT shows reconstructing a channel and performing additional operations on it.
rickr (Wed, 26 Jul 2017 13:20:48 GMT):
Not sure why you're seeing that error. End2endAndBackAgainIT shows reconstructing a channel and performing additional operations on it. Check the orderer log if there is any hints what's wrong.
rickr (Wed, 26 Jul 2017 13:23:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jtWbPKRk75L5uhdBS) End2endIT.java shows deploying chaincode.
rickr (Wed, 26 Jul 2017 13:25:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=q8nmxxKWkkEFuBQZQ) At the moment you need an Orderer for most almost all but probably just listening for events.
rickr (Wed, 26 Jul 2017 13:25:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=q8nmxxKWkkEFuBQZQ) At the moment you need an Orderer for most almost all operations but probably just listening for events.
tallharish (Wed, 26 Jul 2017 13:30:34 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=x3id4FguaQnefbCqE) @rickr Quick followup: I am seeing logs running the fabric-sdk-java project on eclipse console. I created a new Eclipse maven project, adding fabric-sdk-java project as a dependency. When I run the project now, I dont see any sdk logs on console. How do I see them? Sorry for the eclipse-specific question :)
clempo (Wed, 26 Jul 2017 13:37:02 GMT):
I still think this is a bug. My piece of software only listens to events and I force my user to define an orderer that will never be used.
clempo (Wed, 26 Jul 2017 13:40:47 GMT):
I wonder if a simple block listener is really related to a channel. I know the channel uses it to finish the transaction, but that's not the same as saying the block listener is a part of the channel.
clempo (Wed, 26 Jul 2017 13:41:25 GMT):
The other solution is to add the check for empty orderers at the point you use them
tallharish (Wed, 26 Jul 2017 14:08:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=x3id4FguaQnefbCqE) @rickr Followup question. I created a new eclipse maven project, importing fabric-sdk-java dependency and writing a simple client which works. I see the following error ```log4j:WARN No appenders could be found for logger (com.ibm.research.fabricClient.TestConfig).
log4j:WARN Please initialize the log4j system properly.```. I added log4j in my project as follows: ```
tallharish (Wed, 26 Jul 2017 14:08:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=x3id4FguaQnefbCqE) @rickr Followup question. I created a new eclipse maven project, importing fabric-sdk-java dependency and writing a simple client which works. I see the following error ```log4j:WARN No appenders could be found for logger (com.ibm.research.fabricClient.TestConfig).
log4j:WARN Please initialize the log4j system properly.```. I added log4j in my project as follows:
```
tallharish (Wed, 26 Jul 2017 14:08:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=x3id4FguaQnefbCqE) @rickr Followup question. I created a new eclipse maven project, importing fabric-sdk-java dependency and writing a simple client which works. I see the following error ```log4j:WARN No appenders could be found for logger (com.ibm.research.fabricClient.TestConfig).
log4j:WARN Please initialize the log4j system properly.```. I added log4j in my project as follows:
```
tallharish (Wed, 26 Jul 2017 14:08:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=x3id4FguaQnefbCqE) @rickr Followup question. I created a new eclipse maven project, importing fabric-sdk-java dependency and writing a simple client which works. I see the following error ```log4j:WARN No appenders could be found for logger (com.org.division.fabricClient.TestConfig).
log4j:WARN Please initialize the log4j system properly.```. I added log4j in my project as follows:
```
rickr (Wed, 26 Jul 2017 14:17:04 GMT):
I don't _think_ this is an SDK issue. Your application is using log4J and you're not setting it up properly
n91 (Wed, 26 Jul 2017 15:00:13 GMT):
@rickr Hi , I am following the reconfiguration example from documentation to add a new organization to channel. I am able to decode,encode, updateConfig and create envelope using HttpPost. How to execute `peer channel update -f config_update_as_envelope.pb -c testchainid -o 127.0.0.1:7050` from java SDK ?
rickr (Wed, 26 Jul 2017 15:19:24 GMT):
Updates and a complete example ( _UpdateChannelIT.java_ ) has been delivered on the master branch. Should be in v1.0.1 when it's cut.
n91 (Wed, 26 Jul 2017 15:25:25 GMT):
@rickr v1.0.1 is not available yet !! Any insight on this part specifically 'SDK signs and submit config'
n91 (Wed, 26 Jul 2017 15:28:24 GMT):
@rickr Thanks
mescoba1 (Wed, 26 Jul 2017 17:50:16 GMT):
Has left the channel.
anik (Wed, 26 Jul 2017 18:02:46 GMT):
End2EndIT run successfully for org1, can I run query in command for installed chaincode in peer (peer0.org2)?
anik (Wed, 26 Jul 2017 18:28:40 GMT):
Message Attachments
anik (Wed, 26 Jul 2017 18:29:06 GMT):
running End2EndIT
clempo (Wed, 26 Jul 2017 19:38:56 GMT):
The Epoch in my BlockInfo or BlockEvents is always 0, is that normal? I thought the epoch was similar to a date. What does Epoch mean if it is always 0?
clempo (Wed, 26 Jul 2017 20:22:18 GMT):
I don't understand how this response in the Go chaincode jsonResp := "{\"Name\":\"" + A + "\",\"Amount\":\"" + string(Avalbytes) + "\"}"
clempo (Wed, 26 Jul 2017 20:22:35 GMT):
is deserialized into the value of b in End2endIT with this String payload = proposalResponse.getProposalResponse().getResponse().getPayload().toStringUtf8();
clempo (Wed, 26 Jul 2017 20:23:01 GMT):
My goal is to return multiple values from a query, which seems easy in Go but does not make sense on the client side in Java
clempo (Wed, 26 Jul 2017 20:24:29 GMT):
Is it possible the go code under src/test/fixtures/sdkintegration/gocc/sample1 is not the code the sample is actually running
cjvkrishna (Wed, 26 Jul 2017 21:50:15 GMT):
Howto install java chaincode on Fabric 1.0?
cjvkrishna (Wed, 26 Jul 2017 22:04:26 GMT):
Can I use InstallProposalRequest to install java chaincode? If yes, where can I find an example?
cjvkrishna (Wed, 26 Jul 2017 22:33:29 GMT):
From the source code, I see the following comment: "Chaincode input stream containing the actual chaincode. Only format supported is a tar zip compressed input of the source" for the method: setChaincodeInputStream(..)
So, to install a Java ChainCode, do I just build it with gradle and point the ChaincodeInputStream to the .tar I get in the build/distributions folder?
cjvkrishna (Wed, 26 Jul 2017 22:34:05 GMT):
Hi @rickr can you please look into my question?
anik (Thu, 27 Jul 2017 02:26:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=aD4RqigadB7KrFp4P) @anik @rickr
gopinathbr (Thu, 27 Jul 2017 07:33:48 GMT):
Has joined the channel.
gopinathbr (Thu, 27 Jul 2017 07:38:37 GMT):
@cjvkrishna If I am not wrong, you should install a zip or tar of the source only (without building it). Once installed, fabric will build the java chain code as per the build instructions in the .gradle file.
sajeevkhan (Thu, 27 Jul 2017 07:56:39 GMT):
Hi, On bringing up a network with couchdb the container entry for couchdb is getting deleted from docker-compose.yaml file. Can anyone explain the reason why the following entry is deleted
couchdb:
container_name: couchdb
image: hyperledger/fabric-couchdb:x86_64-1.0.0-rc1
ports:
- 5984:5984
environment:
DB_URL: http://localhost:5984/member_db
HuangLijun (Thu, 27 Jul 2017 11:56:41 GMT):
Has joined the channel.
rickr (Thu, 27 Jul 2017 13:05:38 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=34J9qjdozZqKt3z8Y) Full examples of installing chaincode is in org/hyperledger/fabric/sdkintegration/End2endIT.java
rickr (Thu, 27 Jul 2017 13:08:32 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rvNjT6rEciZb95qp2) Most of the time is either wrong MSPID and or certificate being supplied.
tallharish (Thu, 27 Jul 2017 13:11:06 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=56PEiCYfy3akRBX7E) @rickr Let me try to understand the flow here. For a transaction that requires endorsements from Org1.member AND Org2.member, the client belonging to Org1.member sends transaction proposal (
rickr (Thu, 27 Jul 2017 13:21:01 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Ei8GLom7xxqPehi2w) Epoch is not used but must be set zero currently.
rickr (Thu, 27 Jul 2017 13:25:26 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=da84WkA95R5NnjxiH) You can on a channel use `registerBlockListener` to see which blocks have been written to the ledger.
clempo (Thu, 27 Jul 2017 14:06:58 GMT):
Never mind, the JSON document is a debug message, the return value is just the value of b [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=oE7AQcMwRoTiz7PaD)
fanjianhang (Fri, 28 Jul 2017 08:41:03 GMT):
Has joined the channel.
anik (Fri, 28 Jul 2017 11:33:31 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=hvbL3htgPWanZyngR) @rickr Actually i deployed the chaincode using existing End2endIT via Org1 peer.Than logged in to the docker container of peer of Org1 and query the chaincode which works fine for me .But when i try to query the same chaincode from peer of Org2 i get this error.Does existing sample End2endIT deploy chaincode on all four peers ?
hcw (Fri, 28 Jul 2017 14:14:56 GMT):
Has joined the channel.
cjvkrishna (Fri, 28 Jul 2017 15:18:43 GMT):
Thanks @gopinathbr and @rickr. I created a simple service to install custom chaincode to blockchain. I am using Fabric-sdk-java 1.0.0.-beta and the docker images being pulled are also 1.0.0-beta.
1) I am seeing the following error: "Java chaincode is work-in-progress and disabled" while installing custom ChainCode. Does the latest version 1.0.0 support Java chaincode installation.
2) I couldn't find the relevant information from the release notes: http://hyperledger-fabric.readthedocs.io/en/latest/releases.html This might not be related, but this ticket FAB-1794 that says that the fix version should be 1.1
cjvkrishna (Fri, 28 Jul 2017 15:20:40 GMT):
Which version of Fabric supports Java Chaincode installation?
ibmmqmet (Fri, 28 Jul 2017 15:23:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=S9XJbJdW3PShwBSNA) @pschnap I'm seeing the
ibmmqmet (Fri, 28 Jul 2017 15:23:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=S9XJbJdW3PShwBSNA) @pschnap I'm seeing the same error when connecting to a service I have no control over ... It seems to be a problem with the certificate created from a pem in CryptoPrimitives.verify() - the usage bits for the cert are not including data signing. To allow me to go further for now, I've modified things so the doVerify() method on the transaction proposal returns false but I know the underlying issue needs to be looked at. I don;t have any control over the servers or CA - that's hosted elsewhere; all I can play with is on the client side. Did you make any progress?
pschnap (Fri, 28 Jul 2017 15:25:01 GMT):
I had my head in the clouds that day, the `sendTransactionProposal` was actually the source of the exceptions I was seeing, not the `isVerified` methods
pschnap (Fri, 28 Jul 2017 15:25:58 GMT):
@ibmmqmet are you trying against the bluemix beta? That's when I'm seeing this error, not against my local
ibmmqmet (Fri, 28 Jul 2017 15:33:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6MPPRnH6FAYk3DTbc) @pschnap Yes - HSBN 1.0 beta
pschnap (Fri, 28 Jul 2017 15:35:34 GMT):
@ibmmqmet I told one of the bluemix team members about the issue; they said they'd had the same thing happen when they were hosting the hyperledger beta release and will look into it
bgaisford (Fri, 28 Jul 2017 17:53:58 GMT):
Has joined the channel.
harsha (Sat, 29 Jul 2017 03:57:10 GMT):
Has left the channel.
rishabh1102 (Sat, 29 Jul 2017 09:23:58 GMT):
Hey all, on running the client app with the java sdk, I'm gettig logging like this:
----------------INBOUND--------------------
[id: 0xedfbe918, L:/192.168.122.55:40654 - R:/192.168.122.55:7051] HEADERS: streamId=5, headers=GrpcHttp2ResponseHeaders[:status: 200, content-type: application/grpc], padding=0, endStream=false
------------------------------------
2017-07-29 09:19:19,371 DEBUG NettyClientHandler:147 -
----------------INBOUND--------------------
[id: 0xedfbe918, L:/192.168.122.55:40654 - R:/192.168.122.55:7051] DATA: streamId=5, padding=0, endStream=false, length=1016, bytes=00000003f30801220d08c80112024f4b1a04313939392ab5010a20d184e12b9e41c35946cd5bf2d37dac901c6aa8b9e51bc56cc3bcdbdec11289d61290010a38...
rishabh1102 (Sat, 29 Jul 2017 09:24:09 GMT):
Is there any way I can disable it?
smita0709 (Mon, 31 Jul 2017 05:08:53 GMT):
Hello,
When will fabric sdk java v1.0.1 be released?
Farit (Mon, 31 Jul 2017 08:54:39 GMT):
Has joined the channel.
clempo (Mon, 31 Jul 2017 16:10:56 GMT):
I'm getting this error from the EventHub connection. Is this normal behavior for the EventHub? If so, why is this an error on the client side?
clempo (Mon, 31 Jul 2017 16:10:57 GMT):
[2017-07-28T21:30:11.172Z] ERROR (XDLog4J) grpc-default-executor-5: [EventHub$1 - onError()] - EventHub:peer0 terminated is false shutdown is false has error UNAVAILABLE
org.hyperledger.fabric.sdk.exception.EventHubException: io.grpc.StatusRuntimeException: UNAVAILABLE
at org.hyperledger.fabric.sdk.EventHub$1.onError(EventHub.java:208)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:392)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
wangxinalex (Mon, 31 Jul 2017 16:14:47 GMT):
Has joined the channel.
kelvinzhong (Tue, 01 Aug 2017 02:09:20 GMT):
@rickr @clempo same problem, every time restart the peer container, we have to reconstruct the Channel in sdk, otherwise could not get the evenhub
Ashish (Tue, 01 Aug 2017 08:32:34 GMT):
Hi All, EndToEndIT has a code like this below
``` SampleUser peerOrgAdmin = sampleStore.getMember(sampleOrgName + "Admin", sampleOrgName, sampleOrg.getMSPID(),
findFileSk(Paths.get(testConfig.getTestChannlePath(), "crypto-config/peerOrganizations/",
sampleOrgDomainName, format("/users/Admin@%s/msp/keystore", sampleOrgDomainName)).toFile()),
Paths.get(testConfig.getTestChannlePath(), "crypto-config/peerOrganizations/", sampleOrgDomainName,
format("/users/Admin@%s/msp/signcerts/Admin@%s-cert.pem", sampleOrgDomainName, sampleOrgDomainName)).toFile());
sampleOrg.setPeerAdmin(peerOrgAdmin); //A special user that can create channels, join peers and install chaincode```
Ashish (Tue, 01 Aug 2017 08:34:45 GMT):
Does this mean that if I write the same code for *User1@org1.example.com*, instead of *Admin@org1.example.com* , would it treat User1@org1.example.com as the Administrator user who can create channels/join peers & install chaincode?
Ashish (Tue, 01 Aug 2017 08:35:59 GMT):
Is it like, one peer need to have only one PeerAdmin ?
CarlXK (Tue, 01 Aug 2017 10:58:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=B3WNT7GAmaq8LDPYv) @clempo same issue , don't know what happened
rishabh1102 (Tue, 01 Aug 2017 11:15:03 GMT):
@here I have an issue, I was using the sdk to query. My Endorsement policy is the following: AND (OR (Org1, Org2), OR(Org2, Org3)). I created a channel using the java sdk and added org1, org2 and org3 to it. Now I switched off org3 and tried to invoke/query. My endorsement policy was fulfilled, but the SDK says the there aren't enough endorsers and so the transaction fails. How can I get around this?
rickr (Tue, 01 Aug 2017 11:38:42 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=B3WNT7GAmaq8LDPYv) I have not seen this. Can you give some detail steps to recreate.
rickr (Tue, 01 Aug 2017 11:43:23 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=xFkLEoWGvyEnqeysW) Only those credentials (MSPID, private Key, certificate) _Peer Admin_ can do most of the operations. There is another user just Admin which can register other users. That admin and the user's it can register can only query and invoke chaincode.
kelvinzhong (Tue, 01 Aug 2017 11:46:51 GMT):
@rickr construct a channel and save it in the jvm, then restart the fabric node(peer), and use the same channel to invoke, you would find that the invoke is successfully but the channel could not get the eventhub
rickr (Tue, 01 Aug 2017 11:51:15 GMT):
`construct a channel and save it in the jvm` not sure what you mean by this
CarlXK (Tue, 01 Aug 2017 11:53:03 GMT):
cache it , and get it from cache when use it next time
rickr (Tue, 01 Aug 2017 11:54:07 GMT):
Are you recreating the Peer service in docker ?
kelvinzhong (Tue, 01 Aug 2017 11:54:34 GMT):
Channel fooChannel = constructChannel(FOO_CHANNEL_NAME, client, sampleOrg);
fooChannel.invoke();//successfully invoke and get the eventhub
Thread.sleep(100000);//restart the peer
fooChannel.invoke();//successfully invoke but could not get the eventhub
rickr (Tue, 01 Aug 2017 11:54:54 GMT):
If not, that's basically what the End2endAndBackAgainIT does
kelvinzhong (Tue, 01 Aug 2017 11:55:56 GMT):
yes i think 'recreating the Peer service' is what i talking about
kelvinzhong (Tue, 01 Aug 2017 11:55:56 GMT):
yes i think 'recreating the Peer service' is what i'm talking about
rickr (Tue, 01 Aug 2017 12:00:08 GMT):
You can't *recreate* the Peer container services .. It has the ledger and other information. The docker setup does not persist it outside the container environment. You should be able stop and restart the Peer service container, but I have not tested that.
kelvinzhong (Tue, 01 Aug 2017 12:02:31 GMT):
well, might is not recreate but restart
CarlXK (Tue, 01 Aug 2017 12:02:47 GMT):
another problem:
even not restart the peer service , below error occured:
```
08-01 12:00:17.006 DEBUG o.h.f.s.Channel - Channel xnchannel send proposal to peer tcl.org1.xnqkl.com at url grpc://10.0.17.126:7056
08-01 12:00:17.006 DEBUG o.h.f.s.Peer - peer.sendProposalAsync name: tcl.org1.xnqkl.com, url: grpc://10.0.17.126:7056
08-01 12:00:17.031 DEBUG i.n.h.c.h.Http2ConnectionHandler - [id: 0x9a5ccaf1, L:0.0.0.0/0.0.0.0:51950 ! R:/10.0.17.126:7056] Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData 'Connection reset by peer'. Forcing shutdown of the connection.
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.writev0(Native Method)
at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.write(IOUtil.java:148)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504)
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:427)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:856)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:823)
at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1296)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:777)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:769)
at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:750)
at io.netty.handler.codec.http2.Http2ConnectionHandler.onError(Http2ConnectionHandler.java:561)
at io.grpc.netty.AbstractNettyHandler.exceptionCaught(AbstractNettyHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:265)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:257)
at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1301)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:286)
```
CarlXK (Tue, 01 Aug 2017 12:02:47 GMT):
another problem:
even not restart the peer service , just wait 20min, below error occured:
```
08-01 12:00:17.006 DEBUG o.h.f.s.Channel - Channel xnchannel send proposal to peer tcl.org1.xnqkl.com at url grpc://10.0.17.126:7056
08-01 12:00:17.006 DEBUG o.h.f.s.Peer - peer.sendProposalAsync name: tcl.org1.xnqkl.com, url: grpc://10.0.17.126:7056
08-01 12:00:17.031 DEBUG i.n.h.c.h.Http2ConnectionHandler - [id: 0x9a5ccaf1, L:0.0.0.0/0.0.0.0:51950 ! R:/10.0.17.126:7056] Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData 'Connection reset by peer'. Forcing shutdown of the connection.
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.writev0(Native Method)
at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.write(IOUtil.java:148)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504)
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:427)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:856)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:823)
at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1296)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:777)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:769)
at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:750)
at io.netty.handler.codec.http2.Http2ConnectionHandler.onError(Http2ConnectionHandler.java:561)
at io.grpc.netty.AbstractNettyHandler.exceptionCaught(AbstractNettyHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:265)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:257)
at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1301)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:286)
```
CarlXK (Tue, 01 Aug 2017 12:02:47 GMT):
another problem:
Deploy the ca/order--host1, peer1/sdk1--host2, peer2/sdk2--host3, peer3/sdk3--host4
Deploy cc cc1, cc2, to peer1 peer2 peer3, install & instantiate, invoke & query.
Do not restart the peer service , just wait 20min, below error occured:
```
08-01 12:00:17.006 DEBUG o.h.f.s.Channel - Channel xnchannel send proposal to peer tcl.org1.xnqkl.com at url grpc://10.0.17.126:7056
08-01 12:00:17.006 DEBUG o.h.f.s.Peer - peer.sendProposalAsync name: tcl.org1.xnqkl.com, url: grpc://10.0.17.126:7056
08-01 12:00:17.031 DEBUG i.n.h.c.h.Http2ConnectionHandler - [id: 0x9a5ccaf1, L:0.0.0.0/0.0.0.0:51950 ! R:/10.0.17.126:7056] Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData 'Connection reset by peer'. Forcing shutdown of the connection.
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.writev0(Native Method)
at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.write(IOUtil.java:148)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504)
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:427)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:856)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:823)
at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1296)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:777)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:769)
at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:750)
at io.netty.handler.codec.http2.Http2ConnectionHandler.onError(Http2ConnectionHandler.java:561)
at io.grpc.netty.AbstractNettyHandler.exceptionCaught(AbstractNettyHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:265)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:257)
at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1301)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:286)
```
kelvinzhong (Tue, 01 Aug 2017 12:02:49 GMT):
stop the container but not remove it
rickr (Tue, 01 Aug 2017 12:07:30 GMT):
@CarlXK I think that's to be expected you have keep alive enabled ?
CarlXK (Tue, 01 Aug 2017 12:08:25 GMT):
how to enable the keep alive?
rickr (Tue, 01 Aug 2017 12:09:35 GMT):
I'll put it on my to do list to try and stop and start the various services.
kelvinzhong (Tue, 01 Aug 2017 12:10:22 GMT):
well i would counting on that:grin:
rickr (Tue, 01 Aug 2017 12:10:27 GMT):
If you're using the end2end code it's enabled for eventhub (peer)
rickr (Tue, 01 Aug 2017 12:10:27 GMT):
If you're using the end2end code keep alive is enabled for eventhub (peer)
CarlXK (Tue, 01 Aug 2017 12:12:47 GMT):
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {5L, TimeUnit.MINUTES});
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS});
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {5L, TimeUnit.MINUTES});
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS});
peerProperties.put("grpc.NettyChannelBuilderOption.maxInboundMessageSize", 9000000);
CarlXK (Tue, 01 Aug 2017 12:12:47 GMT):
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {5L, TimeUnit.MINUTES});
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS});
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {5L, TimeUnit.MINUTES});
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS});
peerProperties.put("grpc.NettyChannelBuilderOption.maxInboundMessageSize", 9000000);
do you mean of these code ?
rickr (Tue, 01 Aug 2017 12:15:03 GMT):
y
CarlXK (Tue, 01 Aug 2017 12:15:39 GMT):
how to make it always alive, set it to zero?
rickr (Tue, 01 Aug 2017 12:16:05 GMT):
just comment out those lines if you don't want it
CarlXK (Tue, 01 Aug 2017 12:18:30 GMT):
we don't add these code now
rickr (Tue, 01 Aug 2017 12:24:03 GMT):
_Off the bat_ I can't imagine anything on the client side why it wouldn't be able to reconnect to a service. It holds no state information other than how to reconnect. If it's not reconnecting and working after a service restart I have to think it's restarting the service in the docker environment is where the issue is.
kelvinzhong (Tue, 01 Aug 2017 12:27:00 GMT):
the client could still send the transaction to the peer/orderer but,the eventhub seems could not reconnect to the client
rickr (Tue, 01 Aug 2017 12:27:41 GMT):
k will investigate
CarlXK (Tue, 01 Aug 2017 12:29:22 GMT):
yes, the client should be hold no state information, so it seems it is docker service's issue
CarlXK (Tue, 01 Aug 2017 12:29:22 GMT):
yes, the client should be hold no state information, so it seems it is docker service's issue
but now how to fix that?
clempo (Tue, 01 Aug 2017 13:06:03 GMT):
In my case, the peers, orderers, and event hubs are still running. You get the error after a long period of inactivity without any transactions. I pass null for the set of properties when I reconstruct the peers, orderers and event hubs. Maybe keepAlive is turned off by default.
clempo (Tue, 01 Aug 2017 13:06:52 GMT):
I suspect to avoid the timeout, I would need to set keepAliveTime.
clempo (Tue, 01 Aug 2017 13:07:43 GMT):
What is the expected behavior if keepAliveTimeout is reached and causes the timeout? Are you reconnecting or that's the end of this reconstructed channel?
rickr (Tue, 01 Aug 2017 13:08:05 GMT):
long period of inactivity := ?
clempo (Tue, 01 Aug 2017 13:09:00 GMT):
never measured it. Let's say 1h, but it could be 8 min.
rickr (Tue, 01 Aug 2017 13:09:32 GMT):
The event hub maybe a client issue as it tries to do automatic reconnects - I did try this a long time ago and seen it working but not recently
clempo (Tue, 01 Aug 2017 13:10:07 GMT):
So far, I believe it reconnects
clempo (Tue, 01 Aug 2017 13:10:32 GMT):
I just learned about the keep alive props
clempo (Tue, 01 Aug 2017 13:11:45 GMT):
Originally, I thought the behavior was normal and this should not be an error, now I'm not so sure.
clempo (Tue, 01 Aug 2017 13:15:17 GMT):
I'm a bit confused for the need of a keepAliveTimeout on the client side of a permanent connection
clempo (Tue, 01 Aug 2017 13:15:56 GMT):
why would the client disconnect to reconnect and risk losing some events in between
clempo (Tue, 01 Aug 2017 13:16:49 GMT):
similarly, on the event hub side, why would it disconnect if there were no events to report for a while
clempo (Tue, 01 Aug 2017 13:17:17 GMT):
that's not the client side's fault
CarlXK (Tue, 01 Aug 2017 13:40:42 GMT):
@rickr i set properties to orderer & eventhub in sdk
Properties properties = new Properties();
properties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {30L, TimeUnit.SECONDS});
properties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS})
got below error:
```
08-01 13:37:15.894 DEBUG o.h.f.s.Channel - Channel xnchannel sending transaction to orderer(s) with TxID 8978dad165d2032926ddbca7070c257bdd98a4409a5818a5b867937cc92b4c8a
08-01 13:37:15.895 DEBUG o.h.f.s.Orderer - Order.sendTransaction name: orderer.xnqkl.com, url: grpc://172.18.173.191:7050
08-01 13:37:15.897 ERROR i.n.h.c.h.DefaultHttp2Connection - Caught Throwable from listener onStreamActive.
java.lang.IllegalArgumentException: delay: -205431781801 (expected: >= 0)
at io.netty.util.concurrent.AbstractScheduledEventExecutor.schedule(AbstractScheduledEventExecutor.java:138)
at io.netty.util.concurrent.AbstractScheduledEventExecutor.schedule(AbstractScheduledEventExecutor.java:29)
at io.grpc.internal.KeepAliveManager.onTransportActive(KeepAliveManager.java:202)
at io.grpc.netty.NettyClientHandler$1.onStreamActive(NettyClientHandler.java:211)
at io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams.addToActiveStreams(DefaultHttp2Connection.java:1212)
at io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams.activate(DefaultHttp2Connection.java:1159)
at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultStream.activate(DefaultHttp2Connection.java:538)
at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultEndpoint.createStream(DefaultHttp2Connection.java:961)
at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultEndpoint.createStream(DefaultHttp2Connection.java:868)
at io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder.writeHeaders(DefaultHttp2ConnectionEncoder.java:158)
at io.netty.handler.codec.http2.DecoratingHttp2FrameWriter.writeHeaders(DecoratingHttp2FrameWriter.java:52)
at io.netty.handler.codec.http2.StreamBufferingEncoder.writeHeaders(StreamBufferingEncoder.java:157)
at io.netty.handler.codec.http2.StreamBufferingEncoder.writeHeaders(StreamBufferingEncoder.java:141)
at io.grpc.netty.NettyClientHandler.createStream(NettyClientHandler.java:426)
at io.grpc.netty.NettyClientHandler.write(NettyClientHandler.java:240)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:739)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:731)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:817)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:724)
at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1022)
at io.netty.channel.AbstractChannel.write(AbstractChannel.java:291)
at io.grpc.netty.WriteQueue.flush(WriteQueue.java:127)
at io.grpc.netty.WriteQueue.access$000(WriteQueue.java:47)
at io.grpc.netty.WriteQueue$1.run(WriteQueue.java:59)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:445)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
```
clempo (Tue, 01 Aug 2017 13:57:19 GMT):
@CarlXK The IllegalArgumentException might be trying to tell you the value of the two properties are inverted.
clempo (Tue, 01 Aug 2017 13:58:10 GMT):
There is no point in sending a keep alive message after 30 sec if you timeout after 8 sec
clempo (Tue, 01 Aug 2017 13:58:52 GMT):
@rickr, that exception message coule be improved though
clempo (Tue, 01 Aug 2017 13:58:52 GMT):
@rickr, that exception message could be improved though
CarlXK (Tue, 01 Aug 2017 14:01:20 GMT):
properties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {1L, TimeUnit.MINUTES});
properties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS})
change it to 1 min to retry
clempo (Tue, 01 Aug 2017 14:03:14 GMT):
@carlXX, you made the gap even bigger. If I'm right, that will not help at all.
clempo (Tue, 01 Aug 2017 14:04:20 GMT):
The way I read this is: disconnect after 8 sec of inactivity
clempo (Tue, 01 Aug 2017 14:04:45 GMT):
I'm guessing, but that's the only way it makes sense to me
CarlXK (Tue, 01 Aug 2017 14:08:04 GMT):
you means it will disconnect after 8 seconds and only keep 1 min alive ?
CarlXK (Tue, 01 Aug 2017 14:08:04 GMT):
you means it will disconnect after 8 seconds and only keep 1 min alive ? @clempo
clempo (Tue, 01 Aug 2017 14:16:41 GMT):
I'm just guessing, but the way I read this is: send a keep alive message every 1min, disconnect if there is 8 sec of inactivity (including no keep alive messages)
clempo (Tue, 01 Aug 2017 14:16:57 GMT):
so it always disconnects
clempo (Tue, 01 Aug 2017 14:17:36 GMT):
experiment both ways to see if I'm right
CarlXK (Tue, 01 Aug 2017 14:20:19 GMT):
maybe , i will only set the grpc.NettyChannelBuilderOption.keepAliveTime to 15s
clempo (Tue, 01 Aug 2017 14:21:54 GMT):
I set my keepAliveTime to 4 min, and no timeout, but I did not try it yet
clempo (Tue, 01 Aug 2017 14:22:13 GMT):
my previous explanation also does not make sense
clempo (Tue, 01 Aug 2017 14:22:43 GMT):
maybe the way it works is: send a keep alive message every 1min, disconnect if there is 8 sec of inactivity (including no keep alive messages RESPONSES)
clempo (Tue, 01 Aug 2017 14:22:43 GMT):
maybe the way it works is: send a keep alive message every 1min, disconnect if there is 8 sec of inactivity (including no keep alive message RESPONSES)
rickr (Tue, 01 Aug 2017 14:43:21 GMT):
The only reason I know to date to use keep alive feature is if you are connecting through something like a load balancer that kills connections if it detects no activity.
CarlXK (Tue, 01 Aug 2017 15:29:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=c5fQRamCP8tR3tLwp) @clempo set grpc.NettyChannelBuilderOption.keepAliveTime to 4mins is ok now , thanks a lot~
CarlXK (Tue, 01 Aug 2017 15:29:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=c5fQRamCP8tR3tLwp) @clempo set grpc.NettyChannelBuilderOption.keepAliveTime to 4mins is ok now , thanks a lot~
still got the exception but does not affect the use
```
08-01 15:38:00.897 ERROR i.n.h.c.h.DefaultHttp2Connection - Caught Throwable from listener onStreamActive.
java.lang.IllegalArgumentException: delay: -523587550241 (expected: >= 0)
at io.netty.util.concurrent.AbstractScheduledEventExecutor.schedule(AbstractScheduledEventExecutor.java:138)
at io.netty.util.concurrent.AbstractScheduledEventExecutor.schedule(AbstractScheduledEventExecutor.java:29)
at io.grpc.internal.KeepAliveManager.onTransportActive(KeepAliveManager.java:202)
at io.grpc.netty.NettyClientHandler$1.onStreamActive(NettyClientHandler.java:211)
```
CarlXK (Tue, 01 Aug 2017 15:30:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6naaPxR9bi2gyKjL3) @rickr seems that grpc clients and server need keep alive
rickr (Tue, 01 Aug 2017 21:57:50 GMT):
What happens if you don't set the keep alive ?
CarlXK (Wed, 02 Aug 2017 00:10:15 GMT):
@rickr if don't set the keep alive , event hub lost the connection very fast
but now , the event hub also can't receive message , maybe the time is not set right
berserkr (Wed, 02 Aug 2017 03:23:56 GMT):
Has joined the channel.
berserkr (Wed, 02 Aug 2017 03:30:30 GMT):
has the java client been integrated with android?
berserkr (Wed, 02 Aug 2017 03:30:40 GMT):
or does anyone have any experience I could leverage?
Ashish (Wed, 02 Aug 2017 04:51:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=tqtEKJR4bQ6xiX8w6) @rickr Thank you Rick,
MoulaliMvg (Wed, 02 Aug 2017 06:20:42 GMT):
Has joined the channel.
Ashish (Wed, 02 Aug 2017 06:27:41 GMT):
I started the CA instance in HTTPS mode by specifying the following..
``` -e FABRIC_CA_SERVER_TLS_ENABLED=true -e FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem -e FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/b2a5e1d23e0145697c3a4cfa94fef364eb5a94db0534aba157a2e3257a830d9b_sk ```
Ashish (Wed, 02 Aug 2017 06:29:07 GMT):
Then was trying to enroll as below
```HFCAClient hfca = HFCAClient.createNewInstance("https://xxx.xxx.xxx.xxx:7002", props);
hfca.setCryptoSuite(crypto);
admin = new UserImpl("admin", "org1");
if (!admin.isEnrolled()) {
HFCAEnrollment hfcaEnrlMnt = (HFCAEnrollment) hfca.enroll(admin.getName(), "adminpw");```
Ashish (Wed, 02 Aug 2017 06:29:30 GMT):
But its always ending up in the Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Ashish (Wed, 02 Aug 2017 06:29:30 GMT):
But its always ending up in the *Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty*
Ashish (Wed, 02 Aug 2017 06:29:30 GMT):
But its always ending up in the *Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty*
And the server console prints *2017/08/02 07:18:59 http: TLS handshake error from
Ashish (Wed, 02 Aug 2017 06:29:30 GMT):
But its always ending up in the
```
SEVERE: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
```
And the server console prints *2017/08/02 07:18:59 http: TLS handshake error from
Ashish (Wed, 02 Aug 2017 06:30:42 GMT):
I tried importing the server certificate into a trust store which i created..
keytool -import -v -trustcacerts -alias ClientAlias -file *ca.org1.example.com-cert.pem* -keystore client.jks
Ashish (Wed, 02 Aug 2017 06:31:07 GMT):
and referring to the same in the main of my ca-client..
Ashish (Wed, 02 Aug 2017 06:32:16 GMT):
```
System.getProperties().setProperty("javax.net.ssl.trustStore","
Ashish (Wed, 02 Aug 2017 06:32:24 GMT):
but still error is the same.
Ashish (Wed, 02 Aug 2017 06:32:53 GMT):
Can you folks help?
Andrei_Kogun (Wed, 02 Aug 2017 08:30:11 GMT):
Has joined the channel.
Ashish (Wed, 02 Aug 2017 08:53:58 GMT):
Handshake fails with the error. *Host name '192.168.1.5' does not match the certificate subject provided by the peer (CN=ca.org1.example.com, O=org1.example.com, L=San Francisco, ST=California, C=US)*
Ashish (Wed, 02 Aug 2017 08:54:13 GMT):
should i generate the crypto by specifying the ip addresses ?
Ashish (Wed, 02 Aug 2017 08:57:51 GMT):
Oh, my bad. It works with ```props.setProperty("allowAllHostNames", "true");```
munireddya (Wed, 02 Aug 2017 10:12:03 GMT):
Hi I new to blockchain
munireddya (Wed, 02 Aug 2017 10:12:35 GMT):
Suppose if a want to store any docment how I can store?
munireddya (Wed, 02 Aug 2017 10:13:17 GMT):
using hyperledger
dave.enyeart (Wed, 02 Aug 2017 10:43:47 GMT):
@munireddya Hyperledger Fabric uses a key/value model to store things in the ledger. The chaincode API to store something on the ledger is `PutState(key string, value []byte)`. The document bytes can be passed to the chaincode invoke function, and then stored in ledger with PutState().
munireddya (Wed, 02 Aug 2017 11:15:11 GMT):
@dave.enyeart is there any size limit to store data...because doc size may be in MBs..
dave.enyeart (Wed, 02 Aug 2017 11:33:04 GMT):
@munireddya There are some known problems with larger data sizes, which is being worked and intended to be fixed. You can follow the latest status at https://jira.hyperledger.org/browse/FAB-5049
rickr (Wed, 02 Aug 2017 12:30:03 GMT):
@CarlXK @clempo I found a small timing window that caused the eventhub to stop make retries. I'm working on a fix to that. Mostly, the scenario I've tested is in End2endIT.java that I put a minute sleep between instantiate chaincode and the invoke move operation. During the sleep I'd stop and restart all services in the Fabric. You'll see errors logged as the eventhub continues to try and connect when the services are down... I'm going with that's working as designed.
This issue I talked of would not have affected stopping the client, and then stopping all the Fabric services, restarting the Fabric services , then starting and reconnecting the client. I tested that between End2endIT and End2endAndBackAgainIT -- I seen no issues on for this.
I also removed all the grpc Keep alive setting and put a sleep gap in End2endIT.java as above but for an hour wait with no restarting the Fabric services .. I seen no errors in this case. This is all on the same system. Once again, I think the only issue grpc keep alives are needed are for the load balancer issue.
CarlXK (Wed, 02 Aug 2017 12:35:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=iTDQ9W7Gahw9Jm94J) @rickr even add the keepalive property, eventhub also can't receive the message after mins(about 20) wait, now i generate a new channel object every 10 mins if there have no transcations
rickr (Wed, 02 Aug 2017 12:40:08 GMT):
Sorry not sure I'm following your scenario
CarlXK (Wed, 02 Aug 2017 13:54:11 GMT):
Message Attachments
CarlXK (Wed, 02 Aug 2017 13:54:11 GMT):
Message Attachments
CarlXK (Wed, 02 Aug 2017 13:54:11 GMT):
Message Attachments
CarlXK (Wed, 02 Aug 2017 13:54:11 GMT):
Message Attachments
CarlXK (Wed, 02 Aug 2017 13:54:11 GMT):
Message Attachments
CarlXK (Wed, 02 Aug 2017 13:54:11 GMT):
Message Attachments
CarlXK (Wed, 02 Aug 2017 13:54:11 GMT):
Message Attachments
CarlXK (Wed, 02 Aug 2017 13:54:11 GMT):
Message Attachments
CarlXK (Wed, 02 Aug 2017 13:54:11 GMT):
Message Attachments
CarlXK (Wed, 02 Aug 2017 14:08:18 GMT):
@rickr if possible, you can reproduce the scenario
and sometimes got below error
```
Http2ConnectionHandler - [id: 0x714e2be0, L:0.0.0.0/0.0.0.0:52594 ! R:/172.18.173.192:7058] Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData 'Connection reset by peer'.
```
rickr (Wed, 02 Aug 2017 14:50:00 GMT):
no -- can you reproduce it by someway modifying the integration tests provided ?
gauthampamu (Wed, 02 Aug 2017 15:27:51 GMT):
I have a questions on Java SDK. Read the documentation on the page. https://github.com/hyperledger/fabric-sdk-java I wanted to check if there are any limitations or issues with java SDK. Is it stable ? I wanted to find out how many members currently using Java SDK with v1.0 fabric.
gauthampamu (Wed, 02 Aug 2017 15:27:51 GMT):
I have a question on Java SDK. Read the documentation on the page. https://github.com/hyperledger/fabric-sdk-java I wanted to check if there are any limitations or issues with java SDK. Is it stable ? I wanted to find out how many members currently using Java SDK with v1.0 fabric.
scupyr (Wed, 02 Aug 2017 15:32:00 GMT):
Has joined the channel.
CarlXK (Wed, 02 Aug 2017 15:37:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=zp9ChvBGkBh8iyZo4) @rickr i will try to prepare the environment , but not so fast
pschnap (Wed, 02 Aug 2017 18:58:56 GMT):
In the End2endIT test, there's an Org admin user and a Peer Org admin -- why two users? Aren't they synonymous?
Senthil1 (Thu, 03 Aug 2017 03:18:43 GMT):
@rickr In this CR https://gerrit.hyperledger.org/r/#/c/12099/ we are getting an error with e2e sdk integration.
In `End2endIT.java`, channel creation, chaincode install & instantiate, invoke and query succeeded. We get the following error when the test try to call `QSCC` to get block info.
```End2endIT.setup:193->runChannel:539 Test failed with error : queryBlockchainInfo peer peer0.org1.example.com channel foo error Unable to query block channel info for channel foo from peer peer0.org1.example.com with message Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=proto: Marshal called with nil, cause=null}```
Can you help us in identifying the root cause of this error?
Senthil1 (Thu, 03 Aug 2017 03:18:43 GMT):
@rickr In this CR https://gerrit.hyperledger.org/r/#/c/12099/ we are getting an error with e2e sdk integration.
In `End2endIT.java`, channel creation, chaincode install & instantiate, invoke and query succeeded. We get the following error when the test try to call `QSCC` to get block info.
```End2endIT.setup:193->runChannel:539 Test failed with error : queryBlockchainInfo peer peer0.org1.example.com channel foo error Unable to query block channel info for channel foo from peer peer0.org1.example.com with message Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=proto: Marshal called with nil, cause=null}```
Can you help us in identifying the root cause of this error?
a442941609 (Thu, 03 Aug 2017 04:20:30 GMT):
Has joined the channel.
smallX (Thu, 03 Aug 2017 05:02:30 GMT):
Has joined the channel.
smallX (Thu, 03 Aug 2017 06:19:57 GMT):
client:
`New chain foo error. StatusValue 400. Status BAD_REQUEST`
smallX (Thu, 03 Aug 2017 06:19:57 GMT):
server:
```
smallX (Thu, 03 Aug 2017 06:19:57 GMT):
server:
```
2017-08-03 06:02:26.137 UTC [cauthdsl] func2 -> ERRO 41e Principal deserialization failed: (The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com")) for identity [10 7 79 114 103 49 77 83 80 18 178 6 45 45 45 45 45 66 69 71 73 78 32 67 69 82 84 73 70 73 67 65 84 69 45 45 45 45 45 10 77 73 73 67 76 106 67 67 65 100 83 103 65 119 73 66 65 103 73 81 68 103 90 106 50 52 105 83 78 66 122 106 78 48 90 43 116 113 72 66 101 84 65 75 66 103 103 113 104 107 106 79 80 81 81 68 65 106 66 122 77 81 115 119 10 67 81 89 68 86 81 81 71 69 119 74 86 85 122 69 84 77 66 69 71 65 49 85 69 67 66 77 75 81 50 70 115 97 87 90 118 99 109 53 112 89 84 69 87 77 66 81 71 65 49 85 69 66 120 77 78 85 50 70 117 73 69 90 121 10 89 87 53 106 97 88 78 106 98 122 69 90 77 66 99 71 65 49 85 69 67 104 77 81 98 51 74 110 77 83 53 108 101 71 70 116 99 71 120 108 76 109 78 118 98 84 69 99 77 66 111 71 65 49 85 69 65 120 77 84 89 50 69 117 10 98 51 74 110 77 83 53 108 101 71 70 116 99 71 120 108 76 109 78 118 98 84 65 101 70 119 48 120 78 122 65 50 77 84 81 119 77 122 69 49 77 122 82 97 70 119 48 121 78 122 65 50 77 84 73 119 77 122 69 49 77 122 82 97 10 77 70 115 120 67 122 65 74 66 103 78 86 66 65 89 84 65 108 86 84 77 82 77 119 69 81 89 68 86 81 81 73 69 119 112 68 89 87 120 112 90 109 57 121 98 109 108 104 77 82 89 119 70 65 89 68 86 81 81 72 69 119 49 84 10 89 87 52 103 82 110 74 104 98 109 78 112 99 50 78 118 77 82 56 119 72 81 89 68 86 81 81 68 68 66 90 66 90 71 49 112 98 107 66 118 99 109 99 120 76 109 86 52 89 87 49 119 98 71 85 117 89 50 57 116 77 70 107 119 10 69 119 89 72 75 111 90 73 122 106 48 67 65 81 89 73 75 111 90 73 122 106 48 68 65 81 99 68 81 103 65 69 43 112 98 98 110 51 77 106 111 57 55 53 99 109 121 109 101 57 99 73 75 79 116 84 90 52 67 118 99 73 74 81 10 120 68 71 112 98 83 75 71 90 55 115 67 70 109 110 117 117 118 119 104 67 43 115 66 78 97 83 110 102 47 103 79 65 118 43 81 111 98 87 106 43 43 119 107 81 111 106 48 53 57 69 85 108 75 78 105 77 71 65 119 68 103 89 68 10 86 82 48 80 65 81 72 47 66 65 81 68 65 103 87 103 77 66 77 71 65 49 85 100 74 81 81 77 77 65 111 71 67 67 115 71 65 81 85 70 66 119 77 66 77 65 119 71 65 49 85 100 69 119 69 66 47 119 81 67 77 65 65 119 10 75 119 89 68 86 82 48 106 66 67 81 119 73 111 65 103 112 55 67 109 90 80 99 103 90 121 81 121 85 43 114 102 56 73 47 70 57 56 102 78 84 72 114 106 88 53 86 90 90 99 85 73 106 67 80 108 48 79 81 119 67 103 89 73 10 75 111 90 73 122 106 48 69 65 119 73 68 83 65 65 119 82 81 73 104 65 74 71 83 80 119 116 100 102 71 70 70 107 50 87 119 83 74 57 75 71 99 104 75 115 82 102 71 43 100 83 99 116 88 43 99 110 99 115 77 105 88 74 80 10 65 105 65 106 47 52 83 75 66 78 66 43 55 48 117 99 90 86 97 83 55 117 118 86 54 86 72 49 116 67 56 43 100 74 107 115 47 102 106 106 117 49 101 67 119 81 61 61 10 45 45 45 45 45 69 78 68 32 67 69 82 84 73 70 73 67 65 84 69 45 45 45 45 45 10]
orderer.example.com | 2017-08-03 06:02:26.137 UTC [cauthdsl] func2 -> DEBU 41f Principal evaluation fails: (&{0}) [false]
orderer.example.com | 2017-08-03 06:02:26.137 UTC [cauthdsl] func1 -> DEBU 420 Gate evaluation fails: (&{n:1 policies:
smallX (Thu, 03 Aug 2017 06:19:57 GMT):
how to fix it
smallX (Thu, 03 Aug 2017 06:24:32 GMT):
0.0
yoyokeen (Thu, 03 Aug 2017 06:59:00 GMT):
Has joined the channel.
deepakvparmar (Thu, 03 Aug 2017 12:43:56 GMT):
Has joined the channel.
rickr (Thu, 03 Aug 2017 12:44:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=p9kcyiXqXe5qj8GER) End2end tests with no modifications ? Happens consistently ? Running against same level of Fabric ?
deepakvparmar (Thu, 03 Aug 2017 12:44:41 GMT):
Hi, I am getting following error while running integration tests :
2017-08-03 12:40:49,002 WARN SampleStore:75 - Could not find the file "C:\Users\IBM_AD~1\AppData\Local\Temp\HFCSampletest.properties"
from where i can get HFCSampletest.properties file.
rickr (Thu, 03 Aug 2017 12:45:18 GMT):
That should not be an issue
rickr (Thu, 03 Aug 2017 12:47:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=82A5Bn7usZsJ2PAnJ) Almost always means the code is using the identity when you set the user context. Make sure user has correct mspid, private key, and certificate.
rickr (Thu, 03 Aug 2017 12:49:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=xq8Ekdzwfsevq62X4) Org admin can register new user to invoke CC. Peer Org admin constructs the channel.
deepakvparmar (Thu, 03 Aug 2017 12:54:52 GMT):
It's novice question, but not able to understand why do we need to sync following folder into vagrant file in order to test fabric-sdk-java?
config.vm.synced_folder "C:/Deepak/projects/btmu/gitsrc/fabric-sdk-java/src/test/fixture/sdkintegration", "/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration"
Senthil1 (Thu, 03 Aug 2017 13:14:39 GMT):
@rickr We haven't modified End2endIT test. Without SideDB CR, this test works fine. With our CR, it fails consistently in GetChainInfo on QSCC. As it works with other CR, SideDB could be introducing this error.
Senthil1 (Thu, 03 Aug 2017 13:14:39 GMT):
@rickr We haven't modified End2endIT test. Without SideDB CR, this test works fine. With our CR, it fails consistently (in my local vagrant setup) in GetChainInfo on QSCC. As it works with other CR, SideDB could be introducing this error.
Senthil1 (Thu, 03 Aug 2017 13:14:39 GMT):
@rickr We haven't modified End2endIT test. Without SideDB CR, this test works fine. With our CR, it fails consistently (in my local vagrant setup) in GetChainInfo on QSCC. As it works with other CR, SideDB could be introducing this error. With CLI, GetChainInfo on QSCC with SideDB CR works. We have updated protos/ledger/rwset in SideDB CR. Though java SDK uses old proto, It should be the reason for this error.
Senthil1 (Thu, 03 Aug 2017 13:14:39 GMT):
@rickr We haven't modified End2endIT test. Without SideDB CR, this test works fine. With our CR, it fails consistently (in my local vagrant setup) in GetChainInfo on QSCC. As it works with other CR, SideDB could be introducing this error. With CLI, GetChainInfo on QSCC with our CR works. We have updated protos/ledger/rwset. Though java SDK uses old proto, It should be the reason for this error.
Senthil1 (Thu, 03 Aug 2017 13:15:16 GMT):
I tested in my vagrant environment.
clempo (Thu, 03 Aug 2017 14:23:23 GMT):
I would like to implement asynchronous processing of transactions. Channel.sendTransaction() returns a Future so I can go on and do other things, but when I wait on the Future, I become synchronous again. A better approach would be to listen on the BlockEvents like the SDK does and trigger a callback. I'm struggling to make this thread safe because I need to register my interest on a transactionID before we send the transaction. I could duplicate the code that computes the transactionID in the SDK, but that assumes internal knowledge that could change at any time. How can we achieve fully asynchronous processing in the SDK v1.0.0 and how could we make it easier in future versions?
rishabh1102 (Thu, 03 Aug 2017 15:20:20 GMT):
Guys, What exactly happens during Gossip time?
rishabh1102 (Thu, 03 Aug 2017 15:20:58 GMT):
In the java SDK, we have to set a parameter called GOSSIPTIME, anyone know about it in proper detail?
rishabh1102 (Thu, 03 Aug 2017 15:21:22 GMT):
because it seems to have some sort of parallelism
DeutscheBahn-BlockchainDev (Thu, 03 Aug 2017 15:25:44 GMT):
dear all, do you know how to use the Java SDK to listen on BlockEvents which are sent by the chaincode?
clempo (Thu, 03 Aug 2017 15:36:16 GMT):
@DeutscheBahn-BlockchainDev, use channel.registerBlockListener()
DeutscheBahn-BlockchainDev (Thu, 03 Aug 2017 15:43:43 GMT):
hi @cel
DeutscheBahn-BlockchainDev (Thu, 03 Aug 2017 15:43:57 GMT):
hi @clempo thanks a lot!
DeutscheBahn-BlockchainDev (Thu, 03 Aug 2017 15:44:07 GMT):
do you have any code snipplet by any chance? Thanks
DeutscheBahn-BlockchainDev (Thu, 03 Aug 2017 15:48:38 GMT):
how is it related with the EventHubs?
clempo (Thu, 03 Aug 2017 15:59:15 GMT):
@DeutscheBahn-BlockchainDev, strangely, this API is not tested in the junits. It's easy, you implement the BlockListener interface, create an instance of your listener, and pass it to channel.registerBlockListener(mylistener)
DeutscheBahn-BlockchainDev (Thu, 03 Aug 2017 16:03:13 GMT):
thanks, will give it a try and see how it works :)
Dibri (Thu, 03 Aug 2017 16:03:22 GMT):
Has joined the channel.
Dibri (Thu, 03 Aug 2017 16:08:27 GMT):
Hello everyone, I don't know if it's the right chat. But I have problem to understand how to configure the Hyperledger blockchain network to connect a java program using the java SDK. There are some good tutorial that can show me how to do the right configuration of the network and then connect an java client application? Thanks
clempo (Thu, 03 Aug 2017 16:09:14 GMT):
@Dibri, look at End2endIT and End2endAndBackAgainIT
Dibri (Thu, 03 Aug 2017 16:11:23 GMT):
Thank you
clempo (Thu, 03 Aug 2017 16:12:58 GMT):
@deepakvparmar, because you already reserved the ports in vagrant, you need to run the sdkintegration tests within vagrant otherwise the ports will look busy when vagrant is running
rickr (Thu, 03 Aug 2017 17:23:23 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=tEgbFBgErYZDJgc4y) The only mention of gossip is GOSSIPWAITTIME in TestConfig.java .. that's dead code and cleaning it up. GOSSIP should be totally transparent to and SDK.
rickr (Thu, 03 Aug 2017 17:32:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=qaHXgaxeFdhCtMs22) I don't follow a Future is in essence a callback
clempo (Thu, 03 Aug 2017 17:49:07 GMT):
@rickr, A Future is a callback you have to wait on, that takes a thread, hence you are synchronous at that point.
clempo (Thu, 03 Aug 2017 17:49:53 GMT):
It's better to have the listener be the only thread that waits
clempo (Thu, 03 Aug 2017 17:50:24 GMT):
(listener here is a generic term, not one of your data types)
rickr (Thu, 03 Aug 2017 17:55:43 GMT):
Look at End2endAndBackAgainIT see how futures are chained together and even in a a function `moveAmount`
clempo (Thu, 03 Aug 2017 17:56:22 GMT):
Show me how to wait on two futures on the same thread
clempo (Thu, 03 Aug 2017 17:58:39 GMT):
I believe your listener calls back the Future, but that does not call back the app
clempo (Thu, 03 Aug 2017 17:59:54 GMT):
I either need to know the transaction ID of interest before sending the transaction, or I need the SDK listener to callback my app, this could be my own Future for example
clempo (Thu, 03 Aug 2017 18:15:07 GMT):
I just noticed the ProposalWaitTime has the problem I'm talking about. The waitTimes are cumulative since each proposal is waiting sequentially and the timeout is full value for each
rickr (Thu, 03 Aug 2017 18:16:19 GMT):
I just hacked this together without any testing maybe issues but think I could get it to work ..
```
List
rickr (Thu, 03 Aug 2017 18:17:20 GMT):
Probably better solutions out there
clempo (Thu, 03 Aug 2017 18:17:35 GMT):
I need to study thenApply()
clempo (Thu, 03 Aug 2017 18:18:15 GMT):
do you see the problem with proposalWaitTime in Channel.sendProposalToPeers()
clempo (Thu, 03 Aug 2017 18:27:11 GMT):
Looks like CompletableFuture is what I was looking for, so this takes care of that.
clempo (Thu, 03 Aug 2017 18:30:19 GMT):
the issue with the proposalWaitTime is unrelated.
clempo (Thu, 03 Aug 2017 18:30:46 GMT):
I believe Channel.sendProposalToPeers() will take peers.size() * proposalWaitTime time to execute if all proposals time out
clempo (Thu, 03 Aug 2017 18:40:13 GMT):
It appears Channel.sendTransaction() also has the same problem but this time the messages are ordered req resp req resp... instead of req req req...resp resp resp like the proposals
clempo (Thu, 03 Aug 2017 18:41:50 GMT):
It's fine to implement a timeout per partner connection, but then there should be a timeout for the whole operation
clempo (Thu, 03 Aug 2017 18:42:38 GMT):
I bet the global timeout is what people expect in v1.0.0 but that's not what they get
clempo (Thu, 03 Aug 2017 19:32:20 GMT):
I changed the chaincode src/test/fixture/sdkintegration/gocc/sample1/src/github.com/example_cc/example_cc.go hoping a fresh run of End2endIT would install it but it's not picking up my new file
clempo (Thu, 03 Aug 2017 19:32:53 GMT):
what is the easiest command to check if I made a syntax error in go
clempo (Thu, 03 Aug 2017 19:33:49 GMT):
Could a syntax error explain why my new code is not the one installed?
rickr (Thu, 03 Aug 2017 19:34:18 GMT):
Look at the logs of the chaincode created container
clempo (Thu, 03 Aug 2017 19:35:30 GMT):
I'm not sure I understand this. That probably explains my trouble.
clempo (Thu, 03 Aug 2017 19:36:33 GMT):
is the chaincode created container created before End2endIT runs?
clempo (Thu, 03 Aug 2017 19:37:23 GMT):
I thought End2endIT sent source code
clempo (Thu, 03 Aug 2017 19:37:54 GMT):
then maybe a peer would create a container from the source
clempo (Thu, 03 Aug 2017 19:38:25 GMT):
should I look at the log of a peer?
clempo (Thu, 03 Aug 2017 19:40:02 GMT):
maybe the chaincode is preinstalled and the install in End2endIT is a no-op
clempo (Thu, 03 Aug 2017 20:25:18 GMT):
The log does not say anything
clempo (Thu, 03 Aug 2017 20:25:20 GMT):
docker logs 97eb63799f09
########### example_cc Init ###########
Aval = 500, Bval = 200
########### example_cc Invoke ###########
Aval = 400, Bval = 300
########### example_cc Invoke ###########
Query Response:{"Name":"b","Amount":"300"}
########### example_cc Invoke ###########
clempo (Thu, 03 Aug 2017 20:25:52 GMT):
The last Invoke with no detail is the call to my new action
clempo (Thu, 03 Aug 2017 20:26:15 GMT):
it fails because I'm not running my modified code
clempo (Thu, 03 Aug 2017 20:28:38 GMT):
I read http://hyperledger-fabric.readthedocs.io/en/latest/chaincode.html
clempo (Thu, 03 Aug 2017 20:29:15 GMT):
Next I'll have to figure out how the chaincode containers are created and initializated in the samples
sqwerrels (Thu, 03 Aug 2017 21:02:56 GMT):
Are you running the fabric script? Try running ./fabric.sh restart and then running the End2EndIT test again
CarlXK (Fri, 04 Aug 2017 02:00:29 GMT):
@clempo @rickr i use java sdk deploy 2 chaincodes in one channel, step below :
1. install chaincode2 in peer1
2. create the channel1, instantiate chaincode1 in peer1&channel1
3. install chaincode2 in peer1
4. *query if chaincode2 is instantiated, found that chaincode2 is instantiated*
it is a bug or there are some mistakes ?
CarlXK (Fri, 04 Aug 2017 02:00:29 GMT):
@clempo @rickr i use java sdk deploy 2 chaincodes in one channel, step below :
1. install chaincode2 in peer1
2. create the channel1, join the peer1 to channel, instantiate chaincode1 in peer1&channel1
3. install chaincode2 in peer1
4. *query if chaincode2 is instantiated, found that chaincode2 is instantiated*
it is a bug or there are some mistakes ?
CarlXK (Fri, 04 Aug 2017 02:00:29 GMT):
@clempo @rickr i use java sdk deploy 2 chaincodes in one channel 2hosts; for host1 everything is ok, for the host2 step below :
1. install chaincode2 in peer1
2. create the channel1, join the peer1 to channel, instantiate chaincode1 in peer1&channel1
3. install chaincode2 in peer1
4. *query if chaincode2 is instantiated, found that chaincode2 is instantiated*
liuwenliang0632 (Fri, 04 Aug 2017 03:08:08 GMT):
@CarlXK i think instantiated is Automatic
liuwenliang0632 (Fri, 04 Aug 2017 03:11:04 GMT):
is chaincode2 instantiated in other peer
CarlXK (Fri, 04 Aug 2017 03:12:30 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=FX8j6jbv7on3hKpMr) @liuwenliang0632 yes, in host1 i install and instantiate the cc1 & cc2, in host2 only can instantiate cc1 , can't instantiate cc2, why?
liuwenliang0632 (Fri, 04 Aug 2017 03:14:06 GMT):
we could speek in twg-china channel with chinese
liuwenliang0632 (Fri, 04 Aug 2017 03:14:06 GMT):
@CarlXK we could speek in twg-china channel with chinese
liuwenliang0632 (Fri, 04 Aug 2017 03:17:20 GMT):
it is a correct process
deepakvparmar (Fri, 04 Aug 2017 04:49:55 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=xcSTHtWPhrAY64jFN) @clempo : Thank You :)
deepakvparmar (Fri, 04 Aug 2017 04:52:11 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=xcSTHtWPhrAY64jFN) @clempo : But, We have forwarded all ports to Host OS as well, will it still create problem?
deepakvparmar (Fri, 04 Aug 2017 04:53:14 GMT):
Can someone who has 1500+ reputation on StackOverflow create tag for "fabric-sdk-java"?
yoyokeen (Fri, 04 Aug 2017 07:31:57 GMT):
ERROR: for configtxlator Cannot start service configtxlator: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\"/usr/local/bin/configtxlator\\\": stat /usr/local/bin/configtxlator: no such file or directory\"\n"
yoyokeen (Fri, 04 Aug 2017 07:32:21 GMT):
```root@iZ2ze5v28cpic3ok2o1ux7Z:/opt/gopath/src/github.com/hyperledger/fabric-sdk-java/src/test/fixture/sdkintegration# ll /usr/local/bin/configtxlator
lrwxrwxrwx 1 root root 69 Aug 4 15:31 /usr/local/bin/configtxlator -> /opt/gopath/src/github.com/hyperledger/fabric/build/bin/configtxlator*```
yoyokeen (Fri, 04 Aug 2017 07:32:33 GMT):
the file existing
yoyokeen (Fri, 04 Aug 2017 07:41:36 GMT):
2017-08-04 07:19:23,230 main WARN SampleStore:75 - Could not find the file "/tmp/HFCSampletest.properties"
yoyokeen (Fri, 04 Aug 2017 07:42:33 GMT):
exactlly it not existing
yoyokeen (Fri, 04 Aug 2017 07:42:44 GMT):
how to make it?
yoyokeen (Fri, 04 Aug 2017 07:58:10 GMT):
Error: Validation of certificate and key failed: Invalid certificate and/or key in files '/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem' and '/etc/hyperledger/fabric-ca-server-config/fcf776b02a05600408d0be9d9752afc59f64950b721cacb363b5b95a0fea6216_sk': Public key and private key do not match
DeutscheBahn-BlockchainDev (Fri, 04 Aug 2017 09:47:40 GMT):
Hi @clempo would I receive my custom set chaincode events also as BlockEvents?
DeutscheBahn-BlockchainDev (Fri, 04 Aug 2017 09:53:20 GMT):
I would generally like to subscribe to custom events I am throwing from my chaincode, I do get he concept of the BlockListener on a particular channel, but does this receive my custom event as a BlockEvent?
DeutscheBahn-BlockchainDev (Fri, 04 Aug 2017 09:54:17 GMT):
you have stub.setEvent on the chaincode side, is the BlockListener the correct way to receive on the SDK side?
DeutscheBahn-BlockchainDev (Fri, 04 Aug 2017 12:14:24 GMT):
can we say you are only supporting BlockEvents?
DeutscheBahn-BlockchainDev (Fri, 04 Aug 2017 12:16:00 GMT):
StreamObserver
Codegidi (Fri, 04 Aug 2017 12:22:51 GMT):
Has left the channel.
rickr (Fri, 04 Aug 2017 12:46:54 GMT):
There is code pending to handle chaincode events when they're detected in the blocks and a callback to a registered listener, but I don't know when it will be available.
Vadim (Fri, 04 Aug 2017 12:47:39 GMT):
Has joined the channel.
Vadim (Fri, 04 Aug 2017 12:56:53 GMT):
Has left the channel.
DeutscheBahn-BlockchainDev (Fri, 04 Aug 2017 13:43:50 GMT):
ok, thanks for update
DeutscheBahn-BlockchainDev (Fri, 04 Aug 2017 13:45:55 GMT):
but you are convinced they are being sent on the chaincode side? for instance by Java chaincode?
DeutscheBahn-BlockchainDev (Fri, 04 Aug 2017 14:02:30 GMT):
do we expect ChaincodeEvents to come as PeerEvents? I can finish the code for our project if these events are populated to the Client SDK
clempo (Fri, 04 Aug 2017 14:27:46 GMT):
It's the result of forwarding that makes the port busy. If you stop vagrant, maybe you can run outside of it. It would make more sense for a production environment. I'm not there yet and I have not tried. [](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=nggmu3qpFG7XSZecZ)
eacoeytaux (Fri, 04 Aug 2017 19:55:58 GMT):
Has joined the channel.
clempo (Fri, 04 Aug 2017 20:44:20 GMT):
I am still unsuccessful trying to make End2endIT work with a modified chaincode example_cc.go
clempo (Fri, 04 Aug 2017 20:44:50 GMT):
I used the go compiler to prove my modified example_cc.go file compiles cleanly
clempo (Fri, 04 Aug 2017 20:45:35 GMT):
I ran End2endIT in the debugger, I put a breakpoint where the targz file is created from the source location
clempo (Fri, 04 Aug 2017 20:46:31 GMT):
The debugger tells me the absolute path of the file included in the targz. The path is correct.
clempo (Fri, 04 Aug 2017 20:46:48 GMT):
I use vi to double check the contents at that path. Still correct.
clempo (Fri, 04 Aug 2017 20:47:13 GMT):
End2endIT reports the chaincode installation was successful
clempo (Fri, 04 Aug 2017 20:48:25 GMT):
Can someone explain where the chaincode code comes from if not from the install proposal
clempo (Fri, 04 Aug 2017 20:48:56 GMT):
or any hints on how to continue debug this?
clempo (Fri, 04 Aug 2017 20:48:56 GMT):
or any hints on how to continue debugging this?
rickr (Sat, 05 Aug 2017 21:16:54 GMT):
The shell script `fabric.sh restart` should restart everything and clean out an CC containers.
Then running your deployment does it produce a CC docker container ?
rickr (Sat, 05 Aug 2017 21:19:01 GMT):
You need to do both a install and instantiate
rickr (Sat, 05 Aug 2017 21:19:50 GMT):
If that's ok it should produce a CC docker container instance. Should be able to look a it's logs
rickr (Sat, 05 Aug 2017 21:24:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=W5NYdRxr6ksK3BBeR) Not sure what your asking. If you have a linux foundation id should be able to see this delta on roughly what to expect
https://gerrit.hyperledger.org/r/#/c/12091/7/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java
deepakvparmar (Sun, 06 Aug 2017 07:12:31 GMT):
What is the right way of setting chaincode location while initialzing installChaincodeProposal, setting sourceLoaction or setting inputStream in Production?
if (isFooChain) {
// on foo chain install from directory.
////For GO language and serving just a single user, chaincodeSource is mostly likely the users GOPATH
installProposalRequest.setChaincodeSourceLocation(new File(TEST_FIXTURES_PATH + "/sdkintegration/gocc/sample1"));
} else {
// On bar chain install from an input stream.
installProposalRequest.setChaincodeInputStream(Util.generateTarGzInputStream(
(Paths.get(TEST_FIXTURES_PATH, "/sdkintegration/gocc/sample1", "src", CHAIN_CODE_PATH).toFile()),
Paths.get("src", CHAIN_CODE_PATH).toString()));
}
Eric.Bui (Sun, 06 Aug 2017 11:08:16 GMT):
Has joined the channel.
rickr (Sun, 06 Aug 2017 14:01:53 GMT):
There is no `right way`. It depends on the use case of the application you want build.
deepakvparmar (Sun, 06 Aug 2017 14:42:11 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=3QdqHvGJKf4JsqCxP) @rickr : Thank You Rick. Can you please explain which one is suitable for which kind of application use case by taking example?
deepakvparmar (Mon, 07 Aug 2017 12:24:07 GMT):
@rickr : I am trying to create channel by taking reference of implementation provided in End2endIT.java, but getting following error , any input or suggestion would be very helpful.
Channel example_ee_go error: Expected config block for channel: example_ee_go, but got: foo
lenin.mehedy (Mon, 07 Aug 2017 12:46:35 GMT):
Hi @rickr I have got the following error as my api module runs inside Websphere liberty, which does not support Oracle JDK. Any idea/suggestion?
```
java.lang.NoClassDefFoundError: sun.security.x509.X509CertImpl
at io.netty.handler.ssl.util.SelfSignedCertificate.
rickr (Mon, 07 Aug 2017 13:24:53 GMT):
Not sure. I have run with the IBM JDK the integration test suite with no problems.
rickr (Mon, 07 Aug 2017 13:28:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=d8foynuFqbbHEP9QP) [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=d8foynuFqbbHEP9QP) You'll need to regenerate the channel config block with configtx with the name you want instead of using the IT suites's generated
daygee (Mon, 07 Aug 2017 14:59:06 GMT):
Has joined the channel.
alexcrownus (Mon, 07 Aug 2017 15:00:59 GMT):
Has joined the channel.
sanjay-saxena (Mon, 07 Aug 2017 18:08:20 GMT):
Has joined the channel.
smcambria22 (Mon, 07 Aug 2017 19:48:52 GMT):
Has joined the channel.
FrankShikhaliev (Mon, 07 Aug 2017 20:23:17 GMT):
Has joined the channel.
blockcloud (Tue, 08 Aug 2017 01:07:01 GMT):
@lenin.mehedy It looks like you miss some jar files, like netty-handler-4.1.8.Final.jar and so on...
zaishengming (Tue, 08 Aug 2017 01:48:59 GMT):
hi,@rickr, I have download newest java-sdk-java,fabric,and fabric-ca. I already use make docker on fabric and fabirc-ca in this way.And I already create
zaishengming (Tue, 08 Aug 2017 01:51:35 GMT):
Message Attachments
zaishengming (Tue, 08 Aug 2017 01:57:48 GMT):
when i get the fabric-java-sdk(src-test-fixture-sdkintegration) copy to fabric project, use "docker-compose up --force-recreate" produce the contrainers .It have exited with a contraniners ...How is it happen?
zaishengming (Tue, 08 Aug 2017 01:57:57 GMT):
Message Attachments
rishabh1102 (Tue, 08 Aug 2017 06:14:50 GMT):
Guys, is it possible that the java sdk adds peers to the channel as per the endorsement policy?
For eg: If I have a 4 org network (Org0, Org1, Org2, Org3) with My endorsement Policy = Any 3 Of 4.
If I create a channel (In the SDK) with peers of all orgs, even if one of them doesn
rishabh1102 (Tue, 08 Aug 2017 06:19:44 GMT):
Guys, is it possible that the java sdk adds peers to the channel as per the endorsement policy?
For eg: If I have a 4 org network (Org0, Org1, Org2, Org3) with My endorsement Policy = Any 3 Of 4.
If I create a channel (In the SDK) with peers of all orgs, even if only one doesn't respond (which means my endorsement policy is fulfilled, the sdk says not enough endorsers
gauravgiri (Tue, 08 Aug 2017 06:31:59 GMT):
I am using fabric-sdk-java and trying to connect to an existing hyperledger 1.0 blockchain network created using: http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html
I used CLI to install, instantiate and query on a sample chaincode they all worked fine.
I configured fabric-sdk-java to use the admin privatekeyfile, and certificatefile generated.
However, when i try to use fabric-sdk-java client to connect to this network, it gives error below, any idea what may have caused this error:
org.hyperledger.fabric.sdk.exception.ProposalException: Failed exception message is Sending proposal to peer0 failed because of: gRPC failure=Status{code=INTERNAL, description=null, cause=io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002
at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:309)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:217)
at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:401)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:745)
}, status is 500
deepakvparmar (Tue, 08 Aug 2017 07:06:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=FxMSXxBfyJ5qy6o8R) @rickr : Thank You Rickr, Kindly let me know how to use configtx as i havent used before or guide me link where i can take reference.
qsmen (Tue, 08 Aug 2017 07:31:07 GMT):
Has joined the channel.
qsmen (Tue, 08 Aug 2017 07:33:14 GMT):
hello,I want to know whether if the current java sdk can be
qsmen (Tue, 08 Aug 2017 07:34:37 GMT):
Hello, I want to know whether the current java sdk can work correctly. I mean if it can be compiled and run correctly. Thank you.
liuwenliang0632 (Tue, 08 Aug 2017 07:35:55 GMT):
java sdk work well.
liuwenliang0632 (Tue, 08 Aug 2017 07:36:01 GMT):
@qsmen
qsmen (Tue, 08 Aug 2017 07:38:37 GMT):
@liuwenliang0632 , Thank you.
DeutscheBahn-BlockchainDev (Tue, 08 Aug 2017 07:47:24 GMT):
@rickr thanks a lot, things work with the events! :)
deepakvparmar (Tue, 08 Aug 2017 08:18:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=xvruAzG8YQKtAGcZA) @zaishengming : You are not running process in background. Kindly use "docker-compose up --force-recreate -d" command.
zaishengming (Tue, 08 Aug 2017 08:25:48 GMT):
@deepakvparmar thank you for your help!but both methods are the same.In fact,I want to know why the "ccenv" container is exited?
zaishengming (Tue, 08 Aug 2017 08:27:35 GMT):
@rickr hello, whether the newest version of fabric-sdk-java more than netty.jar?which version?
yoyokeen (Tue, 08 Aug 2017 09:02:59 GMT):
```[2017-08-08 16:57:02.696] [DEBUG] Helper - [crypto_ecdsa_aes]: constructor, keySize: 256
[2017-08-08 16:57:02.696] [DEBUG] Helper - [crypto_ecdsa_aes]: Hash algorithm: SHA2, hash output size: 256
[2017-08-08 16:57:02.696] [DEBUG] Helper - [utils.CryptoKeyStore]: CryptoKeyStore, constructor - start
[2017-08-08 16:57:02.699] [DEBUG] Helper - [utils.CryptoKeyStore]: constructor, no super class specified, using config: fabric-client/lib/impl/FileKeyValueStore.js
[2017-08-08 16:57:02.700] [DEBUG] Helper - [crypto_ecdsa_aes]: constructor, keySize: 256
[2017-08-08 16:57:02.701] [DEBUG] Helper - [crypto_ecdsa_aes]: Hash algorithm: SHA2, hash output size: 256
[2017-08-08 16:57:02.701] [DEBUG] Helper - [utils.CryptoKeyStore]: CryptoKeyStore, constructor - start
[2017-08-08 16:57:02.701] [DEBUG] Helper - [utils.CryptoKeyStore]: constructor, no super class specified, using config: fabric-client/lib/impl/FileKeyValueStore.js
[2017-08-08 16:57:02.701] [DEBUG] Helper - [crypto_ecdsa_aes]: constructor, keySize: 256
[2017-08-08 16:57:02.702] [DEBUG] Helper - [crypto_ecdsa_aes]: Hash algorithm: SHA2, hash output size: 256
[2017-08-08 16:57:02.702] [DEBUG] Helper - [utils.CryptoKeyStore]: CryptoKeyStore, constructor - start
[2017-08-08 16:57:02.702] [DEBUG] Helper - [utils.CryptoKeyStore]: constructor, no super class specified, using config: fabric-client/lib/impl/FileKeyValueStore.js
[2017-08-08 16:57:02.712] [DEBUG] Helper - [crypto_ecdsa_aes]: ecdsa signature: Signature {
r:
yoyokeen (Tue, 08 Aug 2017 09:03:19 GMT):
when I run instantiate-chaincode command with the error.
deepakvparmar (Tue, 08 Aug 2017 09:15:10 GMT):
Where i can find build/bin/cryptogen tool?
zaishengming (Tue, 08 Aug 2017 09:17:31 GMT):
@deepakvparmar you can find with "gopath/src/github.com/hyperledger/fabric/release/linux-amd64/bin"
nikit-os (Tue, 08 Aug 2017 09:45:54 GMT):
Has joined the channel.
deepakvparmar (Tue, 08 Aug 2017 09:54:40 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=h8zp38enrmEeE22M3) @zaishengming : Thank You. Actually i cannot find linux-amd64 folder within release folder.
zaishengming (Tue, 08 Aug 2017 09:56:35 GMT):
@deepakvparmar you must in github download fabirc prpject ,and run "make docker" first ,second "make release" .Just can hava
zaishengming (Tue, 08 Aug 2017 09:56:51 GMT):
@deepakvparmar Just can have
deepakvparmar (Tue, 08 Aug 2017 10:43:31 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6oQ8dcNCv7eNNg8sR) @zaishengming Thank You. "make release" worked. :)
deepakvparmar (Tue, 08 Aug 2017 10:44:11 GMT):
I am trying to create new channel, but transaction proposal is getting time out. Any suggestion or pointers would help me.
org.hyperledger.fabric.sdk.exception.TransactionException: Send transactions failed. Reason: timeout
at org.hyperledger.fabric.sdk.OrdererClient.sendTransaction(OrdererClient.java:163)
at org.hyperledger.fabric.sdk.Orderer.sendTransaction(Orderer.java:133)
at org.hyperledger.fabric.sdk.Channel.
deepakvparmar (Tue, 08 Aug 2017 12:28:51 GMT):
@rickr : While creating new channel using fabric-java-sdk, I am getting timeout error consistently. Any pointers or suggestion would be very helpful.
org.hyperledger.fabric.sdk.exception.TransactionException: Send transactions failed. Reason: timeout
at org.hyperledger.fabric.sdk.OrdererClient.sendTransaction(OrdererClient.java:163)
at org.hyperledger.fabric.sdk.Orderer.sendTransaction(Orderer.java:133)
at org.hyperledger.fabric.sdk.Channel.
rickr (Tue, 08 Aug 2017 13:06:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=H7HWfsmtwsFgTJmzs) You need to sign the request block with at least 3 endorser signatures.
rickr (Tue, 08 Aug 2017 13:08:15 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=5iiANhqXgrXJ7qHkm) First looks appears you're not even connecting. Recheck url port and that services is up. If it is does it have anything in the logs.
rickr (Tue, 08 Aug 2017 13:08:57 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Gq7bnFjxKu3P4F6yv) Example is in the README.md
rickr (Tue, 08 Aug 2017 13:12:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RTQcNojJhEAtwqvPJ) Is this Node ? If yes, please post in #fabric-sdk-node
rickr (Tue, 08 Aug 2017 13:15:23 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8qBwrQhKgwvwFshDu) Part of the Fabric. JSDK Readme.md shows how it was used for the integration test. http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html
BhavishaDawda (Tue, 08 Aug 2017 13:58:13 GMT):
The hyperledger FAQ mentions that the client should only connect to as many peers as are required by the endorsement policy - Does SDK provide an API to get the number of peers to connect to?
BhavishaDawda (Tue, 08 Aug 2017 13:58:13 GMT):
@rickr The hyperledger FAQ mentions that the client should only connect to as many peers as are required by the endorsement policy - Does SDK provide an API to get the number of peers to connect to?
eric.wall (Tue, 08 Aug 2017 14:57:05 GMT):
Is it possible to install Java chaincode on the fabric-samples/first-network using "peer install chaincode" command?
rickr (Tue, 08 Aug 2017 15:00:20 GMT):
Java chaincode is not supported at this time.
rickr (Tue, 08 Aug 2017 15:01:25 GMT):
Better discussed in #fabric-java-chaincode
jtsiros (Tue, 08 Aug 2017 22:19:50 GMT):
Has left the channel.
licdhemin (Wed, 09 Aug 2017 02:12:23 GMT):
Has joined the channel.
DarshanBc (Wed, 09 Aug 2017 03:34:29 GMT):
Has joined the channel.
yoyokeen (Wed, 09 Aug 2017 08:01:15 GMT):
```org.hyperledger.fabric.sdk.exception.InvalidArgumentException: UserContext for user user1 has no enrollment set.
at org.hyperledger.fabric.sdk.User.userContextCheck(User.java:84)
at org.hyperledger.fabric.sdk.HFClient.setUserContext(HFClient.java:257)
at org.hyperledger.fabric.sdkintegration.End2endIT.lambda$runChannel$0(End2endIT.java:345)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
at org.hyperledger.fabric.sdk.Channel$TL.lambda$fire$1(Channel.java:2567)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)```
yoyokeen (Wed, 09 Aug 2017 08:01:41 GMT):
when I run End2endIT test with the error
licdhemin (Wed, 09 Aug 2017 08:22:04 GMT):
hello everyone. how to set up fabric-sdk-java to ? thanks.
licdhemin (Wed, 09 Aug 2017 08:22:28 GMT):
how to set up fabric-sdk-java to run
licdhemin (Wed, 09 Aug 2017 08:24:33 GMT):
hello wvwry one . how to set up fabric-sdk-java to used in business system ? thanks
licdhemin (Wed, 09 Aug 2017 08:25:23 GMT):
where can found the logic paper?
Styxt (Wed, 09 Aug 2017 09:18:47 GMT):
Has joined the channel.
licdhemin (Wed, 09 Aug 2017 09:23:08 GMT):
hello every one. how to set up fabric-sdk-java to connect chaincode ? thanks
rwadhwa (Wed, 09 Aug 2017 12:33:23 GMT):
Has joined the channel.
eric.wall (Wed, 09 Aug 2017 15:00:46 GMT):
Any advice how to get started with End2EndIT? I don't exactly know how to run it and what is needed. I have built Java from source and reverted the git commit that disabled Java chaincode. Now I want to use the Java SDK to deploy some Java chaincode (although Go works fine for now so I can get accustomed to the SDK first)
eric.wall (Wed, 09 Aug 2017 15:01:25 GMT):
I've spun up a network by configuring the config files of the "first-network" folder in fabric-samples. This is on a remote machine I only connect to through ssh
eric.wall (Wed, 09 Aug 2017 15:02:40 GMT):
If I want to use the Java SDK, do I set up a development environment like Eclipse? Can I do this on my local machine and have it connect to the network running on the remote machine?
rickr (Wed, 09 Aug 2017 15:43:55 GMT):
Look at the README.md should tell you how to get started. Java chaincode is not supported.
kelvinzhong (Thu, 10 Aug 2017 01:48:52 GMT):
@rickr hi rickr, as i noticed that, when successfully send a transaction to the orderer, the return future will wait for all events to fire. but it's too costly to wait for all events to return, even sometimes one of the event fail to return then the future would never be fired. can i simply consider the peers would always come to synchronize the transaction if the orderer return success, even the events fail to return?
DarshanBc (Thu, 10 Aug 2017 05:05:14 GMT):
can anyone pst the link to read about java sdk documentation
DarshanBc (Thu, 10 Aug 2017 05:05:14 GMT):
can anyone post the link to read about java sdk documentation
rwadhwa (Thu, 10 Aug 2017 08:04:06 GMT):
@DarshanBc The only place I could see it is in this link: https://github.com/hyperledger/fabric-sdk-java
rwadhwa (Thu, 10 Aug 2017 08:05:26 GMT):
Hi All, Till now, even through the examples given through the Git, I could only run the gradle test cases. Which actually doesn't refer to the actual running environment.
rwadhwa (Thu, 10 Aug 2017 08:06:32 GMT):
Let's say, I started the already provided Images via docker for all the components,, now I want to query the chaincode via Java Code. I couldn't find any example for that. Can someone help help with this?
rwadhwa (Thu, 10 Aug 2017 08:07:05 GMT):
A good documentation is a must for Hyperledger Fabric. And till now, we don't have it. :(
DarshanBc (Thu, 10 Aug 2017 10:47:16 GMT):
What is cryptosuite
DarshanBc (Thu, 10 Aug 2017 10:47:16 GMT):
What does HFCClient.cryptosuite returns and why is it required ?
gauravgiri (Thu, 10 Aug 2017 11:03:04 GMT):
Any pointers for fabric-java-sdk to listen to different event types(block, chaincode) from hyperledger network? And if the fabric-sdk-java subscriptions for these events be made durable in nature?
DarshanBc (Thu, 10 Aug 2017 11:03:45 GMT):
Hi @here with respect to this link https://github.com/venugopv/FabricJavaSDKSample.
I may sound silly, However this code doesn't have public static void main so from where does it start executing
DarshanBc (Thu, 10 Aug 2017 11:03:45 GMT):
Hi @here with respect to End2endIT in this link https://github.com/venugopv/FabricJavaSDKSample.
I may sound silly, However this code doesn't have public static void main so from where does it start executing
DarshanBc (Thu, 10 Aug 2017 11:54:52 GMT):
on executing End2endIT example I am getting this error `End2endTest.setup:214 Url:http://localhost:7054, Failed to enroll user admin
UpgradeCCEnd2endTest.setup:180 UserContext for user peerOrg1Admin has no enrollment set.`
DarshanBc (Thu, 10 Aug 2017 11:54:52 GMT):
on executing End2endIT example I am getting this error ```End2endTest.setup:214 Url:http://localhost:7054, Failed to enroll user admin
UpgradeCCEnd2endTest.setup:180 UserContext for user peerOrg1Admin has no enrollment set.```
Dpkkmr (Thu, 10 Aug 2017 12:21:45 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8ihseScmzsaTpKENW) @DarshanBc
Even I am getting the same error,
Failed tests:
UpgradeCCEnd2endTest.setup:180 UserContext for user peerOrg1Admin has no enrollment set.
End2endTest.setup:214 Error while registering the user org.hyperledger.fabric.sdkintegration.SampleUser@67b467e9 url: http://localhost:7054 POST request to http://localhost:7054/api/v1/register failed request body {"id":"user1","type":"user","max_enrollments":0,"affiliation":"org1.department1","attrs":[]} with status code: 500. Response: {"success":false,"result":null,"errors":[{"code":0,"message":"Identity 'user1' is already registered"}],"messages":[]}
Tests run: 2, Failures: 2, Errors: 0, Skipped: 0
Any help in resolving this will be helpful.
rickr (Thu, 10 Aug 2017 14:31:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=SXR2ALAfKvizbpW3q) Depends on how important it is that the ledger was updated. If it's like a procurement application for your company and you just want to write immediately to another channel an invoice to your fulfillment dept to send merchandise without knowing 100% you've have valid transaction you've been paid .. by all means.
rickr (Thu, 10 Aug 2017 14:43:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=LWzn73YbBQuExEdxF) The SDK will not _ re-document_ Hyperledger Fabric. It should have documentation for that. You need to have done some homework to get that basic understanding for Fabric prior to using the JSDK. I liken it to using a JDBC without have any knowledge of relational databases. The README.md does have some explanation of specific items. Most important the integration test _src/test/java/org/hyperledger/fabric/sdkintegration/*IT_ should cover 90% of what the JDSK can do. With the prerequisite of knowing the Fabric should get you going fairly fast. You should be able to actually cut paste what you need to build your own application. Yes, I suppose you can never have enough documentation.
rickr (Thu, 10 Aug 2017 14:47:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8ihseScmzsaTpKENW) I run the End2endIT all the time and so does our verify builds Have never seen that error. Don't know how you're seeing that.
clempo (Thu, 10 Aug 2017 15:40:11 GMT):
@Dpkkmr, it appears you are running End2endIT twice without restarting your network. End2endIT assumes the network has just started and needs to be initialized. [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=WhtE4ozDexgXrv2em)
clempo (Thu, 10 Aug 2017 15:43:02 GMT):
@DarshanBc, End2endIT is a junit. It is called by the maven-failsafe-plugin through IntegrationSuite.java [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=QsQKuEG3F4ntM5oto)
clempo (Thu, 10 Aug 2017 21:08:46 GMT):
@rickr, the method TransactionEvent.getEventHub() should be public. That should be accessible from the CompletableFuture's result
yacovm (Thu, 10 Aug 2017 21:39:03 GMT):
Has joined the channel.
moriohara (Thu, 10 Aug 2017 23:41:48 GMT):
Has left the channel.
gauravgiri (Fri, 11 Aug 2017 03:04:12 GMT):
@rickr Regarding EventHub feature in fabric-sdk-java:
1. Listener for specific events like chaincode/block events: Any pointers for fabric-java-sdk to listen to specific event types(block, chaincode) from hyperledger network, something similar to fabric-sdk-node.js, EventHub.registerChaincodeEvent(), EventHub.registerBlockEvent() ?
2. Durability of the EventHub subscriptions: And any suggestions on how fabric-sdk-java subscriptions for these events be made durable in nature, what if the consumer application in fabric-sdk-java is not available, will it lead to event loss ?
sh (Fri, 11 Aug 2017 05:03:35 GMT):
Has joined the channel.
rishabh1102 (Fri, 11 Aug 2017 07:30:34 GMT):
Hey all, I had a doubt, in the java sdk, when one sends an invoke request on a channel, it waits asynchrounously for all peers on the channel to reply. My endorsement policy is set to n out of m. Is it possible that my asynchronous invoke returns as soon as I get a successful transaction endorsement from n peers? I'm trying to simulate malicious peers and this would make the sdk immune to DoS attacks
deepakvparmar (Fri, 11 Aug 2017 08:03:14 GMT):
@rickr : I am experiencing timeout error consistently while running End2EndIT.java , when creating new channel.
org.hyperledger.fabric.sdk.exception.TransactionException: Send transactions failed. Reason: timeout
Any pointer or suggestion how to avoid this error and create channel successfully.
rwadhwa (Fri, 11 Aug 2017 08:37:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=5qtY4WFNKWoiWfkj8) @rickr Hi Rick, I understand there is a lots of info given in the readme.md. But to be honest, the person who is not aware of how things are happening (even after reading a lot of documents), must have a working example to start with.
I'm sure most of us here are struggling because of that.
rwadhwa (Fri, 11 Aug 2017 08:39:48 GMT):
@rickr I understood all the components separately, but didn't understand how to work with fabric-ca server via Java. I want to register user/entities using Java Code, and not via CLI. Any help on that would be appreciated.
However, just want to make a point, if Fabric Documentation would have been any where close to what was provided for JDBC, people wouldn't be asking questions. No offence. Looking forward for the reply.
DarshanBc (Fri, 11 Aug 2017 08:46:08 GMT):
Actually I am trying things on fabcar example this is the command that is staring the fabric ca server can you tell me how to go with this type of setup
`command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/CA1_PRIVATE_KEY -b admin:adminpw -d'
DarshanBc (Fri, 11 Aug 2017 08:46:08 GMT):
Actually I am trying things on fabcar example this is the command that is staring the fabric ca server can you tell me how to go with this type of setup
```command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/CA1_PRIVATE_KEY -b admin:adminpw -d'```
DarshanBc (Fri, 11 Aug 2017 08:47:57 GMT):
to register user and enroll
DarshanBc (Fri, 11 Aug 2017 09:16:36 GMT):
How to connect to my ca server in docker and get hf.Registrar.Roles attributes associated with a user
ngeorge (Fri, 11 Aug 2017 09:58:36 GMT):
Has joined the channel.
ngeorge (Fri, 11 Aug 2017 10:02:39 GMT):
I am connecting to an existing blockchain network. Using java SDK, what would be the execution point from which I can start, to get the details of existing nodes in the network(peer, orderer etc ) ?
clempo (Fri, 11 Aug 2017 14:42:06 GMT):
@ngeorge, are you asking for an API to discover which nodes participate in the network? I did not see a discovery API in the samples.I thought (a subset of) the network topology must be known ahead of time by the client.
pvrbharg (Fri, 11 Aug 2017 19:50:42 GMT):
Hi - where would I find the meaning of status 11 when program emits a TransactionEventException?
https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/End2endAndBackAgainIT.java
if (e instanceof TransactionEventException) {
BlockEvent.TransactionEvent te = ((TransactionEventException) e).getTransactionEvent();
if (te != null) {
e.printStackTrace(System.err);
fail(format("Transaction with txid %s failed. %s", te.getTransactionID(), e.getMessage()));
}
}
The program emits a transaction ID and status 11 text - it means nothing unless we know what the status 11 description is.
Any help would be appreciated.
spinisetti (Sat, 12 Aug 2017 04:30:08 GMT):
Has joined the channel.
acosta_rodrigo (Sat, 12 Aug 2017 17:05:13 GMT):
Has joined the channel.
chaitanya (Mon, 14 Aug 2017 10:28:29 GMT):
@here I have been trying to setup a network consisting of 4 orgs, but everytime I pull it up, and exec into the cli container, chaincode deployment fails because the container doesn't have `Go` setup. ```bash: go: command not found
```
chaitanya (Mon, 14 Aug 2017 10:28:41 GMT):
Does anyone have any idea what I could be missing?
mastersingh24 (Mon, 14 Aug 2017 11:41:19 GMT):
@chaitanya - not sure what you are using as the CLI container, but you should use the fabric-tools images
rickr (Mon, 14 Aug 2017 12:44:32 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=hiRateiqcALpFv9BL) Chaincode event listener is coming. There are no plans for the SDK itself to take into account missed events. There is a JIRA open on the Peer side to start sending events from a specific block. When that get's implemented it will be exposed to the application directly.
pvrbharg (Mon, 14 Aug 2017 12:45:59 GMT):
@chaitanya If you following this document thru all the way down - your entire go setup would be correctly setup. https://golang.org/doc/code.html#Workspaces
rickr (Mon, 14 Aug 2017 12:48:30 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=GgFqziSrd32aptAqN) Not at this time
rickr (Mon, 14 Aug 2017 12:48:30 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=GgFqziSrd32aptAqN) Not at this time. The proposal creation is done on all peers requested in parallel so not waiting for all would only provide a minor if any improvement in performance.
The waiting done once sent to the Orderer is *much* longer but this only waits for all the eventhubs your applications has set up to listen on and is NOT related to any policies - the only thing here to consider is which Peers/commiters you want to know for sure have commited your transaction.
rickr (Mon, 14 Aug 2017 12:53:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=daHpfBekAhGmnJhmG) CHANNEL_CONFIG_WAIT_TIME ?
rickr (Mon, 14 Aug 2017 12:57:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=XSxG3h2jiohZZkb26)
```
enum TxValidationCode {
VALID = 0;
NIL_ENVELOPE = 1;
BAD_PAYLOAD = 2;
BAD_COMMON_HEADER = 3;
BAD_CREATOR_SIGNATURE = 4;
INVALID_ENDORSER_TRANSACTION = 5;
INVALID_CONFIG_TRANSACTION = 6;
UNSUPPORTED_TX_PAYLOAD = 7;
BAD_PROPOSAL_TXID = 8;
DUPLICATE_TXID = 9;
ENDORSEMENT_POLICY_FAILURE = 10;
MVCC_READ_CONFLICT = 11;
PHANTOM_READ_CONFLICT = 12;
UNKNOWN_TX_TYPE = 13;
TARGET_CHAIN_NOT_FOUND = 14;
MARSHAL_TX_ERROR = 15;
NIL_TXACTION = 16;
EXPIRED_CHAINCODE = 17;
CHAINCODE_VERSION_CONFLICT = 18;
BAD_HEADER_EXTENSION = 19;
BAD_CHANNEL_HEADER = 20;
BAD_RESPONSE_PAYLOAD = 21;
BAD_RWSET = 22;
ILLEGAL_WRITESET = 23;
INVALID_OTHER_REASON = 255;
}```
rickr (Mon, 14 Aug 2017 12:59:09 GMT):
Best ask on the #fabric channels for the details of those.
rickr (Mon, 14 Aug 2017 13:03:12 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jGwhzjQLJ8aN5CGMb) There is examples of registering a user in the End2endIT.java
Anyone can contribute to enhancing the documentation -- very few have posted minor inconsistencies.
rickr (Mon, 14 Aug 2017 13:03:12 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jGwhzjQLJ8aN5CGMb) There is examples of registering a user in the End2endIT.java
Anyone can contribute to enhancing the documentation -- todate very few have posted minor inconsistencies and less have contributed.
rickr (Mon, 14 Aug 2017 13:03:12 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jGwhzjQLJ8aN5CGMb) There is examples of registering a user in the End2endIT.java Like I said, I think the *IT.java cover 90% of what you can do with the SDK. You can _mostly_ build your application by cut and paste.
Anyone can contribute to enhancing the documentation -- todate very few have posted minor inconsistencies and less have contributed.
ohupalo (Mon, 14 Aug 2017 13:38:41 GMT):
dynamic
pasimoes (Tue, 15 Aug 2017 04:48:40 GMT):
Has joined the channel.
gloriow (Tue, 15 Aug 2017 09:06:32 GMT):
Has joined the channel.
gauravgiri (Tue, 15 Aug 2017 10:30:34 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=y5YYQtJApkH5CmhZ7) @rickr Thank You. Does your comment mean that fabric-sdk-java does not yet implement the register methods for chaincode or blocks inside EventHub.java, similar to corresponding implementation in fabric-sdk-node? Any idea when will they be available?
rickr (Tue, 15 Aug 2017 12:34:55 GMT):
You can today with `Channel.registerBlockListener` listen to _any_ block on the channel. If you're looking for CC events in the block today you'll need to do the work to get them. There is an update `registerChaincodeEventListener` that should make that easier.
Jonny (Tue, 15 Aug 2017 13:28:40 GMT):
Has joined the channel.
gauravgiri (Tue, 15 Aug 2017 13:38:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=gNFqFGfBnnmxQnnak) @rickr Thank You.
Do you have any information when will the Channel.registerChaincodeEventListener implementation be available?
We are using fabric-sdk-java primarily for our application, however our application needs to listen to chaincode events also to fulfill an important business function. So we need to make design decision, if we should wait on fabric-sdk-java implementation to be available, or should we think for alternative fabric-sdk-node implementation specifically for chaincode events?
rickr (Tue, 15 Aug 2017 15:23:09 GMT):
It should be in 1.1 but I won't commit when that will be available. You can merge cherrypick https://gerrit.hyperledger.org/r/#/c/12091/ or wait till it gets merged then work with master in the interim.
yoyokeen (Wed, 16 Aug 2017 00:00:15 GMT):
how to judge the user existing via sdk?
wangpan22 (Wed, 16 Aug 2017 04:35:38 GMT):
anyone met this exception before? when trying to create a channel, Caused by: io.netty.handler.codec.http2.Http2Exception: Invalid frame length
1024.
chenxu123 (Wed, 16 Aug 2017 06:06:59 GMT):
Has joined the channel.
chenxu123 (Wed, 16 Aug 2017 06:39:07 GMT):
how to join channel instead of creating a new channel?
YashGanthe (Wed, 16 Aug 2017 08:53:23 GMT):
Has joined the channel.
YashGanthe (Wed, 16 Aug 2017 08:59:23 GMT):
If I run peer channel fetch config config_block.pb -o 127.0.0.1:7050 -c testchainid, I get a proto formatted configuration of a channel. Where is the definition of the proto class that corresponds to this proto formatted configuration?
wangdong (Wed, 16 Aug 2017 09:19:03 GMT):
Has joined the channel.
wangdong (Wed, 16 Aug 2017 09:22:16 GMT):
Hi, when I read the code, I got one situation. when to create a new channel, there is one line: ordererChannel = orderer.getChannel(). And I found there is a method in orderer class which said to get the channel of which the orderer is a member. But what if this order is used by multiple channels? Or I missed something, please let me know. Thanks
wangdong (Wed, 16 Aug 2017 09:24:06 GMT):
And this line is in channel.java, constructor methods line 167. Any comment will be appreciated.
paapighoda (Wed, 16 Aug 2017 09:26:59 GMT):
Hello, is there any tutorial available on java-sdk, similar to that on node sdk?
rickr (Wed, 16 Aug 2017 12:14:45 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=zM5893eJkYcj4uTBk) You need to know which users you created registered
rickr (Wed, 16 Aug 2017 12:15:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=EBeY57uo8M7mLi53F) Have never seen that before.
rickr (Wed, 16 Aug 2017 12:17:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=aYCnztYoQd4kvrTFK) At the moment you need to create a orderer object for each channel
rickr (Wed, 16 Aug 2017 12:17:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=aYCnztYoQd4kvrTFK) At the moment you need to create a orderer object for each channel. They can use the same URL to the actual Orderer
rickr (Wed, 16 Aug 2017 12:18:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=4obQhxnX3nZeEbLNK) No tutorial follow the *IT.java to see how to use the sdk
wangdong (Wed, 16 Aug 2017 14:37:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=cwexw5Ka4uLzNt4hS) @rickr Hi, thanks for your reply. My point is this orderer object just return one channel. If the orderer node can be used by multiple channel, this orderer should return multiple channels instead of only one. And in my opinion, one channel can have multi-orderer which we call orderer set. And as I ask one developer of fabric, that one order can be used by multiple channels. You said "create a orderer object", but why this line? what if this orderer is used
wangdong (Wed, 16 Aug 2017 14:44:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=cwexw5Ka4uLzNt4hS) @rickr Hi, thanks for your reply. My point is this orderer object just return one channel. If the orderer node can be used by multiple channel, this orderer should return multiple channels instead of only one. And in my opinion, one channel can have multi-orderer which we call orderer set. And as I ask one developer of fabric, that one order can be used by multiple channels. You said "create a orderer object", but why that line code? what if this orderer is used by other channels. There are more than one channels which should be returned. If I am wrong and it is a long story. Would you please share me some document? Thanks.
VenuVemula (Wed, 16 Aug 2017 14:50:22 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jbTgrYrtg4hpgcZfy) @paapighoda , you can generate javadocs by running 'mvn site' or 'mvn javadoc:javadoc' . The javadoc wud be in target/site/apidocs
rickr (Wed, 16 Aug 2017 14:56:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=yBskdsfdR7ffyc99f) The Orderer created in the SDK is more or less a connection to the actual Orderer. You can create as many of these you like to the SAME Orderer. Use each in different channels - it's the same Orderer you're connecting to. Today, It a _limitation_ these _Orderer connection_ objects are a 1 to 1 with channels.
wangdong (Thu, 17 Aug 2017 03:05:24 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8jsuJZBdhbir5Rd79) @rickr Thanks a lot for your answer. Really appreciate it.
kelvinzhong (Thu, 17 Aug 2017 05:09:27 GMT):
@rickr hi rick, i found that seems the gossip protocol is not stable, some peer appear disconnect with the other peers, the block is missing unless restart the peer or it would not synchronize with the others. where should i ask the question about the gossip protocol?
kelvinzhong (Thu, 17 Aug 2017 05:09:27 GMT):
@rickr hi rick, i found that seems the gossip protocol is not stable, some peer appear disconnect with the other peers, the block height is less than the others, unless restart the peer or it would not synchronize with the others. where should i ask the question about the gossip protocol?
tallharish (Thu, 17 Aug 2017 08:12:43 GMT):
event
tallharish (Thu, 17 Aug 2017 09:33:52 GMT):
Looking for sample code to understand how to listen to chaincode or Tx events via the eventhub. I see some discussion on this channel, but some concrete examples / pointers would be useful. Thanks
tallharish (Thu, 17 Aug 2017 11:05:35 GMT):
register
Othman.Darwish (Thu, 17 Aug 2017 11:30:44 GMT):
Has joined the channel.
Othman.Darwish (Thu, 17 Aug 2017 11:36:01 GMT):
practically , what is the difference between transaction proposal and query chain proposal , they both derived from the same class and have no significant implementation ?
rickr (Thu, 17 Aug 2017 12:28:31 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Mx2B9GvRbSRZ8Rfe7) I would start with #fabric-gossip
rickr (Thu, 17 Aug 2017 12:35:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dvhNkTZpFf4J84j79) There is no direct example in the IT tests. However if you look at Channel.java it uses the `registerBlockListener` which is available for applications to listen to raw blocks. So that in essence is the example :) There is comming code to make listening for CC events easier https://gerrit.hyperledger.org/r/#/c/12091/
rickr (Thu, 17 Aug 2017 12:35:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dvhNkTZpFf4J84j79) There is no direct example in the IT tests. However if you look at Channel.java it uses the `registerBlockListener` which is available for applications to listen to raw blocks. So that in essence is the example :) There is coming code to make listening for CC events easier https://gerrit.hyperledger.org/r/#/c/12091/
samdeir (Thu, 17 Aug 2017 14:46:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=nFg5SiyauNoq8KgHM) @Othman.Darwish
samdeir (Thu, 17 Aug 2017 14:48:24 GMT):
[ I guess there's no difference at all, maybe be its for future requirements? ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=nFg5SiyauNoq8KgHM) @Othman.Darwish
Othman.Darwish (Thu, 17 Aug 2017 14:49:17 GMT):
Thank you for nothing !
samdeir (Thu, 17 Aug 2017 14:58:17 GMT):
Difference between QueryByChaincodeRequest and TransactionProposalRequest?
chenxuan (Thu, 17 Aug 2017 15:23:04 GMT):
@rickr i use the idea open the sdk
chenxuan (Thu, 17 Aug 2017 15:23:29 GMT):
but i run the protobuf:compile
chenxuan (Thu, 17 Aug 2017 15:23:36 GMT):
cmd to build the proto
chenxuan (Thu, 17 Aug 2017 15:24:08 GMT):
find it can't generate the grpc-java
chenxuan (Thu, 17 Aug 2017 15:24:15 GMT):
it just generate the java
chenxuan (Thu, 17 Aug 2017 15:24:27 GMT):
in the target folder
tallharish (Thu, 17 Aug 2017 15:55:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=5YE7AbbLiD8oRpEbG) Thanks @rickr. I could get registerBlockListener working easily.. Do you recommend cherry-picking and compiling this in jdk ourselves, or is there an upcoming code-fix / minor release coming soon?
MeenakshiSingh (Fri, 18 Aug 2017 07:13:57 GMT):
Has joined the channel.
MeenakshiSingh (Fri, 18 Aug 2017 07:14:11 GMT):
Hi..I have a few doubts...1. does 1.0 provide a way to find out which transactions failed in consensus or did not meet endorsement policy? 2. If a set of transactions fail due to network issues, is there a mechanism to retry them?
Styxt (Fri, 18 Aug 2017 10:39:45 GMT):
Hi,
i imported the fabric-sdk-java dependency to my maven project but somehow org.hyperledger.fabric.sdk.Chain is missing.
Anyone got an idea how i could fix this?
kelvinzhong (Fri, 18 Aug 2017 11:13:14 GMT):
Chain has change the name to Channel
tallharish (Fri, 18 Aug 2017 11:47:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=CQBbP2k7RgNsMnmBf) @tallharish Cherry picked and integrated the patch with my build. It works fine. For the benefit of others, sharing my code snippet. (You can refer to End2endIT as well).
```
channel.registerChaincodeEventListener(
Pattern.compile(".*"), // chaincode name - any
Pattern.compile(Pattern.quote("event")), // event name - event
chaincodeEventListener);
ChaincodeEventListener chaincodeEventListener = new ChaincodeEventListener() {
@Override
public void received(String handle, BlockEvent blockEvent, ChaincodeEvent chaincodeEvent) {
out("RECEIVED Chaincode event with handle: %s, chhaincode Id: %s, chaincode event name: %s, "
+ "transaction id: %s, event payload: \"%s\", from eventhub: %s",
handle, chaincodeEvent.getChaincodeId(),
chaincodeEvent.getEventName(), chaincodeEvent.getTxId(),
new String(chaincodeEvent.getPayload()), blockEvent.getEventHub().toString());
}
};
```
MoulaliMvg (Fri, 18 Aug 2017 12:17:38 GMT):
how we can fetch all entities fron chaincode stub in go language?
rickr (Fri, 18 Aug 2017 13:11:00 GMT):
@tallharish It's been merged into master branch.
rickr (Fri, 18 Aug 2017 13:16:37 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jtzspNASPgkkAbiKC) If it fails for any reason the future will complete with an exception. It's generally up to the application to put what retry attempts it wants to do.
FollowingGhosts (Fri, 18 Aug 2017 15:41:45 GMT):
Does the Java SDK work on Android?
tallharish (Fri, 18 Aug 2017 19:09:42 GMT):
i am creating a new Java Maven project for fabric client, leveraging features such as SampleStore, SampleUser and SampleOrg from fabric-sdk-java. When I declare maven dependency on fabric-sdk-java, all other dependencies (like org.apache.commons*) are imported automatically. When I build the jar from the latest fabric-sdk-java and import it as a local maven repository, I need to add all libraries (presumably from `mvn dependency:list`) to pom one by one to resolve all dependencies. What I am doing wrong? should I build the jar in a different way?
rickr (Fri, 18 Aug 2017 19:47:10 GMT):
Why not start your own maven project pom.xml and list a dependency on it ?
tallharish (Fri, 18 Aug 2017 19:49:37 GMT):
yes I started. If i declare following dependency in my pom.xml, then its all good.
```
tallharish (Fri, 18 Aug 2017 19:49:37 GMT):
yes I started. If i declare following dependency in my pom.xml, then its all good.
```
tallharish (Fri, 18 Aug 2017 19:53:03 GMT):
since i made latest build 1.1.0 with ChaincodeEvents etc.. i have a jar file.. I declare my dependency as a local maven repo. (donno the best way to do this). Then maven isn't getting sdk dependencies resolved
```
tallharish (Fri, 18 Aug 2017 19:53:03 GMT):
My .jar is kept at {project.basedir}/local-maven-repo/fabric-local/fabric-sdk-java/1.1/fabric-sdk-java-1.1.jar
rickr (Fri, 18 Aug 2017 19:56:00 GMT):
well I've not tried that - But there is no version 1.1 it's 1.1.0-SNAPSHOT if its from the master branch
rickr (Fri, 18 Aug 2017 19:58:37 GMT):
why is the groupId not fabric-sdk-java ?
tallharish (Fri, 18 Aug 2017 20:01:39 GMT):
My .jar is kept at {project.basedir}/local-maven-repo/fabric-local/fabric-sdk-java/1.1/fabric-sdk-java-1.1.jar
tallharish (Fri, 18 Aug 2017 20:01:39 GMT):
My .jar is kept at `{project.basedir}/local-maven-repo/fabric-local/fabric-sdk-java/1.1/fabric-sdk-java-1.1.jar`, just named it like this.
tallharish (Fri, 18 Aug 2017 20:01:39 GMT):
My .jar is kept at `{project.basedir}/local-maven-repo/fabric-local/fabric-sdk-java/1.1/fabric-sdk-java-1.1.jar`, just named it like this.
Ashish (Sat, 19 Aug 2017 07:30:38 GMT):
Has left the channel.
Ashish (Sat, 19 Aug 2017 07:30:58 GMT):
Has joined the channel.
sajeevkhan (Sat, 19 Aug 2017 11:20:36 GMT):
Hi Folks, Using the JAVA SDK how can we get the status of a peer? I am looking for the equivalent of Peer node status command...... Thanks, Sajeev
MeenakshiSingh (Sun, 20 Aug 2017 06:00:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=NSL7EmM3C5y8h8EBL) @rickr ok..but if I want to find out what transactions did not go through, failing an endorsement policy or consensus, how will I retrieve those?
ngeorge (Mon, 21 Aug 2017 05:26:04 GMT):
Using java sdk APIs, is there a way to get the details(peers, orderers etc ) of existing network topology for a given channel name ? I could see function getChannel in HFClient class. When I tried it returned a null object.
yyyyyyy9 (Mon, 21 Aug 2017 08:25:47 GMT):
Has joined the channel.
ngeorge (Mon, 21 Aug 2017 08:39:01 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=fz9YqEosHRwBhSA3C) @clempo I have brought up the network using cli containers(created channel, peers and have joined them ). Now I want to install chaincode using java SDK. For that I will need a handle to the created channel and peers. Is there a way to get that?
deepakvparmar (Mon, 21 Aug 2017 09:01:00 GMT):
While calling channel.initialize() method, I am getting following exception. Any pointer or suggestion would be very helpful.
org.hyperledger.fabric.sdk.exception.TransactionException: Bad newest block expected status 200 got 404, Channel mychannel
at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1085)
at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:898)
at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:826)
at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:526)
tallharish (Mon, 21 Aug 2017 13:33:07 GMT):
@rickr How do I initialize log4j? I created a new eclipse maven project, added dependency for fabric-sdk-java, added my code. I see the following WARN, and do not see any fabric based logs on the console.
```
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.
```
I guess it has something to do with initializing the Config. I added the `config.properties` in my project base folder.
Note that when I run the same code in the fabric-java-sdk project in Eclipse, it works fine and I get log outputs on console. What initialization am I missing?
MoulaliMvg (Mon, 21 Aug 2017 13:56:37 GMT):
Hi I am following fabric-samples/balance-transfer
I have two modules in my project like comp1 and comp2 modules
curl commands like below in balance-transfer
curl -s -X POST \
http://localhost:4000/chaincodes \
-H "authorization: Bearer $ORG1_TOKEN" \
-H "content-type: application/json" \
-d '{
"peers": ["localhost:7056"],
"chaincodeName":"mycc",
"chaincodePath":"github.com/example_cc",
"chaincodeVersion":"v0"
}'
curl -s -X POST \
http://localhost:4000/chaincodes \
-H "authorization: Bearer $ORG2_TOKEN" \
-H "content-type: application/json" \
-d '{
"peers": ["localhost:8056"],
"chaincodeName":"mycc",
"chaincodePath":"github.com/example_cc",
"chaincodeVersion":"v0"
}'
1. when company1 want to send JSON data to company2
2. company2 takes that data and displays in UI and it should approve that data. Once it approves , company1 should get acknoledgement from comp2 to comp1
3. How I can do transactions with in companies in balance transfer setup
4. How can i launch comp1 UI with "localhost:7056" and comp2 UI with "localhost:8056" and how to fetch all transactions from distributed ledger
tallharish (Mon, 21 Aug 2017 14:30:35 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=NvXyWYyDwswgvKgd2) @tallharish Figured out the problem. Copied the log4j.properties file from /src/resources/. to /src/resources/. in my project as well.
tallharish (Mon, 21 Aug 2017 14:30:35 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=NvXyWYyDwswgvKgd2) @tallharish Figured out the problem. Copied the log4j.properties file from src/resources/. to src/resources/. in my project as well. Had to create folder resources in src.
tallharish (Mon, 21 Aug 2017 14:30:35 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=NvXyWYyDwswgvKgd2) @tallharish Figured out the problem. Copied the log4j.properties file from src/resources/. in fabric-sdk-java to src/resources/. in my project as well. Had to create folder resources in src.
wangdong (Tue, 22 Aug 2017 02:04:18 GMT):
Hi, when I am reading the code. I met the systemChannel in Channel class. Is it a implementation of a asynchronization ? I am not sure. Just make sure of it. because I am not familiar to java. And I googled Executor. it is used for async. But I am not familiar with background story. So I just ask what the advantages here with a systemChannel?
smita0709 (Tue, 22 Aug 2017 04:59:08 GMT):
Hello
I am trying to update the channel configuration
I have computed the diff of 2 configs with configtxlator and now I want to update the channel config
updateChannelConfiguration(UpdateChannelConfiguration updateChannelConfiguration, Orderer orderer, byte[]... signers)
httppost = new HttpPost("http://localhost:7059/configtxlator/compute/update-from-configs");
HttpEntity multipartEntity = MultipartEntityBuilder.create()
.setMode(HttpMultipartMode.BROWSER_COMPATIBLE)
.addBinaryBody("original", channelConfigurationBytes, ContentType.APPLICATION_OCTET_STREAM, "originalFakeFilename")
.addBinaryBody("updated", newConfigBytes, ContentType.APPLICATION_OCTET_STREAM, "updatedFakeFilename")
.addBinaryBody("channel", fooChannel.getName().getBytes()).build();
httppost.setEntity(multipartEntity);
response = httpclient.execute(httppost);
statuscode = response.getStatusLine().getStatusCode();
out("Got %s status for updated config bytes needed for updateChannelConfiguration ", statuscode);
assertEquals(200, statuscode);
byte[] updateBytes = EntityUtils.toByteArray(response.getEntity());
UpdateChannelConfiguration updateChannelConfiguration = new UpdateChannelConfiguration(updateBytes);
//Ok now do actual channel update.
fooChannel.updateChannelConfiguration(updateChannelConfiguration, client.getUpdateChannelConfigurationSignature(updateChannelConfiguration, ordererAdmin));
smita0709 (Tue, 22 Aug 2017 05:02:03 GMT):
Hello
I am trying to update the channel configuration
I have computed the diff of 2 configs with configtxlator and now I want to update the channel config
the updateChannelConfiguration methos takes UpdateChannelConfiguration , Orderer and signers as parameters
I have the UpdateChannelConfiguration , from where to I get the Orderer and the signers which I need to pass to the methos?
The methos signature of updateChannelConfiguration
updateChannelConfiguration(UpdateChannelConfiguration updateChannelConfiguration, Orderer orderer, byte[]... signers)
**** the code that i'm trying to execute****
httppost = new HttpPost("http://localhost:7059/configtxlator/compute/update-from-configs");
HttpEntity multipartEntity = MultipartEntityBuilder.create()
.setMode(HttpMultipartMode.BROWSER_COMPATIBLE)
.addBinaryBody("original", channelConfigurationBytes, ContentType.APPLICATION_OCTET_STREAM, "originalFakeFilename")
.addBinaryBody("updated", newConfigBytes, ContentType.APPLICATION_OCTET_STREAM, "updatedFakeFilename")
.addBinaryBody("channel", fooChannel.getName().getBytes()).build();
httppost.setEntity(multipartEntity);
response = httpclient.execute(httppost);
statuscode = response.getStatusLine().getStatusCode();
out("Got %s status for updated config bytes needed for updateChannelConfiguration ", statuscode);
assertEquals(200, statuscode);
byte[] updateBytes = EntityUtils.toByteArray(response.getEntity());
UpdateChannelConfiguration updateChannelConfiguration = new UpdateChannelConfiguration(updateBytes);
//Ok now do actual channel update.
fooChannel.updateChannelConfiguration(updateChannelConfiguration, client.getUpdateChannelConfigurationSignature(updateChannelConfiguration, ordererAdmin));
xymoc (Tue, 22 Aug 2017 08:52:07 GMT):
Has joined the channel.
samdeir (Tue, 22 Aug 2017 10:10:31 GMT):
Hi all, Whats the difference between QueryByChaincodeRequest and TransactionProposalRequest classes from design perspective?
kelvinzhong (Tue, 22 Aug 2017 10:56:59 GMT):
query would not commit the record into the ledger
kelvinzhong (Tue, 22 Aug 2017 10:57:04 GMT):
but transaction would
Styxt (Tue, 22 Aug 2017 14:21:24 GMT):
Hi all, i want to use the sdk to query the ledger and invoke transactions ... i looked at the End2endIT.java so my question is what if i can just copy paste and change the TestConfig.java or what exactly how i can use the sdk in a real scenario.
mrkiouak (Tue, 22 Aug 2017 19:45:43 GMT):
Has joined the channel.
SantoshShahane (Tue, 22 Aug 2017 21:43:33 GMT):
Has joined the channel.
SantoshShahane (Tue, 22 Aug 2017 21:43:52 GMT):
RUNNING: End2endAndBackAgainIT
org.hyperledger.fabric.sdk.exception.InvalidArgumentException: UserContext for user peerOrg1Admin has no enrollment set.
at org.hyperledger.fabric.sdk.User.userContextCheck(User.java:84)
at org.hyperledger.fabric.sdk.HFClient.setUserContext(HFClient.java:257)
at org.hyperledger.fabric.sdk.endtoend.UpgradeCCEnd2endTest.reconstructChannel(UpgradeCCEnd2endTest.java:492)
at org.hyperledger.fabric.sdk.endtoend.UpgradeCCEnd2endTest.setup(UpgradeCCEnd2endTest.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
SantoshShahane (Tue, 22 Aug 2017 21:44:05 GMT):
Anyone knows ??
SystemShock (Wed, 23 Aug 2017 08:41:01 GMT):
Has joined the channel.
bercinho (Wed, 23 Aug 2017 13:33:34 GMT):
Has joined the channel.
chaitanya (Wed, 23 Aug 2017 14:26:45 GMT):
Hi, we have an application that's making invokes through the JavaSDK. The issue is that requests coming at the invoke parallely are getting the same TransactionID. Any idea as to what we could be doing wrong? The SDK application is largely the same as the End2EndIT.java (Fabric beta)
rickr (Wed, 23 Aug 2017 15:15:42 GMT):
Are you recreating a new request each time from scratch ? The request going to multiple peers will have the same transactionID
clempo (Wed, 23 Aug 2017 17:18:22 GMT):
@SantoshShahane, End2endAndBackAgainIT assumes End2endIT has been run exactly once before it can run.
clempo (Wed, 23 Aug 2017 17:28:25 GMT):
I noticed chaincode methods can return values even when they are called with sendTransactionProposal(). In End2endIT's example_cc.go, the move() method returns nil but it does not appear to be mandatory. What would happen if I call the orderer.sendTransaction() with a bunch of successful ProposalResponses which agreed on everything except the payload? The reason I ask is because I'd like to define the return value to be the payload of the first successful ProposalResponse, just like I do for queryByChaincode().
chaitanya (Wed, 23 Aug 2017 17:46:52 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=g6LvZp76Yt8ZHehnC) @rickr Yes, they're both new requests
clempo (Wed, 23 Aug 2017 20:37:49 GMT):
@rickr, the comment for SDKUtils.getProposalConsistencySets() is misleading since it returns a set without checking anything. The example in End2endIT does not check the return value so this is doubly misleading.
clempo (Wed, 23 Aug 2017 20:38:11 GMT):
The comment says: Check that the proposals all have consistent read write sets
rickr (Wed, 23 Aug 2017 22:01:58 GMT):
By default we the SDK will do this and throw an exception if there is more than one proposal sent to the Orderer that are not consistent.. But the utility is available to the application too.
rickr (Wed, 23 Aug 2017 22:20:43 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=YDvM5SJChTZjPA7HQ) Not sure how your getting this. Just from observation of running the integration test I have never seen them produce transactionIDs that are similar by observation. I just reran it sending the output to a file and made sure they were different.
The request can go to multiple peers when they come back the do have the SAME transaction ID that's to be expected are you possibly confusing this ?
```
sending transaction proposal to all peers with arguments: move(a,b,25)
Successful transaction proposal response Txid: 3479433e1ccf5834a18c3d988813a7947cd883cbd65d49c98f2356645aac272f from peer peer0.org2.example.com
Successful transaction proposal response Txid: 3479433e1ccf5834a18c3d988813a7947cd883cbd65d49c98f2356645aac272f from peer peer1.org2.example.com
```
Those will both go to the Orderer and are considered to be one transaction
rickr (Wed, 23 Aug 2017 22:26:02 GMT):
Also if you send the same transactionID to the orderer again it will reject any later ones so if the integration test were producing this there should be failures.
nimtiazm (Thu, 24 Aug 2017 00:26:58 GMT):
Has joined the channel.
chaitanya (Thu, 24 Aug 2017 03:33:37 GMT):
>Those will both go to the Orderer and are considered to be one transaction
@rickr By new requests, I meant they're both new invoke requests (transactionProposals sent out, response awaited, transaction sent to orderer). Could you please elaborate as to why they'll be considered to be one transaction at the Orderer?
girishgh88 (Thu, 24 Aug 2017 11:26:52 GMT):
Has joined the channel.
girishgh88 (Thu, 24 Aug 2017 11:29:10 GMT):
by running channel.initialize();
I am getting the following exception
```
girishgh88 (Thu, 24 Aug 2017 11:43:11 GMT):
while running `channer.initialize()` getting the following exception
```Exception in thread "main" org.hyperledger.fabric.sdk.exception.TransactionException: INTERNAL
at org.hyperledger.fabric.sdk.OrdererClient.sendDeliver(OrdererClient.java:286)
at org.hyperledger.fabric.sdk.Orderer.sendDeliver(Orderer.java:165)
at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1074)
at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:898)
at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:826)
at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:526)
at com.ibs.blockchain.client.test.Test.createChannel(Test.java:151)
at com.ibs.blockchain.client.test.Test.main(Test.java:179)
Caused by: io.grpc.StatusRuntimeException: INTERNAL
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:392)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002
at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:309)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:217)
at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:401)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
... 1 more```
girishgh88 (Thu, 24 Aug 2017 11:43:11 GMT):
while running `channer.initialize()` getting the following exception
```Exception in thread "main" org.hyperledger.fabric.sdk.exception.TransactionException: INTERNAL
at org.hyperledger.fabric.sdk.OrdererClient.sendDeliver(OrdererClient.java:286)
at org.hyperledger.fabric.sdk.Orderer.sendDeliver(Orderer.java:165)
at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1074)
at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:898)
at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:826)
at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:526)
at com.ibs.blockchain.client.test.Test.createChannel(Test.java:151)
at com.ibs.blockchain.client.test.Test.main(Test.java:179)
Caused by: io.grpc.StatusRuntimeException: INTERNAL
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:392)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002
at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:309)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:217)
at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:401)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
... 1 more```
What will be issue?
girishgh88 (Thu, 24 Aug 2017 11:43:11 GMT):
while running `channer.initialize()` getting the following exception
```Exception in thread "main" org.hyperledger.fabric.sdk.exception.TransactionException: INTERNAL
at org.hyperledger.fabric.sdk.OrdererClient.sendDeliver(OrdererClient.java:286)
at org.hyperledger.fabric.sdk.Orderer.sendDeliver(Orderer.java:165)
at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1074)
at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:898)
at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:826)
at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:526)
at com.ibs.blockchain.client.test.Test.createChannel(Test.java:151)
at com.ibs.blockchain.client.test.Test.main(Test.java:179)
Caused by: io.grpc.StatusRuntimeException: INTERNAL
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:392)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002
at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:309)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:217)
at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:401)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
... 1 more```
What will be the issue?
girishgh88 (Thu, 24 Aug 2017 11:43:11 GMT):
while running `channer.initialize()` getting the following exception
```Exception in thread "main" org.hyperledger.fabric.sdk.exception.TransactionException: INTERNAL
at org.hyperledger.fabric.sdk.OrdererClient.sendDeliver(OrdererClient.java:286)
at org.hyperledger.fabric.sdk.Orderer.sendDeliver(Orderer.java:165)
at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1074)
at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:898)
at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:826)
at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:526)
at com.ibs.blockchain.client.test.Test.createChannel(Test.java:151)
at com.ibs.blockchain.client.test.Test.main(Test.java:179)
Caused by: io.grpc.StatusRuntimeException: INTERNAL
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:392)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002
at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:309)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:217)
at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:401)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
... 1 more```
What will be the issue?
I am running this in a java application through eclipse mars and using jdk 1.8
clempo (Thu, 24 Aug 2017 13:13:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=3rv7gjKTvJj2i5mAT)
clempo (Thu, 24 Aug 2017 13:19:45 GMT):
I now see End2endIT checks the return value of getProposalConsistencySets() in one place, but there is another call where the return value is not checked and that makes it into a no-op (and a bad example)[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=3rv7gjKTvJj2i5mAT)
clempo (Thu, 24 Aug 2017 13:40:44 GMT):
@rickr, you said the sdk checks for consistency of the ProposalResponses. It appears SDKUtils.getProposalConsistencySets() only checks the chaincodeAction without checking the actual proposalResponsePayload. Should it also check the return value in the payload? Is the method implementing the same consistency check as the orderer? If Fabric does not mind different return values, should the SDK provide a utility to check the return values are consistent for those applications that need it? [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=snxcs2NJMSCrMWeqE)
rickr (Thu, 24 Aug 2017 13:43:55 GMT):
All that matters is the read write sets are identical. That's all that's put in the ledger. There was a issue that it didn't handle bad proposals right but the latest code has that addressed.
wangdong (Thu, 24 Aug 2017 13:44:44 GMT):
@rickr Hi, I have a question regarding the channel constructor. There is a short one, which has less parameters. And when the client call this to get channel instance, it said that it is a configured channel. I wonder if it is not instantiated? At least this is my finding.
clempo (Thu, 24 Aug 2017 13:59:10 GMT):
Do I need to create a Jira for this? I think fixing the example is important.[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bE59dkoXXB4wF7zxj)
rickr (Thu, 24 Aug 2017 14:15:36 GMT):
I can remove that one line ... as said it strictly not need for ANY application to call `getProposalConsistencySets` as that by default will be handled when sending to the orderer. I put the call in *explicitly* in once case to show application have access to that call. I can put a comment there that it's not strictly needed.
rickr (Thu, 24 Aug 2017 14:15:36 GMT):
I can remove that one line ... as said it strictly not need for ANY application to call `getProposalConsistencySets` as that by default will be handled when sending to the orderer. I put the call in *explicitly* in one case to show application have access to that call. I can put a comment there that it's not strictly needed.
clempo (Thu, 24 Aug 2017 14:21:16 GMT):
I think it is excellent that you show the call, but there is a second call that gives a bad example because it is a no-op without the check
clempo (Thu, 24 Aug 2017 14:22:17 GMT):
Adding the comment that is not strictly needed is also a good idea
clempo (Thu, 24 Aug 2017 14:22:17 GMT):
Adding a comment that the call is not strictly needed (where we do the check) is also a good idea
rickr (Thu, 24 Aug 2017 14:27:49 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=x5dTQzxpcDsGk9vPf) Have not come across this error. IMO making sure the integration test provided work is always a good idea to make sure your environment is up and running ok as they have know to pass. Then move on from there with your own application. Have you tried that ?
clempo (Thu, 24 Aug 2017 14:29:47 GMT):
What I'm proposing is to remove line 342: SDKUtils.getProposalConsistencySets(responses); or else check its return value (and add the comment that this was optional)
rickr (Thu, 24 Aug 2017 14:33:57 GMT):
got it
nimtiazm (Thu, 24 Aug 2017 15:08:32 GMT):
Hi. Is there any blog or how-to that I could follow to simply and run an actual hello world on fabric. Every single tutorial i've tried just doesn't work
nimtiazm (Thu, 24 Aug 2017 15:08:56 GMT):
some is v0.6, other is 1.0.0 and docker images aren't there etc etc
nimtiazm (Thu, 24 Aug 2017 15:09:29 GMT):
or maybe i'm too early into trying fabric java sdk. may be it isn't ready yet. please can someone tell me if that's the case?
clempo (Thu, 24 Aug 2017 15:42:10 GMT):
@nimtiazm, I suggest you checkout fabric version v1.0.1, rebuild the docker containers within vagrant and run the Java sdk sample End2endIT. This is explained in the java sdk readme https://github.com/hyperledger/fabric-sdk-java Using a stable release is easier than staying at the tip of master all the time
girishgh88 (Fri, 25 Aug 2017 04:50:29 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=EfzAxJ4sxgP7BxsX2) @rickr No. since I have already checking with my network which is up and running, I directly tried to integrate with it. Ok I will start with the provided integration test and update.
nnao (Fri, 25 Aug 2017 17:57:21 GMT):
Has joined the channel.
nimtiazm (Fri, 25 Aug 2017 20:21:35 GMT):
A general and a bit of newbie question. Is fabric java sdk a catchup game over go sdk or it'll stay head to head. I understand that the platform is written in go and libraries are supported through shim.
qiang0723 (Sat, 26 Aug 2017 10:00:20 GMT):
Has joined the channel.
chaitanya (Sun, 27 Aug 2017 11:22:36 GMT):
@rickr I have an application sending invokes parallelly to my SDK client. One of them gets validation code 0 (lets calls this T1) and the other gets 11 (lets call this T2), which is expected behavior. However, when I'm trying to return the TransactionID from the invoke interface to the application, it returns T1 txID twice, and the application never comes to know of the failed transaction T2. Any idea what's happening here?
duwenhui (Mon, 28 Aug 2017 05:40:54 GMT):
Has joined the channel.
rickr (Mon, 28 Aug 2017 13:06:52 GMT):
It's opensource depends on what's contributed
pschnap (Mon, 28 Aug 2017 16:00:07 GMT):
Is there a way to access an invocation's arguments from a BlockListener event's Block(Data)? I've been poking through the SDK but haven't really found anything yet
pschnap (Mon, 28 Aug 2017 16:04:12 GMT):
Nevermind, found it in TransactionActionInfo
zArchitectBill (Mon, 28 Aug 2017 22:12:14 GMT):
Has joined the channel.
grice_32 (Tue, 29 Aug 2017 00:28:32 GMT):
Has joined the channel.
yoyokeen (Tue, 29 Aug 2017 07:40:06 GMT):
```2017-08-29 07:39:28,724 DEBUG Channel:1930 - Channel foo send proposal to peer peer1.org1.example.com at url grpc://112.126.87.91:7056
2017-08-29 07:39:29,542 DEBUG Peer:152 - peer.sendProposalAsync name: peer1.org1.example.com, url: grpc://112.126.87.91:7056
2017-08-29 07:39:30,764 ERROR Channel:1977 - Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=Transaction returned with failure: Incorrect arguments, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Transaction returned with failure: Incorrect arguments
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:1977)
at org.hyperledger.fabric.sdk.Channel.sendInstantiationProposal(Channel.java:1120)
at org.hyperledger.fabric.sdkintegration.End2endIT1.runChannel(End2endIT1.java:312)
at org.hyperledger.fabric.sdkintegration.End2endIT1.setup(End2endIT1.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Transaction returned with failure: Incorrect arguments
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:439)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)```
yoyokeen (Tue, 29 Aug 2017 07:41:18 GMT):
when I Instantiate chaincode with the error 'Incorrect arguments', but my arguments is correct which has 5 params.
CarlXK (Tue, 29 Aug 2017 08:49:47 GMT):
@rickr when create channel, i got an error in 1.0.1 version(sdk peer orderer), it work fine in 1.0.0 version, any update for channel create?
`
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Creating channel: xnchannel, client context Org1MSPuser
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Creating new channel xnchannel on the Fabric
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel adding ordererorderer.xnqkl.com, url: grpc://119.23.74.36:7050
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel sendUpdateChannel
2017-08-29 16:18:34.005 DEBUG 5 --- [nio-8080-exec-2] o.h.fabric.sdk.transaction.ProtoUtils : SignatureHeader: nonce: 5fe3471fe0237d1538e25370a2489c4048c0d245f6d5c75b, User:Org1MSPuser, MSPID: Org1MSP, idBytes: 040f12ab7eecb8aeb16c53371fc84e545be66e3212fffa8214e4954400c6f285
2017-08-29 16:18:34.005 DEBUG 5 --- [nio-8080-exec-2] o.h.fabric.sdk.transaction.ProtoUtils : ChannelHeader: type: CONFIG_UPDATE, version: 1, Txid: d1cae4bf150566247eefd2ebac7b152f3e6c4441560c132e055c68674400f41e, channelId: xnchannel, epoch 0
2017-08-29 16:18:34.010 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Orderer : Order.sendTransaction name: orderer.xnqkl.com, url: grpc://119.23.74.36:7050
2017-08-29 16:18:34.029 DEBUG 5 --- [ault-executor-1] o.hyperledger.fabric.sdk.OrdererClient : resp status value: 400, resp: BAD_REQUEST
2017-08-29 16:18:34.030 DEBUG 5 --- [nio-8080-exec-2] o.hyperledger.fabric.sdk.OrdererClient : Done waiting for reply! Got:status: BAD_REQUEST
2017-08-29 16:18:34.030 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel sendUpdateChannel 400
2017-08-29 16:18:34.032 ERROR 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel error: New channel xnchannel error. StatusValue 400. Status BAD_REQUEST
org.hyperledger.fabric.sdk.exception.TransactionException: New channel xnchannel error. StatusValue 400. Status BAD_REQUEST
at org.hyperledger.fabric.sdk.Channel.sendUpdateChannel(Channel.java:378) [fabric-sdk-java-1.0.1.jar!/:na]
at org.hyperledger.fabric.sdk.Channel.
CarlXK (Tue, 29 Aug 2017 08:49:47 GMT):
@rickr when create channel, i got an error in 1.0.1 version(sdk peer orderer), it work fine in 1.0.0 version, any update for channel create?
`
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Creating channel: xnchannel, client context Org1MSPuser
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Creating new channel xnchannel on the Fabric
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel adding ordererorderer.xnqkl.com, url: grpc://119.23.74.36:7050
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel sendUpdateChannel
2017-08-29 16:18:34.005 DEBUG 5 --- [nio-8080-exec-2] o.h.fabric.sdk.transaction.ProtoUtils : SignatureHeader: nonce: 5fe3471fe0237d1538e25370a2489c4048c0d245f6d5c75b, User:Org1MSPuser, MSPID: Org1MSP, idBytes: 040f12ab7eecb8aeb16c53371fc84e545be66e3212fffa8214e4954400c6f285
2017-08-29 16:18:34.005 DEBUG 5 --- [nio-8080-exec-2] o.h.fabric.sdk.transaction.ProtoUtils : ChannelHeader: type: CONFIG_UPDATE, version: 1, Txid: d1cae4bf150566247eefd2ebac7b152f3e6c4441560c132e055c68674400f41e, channelId: xnchannel, epoch 0
2017-08-29 16:18:34.010 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Orderer : Order.sendTransaction name: orderer.xnqkl.com, url: grpc://119.23.74.36:7050
2017-08-29 16:18:34.029 DEBUG 5 --- [ault-executor-1] o.hyperledger.fabric.sdk.OrdererClient : resp status value: 400, resp: BAD_REQUEST
2017-08-29 16:18:34.030 DEBUG 5 --- [nio-8080-exec-2] o.hyperledger.fabric.sdk.OrdererClient : Done waiting for reply! Got:status: BAD_REQUEST
2017-08-29 16:18:34.030 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel sendUpdateChannel 400
2017-08-29 16:18:34.032 ERROR 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel error: New channel xnchannel error. StatusValue 400. Status BAD_REQUEST
org.hyperledger.fabric.sdk.exception.TransactionException: New channel xnchannel error. StatusValue 400. Status BAD_REQUEST
at org.hyperledger.fabric.sdk.Channel.sendUpdateChannel(Channel.java:378) [fabric-sdk-java-1.0.1.jar!/:na]
at org.hyperledger.fabric.sdk.Channel.
CarlXK (Tue, 29 Aug 2017 08:49:47 GMT):
@rickr when create channel, i got an error in 1.0.1 version(sdk peer orderer), it work fine in 1.0.0 version, any update for channel create?
```
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Creating channel: xnchannel, client context Org1MSPuser
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Creating new channel xnchannel on the Fabric
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel adding ordererorderer.xnqkl.com, url: grpc://119.23.74.36:7050
2017-08-29 16:18:34.004 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel sendUpdateChannel
2017-08-29 16:18:34.005 DEBUG 5 --- [nio-8080-exec-2] o.h.fabric.sdk.transaction.ProtoUtils : SignatureHeader: nonce: 5fe3471fe0237d1538e25370a2489c4048c0d245f6d5c75b, User:Org1MSPuser, MSPID: Org1MSP, idBytes: 040f12ab7eecb8aeb16c53371fc84e545be66e3212fffa8214e4954400c6f285
2017-08-29 16:18:34.005 DEBUG 5 --- [nio-8080-exec-2] o.h.fabric.sdk.transaction.ProtoUtils : ChannelHeader: type: CONFIG_UPDATE, version: 1, Txid: d1cae4bf150566247eefd2ebac7b152f3e6c4441560c132e055c68674400f41e, channelId: xnchannel, epoch 0
2017-08-29 16:18:34.010 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Orderer : Order.sendTransaction name: orderer.xnqkl.com, url: grpc://119.23.74.36:7050
2017-08-29 16:18:34.029 DEBUG 5 --- [ault-executor-1] o.hyperledger.fabric.sdk.OrdererClient : resp status value: 400, resp: BAD_REQUEST
2017-08-29 16:18:34.030 DEBUG 5 --- [nio-8080-exec-2] o.hyperledger.fabric.sdk.OrdererClient : Done waiting for reply! Got:status: BAD_REQUEST
2017-08-29 16:18:34.030 DEBUG 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel sendUpdateChannel 400
2017-08-29 16:18:34.032 ERROR 5 --- [nio-8080-exec-2] org.hyperledger.fabric.sdk.Channel : Channel xnchannel error: New channel xnchannel error. StatusValue 400. Status BAD_REQUEST
org.hyperledger.fabric.sdk.exception.TransactionException: New channel xnchannel error. StatusValue 400. Status BAD_REQUEST
at org.hyperledger.fabric.sdk.Channel.sendUpdateChannel(Channel.java:378) [fabric-sdk-java-1.0.1.jar!/:na]
at org.hyperledger.fabric.sdk.Channel.
Styxt (Tue, 29 Aug 2017 09:16:18 GMT):
Hi all,
could anyone here explain to me how i can connect the sdk to an existing Blockchain like the balance-transfer example - i looked at the tests but i can't quite figure out how it works and what files i need if the sdk is running on a different host where no components are running.
aso (Tue, 29 Aug 2017 09:47:38 GMT):
Has joined the channel.
deepakvparmar (Tue, 29 Aug 2017 10:12:51 GMT):
While sending sending transaction to orderer, How we can find out whether transaction has been timed out or not?
deepakvparmar (Tue, 29 Aug 2017 10:19:20 GMT):
In case of time out response based on configured invokeTimeOut value while sending successful transaction proposal response to orderer, Are we going to receive TransactionEventException in exceptionally() block?
mastersingh24 (Tue, 29 Aug 2017 12:21:41 GMT):
@rickr - If you have a chance, can you pull down and review https://gerrit.hyperledger.org/r/#/c/12909/ ?
mastersingh24 (Tue, 29 Aug 2017 12:21:51 GMT):
(it's a nice sample for the Java SDK)
rickr (Tue, 29 Aug 2017 12:27:28 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=w4EGAs36m5qiCyJK3) Anything in the orderer logs gives a hint ?
rickr (Tue, 29 Aug 2017 12:29:25 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=aAem5FXeJNni9ehy7) End2endIT and End2endAndBackAgainIT are examples of creating and reconnecting back.
rickr (Tue, 29 Aug 2017 12:30:52 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dpwoCfKnJa7EznWqA) Should throw an exception there.
rickr (Tue, 29 Aug 2017 12:34:58 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=N7j4ZLqgMgAr6GvSD) I +1 it. Not a committer to `fabric-samples`
rickr (Tue, 29 Aug 2017 12:34:58 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=N7j4ZLqgMgAr6GvSD) I +1 it. Not a maintainer to `fabric-samples`
rickr (Tue, 29 Aug 2017 12:34:58 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=N7j4ZLqgMgAr6GvSD) I +1 it. Not a maintainer to `fabric-samples`
Once committed I'll add to our README.md a reference to it.
ascatox (Tue, 29 Aug 2017 12:43:08 GMT):
Hi All! Where can I find API documentation for this java SDK?
silliman (Tue, 29 Aug 2017 14:57:07 GMT):
I am trying to follow the README.md file at the root of the https://github.com/hyperledger/fabric-sdk-java repo with the goal of running the integration tests successfully. I have not used Maven before.
I am at the 1.0.1 tag for fabric-sdk-java, fabric, and fabric-ca.
```
ubuntu@hyperledger-devenv:e43b68f:/opt/gopath/src/github.com/hyperledger/fabric-sdk-java$ mvn -version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-93-generic", arch: "amd64", family: "unix"
```
I have run these commands that are mentioned in the *SDK dependencies* section of README.md: `mvn dependency:tree`, `mvn dependency:list` and `mvn dependency:analyze-report`.
In all three of those commands I receive these warnings. Is this something I need to worry about or can they be safely ignored?
```
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.hyperledger.fabric-sdk-java:fabric-sdk-java:jar:1.0.1
[WARNING] 'version' contains an expression but should be a constant. @ org.hyperledger.fabric-sdk-java:fabric-sdk-java:${fabric.sdk.java.version}, /opt/gopath/src/github.com/hyperledger/fabric-sdk-java/pom.xml, line 7, column 14
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ org.hyperledger.fabric-sdk-java:fabric-sdk-java:${fabric.sdk.java.version}, /opt/gopath/src/github.com/hyperledger/fabric-sdk-java/pom.xml, line 488, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
```
Then, in the output from the `mvn dependency:analyze-report` command I receive these messages:
```
Unable to process: org.hyperledger.fabric.sdk.SDKUtils
Unable to process: org.hyperledger.fabric.sdk.HFClient
Unable to process: org.hyperledger.fabric.sdk.Channel$TL
Unable to process: org.hyperledger.fabric.sdk.Channel
Unable to process: org.hyperledger.fabric.sdk.helper.Utils
Unable to process: org.hyperledger.fabric.sdk.helper.DiagnosticFileDumper
Unable to process: org.hyperledger.fabric.sdk.EventHub$2
Unable to process: org.hyperledger.fabric.sdk.TestHFClient
Unable to process: org.hyperledger.fabric.sdkintegration.End2endIT
Unable to process: org.hyperledger.fabric.sdkintegration.End2endAndBackAgainIT
Unable to process: org.hyperledger.fabric.sdkintegration.Util
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.764 s
[INFO] Finished at: 2017-08-29T14:07:55+00:00
[INFO] Final Memory: 39M/390M
[INFO] ------------------------------------------------------------------------
```
Are the *unable to process...* messages just prior to the BUILD SUCCESS message cause for concern?
CarlXK (Tue, 29 Aug 2017 15:20:38 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=esMoNtKiQCYmkxd94) @rickr there have a warning
```
2017-08-29 23:19:34.885 CST [msp/identity] newIdentity -> DEBU 42f Creating identity instance for ID &{Org1MSP 040f12ab7eecb8aeb16c53371fc84e545be66e3212fffa8214e4954400c6f285}
2017-08-29 23:19:34.885 CST [msp] SatisfiesPrincipal -> DEBU 430 Checking if identity satisfies ADMIN role for Org1MSP
2017-08-29 23:19:34.885 CST [cauthdsl] func2 -> DEBU 431 0xc42006eb88 principal matched by identity 0
2017-08-29 23:19:34.885 CST [msp/identity] Verify -> DEBU 432 Verify: digest = 00000000 16 80 a1 78 8d 4a 6a e1 0a 4d 68 eb cf 00 c2 fa |...x.Jj..Mh.....|
00000010 4c bc ad 93 36 6f ab 5d 0a 3a 5e 75 af 65 f1 48 |L...6o.].:^u.e.H|
2017-08-29 23:19:34.885 CST [msp/identity] Verify -> DEBU 433 Verify: sig = 00000000 30 44 02 20 41 2a b7 9b 7c 4c a5 fb 78 34 82 cd |0D. A*..|L..x4..|
00000010 c4 14 73 b7 7a a4 b9 3b 91 6a c4 ef cd 3d 1d 5a |..s.z..;.j...=.Z|
00000020 6a e8 93 a2 02 20 4a 69 2f dd 23 f5 09 20 6b 31 |j.... Ji/.#.. k1|
00000030 5a bb 25 09 04 c0 84 85 79 05 49 c0 e8 ce c7 02 |Z.%.....y.I.....|
00000040 e6 c5 4c 2b ba d7 |..L+..|
2017-08-29 23:19:34.885 CST [cauthdsl] func2 -> DEBU 434 0xc42006eb88 principal evaluation succeeds for identity 0
2017-08-29 23:19:34.885 CST [cauthdsl] func1 -> DEBU 435 0xc42006eb88 gate 1504019974885041139 evaluation succeeds
2017-08-29 23:19:34.885 CST [orderer/common/broadcast] Handle -> WARN 436 Rejecting CONFIG_UPDATE because: Error authorizing update: Error validating DeltaSet: invalid mod_policy for element [Policy] /Channel/Application/Admins: mod_policy not set
```
CarlXK (Tue, 29 Aug 2017 15:20:38 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=esMoNtKiQCYmkxd94) @rickr there have a warning, invalid mod_policy for element [Policy] /Channel/Application/Admins: mod_policy not set?
```
2017-08-29 23:19:34.885 CST [msp/identity] newIdentity -> DEBU 42f Creating identity instance for ID &{Org1MSP 040f12ab7eecb8aeb16c53371fc84e545be66e3212fffa8214e4954400c6f285}
2017-08-29 23:19:34.885 CST [msp] SatisfiesPrincipal -> DEBU 430 Checking if identity satisfies ADMIN role for Org1MSP
2017-08-29 23:19:34.885 CST [cauthdsl] func2 -> DEBU 431 0xc42006eb88 principal matched by identity 0
2017-08-29 23:19:34.885 CST [msp/identity] Verify -> DEBU 432 Verify: digest = 00000000 16 80 a1 78 8d 4a 6a e1 0a 4d 68 eb cf 00 c2 fa |...x.Jj..Mh.....|
00000010 4c bc ad 93 36 6f ab 5d 0a 3a 5e 75 af 65 f1 48 |L...6o.].:^u.e.H|
2017-08-29 23:19:34.885 CST [msp/identity] Verify -> DEBU 433 Verify: sig = 00000000 30 44 02 20 41 2a b7 9b 7c 4c a5 fb 78 34 82 cd |0D. A*..|L..x4..|
00000010 c4 14 73 b7 7a a4 b9 3b 91 6a c4 ef cd 3d 1d 5a |..s.z..;.j...=.Z|
00000020 6a e8 93 a2 02 20 4a 69 2f dd 23 f5 09 20 6b 31 |j.... Ji/.#.. k1|
00000030 5a bb 25 09 04 c0 84 85 79 05 49 c0 e8 ce c7 02 |Z.%.....y.I.....|
00000040 e6 c5 4c 2b ba d7 |..L+..|
2017-08-29 23:19:34.885 CST [cauthdsl] func2 -> DEBU 434 0xc42006eb88 principal evaluation succeeds for identity 0
2017-08-29 23:19:34.885 CST [cauthdsl] func1 -> DEBU 435 0xc42006eb88 gate 1504019974885041139 evaluation succeeds
2017-08-29 23:19:34.885 CST [orderer/common/broadcast] Handle -> WARN 436 Rejecting CONFIG_UPDATE because: Error authorizing update: Error validating DeltaSet: invalid mod_policy for element [Policy] /Channel/Application/Admins: mod_policy not set
```
rickr (Tue, 29 Aug 2017 15:21:13 GMT):
I've not see issues if at the end BUILD SUCCESS is displayed
CarlXK (Tue, 29 Aug 2017 15:22:31 GMT):
2017-08-29 23:19:34.885 CST [orderer/common/broadcast] Handle -> WARN 436 Rejecting CONFIG_UPDATE because: Error authorizing update: Error validating DeltaSet: invalid mod_policy for element [Policy] /Channel/Application/Admins: mod_policy not set
what wrong with this?
rickr (Tue, 29 Aug 2017 15:24:27 GMT):
Running against the same Fabric level ? --- Maybe try #fabric channel
rickr (Tue, 29 Aug 2017 15:27:59 GMT):
try regenerating your channel config block maybe with v101 fabric if you didn't try that
CarlXK (Tue, 29 Aug 2017 15:30:50 GMT):
@rickr thanks , will update the tool and retry it
silliman (Tue, 29 Aug 2017 15:31:10 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=7YRtBdqdcuFp4tgYy)
@rickr was this statement w.r.t. the `mvn dependency` commands only? For example, when I ran `mvn test` or `mvn install` to run the unit tests, I received lots of stack exceptions and errors yet at the end it displayed....
```
Results :
Tests run: 288, Failures: 0, Errors: 0, Skipped: 2
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.9:report (post-unit-test) @ fabric-sdk-java ---
[INFO] Loading execution data file /opt/gopath/src/github.com/hyperledger/fabric-sdk-java/target/coverage-reports/jacoco-ut.exec
[INFO] Analyzed bundle 'fabric-java-sdk' with 129 classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
```
and when I tried to run the integration tests I received similar output despite seeing lots of exceptions in the *HFCAClientEnrollIT* portion of the test:
```
Tests run: 18, Failures: 0, Errors: 0, Skipped: 2
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! The file encoding for reports output files should be provided by the POM property ${project.reporting.outputEncoding}.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
```
rickr (Tue, 29 Aug 2017 15:34:01 GMT):
From what I've seen BUILD SUCCESS is BUILD SUCCESS. Do any of the tests say Failure ?
silliman (Tue, 29 Aug 2017 15:40:14 GMT):
@rickr nothing that specifically says failure but I've got a lot of warnings, ERROR messages in the logs, lots of java exceptions, etc., NullPointerExceptions, IllegalArgumentExceptions, HTTP 404, 500, etc.
SandySun2000 (Tue, 29 Aug 2017 20:23:20 GMT):
Does any one have the experience to set up the eclipse environment to compile .proto files? I need help on that. Thanks!
SandySun2000 (Tue, 29 Aug 2017 23:49:18 GMT):
I made it work by following this link https://stackoverflow.com/questions/1578456/integrate-protocol-buffers-into-maven2-build
deepakvparmar (Wed, 30 Aug 2017 05:55:38 GMT):
We are currently handling timeout event when we are sending transaction proposal to orderer. We would also like to handle completion phase when orderer will send block to all peers, all peers will verify and commit transaction. Any suggestion or pointer how we can handle this use case?
aneb (Wed, 30 Aug 2017 06:04:38 GMT):
Has joined the channel.
gauravgiri (Wed, 30 Aug 2017 06:44:24 GMT):
Hi @rickr,
One question regarding fabric-sdk-java to handle invoke() transactions.
Invoke transactions are usually done in following 2 phases: channel.sendTransactionProposal & channel.sendTransaction
There is a doubt/query regarding the second phase, channel.sendTransaction. When is the CompletableFuture object returned?
1. Is it returned when after the transactions are committed successfully by the committing peers?
2. OR is it returned when the transactions are just accepted by the orderer?
If it is 1, can we rely that if we get the CompletableFuture
MoulaliMvg (Wed, 30 Aug 2017 06:51:50 GMT):
Hi all I completed my fabric 1.0 set up with node sdk but I don't know about how to set up with java sdk can any one refer some link for how to proceed fabric set up with java sdk
HuangLijun (Wed, 30 Aug 2017 10:20:44 GMT):
hi all,
I deployed a channel that contains peers from two orgs, and use the AND endorsement policy. Then I need to invoke chaincode under this scenario.
So I new a Channel object "newChannel" and new "EventHub"s from two orgs, then newChannel.addEventHub(eventHub) and newChannel.initialize(). But I encountered below error, the eventhub from AMSP could be connected correctly but the ones from BMSP couldn't, and the "newChannel" could be only set one HFClient which only with one UserContext. *How could I achieve the goal that channel could connect to eventhubs from different orgs?* Thanks so much!
```
org.hyperledger.fabric.sdk.exception.EventHubException: io.grpc.StatusRuntimeException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID AMSP, received BMSP]]
```
pine (Wed, 30 Aug 2017 11:11:29 GMT):
Has joined the channel.
rickr (Wed, 30 Aug 2017 12:22:35 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=MmkLg2vywr9xjkEjs) When the future is resolved all listening eventhubs have seen the transaction in a block completed successfully.
rickr (Wed, 30 Aug 2017 12:23:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=AhaJvFn2yjXgrus53) ^^^^
JiuZhuYou (Wed, 30 Aug 2017 12:27:27 GMT):
Has joined the channel.
greg.haskins (Wed, 30 Aug 2017 20:12:46 GMT):
Has left the channel.
leogzl (Thu, 31 Aug 2017 06:17:11 GMT):
Has joined the channel.
CarlXK (Thu, 31 Aug 2017 07:09:18 GMT):
@rickr after fabric network running about 14 hours, send the message to peer, send the message to order , got exception below, and send the message again got succeed, seems that the connection closed by peer and orderer, maybe the issue is from peer/orderer, what's wrong with it?
```
fabric-sdk-server|2017-08-31 10:16:35,081|DEBUG|[grpc-default-worker-ELG-1-6]|io.netty.handler.codec.http2.Http2ConnectionHandler|[id: 0xf7e80175, L:0
.0.0.0/0.0.0.0:35802 ! R:/10.135.56.171:8056] Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData 'Connection reset by peer'. Forcing sh
utdown of the connection.
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.writev0(Native Method)
at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.write(IOUtil.java:148)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504)
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:432)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:856)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:823)
at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1296)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768)
at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749)
at io.netty.handler.codec.http2.Http2ConnectionHandler.onError(Http2ConnectionHandler.java:573)
at io.grpc.netty.AbstractNettyHandler.exceptionCaught(AbstractNettyHandler.java:84)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)
at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1301)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:914)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.handleReadException(AbstractNioByteChannel.java:104)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:145)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:748)
```
CarlXK (Thu, 31 Aug 2017 07:09:18 GMT):
@rickr fabric network running about 14 hours, there always have transaction between sdk and peer/order, at one time got the exception below, send the message to peer/orderer failed, and send the message again got succeed, seems that the connection closed by peer and orderer and retry it will succeed, what's wrong with it?
```
fabric-sdk-server|2017-08-31 10:16:35,081|DEBUG|[grpc-default-worker-ELG-1-6]|io.netty.handler.codec.http2.Http2ConnectionHandler|[id: 0xf7e80175, L:0
.0.0.0/0.0.0.0:35802 ! R:/10.135.56.171:8056] Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData 'Connection reset by peer'. Forcing sh
utdown of the connection.
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.writev0(Native Method)
at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.write(IOUtil.java:148)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504)
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:432)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:856)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:823)
at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1296)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768)
at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749)
at io.netty.handler.codec.http2.Http2ConnectionHandler.onError(Http2ConnectionHandler.java:573)
at io.grpc.netty.AbstractNettyHandler.exceptionCaught(AbstractNettyHandler.java:84)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)
at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1301)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:914)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.handleReadException(AbstractNioByteChannel.java:104)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:145)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:748)
```
deepakvparmar (Thu, 31 Aug 2017 09:59:39 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=HAZftPSLrtm544fK5) @rickr Thank You Rick. It means, Once we are receiving TransactionEvent object in which transactionEvent.isValid() is truee, then peers have successfully verified readwrite set and committed transaction into ledger?
rickr (Thu, 31 Aug 2017 14:09:55 GMT):
As stated - Future is resolved successfully when listening eventhubs on the peers have seen a block that has the transaction marked valid.
CarlXK (Thu, 31 Aug 2017 14:39:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=YrjBqdphhWGFPEHmR) @CarlXK @rickr any idea of this issue?
rickr (Thu, 31 Aug 2017 15:14:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=YrjBqdphhWGFPEHmR) It just got tired after 14 hrs ? :) Seriously there to much that's happening to know. You'd have to have logs from ALL client, oderer, peers probably at debug level to pinpoint the issue. If its grpc issue it may require grpc tracing too. The SDK for any connections issue type exception SHOULD abandon that connection and start a new one.
IMO any robust application should try for proposal endorsement failures do a retry. There is no issue with doing that -- that means creating a WHOLE new request and sending it to the peers again.
For the orderer If failure occurs, the application should try to query for the block by transaction id queryBlockByTransactionID if not there or bad do a retry.
rickr (Thu, 31 Aug 2017 15:14:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=YrjBqdphhWGFPEHmR) It just got tired after 14 hrs ? :) Seriously there too much that's happening to know. You'd have to have logs from ALL client, oderer, peers probably at debug level to pinpoint the issue. If its grpc issue it may require grpc tracing too. The SDK for any connections issue type exception SHOULD abandon that connection and start a new one.
IMO any robust application should try for proposal endorsement failures do a retry. There is no issue with doing that -- that means creating a WHOLE new request and sending it to the peers again.
For the orderer If failure occurs, the application should try to query for the block by transaction id queryBlockByTransactionID if not there or bad do a retry.
Vrai1127 (Thu, 31 Aug 2017 19:45:14 GMT):
Has joined the channel.
ascatox (Fri, 01 Sep 2017 09:16:49 GMT):
Hi All! I'm trying to execute the End2EndIT Test, but I've some problems with my blockchain configuration! What's the blockchain configuration needed to make to work the Integration Test?
JenilDoshi (Fri, 01 Sep 2017 21:11:55 GMT):
Has joined the channel.
JenilDoshi (Fri, 01 Sep 2017 21:17:59 GMT):
Hi All, I am also trying to use Java SDK and I am at first step of starting the Blockchain network by running docker-compose.yaml file inside fabric-sdk-java-test\src\test\fixture\sdkintegration. I start this using docker-compose up command and I am getting following error: ERROR: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.65.1:53: no such host. Can anyone help me in this.
JamieOBE (Sat, 02 Sep 2017 07:12:20 GMT):
Has joined the channel.
eason0208 (Mon, 04 Sep 2017 06:39:15 GMT):
Has joined the channel.
zaishengming (Mon, 04 Sep 2017 06:41:38 GMT):
@rickr when i run "docker-compose up --force-recreate" in "/home/xxx/gopath/src/github.com/hyperledger/fabric/sdkintegration" ,it is normal.But I run " fabric-sdk-java\src\test\java\org\hyperledger\fabric\sdkintegration\End2endIT.java",in the end prompt “peer1.org2.example.com | 2017-09-04 06:31:42.025 UTC [eventhub_producer] Chat -> ERRO 561 error during Chat, stopping handler: rpc error: code = Canceled desc = context canceled
peer1.org2.example.com | 2017-09-04 06:31:42.025 UTC [eventhub_producer] deRegisterHandler -> DEBU 562 deregistering event type: BLOCK
peer0.org2.example.com | 2017-09-04 06:31:42.025 UTC [eventhub_producer] Chat -> ERRO 831 error during Chat, stopping handler: rpc error: code = Canceled desc = context canceled
peer0.org2.example.com | 2017-09-04 06:31:42.025 UTC [eventhub_producer] deRegisterHandler -> DEBU 832 deregistering event type: BLOCK”.How did this happen?
CarlXK (Mon, 04 Sep 2017 08:43:47 GMT):
@rickr now java sdk use tls cert only support absolute path ret.setProperty("pemFile", cert.getAbsolutePath()), could it support String or byte[] way , it will be convenient
CarlXK (Mon, 04 Sep 2017 08:43:47 GMT):
@rickr now java sdk use tls cert only support absolute path ret.setProperty("pemFile", cert.getAbsolutePath()), could it support String or byte[] way , it could be convenient
CarlXK (Mon, 04 Sep 2017 08:43:47 GMT):
@rickr now java sdk use tls cert only support absolute path ret.setProperty("pemFile", cert.getAbsolutePath()), could it support String or byte[] way , it could be convenient pemBytes was recently added.
CarlXK (Mon, 04 Sep 2017 08:43:47 GMT):
@rickr now java sdk use tls cert only support absolute path ret.setProperty("pemFile", cert.getAbsolutePath()), could it support String or byte[] way , it could be convenient
Vrai1127 (Mon, 04 Sep 2017 19:46:38 GMT):
Hi, could anyone help me understand what Java SDK currently doesn't do compared to Node SDK?
ngeorge (Tue, 05 Sep 2017 10:28:48 GMT):
Hi, while running the End2EndIT.java integration test, whatever endorsement policy is given, the instantiation is getting successful ..eg. with a wrong value for identity mspid, the endorsement is supposed to fail, but in my case, instantiation succeeds.. Could anyone explain the reason for the same?
deepakvparmar (Tue, 05 Sep 2017 11:05:34 GMT):
If We have TLS enabled fabric network, Do we need to provide certificates of peers, orderer and eventhub while invoking and querying existing channel?
LaurenceBonney (Tue, 05 Sep 2017 12:34:28 GMT):
Has joined the channel.
LaurenceBonney (Tue, 05 Sep 2017 12:48:31 GMT):
Hi there, I'm getting an issue with using the Java client connecting to an SSL enabled version of the fabric-samples/fabcar demo. The application is successfully updating and querying the update of the ledger, but the confirmation to the EventHub is failing, I do not see any errors in the peer container, orderer container does log this:
2017-09-05 12:25:19.530 UTC [msp/identity] newIdentity -> DEBU e30 Creating identity instance for ID &{Org1MSP 1eb740903a7f4e689b1a4647dc57acfa4fb9fd0b530147a885d28880f7c5a452}
2017-09-05 12:25:19.530 UTC [cauthdsl] func2 -> DEBU e31 0xc420164060 identity 0 does not satisfy principal: The identity is a member of a different MSP (expected OrdererMSP, got Org1MSP)
2017-09-05 12:25:19.530 UTC [cauthdsl] func2 -> DEBU e32 0xc420164060 principal evaluation fails
My order is configured to use OrdererMSP and peer configured to use Org1MSP (as per the fabcar/basic-network config).
My application logs the following:
Tue Sep 05 13:25:19 BST 2017 [INFO] Creating endpoint for url grpcs://peer0.org1.example.com:7053
Sep 05, 2017 1:25:19 PM io.grpc.internal.ManagedChannelImpl
rickr (Tue, 05 Sep 2017 16:38:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Z6p4YgJu4zRbS9LKM) pemBytes was recently added.
rickr (Tue, 05 Sep 2017 16:40:55 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=qujnggwoQH5pcgD9X) My only guess is it's not finding dockerhub IP or bad connection to it ?
rickr (Tue, 05 Sep 2017 16:43:50 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=LPeZnmRFWY4fPJJ5y) Do the integration test fully run ? I think those messages is what the peer will produce each time the client disconnects from it.
rickr (Tue, 05 Sep 2017 16:45:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6nvuANMZN3wsjQup4) yes
rickr (Tue, 05 Sep 2017 16:50:54 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=PeuxSaupmHBJqDBWv) Anything on the peer side logs ?
zaishengming (Wed, 06 Sep 2017 01:42:11 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=3ucP8vxT9gYfN8W4N) @rickr thank you ,rickr.I understand with it.
smith (Wed, 06 Sep 2017 02:47:28 GMT):
Has joined the channel.
henryhs (Wed, 06 Sep 2017 03:04:16 GMT):
Has joined the channel.
zemtsov (Wed, 06 Sep 2017 06:33:47 GMT):
Has left the channel.
LaurenceBonney (Wed, 06 Sep 2017 11:37:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Pb2ckmt8usLvaLEGy) @rickr
Nothing from the EventHub it appears to be working as far as the container is concerned (note: this is a fresh setup created today):
2017-09-06 11:28:47.535 UTC [eventhub_producer] AddEventType -> DEBU 03c Registering BLOCK
2017-09-06 11:28:47.535 UTC [eventhub_producer] AddEventType -> DEBU 03d Registering CHAINCODE
2017-09-06 11:28:47.535 UTC [eventhub_producer] AddEventType -> DEBU 03e Registering REJECTION
2017-09-06 11:28:47.535 UTC [eventhub_producer] AddEventType -> DEBU 03f Registering REGISTER
2017-09-06 11:28:47.535 UTC [eventhub_producer] start -> INFO 040 Event processor started
2017-09-06 11:29:47.494 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 2ea Entry
2017-09-06 11:29:47.494 UTC [eventhub_producer] SendProducerBlockEvent -> INFO 2eb Channel [mychannel]: Sending event for block number [0]
2017-09-06 11:29:47.494 UTC [eventhub_producer] Send -> DEBU 2ec Entry
2017-09-06 11:29:47.494 UTC [eventhub_producer] Send -> DEBU 2ed Event processor timeout > 0
2017-09-06 11:29:47.494 UTC [eventhub_producer] Send -> DEBU 2ee Event sent successfully
2017-09-06 11:29:47.494 UTC [eventhub_producer] Send -> DEBU 2ef Exit
2017-09-06 11:29:47.494 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 2f0 Exit
2017-09-06 11:30:02.731 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 440 Entry
2017-09-06 11:30:02.731 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 441 Channel [mychannel]: Block event for block number [1] contains transaction id: 290f4902d051545c0fabc94ce3a590d27fd9f58bc6860a3ccb74b8ea0e27f368
2017-09-06 11:30:02.731 UTC [eventhub_producer] SendProducerBlockEvent -> INFO 442 Channel [mychannel]: Sending event for block number [1]
2017-09-06 11:30:02.731 UTC [eventhub_producer] Send -> DEBU 443 Entry
2017-09-06 11:30:02.731 UTC [eventhub_producer] Send -> DEBU 444 Event processor timeout > 0
2017-09-06 11:30:02.731 UTC [eventhub_producer] Send -> DEBU 445 Event sent successfully
2017-09-06 11:30:02.731 UTC [eventhub_producer] Send -> DEBU 446 Exit
2017-09-06 11:30:02.731 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 447 Exit
2017-09-06 11:30:12.878 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 609 Entry
2017-09-06 11:30:12.878 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 60a Channel [mychannel]: Block event for block number [2] contains transaction id: 0abe2bd41ac7e0e92c337e4bf48266a870668d985f222e41824a1a16c1cc8046
2017-09-06 11:30:12.878 UTC [eventhub_producer] SendProducerBlockEvent -> INFO 60b Channel [mychannel]: Sending event for block number [2]
2017-09-06 11:30:12.878 UTC [eventhub_producer] Send -> DEBU 60c Entry
2017-09-06 11:30:12.878 UTC [eventhub_producer] Send -> DEBU 60d Event processor timeout > 0
2017-09-06 11:30:12.878 UTC [eventhub_producer] Send -> DEBU 60e Event sent successfully
2017-09-06 11:30:12.878 UTC [eventhub_producer] Send -> DEBU 60f Exit
2017-09-06 11:30:12.878 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 610 Exit
2017-09-06 11:31:15.258 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 723 Entry
2017-09-06 11:31:15.258 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 724 Channel [mychannel]: Block event for block number [3] contains transaction id: e9e3312afad7a2e2d5538bba30f20628dbf12678ab3660b6e0b36334782460cc
2017-09-06 11:31:15.258 UTC [eventhub_producer] SendProducerBlockEvent -> INFO 725 Channel [mychannel]: Sending event for block number [3]
2017-09-06 11:31:15.259 UTC [eventhub_producer] Send -> DEBU 726 Entry
2017-09-06 11:31:15.259 UTC [eventhub_producer] Send -> DEBU 727 Event processor timeout > 0
2017-09-06 11:31:15.259 UTC [eventhub_producer] Send -> DEBU 728 Event sent successfully
2017-09-06 11:31:15.259 UTC [eventhub_producer] Send -> DEBU 729 Exit
2017-09-06 11:31:15.259 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 72a Exit
LaurenceBonney (Wed, 06 Sep 2017 13:01:02 GMT):
@rickr The full peer log from startup including the SDK performing a query request is available here: https://ibm.box.com/s/j1g7k6er3yny3mvyb28c5vywedgb4fxc
rickr (Wed, 06 Sep 2017 14:52:30 GMT):
If going through some firewall/proxy/loadbalancer try setting the keepAliveTime see the End2endxxxxIT integration tests on how this is done.
rickr (Wed, 06 Sep 2017 14:52:30 GMT):
If going through some firewall/proxy/loadbalancer try setting the keepAliveTime see the End2endxxxxIT integration tests on how this is done. Even if you're not would give that a try.
LaurenceBonney (Wed, 06 Sep 2017 14:56:53 GMT):
I'll try that, its all local but worth a shot.
LaurenceBonney (Wed, 06 Sep 2017 15:28:34 GMT):
Am I right in thinking in terms of SSL, if I've got authority to connect to the peer I'll have (the same) authority to connect to the peer's eventhub?
rickr (Wed, 06 Sep 2017 16:49:36 GMT):
Certificate in general should be the same. If you're connect to the endorser port, which it seems you are, it should be the exact same for the eventhub port
rrb01 (Wed, 06 Sep 2017 23:26:35 GMT):
Has joined the channel.
Sean219 (Thu, 07 Sep 2017 08:48:37 GMT):
Has joined the channel.
roccia8685 (Thu, 07 Sep 2017 13:59:13 GMT):
Has joined the channel.
bercinho (Thu, 07 Sep 2017 15:52:39 GMT):
Hi @rickr do you by any chance have an example for UpdateChannelConfiguration / public void updateChannelConfiguration(UpdateChannelConfiguration updateChannelConfiguration, Orderer orderer, byte[]... signers) throws TransactionException, InvalidArgumentException {
bercinho (Thu, 07 Sep 2017 15:52:55 GMT):
I would like to change the BatchTime for a channel via the SDK
bercinho (Thu, 07 Sep 2017 15:53:02 GMT):
or BatchSize
bercinho (Thu, 07 Sep 2017 15:53:10 GMT):
any example would be of big help
bercinho (Thu, 07 Sep 2017 15:56:30 GMT):
when I see I need a configFile from the file system
bercinho (Thu, 07 Sep 2017 15:56:57 GMT):
is this the "config_update_as_envelope.pb" I can generate via the CLI commands
bercinho (Thu, 07 Sep 2017 15:58:06 GMT):
with the configtxlator service and manually fetching the config block via the peer command?
bercinho (Thu, 07 Sep 2017 16:06:13 GMT):
@bestbeforetoday could you please help with the above question, I see you have committed the UpdateChannelConfiguration class in git, I just would like to understand the expectations on the source file you are referring to? "* constructs a ChannelConfiguration object with the actual configuration gotten from the file system" ... what is the structure of the config allowed here? is this the one we generate via the configtxlator service & fetch via the peer? Thanks
bestbeforetoday (Thu, 07 Sep 2017 16:06:13 GMT):
Has joined the channel.
suganuma (Thu, 07 Sep 2017 16:57:20 GMT):
Hi, I have a question for a channel construction for multi organizations (End2endIT example is just a single organization). I add all peers and event hubs from each organization to the channel. I set user context of the client instance with peerAdmin of the corresponding organization when adding peers and event hubs. But I got the following error:
suganuma (Thu, 07 Sep 2017 16:57:31 GMT):
`2017-09-07 16:25:30,114 ERROR EventHub:208 - EventHub:peer1.org1.example.com terminated is false shutdown is false has error UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org1MSP, received Org2MSP]]`
suganuma (Thu, 07 Sep 2017 16:58:05 GMT):
How can we get around the problem?
trongcauhcmus (Fri, 08 Sep 2017 02:29:30 GMT):
Has joined the channel.
trongcauhcmus (Fri, 08 Sep 2017 02:32:39 GMT):
hi, i'm new. maybe my questions already have but if you can, pls help me. IS the environment for java sdk of fabric the same with "byfn example"?
robert.feng (Fri, 08 Sep 2017 04:00:57 GMT):
Has joined the channel.
bestbeforetoday (Fri, 08 Sep 2017 09:30:49 GMT):
@bercinho My only contribution there was to tidy up some compile-time warnings. @rickr is the primary contributor so most likely to be able to help. @jimthematrix might also be able to help, or at least steer somebody else who can to your question
bestbeforetoday (Fri, 08 Sep 2017 09:31:18 GMT):
Has left the channel.
bercinho (Fri, 08 Sep 2017 09:50:37 GMT):
@bestbeforetoday many thanks for feedback, then I will wait for the Gents above to come back to me :)
bestbeforetoday (Fri, 08 Sep 2017 09:50:37 GMT):
Has joined the channel.
bestbeforetoday (Fri, 08 Sep 2017 09:51:14 GMT):
Has left the channel.
ascatox (Fri, 08 Sep 2017 10:26:22 GMT):
Hi All! I'm trying to develop an application by maven dependency of the SDK, but it seems to me that there are some missing methods respect to the SDK source code available on github.
ascatox (Fri, 08 Sep 2017 10:26:22 GMT):
Hi All! I'm trying to develop an application by maven dependency of the SDK, but it seems to me that there are some missing methods respect to the SDK source code available on github,
ascatox (Fri, 08 Sep 2017 10:27:17 GMT):
for example I couldn't find the method `channel.registerChaincodeEventListener``
ascatox (Fri, 08 Sep 2017 10:28:03 GMT):
and others
ascatox (Fri, 08 Sep 2017 10:28:03 GMT):
and different others.
ascatox (Fri, 08 Sep 2017 10:28:05 GMT):
.
pschnap (Fri, 08 Sep 2017 13:58:33 GMT):
Is there a way to have the SDK create a genesis block for creating a channel instead of having to create it externally then read it in?
sativ (Fri, 08 Sep 2017 14:32:13 GMT):
Hi guys, could you please let me know where can I get the latest "Hyperledger Fabric SDK Design Specification"
I have a document that I've downloaded in the end of 2016, but can't seems to find the newer version
thanks
deepakvparmar (Sat, 09 Sep 2017 10:59:48 GMT):
@rickr : While executing End2EndIT.java, We have enabled runningTLS= true and runningFabricCATLS=false. We could able to register user successfully, but getting following error while constructing channel, Any pointer or suggestion would be very helpful.
org.hyperledger.fabric.sdk.exception.TransactionException: Send transactions failed. Reason: UNAVAILABLE
at org.hyperledger.fabric.sdk.OrdererClient.sendTransaction(OrdererClient.java:169)
at org.hyperledger.fabric.sdk.Orderer.sendTransaction(Orderer.java:133)
at org.hyperledger.fabric.sdk.Channel.
deepakvparmar (Sat, 09 Sep 2017 11:44:26 GMT):
@rickr : Our fabric java client program is working fine if TLS is not enabled. Now, When we are enabling TLS by providing following properties , We are getting exception.
sslProvider=openSSL
negotiationType=TLS
In addition of above properties, We are also providing pemFile for each peer, orderer and eventhub before invoking channel. Exception we are receiving is:
org.hyperledger.fabric.sdk.Channel sendProposalToPeers Sending proposal to peer1.org1.sla.mufg.com failed because of: gRPC failure=Status{
code=UNAVAILABLE, description=Channel closed while performing protocol negotiation, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2029)
at org.hyperledger.fabric.sdk.Channel.queryChannels(Channel.java:1701)
at org.hyperledger.fabric.sdk.HFClient.queryChannels(HFClient.java:393)
at com.common.bcb.config.FabricManager.useExistingChannel(FabricManager.java:170)
at com.common.bcb.config.FabricManager.initChannel(FabricManager.java:115)
at com.common.bcb.config.FabricManager.invoke(FabricManager.java:233)
at com.common.bcb.services.FabricChaincodeServiceImpl.invoke(FabricChaincodeServiceImpl.java:65)
at com.business.service.SLAServiceDelegatorImpl.listSLAs(SLAServiceDelegatorImpl.java:82)
at com.business.service.SLAServiceDelegatorImpl$Proxy$_$$_WeldClientProxy.listSLAs(Unknown Source)
at com.business.SLAsResource.listSLAs(SLAsResource.java:85)
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:439)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:785)
spiditec (Sat, 09 Sep 2017 15:35:47 GMT):
Has joined the channel.
MariaHenderson (Sun, 10 Sep 2017 09:57:42 GMT):
Has joined the channel.
Peaches (Sun, 10 Sep 2017 14:46:33 GMT):
Has joined the channel.
ngeorge (Mon, 11 Sep 2017 06:45:56 GMT):
Hi All, I am trying to use Java SDK , to instantiate the chaincode on two organisations .I am using the configurations which are used in End2EndIT.java. The instantiation succeeds when the instantiate method is called on the organisations individually(as shown in End2EndIT.java ).. but while trying to instantiate on two organisations together, it fails with the below error:
2017-09-11 05:41:00,325 ERROR Channel:2029 - Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=Failed to deserialize creator identity, err MSP Org1MSP is unknown, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Failed to deserialize creator identity, err MSP Org1MSP is unknown
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2029)
at org.hyperledger.fabric.sdk.Channel.sendInstantiationProposal(Channel.java:1174)
at org.hyperledger.fabric.sdk.Channel.sendInstantiationProposal(Channel.java:1136)
......
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Failed to deserialize creator identity, err MSP Org1MSP is unknown
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:439)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Does Java SDK support instantiation on multiple organisations connected to same channel?
bercinho (Mon, 11 Sep 2017 11:31:53 GMT):
Hi @rickr do you by any chance have an example for UpdateChannelConfiguration / public void updateChannelConfiguration(UpdateChannelConfiguration updateChannelConfiguration, Orderer orderer, byte[]... signers) throws TransactionException, InvalidArgumentException {
I would like to change the BatchTime for a channel via the SDK or BatchSize
any example would be of big help
when I see I need a configFile from the file system
is this the "config_update_as_envelope.pb" I can generate via the CLI commands
with the configtxlator service and manually fetching the config block via the peer command?
jeffgarratt (Mon, 11 Sep 2017 15:20:06 GMT):
Has joined the channel.
suganuma (Mon, 11 Sep 2017 15:48:19 GMT):
@ngeorge One point to be careful (in channel construction and chaincode installation) is to switch the client user context to the peerAdmin from corresponding organization. One problem I noticed in java-sdk is that the EventHub connection uses the current user context. I raised the issue FAB-6101 and will put the fix code soon.
rickr (Mon, 11 Sep 2017 16:11:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Tyaoopc8HfJtxYNq5) UpdateChannelIT.java ?
rickr (Mon, 11 Sep 2017 16:14:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=7BAzzxo9JsMAjWqyC) No
rickr (Mon, 11 Sep 2017 16:16:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bYd5xeNm83wwS2hbz) There is only one version and it's obsolete given the changes that occurred as the fabric matured.
rickr (Mon, 11 Sep 2017 16:19:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=TSgY2LBWZREwBgdtn) The integration suite can be run with TLS and in our verify builds it only run that way so I have to think it's working. More than like your not providing there right certs or the generated certs have wrong CN
rickr (Mon, 11 Sep 2017 16:34:11 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=WmDew6B5fmAmcYpay) You can only instantiate CC on your OWN organization's peers. Also, currently you can only register an event hub to listen that are your own. You can send proposals for endorsement to all peers in a channel even those NOT in your organization.
If you want to simulate this you will need create two clients, two channels. Set user context for each of the organizations on the separate clients. Join the peer that is on the client that user context matches add the other. Add an eventhub of the peer that is set for the organization the user context is on the client.
deepakvparmar (Tue, 12 Sep 2017 05:29:43 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Toth6kRQLE9XWnLuJ) @rickr : Thank You Rick.
ngeorge (Tue, 12 Sep 2017 06:52:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=HQsnukigeCMEdG9KA) @rickr Thank you.
ngeorge (Tue, 12 Sep 2017 06:52:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=HQsnukigeCMEdG9KA) @rickr Thank you. By mentioning two channels did you mean two different channels or two instances of the same channel with appropriate peers added to them (peers that is on the client that user context matches )?
CarlXK (Tue, 12 Sep 2017 08:49:13 GMT):
@rickr we add below code , it makes client & server connection stable
peerProperties.put("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls", new Object[]{true});
CarlXK (Tue, 12 Sep 2017 08:49:13 GMT):
@rickr we add below code , it makes client & server connection stable
peerProperties.put("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls", new Object[]{true});
imp
CarlXK (Tue, 12 Sep 2017 08:49:13 GMT):
@rickr we add below code , it improve the stability client & server connection
peerProperties.put("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls", new Object[]{true});
CarlXK (Tue, 12 Sep 2017 08:49:13 GMT):
@rickr we add below code , it improve the stability of client & server connection
peerProperties.put("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls", new Object[]{true});
ngeorge (Tue, 12 Sep 2017 09:31:51 GMT):
As per the document, "the initial instantiation applies to all peers in the channel". If we try instantiate a second time the error thrown by SDK is "chaincode exists", while the error message should have been something that says that the chaincode is already instantiated.
2017-09-11 13:10:39,666 ERROR Channel:2029 - Sending proposal to peer0.ABC failed because of: gRPC failure=Status{code=UNKNOWN, description=chaincode error (status: 500, message: chaincode exists example_cc), cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: chaincode error (status: 500, message: chaincode exists example_cc)
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2029)
at org.hyperledger.fabric.sdk.Channel.sendInstantiationProposal(Channel.java:1174)
at org.hyperledger.fabric.sdk.Channel.sendInstantiationProposal(Channel.java:1136)
....
Please correct me if I am wrong.
sajeevkhan (Tue, 12 Sep 2017 09:37:29 GMT):
Hi,
I am trying to fetch the complete details of a channel using JAVA SDK.
The channel is already created successfully with multiple peers joined already on it.
There are a couple of eventHubs added to the channel.
Later, I am trying to fetch the channels on the peer as follows
Set
sajeevkhan (Tue, 12 Sep 2017 09:39:32 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=4emGNrgYXPoTWbpio) @DeutscheBahn-BlockchainDev Were able to get the Channel Object. If yes, does it have the list of peers and evenhubs on the object.
deepakvparmar (Tue, 12 Sep 2017 09:49:04 GMT):
@rickr : Is there provision of mock services into fabric-sdk-java?
rickr (Tue, 12 Sep 2017 15:26:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ZMwWcp45ehi5Tyfpr) More like two instance of the same channel so yes.
rickr (Tue, 12 Sep 2017 15:27:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=7eDixWFvCR4paC4eG) I've noted this in the README.md and added it to the End2endIT.java -- Thanks!
rickr (Tue, 12 Sep 2017 15:29:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ci7vT8tYzHePgtLri) Not SDK generated errors. These are directly returned from the Fabric so you need to address in the #fabric channel.
rickr (Tue, 12 Sep 2017 15:31:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=YBJJz5a5tpFu7TMjF) Not sure what's being asked.
deepakvparmar (Wed, 13 Sep 2017 05:23:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=oWv5uFnqtEEC7uMME) @rickr : Thank You Rick. Actually, We have written java client using fabric-java-sdk to connect fabric network, for invoking/querying chaincode, now, We would like to write unit test cases for the same. As we would like to avoid using actual running fabric network in Unit Test Cases, We are trying to find if fabric-java-sdk is providing any mock services for the same.
sativ (Wed, 13 Sep 2017 07:55:14 GMT):
Hi guys,
I have a problem running End2EndIT on 2 machines.
My setup is: a VM where I have built Java SDK, and tested End2EndIT to run successfully.
Then I have a 2nd Linux system in the same network, where I can't use Maven.
I have copied _fabric-sdk-java.jar_ file from _target_ folde from a VM to the 2nd system. I have also downloaded and copied all 3rd party libraries as *.jar files and included them into the project
The goal - is to run End2EndIT by connecting it to the original VM that runs Fabric network using Docker.
Currently when I run it, I get the error below. Docker containers are running, and I can get the test running fine on a VM.
Could you please have a look and see where could the problem be? Struggling for several days already...
sativ (Wed, 13 Sep 2017 07:55:32 GMT):
Message Attachments
gxx (Wed, 13 Sep 2017 10:20:20 GMT):
Has joined the channel.
rickr (Wed, 13 Sep 2017 13:00:36 GMT):
Have your tried from the system running the client to use telnet to the system running the fabric ca ?
rickr (Wed, 13 Sep 2017 13:01:21 GMT):
Guessing firewalls blocking
rickr (Wed, 13 Sep 2017 13:19:03 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=icnvPcFnLxejSo4k2) We do some very simplistic mocking for exercising code for negative paths. Most coverage requires actual Fabric network, Integration tests.
Girish.GH (Wed, 13 Sep 2017 13:37:53 GMT):
Has joined the channel.
Girish.GH (Wed, 13 Sep 2017 13:47:47 GMT):
by using fabric-sdk-java client I am trying to invoke chaincode installed and instantiated in peers on my hyperledger fabric network setup locall in windows using docker images. I am able to invoke and query the chain code to the peer `peer0.org2.example.com`, but when I am trying the same to the peer `peer0.org2.example.com` getting the following error
```
2017-09-13 13:22:45,382 main ERROR Channel:2241 - Sending proposal to peer0.org2.example.com failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Channel closed while performing protocol negotiation, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2241)
at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:2155)
at org.hyperledger.fabric.sdk.Channel.sendTransactionProposal(Channel.java:2089)
at com.ibs.blockchain.client.utility.BlockChainUtility.sendProposal(BlockChainUtility.java:232)
at com.ibs.blockchain.client.utility.BlockChainUtility.createFlight(BlockChainUtility.java:80)
at com.ibs.blockchain.client.test.BCAPITest.main(BCAPITest.java:9)
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation
at io.grpc.Status.asRuntimeException(Status.java:526)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:427)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:419)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:60)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:493)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$500(ClientCallImpl.java:422)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:525)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:102)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```
while looking to the docker-compose.yaml the port mapping is like
```
peer0.org1.example.com
ports:
- 7051:7051
- 7053:7053
peer0.org2.example.com
ports:
- 8051:7051
- 8053:7053
```
it is working only with peer having the port same as tcp port(7051) but getting the above error with the peer having different port 8051. why?
Girish.GH (Wed, 13 Sep 2017 13:47:47 GMT):
by using fabric-sdk-java client I am trying to invoke chaincode installed and instantiated in peers on my hyperledger fabric network setup locall in windows using docker images. I am able to invoke and query the chain code to the peer `peer0.org1.example.com`, but when I am trying the same to the peer `peer0.org2.example.com` getting the following error
```
2017-09-13 13:22:45,382 main ERROR Channel:2241 - Sending proposal to peer0.org2.example.com failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Channel closed while performing protocol negotiation, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2241)
at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:2155)
at org.hyperledger.fabric.sdk.Channel.sendTransactionProposal(Channel.java:2089)
at com.ibs.blockchain.client.utility.BlockChainUtility.sendProposal(BlockChainUtility.java:232)
at com.ibs.blockchain.client.utility.BlockChainUtility.createFlight(BlockChainUtility.java:80)
at com.ibs.blockchain.client.test.BCAPITest.main(BCAPITest.java:9)
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation
at io.grpc.Status.asRuntimeException(Status.java:526)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:427)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:419)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:60)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:493)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$500(ClientCallImpl.java:422)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:525)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:102)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```
while looking to the docker-compose.yaml the port mapping is like
```
peer0.org1.example.com
ports:
- 7051:7051
- 7053:7053
peer0.org2.example.com
ports:
- 8051:7051
- 8053:7053
```
it is working only with peer having the port same as tcp port(7051) but getting the above error with the peer having different port 8051. why?
AnilOner (Thu, 14 Sep 2017 03:02:54 GMT):
Has joined the channel.
CallMain (Thu, 14 Sep 2017 06:41:46 GMT):
Has joined the channel.
jarvis26 (Thu, 14 Sep 2017 07:07:41 GMT):
Has joined the channel.
zhaochy (Fri, 15 Sep 2017 03:30:39 GMT):
hi guys, is anyone knows where the chaincode is stored after I successfully invoke the `client.installChaincode()` from sdk-node?
zhaochy (Fri, 15 Sep 2017 03:34:15 GMT):
some path at the target peer, I guess, can anyone explicate it ?
willenchou (Fri, 15 Sep 2017 08:27:46 GMT):
Has joined the channel.
willenchou (Fri, 15 Sep 2017 08:42:46 GMT):
in one node ,i user "EndToEndIT" create a channel named "foo",it work . how can i user the channel in other node with the java sdk. what is the steps.
szlaci1983 (Fri, 15 Sep 2017 10:37:04 GMT):
Hey, I just like to ask you guys about your approach of developing blockchain solutions.... are you guys using composer or writing the chaincode in GOlang?
rickr (Fri, 15 Sep 2017 13:06:15 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=QvXpPcpfQtokcusm8)
By node := another system ? Look at End2endAndBackAgainIT.java
sativ (Fri, 15 Sep 2017 14:12:34 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=uKy2a93H4GfddtBXp) @rickr Thanks, it was a firewall indeed
sativ (Fri, 15 Sep 2017 14:57:24 GMT):
hi guys, could you please have a look at the errors I'm getting while running End2EndIT from a remote system
sativ (Fri, 15 Sep 2017 14:57:34 GMT):
server side logs
sativ (Fri, 15 Sep 2017 14:58:04 GMT):
Message Attachments
sativ (Fri, 15 Sep 2017 14:58:33 GMT):
client's side log:
org.hyperledger.fabric_ca.sdk.exception.RegistrationException: Error while registering the user org.hyperledger.fabric.sdkintegration.SampleUser@4273cc8b url: http://130.119.126.220:7054 POST request to http://130.119.126.220:7054/api/v1/register failed request body {"id":"user2_0","type":"user","max_enrollments":0,"affiliation":"org1.department1","attrs":[]} with status code: 400. Response: {"success":false,"result":null,"errors":[{"code":400,"message":"Authorization failure"}],"messages":[]}
at org.hyperledger.fabric_ca.sdk.HFCAClient.register(HFCAClient.java:252)
at org.hyperledger.fabric.sdkintegration.End2endIT.setup(End2endIT.java:207)
at org.hyperledger.fabric.sdkintegration.is_test.main(is_test.java:14)
Caused by: java.lang.Exception: POST request to http://130.119.126.220:7054/api/v1/register failed request body {"id":"user2_0","type":"user","max_enrollments":0,"affiliation":"org1.department1","attrs":[]} with status code: 400. Response: {"success":false,"result":null,"errors":[{"code":400,"message":"Authorization failure"}],"messages":[]}
at org.hyperledger.fabric_ca.sdk.HFCAClient.httpPost(HFCAClient.java:721)
at org.hyperledger.fabric_ca.sdk.HFCAClient.register(HFCAClient.java:243)
... 2 more
Exception in thread "main" java.lang.AssertionError: Error while registering the user org.hyperledger.fabric.sdkintegration.SampleUser@4273cc8b url: http://130.119.126.220:7054 POST request to http://130.119.126.220:7054/api/v1/register failed request body {"id":"user2_0","type":"user","max_enrollments":0,"affiliation":"org1.department1","attrs":[]} with status code: 400. Response: {"success":false,"result":null,"errors":[{"code":400,"message":"Authorization failure"}],"messages":[]}
at org.junit.Assert.fail(Assert.java:88)
at org.hyperledger.fabric.sdkintegration.End2endIT.setup(End2endIT.java:250)
at org.hyperledger.fabric.sdkintegration.is_test.main(is_test.java:14)
szhman (Fri, 15 Sep 2017 17:11:09 GMT):
Has joined the channel.
willenchou (Sat, 16 Sep 2017 05:54:40 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=wWRQpMpJbzM9J9mfD) @rickr it means another system,it worked now,ths
willenchou (Sat, 16 Sep 2017 05:56:02 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=wWRQpMpJbzM9J9mfD) @rickr by the way ,is there any function 2 query chaincodeid on chains
willenchou (Sat, 16 Sep 2017 05:56:02 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=wWRQpMpJbzM9J9mfD) @rickr by the way ,is there any function 2 query chaincodeid on chains by txid
wanghhao (Sat, 16 Sep 2017 16:15:38 GMT):
Has joined the channel.
luke16 (Mon, 18 Sep 2017 01:23:22 GMT):
Has joined the channel.
CarlXK (Mon, 18 Sep 2017 02:26:43 GMT):
@rickr i see the code of HFClient.newChannel changed in master branch, channel object cached by name and only have one copy
but in some scenario, we need more channel objects, ex: build a channel for peer1/peer2/peer3/orderer1, build another channel for peer1/peer3/orderer1
and IMO, the sdk don't need to do the cache function things, cache need implemented by apps
```
public Channel newChannel(String name) throws InvalidArgumentException {
clientCheck();
if (Utils.isNullOrEmpty(name)) {
throw new InvalidArgumentException("Channel name can not be null or empty string.");
}
synchronized (channels) {
if (channels.containsKey(name)) {
throw new InvalidArgumentException(format("Channel by the name %s already exits", name));
}
logger.trace("Creating channel :" + name);
Channel newChannel = Channel.createNewInstance(name, this);
channels.put(name, newChannel);
return newChannel;
}
}
```
CarlXK (Mon, 18 Sep 2017 02:26:43 GMT):
@rickr i see the code of HFClient.newChannel changed in master branch, channel object cached in Map
CarlXK (Mon, 18 Sep 2017 02:26:43 GMT):
@rickr i see the code of HFClient.newChannel changed in master branch, channel object cached in Map
chenshiok (Mon, 18 Sep 2017 02:48:54 GMT):
Has joined the channel.
jarvis26 (Mon, 18 Sep 2017 06:00:38 GMT):
Hi..I am trying to do a sample using the java sdk using my own fabric network. I have my distributed network setup on remote machines. Any pointers on what changes are required to be made in what files. Thanks in advance.
rickr (Mon, 18 Sep 2017 13:06:24 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6NEmJXscxTtb8hnj8) There is no *caching*.
tsnyder (Mon, 18 Sep 2017 13:10:58 GMT):
Question on Managing Endorsements - If endorsement requests are sent out simultaneously (almost - meaning not serially) does the Java SDK respond for Endorsement on the minimal satisfaction / denial of the Endorsement per the Endorsement Policy or when all requests have been received or the timeout triggered?
tsnyder (Mon, 18 Sep 2017 13:14:01 GMT):
Example for question on Endorsement - if the Endorsement Policy is 2 out of 3, and 3 Proposals are sent out - would the SDK respond on receiving 2 successful Endorsements or would it wait until either the 3rd was received or the timeout period expired?
rickr (Mon, 18 Sep 2017 13:17:43 GMT):
The SDK does nothing with *enforcing* policies on endorsements.
pschnap (Mon, 18 Sep 2017 13:17:51 GMT):
What permissions do I need to setup/enable for a user to deploy chaincode from the SDK? I'm getting an error starting with the following: `Authorization for INSTALL has been denied`. I'm using the peer admin to deploy
rickr (Mon, 18 Sep 2017 13:21:55 GMT):
Peer admin should have that. I'm guessing it's not the peer admin or your hitting something else. "deploy" is rather ambiguous, are you installing or instantiating CC?
pschnap (Mon, 18 Sep 2017 13:29:00 GMT):
the error I'm getting is when I'm trying to install (though the code then tries to instantiate after that)
pschnap (Mon, 18 Sep 2017 13:29:30 GMT):
here's the full error message:
```
Authorization for INSTALL has been denied (error-Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]))
```
pschnap (Mon, 18 Sep 2017 13:29:44 GMT):
it's weird that it says it's not an admin because it is the admin user
pschnap (Mon, 18 Sep 2017 13:29:48 GMT):
@rickr ^
pschnap (Mon, 18 Sep 2017 13:31:43 GMT):
erm, I guess I don't know if it's the _peer_ admin, it's the admin user associated with the CA (which I assume is the peer admin)
rickr (Mon, 18 Sep 2017 13:35:36 GMT):
NOT :)
rickr (Mon, 18 Sep 2017 13:37:02 GMT):
Cryptogen produces the admin peers credentials (Certs and private keys) Seen End2endIT for what it uses as the peer admin.
rickr (Mon, 18 Sep 2017 13:37:02 GMT):
Cryptogen produces the admin peers credentials (Certs and private keys) See End2endIT for what it uses as the peer admin.
pschnap (Mon, 18 Sep 2017 13:38:29 GMT):
ok, I'll take a look at that in more depth -- it's what I was following already
pschnap (Mon, 18 Sep 2017 13:39:12 GMT):
but I do have to use the peer admin instead of the admin CA user, correct?
rickr (Mon, 18 Sep 2017 13:39:22 GMT):
To be honest admin was a bad choice for the CA .. it should probably have been named CA registrar
pschnap (Mon, 18 Sep 2017 13:39:38 GMT):
eh, hindsight
pschnap (Mon, 18 Sep 2017 13:44:29 GMT):
Aha, found it in End2endIT; thanks @rickr !
tsnyder (Mon, 18 Sep 2017 13:50:22 GMT):
@rickr - (The SDK does nothing with *enforcing* policies on endorsements.) - I interpret your response as - it waits for all Proposal Responses to return or the timeout.
rickr (Mon, 18 Sep 2017 14:36:55 GMT):
Sends endorsements to all peers in parallel. If one times out, It should have an error code 500 with an appropriate message. Other peer endorsements that were successful would be ok (200). It' up to the application to decide if that meets it's requirement.
waslleysouza (Mon, 18 Sep 2017 15:44:09 GMT):
Has joined the channel.
SandySun2000 (Tue, 19 Sep 2017 01:06:31 GMT):
I followed the JAVA-SDK readme file, but I have trouble to perform the following step: If `build/bin/configtxgen` tool is not present run `make configtxgen`. I want to customize channel.tx instead of using the pregenerated foo.tx and bar.tx. Do you have any successful experience to share with me? Thanks in the advance!
rickr (Tue, 19 Sep 2017 14:33:09 GMT):
http://hyperledger-fabric.readthedocs.io/en/latest/configtxgen.html
SandySun2000 (Tue, 19 Sep 2017 17:22:23 GMT):
@rickr I have problem to find "build/bin/configtxgen".
rickr (Tue, 19 Sep 2017 17:32:57 GMT):
If its not in fabric documentation ask in #fabric channel it's their tool. If it's not documented any where obvious open a JIRA against Fabric
SandySun2000 (Tue, 19 Sep 2017 17:59:22 GMT):
@rickr I didn't know configtxgen is fabric tool. I thought it is the JAVA-SDK tool. After I issued "make configtxgen" under fabric. It works. Thanks!
asaningmaxchain (Wed, 20 Sep 2017 06:47:57 GMT):
Has joined the channel.
asaningmaxchain (Wed, 20 Sep 2017 06:48:35 GMT):
@rickr i see the source code about the fabric-sdk-java,it use the async way to make transaction
asaningmaxchain (Wed, 20 Sep 2017 06:48:36 GMT):
?
bmalavan (Wed, 20 Sep 2017 07:02:53 GMT):
Hi, I have a scenario here.
My chaincode return 'shim.Error("some Data")' for a specific business logic. However, when I send proposal for this kind of transaction, it fails ( as expected ) and returning proposal response (failed). I am not able to get the `some Data` using `getMessage()` back using my Java SDK client. Meanwhile, if my response is `shim.Success ("some data in bytes")` I am able to get the Payload message.
Is this expected behaviour? I am using HLF v1.0
bmalavan (Wed, 20 Sep 2017 07:02:53 GMT):
Hi, I have a scenario here.
My chaincode return `shim.Error("some Data")` for a specific business logic. However, when I send proposal for this kind of transaction, it fails ( as expected ) and returning proposal response (failed). I am not able to get the `some Data` using `getMessage()` back using my Java SDK client. Meanwhile, if my response is `shim.Success ("some data in bytes")` I am able to get the Payload message.
Is this expected behaviour? I am using HLF v1.0
clempo (Wed, 20 Sep 2017 15:31:29 GMT):
@rickr, I believe the future sret leaks in Channel.sendTransaction(...) if communication with all the orderers fails, that's because sret is registered but no partner knows about it and therefore nothing can fire it
clempo (Wed, 20 Sep 2017 15:32:26 GMT):
The cleanup based on timeouts was removed a while ago
clempo (Wed, 20 Sep 2017 15:39:27 GMT):
@rickr, I believe the name of the method BlockInfo.getTransactionActionInfos() is wrong since it returns Iterable
rickr (Wed, 20 Sep 2017 15:42:16 GMT):
K best if you open JIRAs for this
rickr (Wed, 20 Sep 2017 15:42:23 GMT):
seperate ones please
clempo (Wed, 20 Sep 2017 15:45:54 GMT):
@rickr, I think there is a problem of types for TxNum between the method TransactionEnvelopeInfo.getTransactionActionInfo(int txNum) and Version.getTxNum() which returns long.
clempo (Wed, 20 Sep 2017 15:48:25 GMT):
Talking about Version, it contains a BlockNum and a TxNum, what happens if the block contains multiple Envelopes since there is no EnvelopeNum, does the transaction index keep counting between envelopes?
qingsongGuo (Thu, 21 Sep 2017 04:56:57 GMT):
Has joined the channel.
rrb01 (Thu, 21 Sep 2017 12:47:56 GMT):
How do I call one chaincode from another chaincode in HyperLedger Fabric Java SDK?
szoghybe (Thu, 21 Sep 2017 13:48:09 GMT):
# As described on page https://github.com/hyperledger/fabric-sdk-java
# I have done:
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-ca.git
cd fabric-ca
git reset --hard fabric-ca_commitlevel from above
cd ../fabric
git reset --hard fabric_commitlevel from above
cd devenv
change the Vagrant file as suggested below:
vagrant up
vagrant ssh
make docker
cd ../fabric-ca
make docker
cd ../fabric/sdkintegration
docker-compose down; rm -rf /var/hyperledger/*; docker-compose up --force-recreate
# and I have a fabric running in a terminal
# Now I open a new Cygwin terminal:
cd /cygdrive/c/gocode/fabric_1.0.2/fabric/devenv
vagrant ssh
cd /vagrant/fabric-sdk-java
mvn install
# build shim-client-1.0.jar
cd /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/java
gradle build
cd /opt/gopath/src/github.com/hyperledger/fabric/sdkintegration/javacc/example_cc
gradle -b build.gradle build
# add in pom.xml:
szoghybe (Thu, 21 Sep 2017 13:48:43 GMT):
Any help appreciated.
szoghybe (Thu, 21 Sep 2017 13:52:24 GMT):
ubuntu@hyperledger-devenv:5fb31dd:/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration$ echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64
ubuntu@hyperledger-devenv:5fb31dd:/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
ubuntu@hyperledger-devenv:5fb31dd:/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration$ mvn -version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-77-generic", arch: "amd64", family: "unix"
ubuntu@hyperledger-devenv:5fb31dd:/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration$
szoghybe (Thu, 21 Sep 2017 13:55:22 GMT):
When I run
szoghybe (Thu, 21 Sep 2017 13:55:25 GMT):
cd /vagrant/fabric-sdk-java
mvn install
szoghybe (Thu, 21 Sep 2017 13:55:40 GMT):
I do get the following listing in the fabric terminal:
szoghybe (Thu, 21 Sep 2017 13:55:54 GMT):
peer0.org1.example.com | 2017-09-21 13:56:57.747 UTC [endorser] ProcessProposal -> DEBU 1a6 Entry
peer0.org1.example.com | 2017-09-21 13:56:57.747 UTC [protoutils] ValidateProposalMessage -> DEBU 1a7 ValidateProposalMessage starts for signed proposal 0xc4202bb680
peer0.org1.example.com | 2017-09-21 13:56:57.747 UTC [endorser] ProcessProposal -> DEBU 1a8 Exit
szoghybe (Thu, 21 Sep 2017 13:56:10 GMT):
I was hoping for somthing more involved (?)
FengChen_1982 (Mon, 25 Sep 2017 03:02:32 GMT):
Has left the channel.
bmalavan (Mon, 25 Sep 2017 06:53:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=mpQtMFMZidfCDLZ2L) @rickr Any idea?
ikset (Mon, 25 Sep 2017 12:16:52 GMT):
Has joined the channel.
ikset (Mon, 25 Sep 2017 12:53:57 GMT):
Vadim composer manager sloman
ikset (Mon, 25 Sep 2017 12:55:18 GMT):
```vendor.1b9a8f4ada7a594aad5a.bundle.js:1 ERROR TypeError: Cannot read property 'orderers' of undefined
at e._next (6.fddb24b2dc6b6087258d.chunk.js:1)
at e.T14+.e.__tryOrSetError (vendor.1b9a8f4ada7a594aad5a.bundle.js:1)
at e.T14+.e.next (vendor.1b9a8f4ada7a594aad5a.bundle.js:1)
at e.T14+.e._next (vendor.1b9a8f4ada7a594aad5a.bundle.js:1)
at e.T14+.e.next (vendor.1b9a8f4ada7a594aad5a.bundle.js:1)
at e._next (vendor.1b9a8f4ada7a594aad5a.bundle.js:1)
at e.T14+.e.next (vendor.1b9a8f4ada7a594aad5a.bundle.js:1)
at e._next (vendor.1b9a8f4ada7a594aad5a.bundle.js:1)
at e.T14+.e.next (vendor.1b9a8f4ada7a594aad5a.bundle.js:1)
at e._subscribe (vendor.1b9a8f4ada7a594aad5a.bundle.js:1)```
rickr (Mon, 25 Sep 2017 13:47:10 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=mfCBoy7fPSinQ8qYC) Best asked on #chaincode-dev
rickr (Mon, 25 Sep 2017 13:48:19 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=2QiGoSf95GvzKRSpz) Follow the readme.md on how to run integration tests. BTW there is no need for vagrant if your OS can support the docker
rickr (Mon, 25 Sep 2017 13:51:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Aj46iWp58GyBaeHgP) I'm not sure on the error case how to get that data if it does not come back the same way as on success. Best asked if it can be gotten to on the #fabric channel
rickr (Mon, 25 Sep 2017 13:57:10 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=DCrmv7rZPozxFQmsq) They're not related.
clempo (Mon, 25 Sep 2017 16:26:29 GMT):
I disagree they are unrelated. If I want to query the actual value of a key mentioned in a ReadSet, I have to find the WriteSet pointed by the TxNum. This may never happen in practice, but technically, a TxNum can point to a transaction that cannot be extracted from a BlockInfo except by a very inefficient iterator. This may never be fixed but being aware of it may avoid future similar mistakes. Too many of those and your API will feel clunky.
clempo (Mon, 25 Sep 2017 16:30:11 GMT):
Another example of inconsistent naming is the singular or plural for the get accessor in a collection. For example BlockInfo.getEnvelopeInfo(int) versus KVRWSet.getWrites(int). I almost logged a Jira for this until I realized the KVRWSet class is probably automatically generated. Plural in that context feels unnatural.
clempo (Mon, 25 Sep 2017 16:31:18 GMT):
@rickr, can you comment about the multiple envelopes in a block, what is the official definition of TxNum in that case? [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=DCrmv7rZPozxFQmsq)
clempo (Mon, 25 Sep 2017 16:31:18 GMT):
@rickr, can you comment about the multiple envelopes in a block, what is the official definition of TxNum in that case? [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=2wMzYABo7Mzo3a5jR)
rickr (Mon, 25 Sep 2017 16:34:26 GMT):
Every transaction may have more than one action it's just not used today. getTransactionActionInfo is just an index into that
clempo (Mon, 25 Sep 2017 16:35:28 GMT):
fine, but the question also applies one layer above with multiple envelopes
clempo (Mon, 25 Sep 2017 16:35:46 GMT):
did you write one action when you meant one envelope?
rickr (Mon, 25 Sep 2017 17:04:29 GMT):
Look at End2endIT.java blockWalker shows going through the blocks. Each block gets Envelopes by looping through `returnedBlock.getEnvelopeInfos()`
Special handling for Transaction type envelope goes through individual actions (today only one ) with an iterator `getTransactionActionInfos`
Which returns a `BlockInfo.TransactionEnvelopeInfo.TransactionActionInfo` for each iteration.
I'm not sure what's `klunky` about that. It _massively simplifies_ what's going on in the protobuf definition if it were left to user to decipher.
clempo (Mon, 25 Sep 2017 17:58:59 GMT):
You misunderstood my point. What can become clunky is the naming convention within the API.
clempo (Mon, 25 Sep 2017 18:00:58 GMT):
I understand how to navigate the BlockInfo and below. My question is how come there is no EnvelopeNum in the key Version. That can only be explained by extra semantics of the TxNum or some external limitation that is not reflected in the API. What is the semantics of TxNum?
clempo (Mon, 25 Sep 2017 18:00:58 GMT):
I understand how to navigate the BlockInfo and below. My question is how come there is no EnvelopeNum in the key Version. That can only be explained by extra semantics of the TxNum or some external limitation that is not reflected in the API. What is the semantics of TxNum in the presence of multiple envelopes within one BlockInfo?
pschnap (Mon, 25 Sep 2017 19:32:26 GMT):
Are chaincode events still a thing and does the Java SDK support them?
pschnap (Mon, 25 Sep 2017 19:43:51 GMT):
hm, seems there's an interface for them as of Aug 2017 but according to the node sdk documentation only Block events are emitted currently
rickr (Mon, 25 Sep 2017 20:30:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bz9uyweNSXt4mitRY) The Version is only on the the readset which has what was read getBlockNum is the block number and getTxNum is the index of the envelope in the block which you can get via getEnvelopeInfo
I think the protos where changed for long to int some time.
clempo (Mon, 25 Sep 2017 20:33:36 GMT):
Oh that's interesting. So you claim the TxNum is the envelope number and the envelope contains only one transactionAction even though the data structure says it's a collection?
rickr (Mon, 25 Sep 2017 20:35:34 GMT):
Today it's only one
rickr (Mon, 25 Sep 2017 20:35:34 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=LXYgKaykeMt8dGAwD)
Example of this in End2endIT.java look for registerChaincodeEventListener
pschnap (Mon, 25 Sep 2017 21:11:55 GMT):
Thanks @rickr !
chaitanya (Tue, 26 Sep 2017 16:08:24 GMT):
Hi everyone, lately I've been getting the following error:
```org.hyperledger.fabric.sdk.exception.ProposalException: Not enough endorsers for invoke AddRequest :500 endorser error:Sending proposal to peer0.org1.example.com failed because of gRPC failure=Status{code=UNKNOWN, description=chaincode error (status: 500, message: Failure in invoking contentList chaincode. Got error: ), cause=null}. Was verified:false
```
The desired chaincode container for the chaincode name is up and had never gone down, ever since the network was brought up. Any idea what causes this error?
szoghybe (Tue, 26 Sep 2017 19:57:34 GMT):
New blog post: Building the Hyperledger Fabric VM and Docker Images version 1.0.2 from scratch, then running the fabric-java-sdk version 1.0.1 end to end test against it https://bertrandszoghy.wordpress.com/2017/09/26/building-the-hyperledger-fabric-vm-and-docker-images-version-1-0-2-from-scratch-then-running-the-fabric-java-sdk-version-1-0-1-end-to-end-test/
clempo (Tue, 26 Sep 2017 20:52:38 GMT):
@rickr, unRegisterBlockListener() and unRegisterChaincodeEventListener() should be called unregisterBlockListener() and unregisterChaincodeEventListener() with a small r for register
clempo (Tue, 26 Sep 2017 20:52:43 GMT):
do you need me to create a Jira?
clempo (Tue, 26 Sep 2017 20:53:14 GMT):
These methods don't exist in v1.0.1 so we can still easily rename them
clempo (Tue, 26 Sep 2017 20:56:14 GMT):
https://github.com/hyperledger/fabric-sdk-java does not list the v1.0.2 release, is that a bug of the mirror site?
rickr (Tue, 26 Sep 2017 23:48:04 GMT):
Best open a JIRA and a patch
rickr (Tue, 26 Sep 2017 23:48:46 GMT):
There was no v1.0.2
mdanaci (Wed, 27 Sep 2017 13:31:36 GMT):
Has joined the channel.
mdanaci (Wed, 27 Sep 2017 13:41:21 GMT):
Hello everyone, I'm trying to run my old chaincode (v0.6) with the new one (v1.1). I'm trying to run End2endIT.java test
I changed the both example_cc.go in text/fixture/sdkintegration with my old chaincode.
I'm running docker-compose up -d --force-recreate and running End2endIT.java
My chaincode successfully deploys to peers. But when i try to send transaction proposal with the *new String[] {"myDummyMethod", "a", "b", "100"}*
I'm getting error`Caused by: io.grpc.StatusRuntimeException: UNKNOWN: chaincode error (status: 500, message: Unknown action, check the first argument, must be one of 'delete', 'query', or 'move')
`
My chaincode has an invoke method like this. I dont have move delete query methods back in version 0.6
```
func (t *ChaincodeMain) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
if function == "init-member" {
return t.init_member(stub, args)
} else if function == "transfer-credit" {
return t.transfer_credit(stub, args)
}
...
```
mdanaci (Wed, 27 Sep 2017 13:41:21 GMT):
Hello everyone, I'm trying to run my old chaincode (v0.6) with the new one (v1.1). I'm trying to run End2endIT.java test
I changed the both example_cc.go in text/fixture/sdkintegration with my old chaincode.
I'm running docker-compose up -d --force-recreate and running End2endIT.java
My chaincode successfully deploys to peers. But when i try to send transaction proposal with the *new String[] {"init-member", "a", "b", "100"}*
I'm getting error`Caused by: io.grpc.StatusRuntimeException: UNKNOWN: chaincode error (status: 500, message: Unknown action, check the first argument, must be one of 'delete', 'query', or 'move')
`
My chaincode has an invoke method like this. I dont have move delete query methods back in version 0.6
```
func (t *ChaincodeMain) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
if function == "init-member" {
return t.init_member(stub, args)
} else if function == "transfer-credit" {
return t.transfer_credit(stub, args)
}
...
```
mdanaci (Wed, 27 Sep 2017 13:41:21 GMT):
Hello everyone, I'm trying to run my old chaincode (v0.6) with the new one (v1.1). I'm trying to run End2endIT.java test
I changed the both example_cc.go in text/fixture/sdkintegration with my old chaincode.
I'm running docker-compose up -d --force-recreate and running End2endIT.java
My chaincode successfully deploys to peers. But when i try to send transaction proposal with the *new String[] {"init-member", "a", "b", "100"}*
I'm getting error`Caused by: io.grpc.StatusRuntimeException: UNKNOWN: chaincode error (status: 500, message: Unknown action, check the first argument, must be one of 'delete', 'query', or 'move')`
My chaincode has an invoke method like this. I dont have move delete query methods back in version 0.6
```
func (t *ChaincodeMain) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
if function == "init-member" {
return t.init_member(stub, args)
} else if function == "transfer-credit" {
return t.transfer_credit(stub, args)
}
...
```
mdanaci (Wed, 27 Sep 2017 13:41:21 GMT):
Hello everyone, I'm trying to run my old chaincode (v0.6) with the new one (v1.1). I'm trying to run End2endIT.java test
I changed the both example_cc.go in text/fixture/sdkintegration with my old chaincode.
I'm running docker-compose up -d --force-recreate and running End2endIT.java
My chaincode successfully deploys to peers. But when i try to send transaction proposal with the *new String[] {"init-member", "a", "b", "100"}*
I'm getting error _Caused by: io.grpc.StatusRuntimeException: UNKNOWN: chaincode error (status: 500, message: Unknown action, check the first argument, must be one of 'delete', 'query', or 'move')_
My chaincode has an invoke method like this. I dont have move delete query methods back in version 0.6
```
func (t *ChaincodeMain) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
if function == "init-member" {
return t.init_member(stub, args)
} else if function == "transfer-credit" {
return t.transfer_credit(stub, args)
}
...
```
rickr (Wed, 27 Sep 2017 14:01:03 GMT):
Best to take that to #chaincode-dev
szoghybe (Wed, 27 Sep 2017 14:15:55 GMT):
@rickr Hello, is there a design doc for fabric-java-sdk explaining the Java code is building the Go code?
clempo (Wed, 27 Sep 2017 14:28:14 GMT):
@mdanaci, I had similar behavior, I solved it by running "./fabric.sh restart" which does a little extra clean up before restarting
clempo (Wed, 27 Sep 2017 14:32:00 GMT):
@szoghybe, fabric-java-sdk does not generate go code, it talks to the Fabric network through grpc. Maybe you want to write chaincode in Java, this is entirely different and is not yet supported in v1.0
mdanaci (Wed, 27 Sep 2017 14:34:38 GMT):
@clempo it worked! Thanks.
szoghybe (Wed, 27 Sep 2017 14:35:12 GMT):
Hello, no I don't want to code chaincode in Java. I was trying to understand /**
* Chaincode builder
*
* @return ChaincodeID builder.
*/ in ChaincodeID.java
szoghybe (Wed, 27 Sep 2017 14:35:41 GMT):
Is there a high-level design doc that explains? Thanks.
clempo (Wed, 27 Sep 2017 14:49:49 GMT):
@szoghybe, a builder is a object oriented pattern to replace a constructor with multiple set accessors, one accessor per constructor argument. That builder creates a ChaincodeID which is just a moniker.
gauthampamu (Thu, 28 Sep 2017 14:57:15 GMT):
https://chat.hyperledger.org/channel/fabric-questions?msg=rhyG2zt7QHQY4K3jM
SandySun2000 (Thu, 28 Sep 2017 22:47:03 GMT):
I saw the following error when I try to use java sdk client to create a channel to bluemix network. Any clue what was wrong? Where should I take a look to debug the problem?
[33m2017-09-28 22:41:23.187 UTC [orderer/common/broadcast] Handle -> WARN 01a[0m Rejecting CONFIG_UPDATE because: Error authorizing update: Error validating DeltaSet: Policy for [Groups] /Channel/Application not satisfied: Failed to reach implicit threshold of 1 sub-policies, required 1 remaining
SandySun2000 (Thu, 28 Sep 2017 22:50:31 GMT):
I found the similar issue: https://jira.hyperledger.org/browse/FAB-3436. But I didn't see the solution
jimthematrix (Fri, 29 Sep 2017 02:36:16 GMT):
@SwatiRaj thanks for submitting the CR for balance transfer with Java SDK, please see my comment to https://gerrit.hyperledger.org/r/#/c/13927/
SwatiRaj (Fri, 29 Sep 2017 02:36:16 GMT):
Has joined the channel.
jimthematrix (Fri, 29 Sep 2017 02:36:20 GMT):
let me know if you have any questions
SwatiRaj (Fri, 29 Sep 2017 06:33:27 GMT):
@jimthematrix , Hi Jim , I mailed you regarding the same on your hotmail ID , can you please check and help . Thanks
mastersingh24 (Sat, 30 Sep 2017 10:09:11 GMT):
(https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ekiS844WAYmxEX9te) @SandySun2000
glotov (Sun, 01 Oct 2017 09:41:01 GMT):
Has joined the channel.
epm2wi (Sun, 01 Oct 2017 10:13:56 GMT):
Has joined the channel.
glotov (Mon, 02 Oct 2017 07:34:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=87e7p9pa3nK2ppueu) @rickr is it possible to run java chaincodes with fabric-sdk-java? it has `src/test/fixture/sdkintegration/javacc/example_cc/`, but how to run it?
glotov (Mon, 02 Oct 2017 07:34:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=87e7p9pa3nK2ppueu) Hello all! Is it possible to run java chaincodes with fabric-sdk-java now? it has `src/test/fixture/sdkintegration/javacc/example_cc/`, but how to run it?
clempo (Mon, 02 Oct 2017 20:59:21 GMT):
@glotov WIP = Work In Progress
asharora78 (Tue, 03 Oct 2017 06:02:03 GMT):
Has joined the channel.
ascatox (Tue, 03 Oct 2017 06:11:51 GMT):
Hi All! Is it possible via Java SDK to send an Upgrade Proposal like in Node SDK `sendUpgradeProposal(request, timeout)``
ngeorge (Tue, 03 Oct 2017 07:46:40 GMT):
Hi All, I am getting the below exception while reading the private key of admin(to set the user context).
java.lang.SecurityException: class "org.bouncycastle.asn1.pkcs.RSAPublicKey"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:898)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668)
at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Has anyone faced the same?
ascatox (Tue, 03 Oct 2017 10:43:38 GMT):
Hi All! I'm facing this problem when I try to instantiate my chaincode the CompletableFuture.get() never finish and is stopped by the timeout. Someone else is facing these problems?
ascatox (Tue, 03 Oct 2017 10:43:38 GMT):
Hi All! I'm facing this problem when I try to instantiate my chaincode the CompletableFuture.get() never finish and is stopped by the timeout. Someone else is facing these problems?
glotov (Tue, 03 Oct 2017 12:30:28 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=SEuKrdaiCov5HrxaQ) @clempo Thank you, I just mean that half a year has passed since @rickr message about WIP and I hope there may be some progress in making Java chaincodes work. Is there?
glotov (Tue, 03 Oct 2017 12:30:28 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=SEuKrdaiCov5HrxaQ) @clempo Thank you, I just mean that 4 month have passed since @rickr message about WIP and I hope there may be some progress in making Java chaincodes work. Is there?
rickr (Tue, 03 Oct 2017 14:22:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=5H86WhsZbzZeHkk26) org/hyperledger/fabric/sdkintegration/UpdateChannelIT.java ?
rickr (Tue, 03 Oct 2017 14:23:55 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Efx8itLxLuPfGrRTj) End2endIT are working must be unique to your situation. Make sure you have eventhubs running and check associated peer for the transaction being sent out to eventhubs
stacie (Tue, 03 Oct 2017 15:06:09 GMT):
Has joined the channel.
clempo (Tue, 03 Oct 2017 18:45:43 GMT):
@ngeorge, you probably have two versions of bouncy castle in your path. Don't forget to check the lib/ext folder in the JRE.
KevinLeyssens (Wed, 04 Oct 2017 10:48:15 GMT):
Has joined the channel.
deva-madala (Wed, 04 Oct 2017 11:18:32 GMT):
Has joined the channel.
ngeorge (Thu, 05 Oct 2017 13:01:19 GMT):
I have certain import statements in the chaincode and those are from a different folder. But while I try to instantiate using the Java sdk, it says 'cannot find package..'. I have placed the folder also along with the chaincode in the source directory(local system from where installation is done) while installing and instantiating the chaincode using the sdk. How do we send the packages along with the chaincode for installation/instantiation?
clempo (Thu, 05 Oct 2017 13:19:36 GMT):
@ngeorge, the fabric-sdk-java readme says: Go lang chaincode dependencies must be contained in vendor folder. For an explanation of this see Vendor folder explanation https://blog.gopheracademy.com/advent-2015/vendor-folder/
ngeorge (Thu, 05 Oct 2017 13:21:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=mFM8yHdGbzirj96PX) @clempo Thanks..
And where is this vendor folder located when we just are running the docker images and deployment is triggered from a java program remotely ?
clempo (Thu, 05 Oct 2017 13:23:55 GMT):
Sorry, never tried it. Please read the doc at the link and tell us what you find.
ngeorge (Thu, 05 Oct 2017 13:24:06 GMT):
:).
SudhiBhat (Thu, 05 Oct 2017 16:28:13 GMT):
Has joined the channel.
SudhiBhat (Thu, 05 Oct 2017 16:30:19 GMT):
Hello,
SudhiBhat (Thu, 05 Oct 2017 16:31:45 GMT):
Maybe a naive question. I am trying to use the java SDK to make transaction proposals on an already running blockchain network. What user/certificate do I set in the context. Should I get the certificate details from the fabric-ca or is there any other way?
clempo (Thu, 05 Oct 2017 17:08:33 GMT):
@SudhiBhat, look at the samples End2endIT and End2endAndBackAgainIT. They show a SampleStore for users. In practice, you will likely need to implement your own User and Enrollment classes. If you call fabric-ca programatically , registering a user creates it, and (re)enrolling the user creates a cert and private key. You can also load the cert and private key from the files generated by the fabric-ca client command line tool. There is an example of that in End2endIT when it creates the peerOrgAdmin.
SudhiBhat (Thu, 05 Oct 2017 17:11:37 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ceH5iE7EmE5GGrusX) @clempo Thanks a lot for the hints! I will take a look at this... Just started to implement the User interface and also stumbled on the fabric-ca's REST APIs documented in http://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html#overview Stuck in the maze right now...
clempo (Thu, 05 Oct 2017 17:12:33 GMT):
That's and old doc, the REST API is dead in v1.0
clempo (Thu, 05 Oct 2017 17:12:33 GMT):
That's an old doc, the REST API is dead in v1.0
clempo (Thu, 05 Oct 2017 17:14:14 GMT):
maybe fabric-ca still supports it, but I would use the java sdk instead
SudhiBhat (Thu, 05 Oct 2017 17:14:35 GMT):
Damn... just when you thought you had something!
SudhiBhat (Thu, 05 Oct 2017 17:14:39 GMT):
:)
clempo (Thu, 05 Oct 2017 17:15:28 GMT):
Like I said, I'm not sure what fabric-ca supports, but you certainly can't call a peer with the REST API anymore.
SudhiBhat (Thu, 05 Oct 2017 17:21:03 GMT):
Can you comment on this https://github.com/ratnakar-asara/FabricJavaSample
clempo (Thu, 05 Oct 2017 17:23:08 GMT):
This code is v1.0-SNAPSHOT, it will not compile with v1.0
clempo (Thu, 05 Oct 2017 17:23:35 GMT):
Why don't you go to official End2endIT which is properly maintained in sync with the release
clempo (Thu, 05 Oct 2017 17:23:35 GMT):
Why don't you go to the official End2endIT which is properly maintained in sync with the release
SudhiBhat (Thu, 05 Oct 2017 17:25:08 GMT):
Thanks for the heads up. Will refer only to the https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java
ngeorge (Fri, 06 Oct 2017 06:17:26 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=uSFdHoiZM73NHJNaq) @clempo That worked.. Thanks.. I copied the dependent packages into a folder named vendor and placed it in the chaincode folder(along with the chaincode)..
SudhiBhat (Fri, 06 Oct 2017 16:35:04 GMT):
Hello, Was looking at the End2endIT sample and in the TestConfig class where the org configurations are read there is a switch from http to https and grpc to grpcs. In these cases it is expected to have the public key stored as a property in the org ca properties. It is a public key hence not a problem to have it but how to get this when our network is running example in a AWS EC2 instance and the SDK is consumed in another application. This application will not have access to the cypto config folder?
SudhiBhat (Fri, 06 Oct 2017 16:35:04 GMT):
Hello, Was looking at the End2endIT sample and in the TestConfig class where the org configurations are read there is a switch from http to https and grpc to grpcs. In these cases it is expected to have the public key stored as a property in the org ca properties. It is a public key hence not a problem to have it but how to get this when our network is running in a AWS EC2 instance and the SDK is consumed in another application. This application will not have access to the cypto config folder?
sonnykui (Fri, 06 Oct 2017 23:45:00 GMT):
Has joined the channel.
SudhiBhat (Sat, 07 Oct 2017 13:30:56 GMT):
I am planning to consume the SDK in a Spring Boot application which will make calls to the network which is already running in AWS EC2. In the SDK is it always necessary to create the channel and have the peers join the network always? The channel and the network will always be running. Is there a way that I can just tell the SDK to use a channel?
SudhiBhat (Sun, 08 Oct 2017 10:51:03 GMT):
When I try to instantiate the HFCAClient the config class tries to load the config.properties and for this it tries to get the System property "user.dir". In the case of spring application this is not guaranteed. What would be the best way to solve this? Currently this gives a null pointer exception while getting the HFCAClient instance.
Hundredwz (Mon, 09 Oct 2017 01:39:52 GMT):
Has joined the channel.
Hundredwz (Mon, 09 Oct 2017 03:03:15 GMT):
I am learning to use fabric-sdk-java,when i type `docker-compose up -d --force-recreate` cmd in `sdkintegration` folder,I always get the error```ERROR: for configtxlator Cannot start service configtxlator: oci runtime error: container_linux.go:262: starting container process caused "exec: \"/usr/local/bin/configtxlator\": stat /usr/local/bin/configtxlator: no such file or directory"``` even if I exec the ```export ORG_HYPERLEDGER_FABRIC_SDKTEST_VERSION="1.0.0"
``` cmd.Could any one give me some suggestions?
Hundredwz (Mon, 09 Oct 2017 03:04:02 GMT):
I am learning to use fabric-sdk-java,when i type `docker-compose up -d --force-recreate` cmd in `sdkintegration` folder,I always get the error ```ERROR: for configtxlator Cannot start service configtxlator: oci runtime error: container_linux.go:262: starting container process caused "exec: \"/usr/local/bin/configtxlator\": stat /usr/local/bin/configtxlator: no such file or directory"``` even if I exec the
Hundredwz (Mon, 09 Oct 2017 03:04:40 GMT):
```export ORG_HYPERLEDGER_FABRIC_SDKTEST_VERSION="1.0.0"``` could any one offer some suggestions?
AlexMeng (Mon, 09 Oct 2017 10:11:43 GMT):
Has joined the channel.
sgdev (Mon, 09 Oct 2017 16:53:36 GMT):
Has joined the channel.
SudhiBhat (Mon, 09 Oct 2017 18:28:14 GMT):
When I try to register and enroll a peer I get an error "url: https://localhost:7054 Remote host closed connection during handshake" What could be the probable reasons?
SudhiBhat (Mon, 09 Oct 2017 18:28:14 GMT):
When I try to register and enroll an user in a peer I get an error "url: https://localhost:7054 Remote host closed connection during handshake" What could be the probable reasons?
koalakeeper (Tue, 10 Oct 2017 05:50:26 GMT):
Has joined the channel.
sunhwei (Tue, 10 Oct 2017 07:04:09 GMT):
Has joined the channel.
rajasekharpippalla (Tue, 10 Oct 2017 10:02:50 GMT):
Has joined the channel.
chaitanya (Tue, 10 Oct 2017 10:30:57 GMT):
Hi, I'm getting the following error on running invokes against Fabric v1,
```
"exception":"org.hyperledger.fabric.sdk.exception.TransactionException","message":"Bad last configuation block type 3, expected 1"}
```
Could someone help me with what could be the problem here?
chaitanya (Tue, 10 Oct 2017 10:30:57 GMT):
Hi, I'm getting the following error on running invokes against Fabric v1,
```
"exception":"org.hyperledger.fabric.sdk.exception.TransactionException","message":"Bad last configuation block type 3, expected 1"}
```
Could someone help me with what could be the problem here?
mdanaci (Tue, 10 Oct 2017 12:55:23 GMT):
Hello,
I'm getting error while i retry to run End2endAndBackAgainIT test.
1. I`m running ./fabric.sh with restart.
2. I`m running End2endIT test, it works ok.
3. If i run End2endIT test again, i got the following exception
```
Caused by: java.lang.Exception: POST request to http://localhost:7054/api/v1/register failed request body {"id":"user1","type":"user","max_enrollments":0,"affiliation":"org1.department1","attrs":[]} with status code: 500. Response: {"success":false,"result":null,"errors":[{"code":0,"message":"Identity 'user1' is already registered"}],"messages":[]}
```
4. if i run End2endAndBackAgainIT, i got the following exception
```
RUNNING: End2endAndBackAgainIT
Reconstructing foo channel
org.hyperledger.fabric.sdk.exception.InvalidArgumentException: UserContext for user peerOrg1Admin has no enrollment set.
at org.hyperledger.fabric.sdk.User.userContextCheck(User.java:84)
at org.hyperledger.fabric.sdk.HFClient.setUserContext(HFClient.java:365)
at org.hyperledger.fabric.sdkintegration.End2endAndBackAgainIT.reconstructChannel(End2endAndBackAgainIT.java:475)
at org.hyperledger.fabric.sdkintegration.End2endAndBackAgainIT.setup(End2endAndBackAgainIT.java:170)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
```
My first question : How can i run tests without fabric.sh restart? (I want to run these test on already running container)
Second : What is the difference between End2endIt.java and End2endAndBackAgainIT.java
Third : Do i need to setup users, construct channel every method invocation? I implemented my smart contract it works fine but i don't understand this fabric-sdk-java. v0.6 was much more easier.
Thank you.
rickr (Tue, 10 Oct 2017 13:42:57 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Foo5WFauaswLxDwcR) That's what this application/sample does. Your application can store it anywhere that it seems suitable for your needs.
rickr (Tue, 10 Oct 2017 13:43:54 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=76yNSdKhQs54HqokX) End2endAndBackAgainIT.java ?
rickr (Tue, 10 Oct 2017 13:47:26 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8CPPbvQ5i5uNY5jqQ) Seems your running a mix-match of sdk >1.0 with docker images from fabric 1.0 is my best guess
rickr (Tue, 10 Oct 2017 13:55:59 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ND5zhEvat4pFWcumh) Can you telnet to localhost 7054 ?
rickr (Tue, 10 Oct 2017 14:01:50 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=7oxcygCyw58qAzig3) Running all the integration tests requires a clean restart. End2endIt.java construct the channel and joins the peers. That would need to be done only once. As the name hints and End2endAndBackAgainIT.java _reconstructs_ the channel so it _can be used again_ and starts of the test validating previous end2endIt.java.
lmars (Tue, 10 Oct 2017 14:02:04 GMT):
Has joined the channel.
SudhiBhat (Tue, 10 Oct 2017 14:06:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8YqoDhZyagpEMPNFD) @rickr Hello, I have my own docker-compose file which spins a three peer org with one orderer. I copied the files from the fabric-samples/first-network and modified the files. Surprisingly this does not spin a fabric-ca image. I would assume this is important as the port 7054 is bound to the ca server. May be this is the reason why it is not connecting. When I enroll a user it tries to connect to the ca server to generate the certificates for the user right? Sorry for the basic questions... but trying to settle in...
SudhiBhat (Tue, 10 Oct 2017 18:32:23 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8YqoDhZyagpEMPNFD) @rickr Yes the problem was the Fabric - CA docker image was not available. I am now facing a different issue. When I enroll a user using the HFCAClient.enroll(String user, String secret) and I pass the basic credentials I would assume the CA will generate the certificates and give back the Enrollment object. This step fails by giving the error "Failed to enroll user" and if I go to the logs of the docker image it has the error "Unknown Certificate". The exception raised in the SDK is Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. "PKIX path building failed"
ConstC (Wed, 11 Oct 2017 03:06:00 GMT):
Has joined the channel.
MoulaliMvg (Wed, 11 Oct 2017 06:23:26 GMT):
Hi can anyone know when Balance transfer application using Fabric_java_sdk is going to release
Hundredwz (Wed, 11 Oct 2017 07:38:35 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RiwE6yGXSvQdaiNMr) @rickr yeah.what i used are mixed.When I pull the images v1.0.1 ,it all works.Thank you
tallharish (Wed, 11 Oct 2017 08:49:55 GMT):
My client is timing out when sending the transaction to the orderer, `channel.sendTransaction(successful).get(InvokeWaitTime, TimeUnit.SECONDS);` At Orderer, I see that it received transaction and forwarded the block to the peer. When I query the peer (after my invoke transaction timed out) I see the right value. So looks like everyone is doing their job.. but i donno why my client is getting stuck there. Any hints? Or debug logs I could add?
adc (Wed, 11 Oct 2017 11:08:41 GMT):
Hi, there is a java-sdk failure in the e2e tests for https://gerrit.hyperledger.org/r/#/c/13917/. Does anyone have an idea of the reason?
rameshthoomu (Wed, 11 Oct 2017 12:21:17 GMT):
@adc FAB-6575
rickr (Wed, 11 Oct 2017 14:09:15 GMT):
Just talked to the fabric-ca maintainers and at the moment they think the issue is their's to fix
rickr (Wed, 11 Oct 2017 14:37:26 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=giBBWiqAYX8eAx67v) Have added an eventHubs ?
rickr (Wed, 11 Oct 2017 14:37:26 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=giBBWiqAYX8eAx67v) Have you added an eventHubs ?
rickr (Wed, 11 Oct 2017 14:37:26 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=giBBWiqAYX8eAx67v) Have you added any eventHubs ?
rickr (Wed, 11 Oct 2017 16:18:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=zXFvBJJ8ffrsEZda3) @rameshthoomu Are the SDKs not being run with Fabric/ca verify builds ? Did this get merged in ?
rameshthoomu (Wed, 11 Oct 2017 16:19:11 GMT):
no.. sdk's run only on fabric verify and merge builds..
rameshthoomu (Wed, 11 Oct 2017 16:19:24 GMT):
I have created a FAB-6577 to take up this work..
rameshthoomu (Wed, 11 Oct 2017 16:20:26 GMT):
working on it..
Maria (Wed, 11 Oct 2017 16:58:19 GMT):
Has joined the channel.
mkhb654 (Wed, 11 Oct 2017 17:03:01 GMT):
Has joined the channel.
luomin (Thu, 12 Oct 2017 01:12:55 GMT):
Has joined the channel.
deepakvparmar (Thu, 12 Oct 2017 05:36:40 GMT):
@rik
deepakvparmar (Thu, 12 Oct 2017 05:38:22 GMT):
@rickr : We are facing blocker in current blockchain poc. We would like to know what is the significance of following properties in context of EventHub. Currently, We are not setting these two properties while configuring channel.
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {5L, TimeUnit.MINUTES});
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS});
rajasekharpippalla (Thu, 12 Oct 2017 06:41:23 GMT):
how we can identify all transactions which are related to particular user , i am working on balance-transfer example in fabric-samples ?
Glen (Thu, 12 Oct 2017 07:15:42 GMT):
Has joined the channel.
gauravgiri (Thu, 12 Oct 2017 08:02:34 GMT):
Hi @rickr
We are using fabric-sdk-java, and have multiple organizations, all users belong to organization: "userorg", while the peer belong to organization "peerorg1".
Sometimes during the invoke() transactions, the TransactionEvent.get() waits forever, and times out. We also observe error below, possibly related to timeout on TransactionEvent.get():
[10/11/17 12:19:38:836 JST] 00000128 EventHub E org.hyperledger.fabric.sdk.EventHub$1 onError EventHub:peer1 terminated is false shutdown is false has error UNKNOWN:
event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID peerorg1, received userorg]]
During Channel.intialize(), the EventHub.connect() is used using the UserContext, and all our user's belong to organization "userorg" only. All transactions are issued from the context of this organization("userorg") and it's users. Also, the endorsement's are all OK while connecting to peer, moreover not all invoke transactions result into timeout(and possibly this error).
Does this error point to something else, could you please try and point why we could be getting this error: "UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID peerorg1, received userorg]"?
kojima714 (Thu, 12 Oct 2017 08:27:05 GMT):
Has joined the channel.
tallharish (Thu, 12 Oct 2017 10:00:11 GMT):
at the channel.sendTransactionProposal() call , i see the following error,
tallharish (Thu, 12 Oct 2017 10:00:11 GMT):
at the channel.sendTransactionProposal() call , i see the following error,
```
2017-10-12 09:52:49,841 main ERROR Channel:2241 - Sending proposal to peer0.manuf1.example.com:7051 failed because of: gRPC failure=Status{code=UNKNOWN, description=Error executing chaincode: Could no
t get deployment transaction from LSCC for mycc:1.0 - Get ChaincodeDeploymentSpec for mycc/mychannel from LSCC error: chaincode fingerprint mismatch data mismatch, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Error executing chaincode: Could not get deployment transaction from LSCC for mycc:1.0 - Get ChaincodeDeploymentSpec for mycc/mychannel from LSCC error: chaincode fingerprint mismatch data mismatch
```
At the peer, I see the following error:
```
2017-10-12 09:52:49.803 UTC [chaincode] notify -> DEBU e7e notifying Txid:3e73d091d7bc2b86bf352375d5ad61256f3a3a289579d3edd608180d3a124212
2017-10-12 09:52:49.803 UTC [chaincode] Execute -> DEBU e7f Exit
2017-10-12 09:52:49.803 UTC [chaincode] ExecuteChaincode -> ERRO e80 Error executing chaincode: Could not get deployment transaction from LSCC for mycc:1.0 - Get ChaincodeDeploymentSpec for mycc/mychannel from LSCC error: chaincode fingerprint mismatch data mismatch
2017-10-12 09:52:49.803 UTC [endorser] callChaincode -> DEBU e81 Exit
2017-10-12 09:52:49.803 UTC [endorser] simulateProposal -> ERRO e82 failed to invoke chaincode path:"github.ibm.com/ICI/msp_overlay/chaincode/go/supply_chain" name:"mycc" version:"1.0" on transaction 3e73d091d7bc2b86bf352375d5ad61256f3a3a289579d3edd608180d3a124212, error: Error executing chaincode: Could not get deployment transaction from LSCC for mycc:1.0 - Get ChaincodeDeploymentSpec for mycc/mychannel from LSCC error: chaincode fingerprint mismatch data mismatch
2017-10-12 09:52:49.803 UTC [endorser] simulateProposal -> DEBU e83 Exit
```
tallharish (Thu, 12 Oct 2017 10:00:11 GMT):
at the channel.sendTransactionProposal() call , i see the following error,
```
2017-10-12 09:52:49,841 main ERROR Channel:2241 - Sending proposal to peer0.
tallharish (Thu, 12 Oct 2017 10:00:11 GMT):
at the channel.sendTransactionProposal() call , i see the following error,
```
2017-10-12 09:52:49,841 main ERROR Channel:2241 - Sending proposal to peer0.
rickr (Thu, 12 Oct 2017 15:36:40 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=yazzhSmL5jPuqxN7m) The only known reason to use these are to keep connection's active for firewalls and loadbalancers
rickr (Thu, 12 Oct 2017 15:39:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=wQ7gax5KWvW8vsRqT) Last I heard it has to be the peeradmin for that peer to create the connection
rickr (Thu, 12 Oct 2017 15:41:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Nx5WDfQj8DaaxQSxc) Each CC has a docker instance associated with it. Have you looked at the logs produced in this docker image ?
rickr (Thu, 12 Oct 2017 15:41:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Nx5WDfQj8DaaxQSxc) Each CC has a docker instance associated with it. Have you looked at the logs produced in this docker image ?
Also when you install/instantiate any change in your CC make sure the docker images associated with it are cleaned out. Or make sure you're upgrading CC each time.
SudhiBhat (Fri, 13 Oct 2017 02:01:54 GMT):
Hello, I am consuming the fabric-sdk-java in a Spring Boot application. When I do a channel.initialize() I get a exception from InvocableHandlerMethod. Should I give some kind of a callback class in my application or I am doing something wrong?
SudhiBhat (Fri, 13 Oct 2017 02:56:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=YXtDR3psT5FrtA74b) Will there be any issues making a grpc call in a spring boot environment?
ryokawajp (Fri, 13 Oct 2017 03:35:14 GMT):
Hi @rickr @gauravgiri , thank you for the information. I want to detect the completion of a Invoke transaction using CompletableFuture (i.e., Block event) returned by sendTransaction(). I suppose non-admin user is usually used to send a transaction. So HFClient.setUserContext() is set to a non-admin user of a org (say, "userorg"). If I understand the spec of fabric-sdk-java correctly, setUserContext() also affect the connection requests to event hubs of peers. If we need admin user of the peer to connect to the peer's event hub, do we also need to use the admin user of the peer to issue Invoke transactions? Is there any way to use different users for transaction and event hub?
SudhiBhat (Fri, 13 Oct 2017 05:12:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=eCaxFmgccMDd6t8rD) Looks like a JAR hell. I removed the dependencies on the io.grpc* libraries in my pom and allowed the dependencies to be injected by the pom of fabric-sdk-java and it appears to be working
johncaboose (Fri, 13 Oct 2017 09:43:49 GMT):
Has joined the channel.
KrzysztofNiemiec (Fri, 13 Oct 2017 11:10:38 GMT):
Has joined the channel.
KrzysztofNiemiec (Fri, 13 Oct 2017 11:11:06 GMT):
Hi I am trying to run code that base on End2EndIT example from fabric-sdk-java. It means just call invoke on chaincode. However I get timeout all the time. I attached log from execution. I tried to analyze logs comparing my execution from invoke called from cli but didn't found any significant differences except fact that called from java orderer starts first new Deliver handler, and later new Broadcasat handler. And when I perform invoke from cli there is no new Deliver handler.
KrzysztofNiemiec (Fri, 13 Oct 2017 11:11:29 GMT):
invoke-chaincode-timeout.log
SudhiBhat (Fri, 13 Oct 2017 11:48:34 GMT):
How do you associate a Fabric CA to an Org/peer. I am enrolling the user to one of the org's CA. However when I set this user to the transaction context and fire a transaction proposal on a peer of which the user is a part of I get an error saying that the certificate is signed by an unknown authority
mdanaci (Fri, 13 Oct 2017 13:19:00 GMT):
hello, i`m using time.Now() in my smart contract. Every peer returns different time so my endorsment fails on SDKUtils.getProposalConsistencySets(responses); what can i do?
sativ (Fri, 13 Oct 2017 16:05:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=XgpeN63poGou4QAAG) @tallharish Hi, I'm using the same code, and it compiles, but I don't see any events, even when I run chaincode, there's no events, nor messages. I have also registered an eventHub, but no luck. Are there any other settings to get chaicode events? Thanks!
silliman (Fri, 13 Oct 2017 17:43:19 GMT):
@mdanaci you cannot use time.Now() in your smart contract. Have the client application produce a timestamp and pass that to your smart contract to that each peer will see the same value.
silliman (Fri, 13 Oct 2017 17:43:19 GMT):
@mdanaci you cannot use time.Now() in your smart contract. Have the client application produce a timestamp and pass that so your smart contract to that each peer will see the same value.
silliman (Fri, 13 Oct 2017 17:43:19 GMT):
@mdanaci you cannot use time.Now() in your smart contract. Have the client application produce a timestamp and pass that to your smart contract so that each peer will see the same value.
mdanaci (Fri, 13 Oct 2017 20:35:07 GMT):
@silliman thanks
SudhiBhat (Sat, 14 Oct 2017 05:59:21 GMT):
@rickr I have a 3 Org (Org1 with Org1MSP, Org2 with Org2MSP and Org3 with Org3MSP) with one Orderer with OrdererMSP docker image set up. For the 3 orgs I have a 3 fabric-ca images (caOrg1, caOrg2, caOrg3) running. I generated all the certificates using the cryptogen tool on my local system and placed it in the crypto-config folder and have mounted them to the docker images as well. Now when a user who belongs to the Org1 wants to make a transaction proposal I enroll that user using the RegistrationRequest and perform the ca.Enroll to enroll the user so that the key pair and certificate gets generated. This user is associated to the Org1MSP. However when I use this new user that has been enrolled is used to perform transaction proposal (via client.setUserContext()) I get an error "Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority". I might be missing a simple configuration step but cannot find it and I spent enough time figuring it out :thinking:
slugle (Sun, 15 Oct 2017 21:44:38 GMT):
Has joined the channel.
ryokawajp (Mon, 16 Oct 2017 02:33:39 GMT):
@rickr @gauravgiri Hi , I found this JIRA issue. It seems that there have been already a discussion. I will comment on the JIRA.
ryokawajp (Mon, 16 Oct 2017 02:33:39 GMT):
@rickr @gauravgiri Hi , I found this JIRA issue. It seems that there have been already a discussion. I will comment on the JIRA.FAB-6101
waterlord (Mon, 16 Oct 2017 06:21:16 GMT):
Has joined the channel.
ozjc (Mon, 16 Oct 2017 08:30:12 GMT):
Has joined the channel.
rexxie (Mon, 16 Oct 2017 08:31:27 GMT):
Has joined the channel.
seungchan (Mon, 16 Oct 2017 10:46:01 GMT):
Has joined the channel.
seungchan (Mon, 16 Oct 2017 10:47:26 GMT):
Hello, Current hyperledger fabric is supporting to make java chaincode?... If it is supporting, could you recommend some example? please....
AlexMeng (Mon, 16 Oct 2017 12:38:27 GMT):
The integration test shows a channel with one Org, how to use the SDK to create/join channel across different Orgs? Could anyone give an example? @rickr
robinrob (Mon, 16 Oct 2017 12:46:10 GMT):
Has joined the channel.
sudhi-git (Mon, 16 Oct 2017 12:58:49 GMT):
Has joined the channel.
Styxt (Mon, 16 Oct 2017 15:15:50 GMT):
Hi,
i am getting the following error when i'm trying to join my peers to the channel i've created:
``` Okt 16, 2017 5:01:16 PM org.hyperledger.fabric.sdk.Channel sendProposalToPeers
SCHWERWIEGEND: Sending proposal to peer0.org1.example.com failed because of: gRP
C failure=Status{code=INTERNAL, description=null, cause=io.netty.handler.codec.h
ttp2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5
bytes: 1503010002 ```
Any idea what could be the cause?
Styxt (Mon, 16 Oct 2017 15:15:50 GMT):
Hi,
i am getting the following error when i'm trying to join my peers to the channel i've created:
``` Okt 16, 2017 5:01:16 PM org.hyperledger.fabric.sdk.Channel sendProposalToPeers
SCHWERWIEGEND: Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=INTERNAL, description=null, cause=io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002 ```
Any idea what could be the cause?
seungchan (Mon, 16 Oct 2017 16:26:04 GMT):
Does java chaincode is supported in current release of fabric?
mastersingh24 (Mon, 16 Oct 2017 22:58:28 GMT):
@Styxt - This typically indicates a TLS error - so likely you missed something in your properties settings.
(https://chat.hyperledger.org/channel/fabric-sdk-java?msg=26KmmnoDoRN5vbiKt)
sudhi-git (Tue, 17 Oct 2017 03:25:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rZBc3gN9QmubJD5rG) @SudhiBhat Tagging other experts @mastersingh24
sudhi-git (Tue, 17 Oct 2017 03:34:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jttgQegQ4w53NvAAb) As far as I can understand there needs to be handshake between the CA and the peer. In the sense the peer needs to know the signing authority for the certificates. Maybe I need to give the certificate of the CA to peer?
malkochoglu (Tue, 17 Oct 2017 03:36:36 GMT):
Has joined the channel.
malkochoglu (Tue, 17 Oct 2017 03:48:30 GMT):
I want first build and run examples under fabric/examples/chaincode/java/ . I see both gradle and pom file. Are they placed there to give an option for developers or do we need both of them?
johncaboose (Tue, 17 Oct 2017 06:45:30 GMT):
Hello! Running Fabric and Java SDK version 1.0.1. I know transactions commit to the blockchain (as a query says it has) and everything about that is all fine and good except that the CompletableFuture from the sendTransaction function is never able to get anything. In other words it waits forever when in the get function for it.
Do I have to manually implement a certain type of event in my chaincode for this elementary SDK function to work? Or are those events built in to the peer logic and there’s some sort of bug in it or the SDK? Thank you.
LemonMinp (Tue, 17 Oct 2017 07:45:40 GMT):
Has joined the channel.
johncaboose (Tue, 17 Oct 2017 08:25:28 GMT):
Alright I found a ticket for what I asked about. It seems I need to add an eventhub to the Channel. Thanks. Here’s the link: https://jira.hyperledger.org/browse/FAB-6198
manu (Tue, 17 Oct 2017 11:34:14 GMT):
Has joined the channel.
rickr (Tue, 17 Oct 2017 13:22:52 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Z5Wmq3s97pQA7DACg) No not supported in the latest nor from what I've gathered in v1.1 but double check with #fabric-java-chaincode
rickr (Tue, 17 Oct 2017 13:25:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jttgQegQ4w53NvAAb) Not sure what operation you're doing with this new enrolled user but from what I know those credentials can ONLY invoke CC (not install or instantiate)
rickr (Tue, 17 Oct 2017 13:28:15 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=W5ogBrmiMqnhd4bQg) Java CC is not supported .. That example probably out dated too.
KJAWSBC (Tue, 17 Oct 2017 14:03:45 GMT):
Has joined the channel.
KJAWSBC (Tue, 17 Oct 2017 14:28:22 GMT):
Hello,
KJAWSBC (Tue, 17 Oct 2017 14:28:25 GMT):
0
down vote
favorite
I'm trying to get the example up and running from https://www.ibm.com/developerworks/library/j-chaincode-for-java-developers/index.html
All the build was successful and peer connection is up and running.
I see below errors.
C:\home\mychaincode\src\gitub.com\hyperledger\fabric\examples\chaincode\java\Exa
mple\build\distributions\Example\bin>Example
Hello world! starting [Ljava.lang.String;@2d98a335
Oct 16, 2017 1:03:32 PM example.Example main
INFO: starting
Oct 16, 2017 1:03:33 PM io.grpc.internal.TransportSet$1 call
INFO: Created transport io.grpc.netty.NettyClientTransport@2f1ec084(/127.0.0.1:7
051) for /127.0.0.1:7051
Oct 16, 2017 1:03:34 PM io.grpc.internal.TransportSet$TransportListener transpor
tShutdown
INFO: Transport io.grpc.netty.NettyClientTransport@2f1ec084(/127.0.0.1:7051) for
/127.0.0.1:7051 is being shutdown
Oct 16, 2017 1:03:34 PM io.grpc.internal.TransportSet$TransportListener transpor
tTerminated
INFO: Transport io.grpc.netty.NettyClientTransport@2f1ec084(/127.0.0.1:7051) for
/127.0.0.1:7051 is terminated
Oct 16, 2017 1:03:34 PM org.hyperledger.java.shim.ChaincodeBase$1 onError
SEVERE: Unable to connect to peer server: UNAVAILABLE
KJAWSBC (Tue, 17 Oct 2017 14:28:25 GMT):
0
down vote
favorite
I'm trying to get the example up and running from https://www.ibm.com/developerworks/library/j-chaincode-for-java-developers/index.html
All the build was successful and peer connection is up and running.
I see below errors.
C:\home\mychaincode\src\gitub.com\hyperledger\fabric\examples\chaincode\java\Exa
mple\build\distributions\Example\bin>Example
Hello world! starting [Ljava.lang.String;@2d98a335
Oct 16, 2017 1:03:32 PM example.Example main
INFO: starting
Oct 16, 2017 1:03:33 PM io.grpc.internal.TransportSet$1 call
INFO: Created transport io.grpc.netty.NettyClientTransport@2f1ec084(/127.0.0.1:7
051) for /127.0.0.1:7051
Oct 16, 2017 1:03:34 PM io.grpc.internal.TransportSet$TransportListener transpor
tShutdown
INFO: Transport io.grpc.netty.NettyClientTransport@2f1ec084(/127.0.0.1:7051) for
/127.0.0.1:7051 is being shutdown
Oct 16, 2017 1:03:34 PM io.grpc.internal.TransportSet$TransportListener transpor
tTerminated
INFO: Transport io.grpc.netty.NettyClientTransport@2f1ec084(/127.0.0.1:7051) for
/127.0.0.1:7051 is terminated
Oct 16, 2017 1:03:34 PM org.hyperledger.java.shim.ChaincodeBase$1 onError
SEVERE: Unable to connect to peer server: UNAVAILABLE
hjy (Tue, 17 Oct 2017 15:39:12 GMT):
Has joined the channel.
SudhiBhat (Wed, 18 Oct 2017 03:27:10 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=mP9CG4GyzAtjFe2nS) @rickr I am only invoking a GetState or a PutState. I am exactly following the steps in the End2endIT.java test case. I might be missing a configuration. Another information. Unlike the "fixtures" in the sdk project, where the certificates are stored in the e2eorgs folder I am generating the cryptographic material using the cryptogen tool for the different entities mentioned in the crypto-config folder. What is the purpose of storing the cacert and in the fabric HFCClient class the certificate is stored in the secure store? Is this the missing link?
paulkeogh (Wed, 18 Oct 2017 21:53:48 GMT):
Has joined the channel.
lin2K (Thu, 19 Oct 2017 09:19:06 GMT):
Has joined the channel.
cumt168 (Thu, 19 Oct 2017 13:33:17 GMT):
Has joined the channel.
cumt168 (Thu, 19 Oct 2017 13:33:36 GMT):
I run the End2endIT.java ,but this is error happen.
cumt168 (Thu, 19 Oct 2017 13:33:45 GMT):
Anyone can help me ? Thanks
cumt168 (Thu, 19 Oct 2017 13:34:04 GMT):
I found the config , defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg1.ca_location", "http://10.99.192.39:7050");
cumt168 (Thu, 19 Oct 2017 13:34:34 GMT):
where can I find the "ca_location"? There is no ca run
ozjc (Fri, 20 Oct 2017 10:55:40 GMT):
I think I'm late. I am currently writing Clojure SDK and learned a couple of things. Using 'grpc' is easier than 'grpcs', and to use 'grpc', need to add/change _TLS_ENABLED to false in configuration file(for example, docker-compose.yaml). I've just finished sign function with 'grpc', so probably turn on TLS and try 'grpcs'. Java keeps CA info in TrustStore and need to tweak it to make it talk with local docker servers (and possibly other tweaks which I do not know how yet).
Hundredwz (Fri, 20 Oct 2017 13:00:16 GMT):
I am using fabric-sdk-java to build one web app.But it couldnt write to blockchain.Actually,I cant do anything to blockchain,like query or invoke.I didnt get any logs.Can any help me ?
mnosseir (Fri, 20 Oct 2017 19:52:32 GMT):
Has joined the channel.
curtissummers (Fri, 20 Oct 2017 21:33:46 GMT):
Has joined the channel.
pheneghan (Fri, 20 Oct 2017 21:52:53 GMT):
Has joined the channel.
pheneghan (Fri, 20 Oct 2017 21:56:55 GMT):
I have set up Hyperledger Fabric on my IBM Bluemix test account and downloaded the Fabric Java SDK. I want to create the simplest "Hello World" type client app to call my Hyperledger install on a IBM Bluemix. Is there a good resource showing a simple Java client app?
fbutnariu (Sun, 22 Oct 2017 21:51:35 GMT):
Has joined the channel.
rickr (Mon, 23 Oct 2017 13:23:55 GMT):
https://github.com/IBM-Blockchain/JSDKIntegrationSample
hellothere (Mon, 23 Oct 2017 18:14:24 GMT):
Has joined the channel.
hellothere (Mon, 23 Oct 2017 18:15:45 GMT):
Hello, I'm a student trying to learn blockchain. If I build and deploy a blockchain network using Hyperledger Fabric, can I use the Java SDK to interact with the blockchain from a java web application? If so, how do I go about implementing the Java SDK in my application? Any simple resources that help explain?
ryokawajp (Tue, 24 Oct 2017 03:30:53 GMT):
message size
ryokawajp (Tue, 24 Oct 2017 03:40:57 GMT):
Hi. I heard that gRPC has a limitation in the maximum message size of 4MiBs. Is this value configurable in fabric-sdk-java? I would like to increase this value to enable the client to upload and download a large file such as a Word document. https://github.com/grpc/grpc/issues/7927
ryokawajp (Tue, 24 Oct 2017 03:43:15 GMT):
FYI: It looks like we can configure the max message size in fabric-sdk-node https://jira.hyperledger.org/browse/FAB-3301
cumt168 (Tue, 24 Oct 2017 03:56:51 GMT):
Hi, when I run fabric-sdk-java unit tests, there is one error happen. -- {"code":0,"message":"Identity 'user1' is already registered"} , Could anyone help on this ?
adrianhopebailie (Tue, 24 Oct 2017 07:05:14 GMT):
Has left the channel.
cumt168 (Tue, 24 Oct 2017 07:35:34 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=aFnwYgvToQNXwkuRw) @rickr Can you provide this sample file of "bmxServiceCredentials.json" ?
rock_martin (Tue, 24 Oct 2017 08:52:14 GMT):
Has joined the channel.
Gauravimpro (Tue, 24 Oct 2017 09:44:04 GMT):
Has joined the channel.
Gauravimpro (Tue, 24 Oct 2017 10:08:33 GMT):
Hi, How can i enable logging for fabric-sdk-java?
mdanaci (Tue, 24 Oct 2017 12:29:03 GMT):
Hello @rickr , i have 2 organizations and 4 peers like the end2endit test. I want to use single channel (foo) with two organizations. Is it possible? The code below only gets first organizations' orderer. and first organizations' peerAdmin. Am i going to call channel.addOrderer(2. organizations' orderer)
client.newChannel(name, anOrderer, channelConfiguration, client.getChannelConfigurationSignature(channelConfiguration, sampleOrg.getPeerAdmin()));
rickr (Tue, 24 Oct 2017 13:00:45 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=7zZ3jFreHoZT3AkE3) [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=7zZ3jFreHoZT3AkE3) No The BMX service should provide that to you.
rickr (Tue, 24 Oct 2017 13:03:25 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=KX3DD3NXagGDgNk6r) There are many ways but the simplest of them is set it via env var: ORG_HYPERLEDGER_FABRIC_SDK_LOGLEVEL or ORG_HYPERLEDGER_FABRIC_CA_SDK_LOGLEVEL
rickr (Tue, 24 Oct 2017 13:06:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=zBZoA2Lzgb9XzLSzc) For the client (SDK) there is a limit on inbound messages size see End2endIT _grpc.NettyChannelBuilderOption.maxInboundMessageSize_
robsonximenes (Tue, 24 Oct 2017 13:24:45 GMT):
Has joined the channel.
robsonximenes (Tue, 24 Oct 2017 13:25:11 GMT):
Hi! Is there a archetype to start a new chaincode project???
Styxt (Tue, 24 Oct 2017 13:27:30 GMT):
Hi, i am getting the following error when i try to do a transaction with the sdk:
```SCHWERWIEGEND: Sending proposal to peer1.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=chaincode error (status: 500, message: Unknown action, check the first argument, must be one of 'delete', 'query', or 'move'. But got: move), cause=null}```
Creating the channel, installing and initializing the chaincode work but somehow when i try to do the transaction it does not recognize the 'move' (I am currently working with the balance transfer examle cc)
Anyone got an idea what the problem could be?
ryokawajp (Tue, 24 Oct 2017 16:35:47 GMT):
@rickr Thank you. I will take a look at the sample.
jeroiraz (Wed, 25 Oct 2017 02:02:26 GMT):
Has joined the channel.
cumt168 (Wed, 25 Oct 2017 04:18:17 GMT):
I meet this error, "First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002". What is this reason? @rickr
ozjc (Wed, 25 Oct 2017 05:55:15 GMT):
@cumt168 I got that when servers are running with TLS enabled, and client is trying to connect via grpc rather than grcps
cumt168 (Wed, 25 Oct 2017 06:56:19 GMT):
@ozjc I just run the classs "End2endAndBackAgainIT", and change nothing. How can I fix this issue?
cumt168 (Wed, 25 Oct 2017 06:57:10 GMT):
May I need to make some changes?
Gauravimpro (Wed, 25 Oct 2017 07:19:47 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=4pYdvd3vyPh8KDuv7) @rickr I tried it but somehow it is not working. I am using maven project and used export command to set but couldn't get the fabric-sdk-java logs.
cumt168 (Wed, 25 Oct 2017 10:14:52 GMT):
I meet a error. --------- 2017-10-25 09:42:36,894 grpc-default-worker-ELG-2-2 DEBUG ReferenceCountedOpenSslContext:648 - verification of certificate failed
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
cumt168 (Wed, 25 Oct 2017 10:15:07 GMT):
what is it, anyone can help?
cumt168 (Wed, 25 Oct 2017 10:15:25 GMT):
I run End2endAndBackAgainIT.
ozjc (Wed, 25 Oct 2017 20:10:35 GMT):
@cumt168 (Warning - I haven't run Java SDK only read code to write my own version of Clojure SDK). About your previous question(assume you run local Docker images). 1. Change server configuration - I.e., change all *_TLS_ENABLED to false in your configuration file. 2. Use overrideAuthority(though I couldn't make it work in my Clojure SDK. I believe underlying library does not support it yet and use InsecureTrustManageFactory)
ozjc (Wed, 25 Oct 2017 20:10:35 GMT):
@cumt168 (Warning - I haven't run Java SDK only read code to write my own version of Clojure SDK). About your previous question(assume you run local Docker images). 1. Change server configuration - I.e., change all *__TLS__ENABLED to false in your configuration file. 2. Use overrideAuthority(though I couldn't make it work in my Clojure SDK. I believe underlying library does not support it yet and use InsecureTrustManageFactory)
anyone (Wed, 25 Oct 2017 20:52:17 GMT):
Has joined the channel.
hartimer (Wed, 25 Oct 2017 21:32:26 GMT):
Has joined the channel.
aatkddny (Wed, 25 Oct 2017 23:17:56 GMT):
Has joined the channel.
aatkddny (Wed, 25 Oct 2017 23:24:48 GMT):
I have a consortium - lets say three orgs A, B and C. My client has the peer admin for A set in the user context.
I want to create a channel they all share. It seems to work if I call client.getChannelConfigurationSignature for the peer admins for all three, form them into an array and use that to call client.newChannel.
What I can't do is figure out how to join the peers from the other orgs - B and C to the channel.
I can't use that HFClient (A means an MSP mismatch).
I can't create new HFClients for B and C because the client.getChannel(name) returns null and client.newChannel gives me an upgrade version mismatch.
How do I join the peers to the channel here? (And after that of course the event hubs).
falix (Thu, 26 Oct 2017 03:25:11 GMT):
Has joined the channel.
cumt168 (Thu, 26 Oct 2017 05:22:06 GMT):
@ozjc Thank you, it is very helpful.
srongzhe (Thu, 26 Oct 2017 09:07:16 GMT):
Has joined the channel.
pheneghan (Thu, 26 Oct 2017 14:22:40 GMT):
I have the same question as @cumt168 with creating the bmxServiceCredentials.json file. The https://github.com/IBM-Blockchain/JSDKIntegrationSample shows how to do this if you are running Blockchain Enterprise installed from the catalog (this one has a blockchain dashboard from which you can download Service Credentials). However if you are running in a Kubernetes container there is no service credentials download. I was pointed to this: https://ibm-blockchain.github.io/interacting/ but not sure how to get the credentials path (have the public IP address). Also the JSDKIntegrationSample code expects a JSON object "organizations" in the bmxServiceCredentials.json file but the credentials block sample in the "interacting with your Blockchain" article is missing this object.
gowrikvk (Thu, 26 Oct 2017 15:11:27 GMT):
Has joined the channel.
rickr (Thu, 26 Oct 2017 15:37:08 GMT):
The sample worked once with standard bmx service. Not sure if they're are keeping it up todate with changes. You need work that team
rickr (Thu, 26 Oct 2017 15:37:08 GMT):
The sample worked once with standard bmx service. Not sure if they're are keeping it up todate with changes. You need work with that team
kz.bake (Thu, 26 Oct 2017 16:13:34 GMT):
Has joined the channel.
neharprodduturi (Thu, 26 Oct 2017 22:30:56 GMT):
Has joined the channel.
georgeanu (Thu, 26 Oct 2017 22:51:38 GMT):
Has joined the channel.
gowrikvk (Fri, 27 Oct 2017 04:40:01 GMT):
test@test-HP-EliteBook-840-G2:~/jsdkhl/src/github.com/hyperledger/fabric/core/chaincode/shim/java$ gradle build
FAILURE: Build failed with an exception.
* Where:
Build file '/home/test/jsdkhl/src/github.com/hyperledger/fabric/core/chaincode/shim/java/build.gradle' line: 33
* What went wrong:
An exception occurred applying plugin request [id: 'java']
> Failed to apply plugin [id 'org.gradle.java']
> Could not create an instance of type com.google.protobuf.gradle.ProtobufSourceDirectorySet_Decorated.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
gowrikvk (Fri, 27 Oct 2017 04:40:27 GMT):
any one suggest why i am getting this any solution?
gowrikvk (Fri, 27 Oct 2017 05:53:39 GMT):
we can resolve this issue with installation of Gradle 4.2.1
gowrikvk (Fri, 27 Oct 2017 08:49:28 GMT):
src/github.com/hyperledger/fabric/examples/chaincode/java/Example/src/main/java/example/Example.java:[66,8] example.Example is not abstract and does not override abstract method invoke(org.hyperledger.fabric.shim.ChaincodeStub) in org.hyperledger.fabric.shim.ChaincodeBase
gowrikvk (Fri, 27 Oct 2017 08:49:43 GMT):
getting issue ...any thoughts please
kz.bake (Fri, 27 Oct 2017 11:16:30 GMT):
hello, is there any sdk for android?
rickr (Fri, 27 Oct 2017 13:29:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=BySLvpQ5M2zCdoPeG) No support for java CC at any fabric release.
rickr (Fri, 27 Oct 2017 13:29:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=BySLvpQ5M2zCdoPeG) No support for java CC at any fabric release. Best discussed on #fabric-java-chaincode
scmchan (Fri, 27 Oct 2017 14:33:10 GMT):
Has joined the channel.
alimamacoin (Mon, 30 Oct 2017 05:02:17 GMT):
Has joined the channel.
deepakvparmar (Mon, 30 Oct 2017 09:07:26 GMT):
@rickr : We would like to increase gRPC package message size in fabric java sdk. Kindly help us how we can increase size. Currently, We are getting following exception :
org.hyperledger.fabric.sdk.Channel initialize INTERNAL: io.grpc.net
ty.NettyClientTransport$3: Frame size 4678347 exceeds maximum: 4194304.
org.hyperledger.fabric.sdk.exception.TransactionException: INTERNAL: io.grpc.netty.Nett
yClientTransport$3: Frame size 4678347 exceeds maximum: 4194304.
at org.hyperledger.fabric.sdk.OrdererClient.sendDeliver(OrdererClient.java:286)
at org.hyperledger.fabric.sdk.Orderer.sendDeliver(Orderer.java:165)
at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1074)
at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:898)
at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:826)
mmick (Mon, 30 Oct 2017 11:33:46 GMT):
Has joined the channel.
ascatox (Mon, 30 Oct 2017 14:23:57 GMT):
Hi All! I'm trying to develop a simple application to interact with the blockchain! Using maven to import the fabric-sdk-java library I can't find this class `import org.hyperledger.fabric.sdk.ChaincodeEvent;``
ascatox (Mon, 30 Oct 2017 14:24:12 GMT):
Someone has the same problem!
rickr (Mon, 30 Oct 2017 14:37:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=exASrHwiT64zXjPK8) On the client side (SDK) you add grpc.NettyChannelBuilderOption.maxInboundMessageSize to the properties. However if what you're sending is also large you may need to update the server side (Fabric). You'll need to ask that on the #fabric-orderer channel
rickr (Mon, 30 Oct 2017 14:42:24 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=oEmqLrcSx6GceqH2Q) Are you referencing version 1.0.0 or 1.0.1 ?
ascatox (Mon, 30 Oct 2017 14:43:08 GMT):
1.0.1
ascatox (Mon, 30 Oct 2017 14:46:06 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bxLvAs4JpxeDysuw6) @rickr 1.0.1
rickr (Mon, 30 Oct 2017 15:53:01 GMT):
I thought that made the 1.0.1 cut but apparently not. I just checked, it is in the 1.1.0-SNAPSHOT builds as expected. The readme.md has some pointers on how to reference in your apps pom.xml
deepakvparmar (Tue, 31 Oct 2017 06:48:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=avctpeu6izs6K73ph) @rickr : Thank You Rick. As per your suggestion, I can add property called "grpc.NettyChannelBuilderOption.maxInboundMessageSize" as a Orderer properties while initializing channel in fabric java sdk. Moreover; We should also increase size on fabric server side as well.
Can you please help me where i can find document for all such properties which we can add as Orderer, Peer and EventHub properties?
Actually I would like to know how we can set "maxInboudMessageSize" and what should be type or unit of property value.
luckydogchina (Tue, 31 Oct 2017 06:58:51 GMT):
Has joined the channel.
luckydogchina (Tue, 31 Oct 2017 07:00:24 GMT):
I may find a bug in the fabric-sdk-java
luckydogchina (Tue, 31 Oct 2017 07:02:48 GMT):
when I try to run `docker-compose up` under the sdkintegration folder, the error is throwed:
luckydogchina (Tue, 31 Oct 2017 07:02:48 GMT):
when I try to run `docker-compose up` under the sdkintegration folder, the error is throwed:`Error: Failed to store certificate: open /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem: read-only file system
ca_peerOrg1 exited with code 1`
luckydogchina (Tue, 31 Oct 2017 07:02:48 GMT):
when I try to run `docker-compose up` under the sdkintegration folder, the error is throwed:`Error: Failed to store certificate: open /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem: read-only file system
ca_peerOrg1 exited with code 1`
Then I change the ` /etc/hyperledger/fabric-ca-server-config:ro` to ` /etc/hyperledger/fabric-ca-server-config` under `ca0` and `ca1` in `docker-compose.yaml`, all is ok !
luckydogchina (Tue, 31 Oct 2017 07:02:48 GMT):
when I try to run `docker-compose up` under the sdkintegration folder, the error is throwed:`Error: Failed to store certificate: open /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem: read-only file system
ca_peerOrg1 exited with code 1`
Then I change the ` /etc/hyperledger/fabric-ca-server-config:ro` to ` /etc/hyperledger/fabric-ca-server-config` under `ca0` and `ca1` in `docker-compose.yaml`, all is ok !
luckydogchina (Tue, 31 Oct 2017 07:03:24 GMT):
start ca fialure.png
xuanyue202 (Tue, 31 Oct 2017 09:58:08 GMT):
@rickr How can fabric-sdk-java listen to the event emitted by chaincode?
xuanyue202 (Tue, 31 Oct 2017 09:59:51 GMT):
I tried the `registerChaincodeEventListener` method in EventHub, but nothing happened. The original 'registerTXListener' has been removed. THere is little document on this. :frowning2:
gujingxiao (Tue, 31 Oct 2017 10:04:52 GMT):
Has joined the channel.
rickr (Tue, 31 Oct 2017 13:55:29 GMT):
I'll have to look into that. What is the version of fab-ca? commit level ? I did this once on purpose because the CA should NOT be changing that. My first inclination is this is a fab-ca bug. Off the bat don't think I'm seeing that in a recent version.
rickr (Tue, 31 Oct 2017 13:56:49 GMT):
@deepakvparmar Please ask that on the #fabric channel they need to be documenting that or showing an example.
smithbk (Tue, 31 Oct 2017 14:30:35 GMT):
@luckydogchina Did /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem exist before starting fabric-ca-server? If not, then it needs to create a self-signed CA cert and store it there. If it already existed, then yes it is a bug since it should not try to replace it.
luckydogchina (Wed, 01 Nov 2017 01:02:39 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rAiaaQ8GgtAeSGogG) @smithbk Yes, I make the msp by the `cryptogen` tool before running the dockers
smithbk (Wed, 01 Nov 2017 01:19:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=JBdejCGnELcv4fqXj) @luckydogchina As Rick asked, what version of fabric-ca-server is this? Pls try with the latest in master if you haven't, and if it is still a problem, open a jira item with more detailed instructions on how to reproduce.
luckydogchina (Wed, 01 Nov 2017 02:51:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=w2F3hpx5DCsoYhQim) @smithbk I pull the `fabric-ca` docker images from `docker pull`, the image version is `hyperledger/fabric-ca:x86_64-1.0.1`.
luckydogchina (Wed, 01 Nov 2017 02:51:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=w2F3hpx5DCsoYhQim) @smithbk I pull the `fabric-ca` docker images from `docker pull`, the image version is `hyperledger/fabric-ca:x86_64-1.0.1`.
the fabric-sdk-java version is v1.0.1 too.
luckydogchina (Wed, 01 Nov 2017 02:57:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=w2F3hpx5DCsoYhQim) @smithbk How can I report the bug ? Can you give a entrance to me ?
zhiqiang 1 (Wed, 01 Nov 2017 04:10:31 GMT):
Has joined the channel.
Kayd29 (Wed, 01 Nov 2017 10:18:21 GMT):
Has joined the channel.
smithbk (Wed, 01 Nov 2017 12:26:19 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=iGT5bPzdXRLRGmDY7) @luckydogchina Go to https://jira.hyperledger.org/secure/Dashboard.jspa ... and it has a link to create a Linux Foundation ID if you don't have one. Click on "Create Issue" and be sure to select "fabric-ca" as the Component
rickr (Wed, 01 Nov 2017 14:15:48 GMT):
I just checked and I don't see any errors with start fabric ca
https://ctrlv.it/id/58214/2710944373
commit 786cb8d0587c331294244cd912cac3dfed0d6daa
Date: Sun Oct 1 15:57:17 2017 -0400
SandySun2000 (Wed, 01 Nov 2017 18:14:29 GMT):
where does org.hyperledger.fabric.protos.peer.EventsGrpc come from? I have trouble to recognize this package from my eclipse project. However, org.hyperledger.fabric.protos.peer.PeerEvents looks good
yoyokeen (Thu, 02 Nov 2017 02:47:43 GMT):
@here,how to use the customsize event?
zhaochy (Thu, 02 Nov 2017 04:03:15 GMT):
Has left the channel.
Jonny (Thu, 02 Nov 2017 15:33:41 GMT):
hi guys, where can I find a working sample of the usage of this java-sdk-client?
hellothere (Thu, 02 Nov 2017 20:15:27 GMT):
Hi all, would anyone be willing to let me direct message them with some beginner, basic questions on getting start on building a java client and using the java sdk?
rickr (Thu, 02 Nov 2017 21:13:57 GMT):
Learn Hyperledger Fabric concepts. First ask on Fabric RC channel the best source for that. Maybe http://hyperledger-fabric.readthedocs.io/en/latest/getting_started.html
The SDK will not re-document it.
*Fully* read the SDK Readme.md Then READ IT AGAIN :)
Study the EndendIT.java and End2endAndBackAgainIT while they are integration tests they do 95% of what an application would do with the SDK.
Maybe take it a step further and follow it in a debugger to help learn what it's doing.
Then for *your application* you have 90% of the code already written as you should be able to copy and paste most of what you need from them .
rickr (Thu, 02 Nov 2017 21:13:57 GMT):
Learn Hyperledger Fabric concepts. First ask on Fabric RC channel the best source for that. Maybe http://hyperledger-fabric.readthedocs.io/en/latest/getting_started.html
The SDK will not re-document it.
*Fully* read the SDK Readme.md Then READ IT AGAIN :)
Study the EndendIT.java and End2endAndBackAgainIT while they are integration tests they do 95% of what an application would do with the SDK.
Maybe take it a step further and follow it in a debugger to help learn what it's doing.
Then for *your application* you have 90% of the code already written as you should be able to copy and paste most of what you need from them .
rickr (Thu, 02 Nov 2017 21:13:57 GMT):
Learn Hyperledger Fabric concepts. First ask on Fabric RC channel the best source for that. Maybe http://hyperledger-fabric.readthedocs.io/en/latest/getting_started.html
The SDK will not re-document it.
*Fully* read the SDK Readme.md Then READ IT AGAIN :)
Study the EndendIT.java and End2endAndBackAgainIT while they are integration tests they do 95% of what an application would do with the SDK.
Maybe take it a step further and follow it in a debugger to help learn what it's doing.
Then for *your application* you have 90% of the code already written as you should be able to copy and paste most of what you need from them :)
rickr (Thu, 02 Nov 2017 21:18:42 GMT):
cumt168 (Fri, 03 Nov 2017 03:26:48 GMT):
Java chaincode is work-in-progress and disabled
cumt168 (Fri, 03 Nov 2017 03:26:59 GMT):
what is this mean? @rickr
cumt168 (Fri, 03 Nov 2017 03:29:40 GMT):
when i use "peer chaincode *** ", the error happen above. My chaincode is implemented by java.
sanchezl (Fri, 03 Nov 2017 13:06:39 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=b9pEQK4xsK3rvfcvi) @cumt168 You will need to compile your own fabric v1.1 with the experimental flag on to use Java chaincode. You can ask more questions in #fabric-java-chaincode
hellothere (Fri, 03 Nov 2017 18:42:38 GMT):
Is the Java SDK the easiest way interact with a blockchain network running on Fabric from a Java web application?
mmick (Sat, 04 Nov 2017 08:43:42 GMT):
when to use hyperledger composer vs SDK's (java, node)?
zhixinlong (Mon, 06 Nov 2017 09:47:11 GMT):
Has joined the channel.
zhixinlong (Mon, 06 Nov 2017 09:47:32 GMT):
please tell who write this broken sdk
zhixinlong (Mon, 06 Nov 2017 09:47:49 GMT):
It is hurt IBM
cumt168 (Mon, 06 Nov 2017 12:32:06 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=v3PBHLvoewhiDM3aX) @sanchezl Thank you.
mdanaci (Mon, 06 Nov 2017 13:14:37 GMT):
Hello i have 5 organization and each org has 1 peer, these orgs has 1 common channel. I'm trying to add 5 eventhubs to channel, even i set the userContext for each eventhub creation i get the following error when i initialize the `channel. java.lang.AssertionError: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org1, received Org5]]`
mdanaci (Mon, 06 Nov 2017 13:14:37 GMT):
Hello i have 5 organization and each org has 1 peer, these orgs has 1 common channel. I'm trying to add 5 eventhubs to channel, even i set the userContext for each eventhub creation i get the following error when i initialize the `channel. java.lang.AssertionError: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org1, received Org5]]`
if i set the usercontext org1 to all eventhubs. This time i get the following exception.
`org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org5, received Org1]]
`
mdanaci (Mon, 06 Nov 2017 13:14:37 GMT):
Hello i have 5 organization and each org has 1 peer, these orgs has 1 common channel. I'm trying to add 5 eventhubs to channel, even i set the userContext for each eventhub creation i get the following error when i initialize the `channel. java.lang.AssertionError: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org1, received Org5]]`
if i set the usercontext org1 to all eventhubs. This time i get the following exception.
`org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org5, received Org1]]
`
mdanaci (Mon, 06 Nov 2017 13:14:37 GMT):
Hello i have 5 organization and each org has 1 peer, these orgs has 1 common channel. I'm trying to add 5 eventhubs to channel, even i set the userContext for each eventhub creation i get the following error when i initialize the `channel. java.lang.AssertionError: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org1, received Org5]]`
if i set the usercontext org1 to all eventhubs. This time i get the following exception.
`org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org5, received Org1]]
`
mdanaci (Mon, 06 Nov 2017 13:14:37 GMT):
Hello i have 5 organization and each org has 1 peer, these orgs has 1 common channel. I'm trying to add 5 eventhubs to channel, even i set the userContext for each eventhub creation i get the following error when i initialize the `channel. java.lang.AssertionError: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org1, received Org5]]`
if i set the usercontext org1 to all eventhubs. This time i get the following exception.`org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org5, received Org1]]
`
mdanaci (Mon, 06 Nov 2017 13:14:37 GMT):
Hello i have 5 organization and each org has 1 peer, these orgs has 1 common channel. I'm trying to add 5 eventhubs to channel, even i set the userContext for each eventhub creation i get the following error when i initialize the `channel. java.lang.AssertionError: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org1, received Org5]]`
if i set the usercontext org1 to all eventhubs. This time i get the following exception.
```org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org5, received Org1]]
```
mdanaci (Mon, 06 Nov 2017 13:14:37 GMT):
Hello i have 5 organization and each org has 1 peer, these orgs has 1 common channel. I'm trying to add 5 eventhubs to channel, even i set the userContext for each eventhub creation i get the following error when i initialize the
```channel. java.lang.AssertionError: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org1, received Org5]]
```
if i set the usercontext org1 to all eventhubs. This time i get the following exception.
```org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org5, received Org1]]
```
mdanaci (Mon, 06 Nov 2017 13:14:37 GMT):
Hello @rickr i have 5 organization and each org has 1 peer, these orgs has 1 common channel. I'm trying to add 5 eventhubs to channel, even i set the userContext for each eventhub creation i get the following error when i initialize the
```channel. java.lang.AssertionError: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org1, received Org5]]
```
if i set the usercontext org1 to all eventhubs. This time i get the following exception.
```org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.EventHubException: UNKNOWN: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org5, received Org1]]
```
hellothere (Mon, 06 Nov 2017 13:22:52 GMT):
Are there any sample java web applications using the Java SDK I can browse?
bh4rtp (Mon, 06 Nov 2017 14:26:27 GMT):
hi, how can i pass access_token value to `composer-cli`? i am using authorization of github.
bh4rtp (Mon, 06 Nov 2017 14:26:27 GMT):
hi, how can i pass `access_token` value to `composer-cli`? i am using authorization of github.
bh4rtp (Mon, 06 Nov 2017 14:26:27 GMT):
hi, how can i pass `access_token` value to `composer-cli`? i am using authentication from github.
rickr (Mon, 06 Nov 2017 15:38:45 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RPwnFGkdtnN4aQoyC) Each organization would be like a company Ford, Toyota, BMW etc Their Peers, Orderers CA would NEVER be shared especially not the credentials using them. Their clients would ONLY run in their own organizations IT shop. If what you want to do is provide a scenario like this and not have them run in the different Java instances (closer to real use case) use a separate HFClient provide each the appropriate user creds for each organization and create a separate channel object (same name) .
mondraymond (Mon, 06 Nov 2017 16:02:17 GMT):
Has joined the channel.
zdmob (Tue, 07 Nov 2017 02:18:11 GMT):
Has joined the channel.
mdanaci (Tue, 07 Nov 2017 07:17:34 GMT):
Hi @rickr, I mentioned before that i have 5 organization, each organization has 1 peer, 1 ca and the whole system has 1 orderer. I will have 5 physical servers in runtime (each server will contain 1ca, 1peer, 1 couchdb for that organization) and a orderer server. Total of 6 physical server. Whole system has 1 channel (1 ledger)
What i am trying to do is create and serialize channel in a starter project using End2endIT.java Here are the steps:
1. For each organization "Create 1 HFCAClient and create admin users, register and enroll them and add to organization." (Each org has its own certificates)
2. Create an orderer
3. Construct channel - Create channel using first organizations peer admin. Add all peers to channel (switching organizations and userContext (I have 1 HFCClient))
4. Add one eventHub using first organization (my previous question was this one)
5. initialize channel
6. Install chaincode to all peers and invoke init method.
7. Serialize channel to a file.
After that i'm copying this serialized file to servers and reconstruct channel like in the End2endAndBackAgainIT.java
I'm running my methods and it works.
There aren't any examples like "Multiple organizations using 1 channel", Am i missing something? Thanks by the way.
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=NiGJqNnvK4mQpFoHy) @rickr
asaningmaxchain (Tue, 07 Nov 2017 12:25:45 GMT):
@rickr i set the max message for the peer ` peerProperties.put("grpc.ManagedChannelBuilderOption.maxInboundMessageSize", 100*1024*1024);
Peer peer = client.newPeer(peerName, peerLocation, peerProperties);` and then i still get the error
asaningmaxchain (Tue, 07 Nov 2017 12:27:56 GMT):
@rickr i set the ` peerProperties.put("grpc.ManagedChannelBuilderOption.maxInboundMessageSize", 100*1024*1024);
Peer peer = client.newPeer(peerName, peerLocation, peerProperties);` but i still get the error
asaningmaxchain (Tue, 07 Nov 2017 12:28:09 GMT):
NettyClientTransport$2: Frame size 88617868 exceeds maximum: 4194304
asaningmaxchain (Tue, 07 Nov 2017 12:28:09 GMT):
`NettyClientTransport$2: Frame size 88617868 exceeds maximum: 4194304`
asaningmaxchain (Tue, 07 Nov 2017 12:33:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Pb8gQfiGNGDZ5Bhz6) @rickr @karo
asaningmaxchain (Tue, 07 Nov 2017 12:33:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Pb8gQfiGNGDZ5Bhz6) @rickr @karumbas https://github.com/hyperledger/fabric-sdk-java/blob/11bd160a95fa8529d93582ec68556bb1c4652c21/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L589
asaningmaxchain (Tue, 07 Nov 2017 12:33:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Pb8gQfiGNGDZ5Bhz6) @rickr @karumbas https://github.com/hyperledger/fabric-sdk-java/blob/11bd160a95fa8529d93582ec68556bb1c4652c21/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L589 i think it's place should to see
rickr (Tue, 07 Nov 2017 13:36:56 GMT):
@mdanaci Sounds to me like it's working. The end2end does have multiple orgs but the use different channel for test purposes.
rickr (Tue, 07 Nov 2017 13:45:37 GMT):
@asaningmaxchain I think that message is coming from the fabric not the SDK you'll need to ask on #fabric-peer-endorser-committer if there are server settings needed
mdanaci (Tue, 07 Nov 2017 14:01:18 GMT):
@rickr It's working if i test with the organization that who created that channel. The other organizations don't work. :D
```
Channel newChannel = client.newChannel(name, anOrderer, channelConfiguration, client.getChannelConfigurationSignature(channelConfiguration, org.getPeerAdmin()));
for (String peerName : org.getPeerNames()) {
String peerLocation = org.getPeerLocation(peerName);
Properties peerProperties = config.getPeerProperties(peerName); //test properties for peer.. if any.
if (peerProperties == null) {
peerProperties = new Properties();
}
peerProperties.put("grpc.NettyChannelBuilderOption.maxInboundMessageSize", 9000000);
Peer peer = client.newPeer(peerName, peerLocation, peerProperties);
newChannel.joinPeer(peer);
org.addPeer(peer);
}
for (Orderer orderer : orderers) { //add remaining orderers if any.
newChannel.addOrderer(orderer);
}
client.setUserContext(org.getPeerAdmin());
for (String eventHubName : org.getEventHubNames()) {
final Properties eventHubProperties = config.getEventHubProperties(eventHubName);
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {5L, TimeUnit.MINUTES});
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS});
EventHub eventHub = client.newEventHub(eventHubName, org.getEventHubLocation(eventHubName), eventHubProperties);
newChannel.addEventHub(eventHub);
}
```
mdanaci (Tue, 07 Nov 2017 14:01:18 GMT):
@rickr It's working if i test with the organization that who created that channel. The other organizations don't work. :D
org1 creates the newChannel, how can i add other organizations to this channel?
```
Channel newChannel = client.newChannel(name, anOrderer, channelConfiguration, client.getChannelConfigurationSignature(channelConfiguration, org.getPeerAdmin()));
for (String peerName : org.getPeerNames()) {
String peerLocation = org.getPeerLocation(peerName);
Properties peerProperties = config.getPeerProperties(peerName); //test properties for peer.. if any.
if (peerProperties == null) {
peerProperties = new Properties();
}
peerProperties.put("grpc.NettyChannelBuilderOption.maxInboundMessageSize", 9000000);
Peer peer = client.newPeer(peerName, peerLocation, peerProperties);
newChannel.joinPeer(peer);
org.addPeer(peer);
}
for (Orderer orderer : orderers) { //add remaining orderers if any.
newChannel.addOrderer(orderer);
}
client.setUserContext(org.getPeerAdmin());
for (String eventHubName : org.getEventHubNames()) {
final Properties eventHubProperties = config.getEventHubProperties(eventHubName);
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {5L, TimeUnit.MINUTES});
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS});
EventHub eventHub = client.newEventHub(eventHubName, org.getEventHubLocation(eventHubName), eventHubProperties);
newChannel.addEventHub(eventHub);
}
```
mdanaci (Tue, 07 Nov 2017 14:01:18 GMT):
@rickr It's working if i test with the organization that who created that channel. The other organizations don't work. :D
org1 creates the newChannel, how can i add other organizations to this channel?
```
Channel newChannel = client.newChannel(name, anOrderer, channelConfiguration, client.getChannelConfigurationSignature(channelConfiguration, org.getPeerAdmin()));
for (String peerName : org.getPeerNames()) {
String peerLocation = org.getPeerLocation(peerName);
Properties peerProperties = config.getPeerProperties(peerName); //test properties for peer.. if any.
if (peerProperties == null) {
peerProperties = new Properties();
}
peerProperties.put("grpc.NettyChannelBuilderOption.maxInboundMessageSize", 9000000);
Peer peer = client.newPeer(peerName, peerLocation, peerProperties);
newChannel.joinPeer(peer);
org.addPeer(peer);
}
for (Orderer orderer : orderers) { //add remaining orderers if any.
newChannel.addOrderer(orderer);
}
client.setUserContext(org.getPeerAdmin());
for (String eventHubName : org.getEventHubNames()) {
final Properties eventHubProperties = config.getEventHubProperties(eventHubName);
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {5L, TimeUnit.MINUTES});
eventHubProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS});
EventHub eventHub = client.newEventHub(eventHubName, org.getEventHubLocation(eventHubName), eventHubProperties);
newChannel.addEventHub(eventHub);
}
newChannel.initialize();
```
knagware9 (Tue, 07 Nov 2017 16:13:50 GMT):
Has left the channel.
mastersingh24 (Tue, 07 Nov 2017 23:52:06 GMT):
@mdanaci - take a look at https://youtu.be/DKuGU5CYV_E to understand what is involved in adding additional organizations to a channel and then look at https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/UpdateChannelIT.java for how to interact with configtxlator from the Java SDK
asaningmaxchain (Wed, 08 Nov 2017 01:16:33 GMT):
@rickr @mastersingh24 the java sdk send the tx in async way,so how to get the tps?
asaningmaxchain (Wed, 08 Nov 2017 01:20:19 GMT):
@mastersingh24 @rickr i got the error `"Failed query proposal from peer peer0.org1.example.com status: FAILURE. Messages: Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=INTERNAL, description=io.grpc.netty.NettyClientTransport$3: Frame size 4545210 exceeds maximum: 4194304. , cause=null}. Was verified : false"
Name
`
asaningmaxchain (Wed, 08 Nov 2017 01:20:19 GMT):
@mastersingh24 @rickr i got the error ```"Failed query proposal from peer peer0.org1.example.com status: FAILURE. Messages: Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=INTERNAL, description=io.grpc.netty.NettyClientTransport$3: Frame size 4545210 exceeds maximum: 4194304. , cause=null}. Was verified : false"
Name
```
Umar12 (Wed, 08 Nov 2017 08:36:29 GMT):
Has joined the channel.
rickr (Wed, 08 Nov 2017 12:56:02 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=9wc5AFFCFCf4HT6Mb) Maybe this will help: only one Org creates the channel. All other orgs would use client.newChannel(name) to get the channel object. All orgs need to join their peers the first time and after that would only to reconnstruct the channel use addPeer.
rickr (Wed, 08 Nov 2017 13:35:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=wmpikSFwFFRgarHR9)
https://github.com/hyperledger/fabric-sdk-java/blob/0b3e5aaa7b7f9440921f75f488da34b67f6dd606/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L684
Should be able to do that for orderer, eventhub and peers
rickr (Wed, 08 Nov 2017 13:37:01 GMT):
You may need to also fix the server side for that too. Need to ask that on one of their channels #fabric-peer-endorser-committer ?
rjones (Wed, 08 Nov 2017 20:12:40 GMT):
Has joined the channel.
rjones (Wed, 08 Nov 2017 20:14:11 GMT):
@rickr I thought I saw a comment somewhere from you about needing to preserve log files from release builds for a long time, and I cannot find your comment. Could you help me out - which release builds in particular?
rjones (Wed, 08 Nov 2017 20:15:03 GMT):
@rickr the upcoming outage (this weekend) is to partly address your desire for longer retention, but right now logs are pruned with a very dull knife. If there is a class of logs I can keep for a longer time I'm open to some work on crontab
rickr (Wed, 08 Nov 2017 20:37:18 GMT):
@rjones I think it's ok now. I did mention to @rameshthoomu that a very nice _icing on the cake_ option would be to keep logs for the builds for the last build merged .. until ofcourse the next merge. This would be a good reference at times when something started failing to fallback why it worked before ... if you get my drift
rjones (Wed, 08 Nov 2017 20:38:25 GMT):
that would be pretty hard to determine externally, I think
rickr (Wed, 08 Nov 2017 20:38:46 GMT):
Yeah -- figured -- not high priority
rjones (Wed, 08 Nov 2017 20:38:50 GMT):
there isn't something neat I can do with a `find` command to find those logs.
rjones (Wed, 08 Nov 2017 20:39:02 GMT):
I think longer retention overall will help everyone
rjones (Wed, 08 Nov 2017 20:39:18 GMT):
there is one particular job that is a problem, tbh. I need to set a much shorter retention for it
rjones (Wed, 08 Nov 2017 20:39:48 GMT):
well, any log of the form `fabric*s390x*` is problematic
rickr (Wed, 08 Nov 2017 20:41:13 GMT):
The issue I was also seeing is on reverify for a merged build (maybe it' was on others ) There was no indication being given that it was starting .. which I thought was it was not running at all. But it did kick off and showed it's status _after_ it was done.
rjones (Wed, 08 Nov 2017 20:42:36 GMT):
there is a bug in the `gerrit` plugin for Jenkins. gerrit changed how you comment on merged changes and the Jenkins plugin is not fixed, yet.
rjones (Wed, 08 Nov 2017 20:44:58 GMT):
to give you an idea of scale, the `fabric-verify-z` job logs are about 20megs each. the `fabric-verify-x86_64` logs are about 70K each
rjones (Wed, 08 Nov 2017 20:44:58 GMT):
to give you an idea of scale, the `fabric-verify-z` job logs are ~20megs each. the `fabric-verify-x86_64` logs are ~70K each
rickr (Wed, 08 Nov 2017 20:49:38 GMT):
Yeah but I heard it completes under half the time :)
rjones (Wed, 08 Nov 2017 20:55:13 GMT):
¯\_(ツ)_/¯
rjones (Wed, 08 Nov 2017 20:55:43 GMT):
I can shake my fist in the direction of the service provider, not much I can do otherwise
rjones (Wed, 08 Nov 2017 20:55:59 GMT):
I've had an open ticket on that issue for a little while
asaningmaxchain (Thu, 09 Nov 2017 01:46:50 GMT):
@rickr @mastersingh24 the java sdk send the tx in async way,so how to get the tps?
rickr (Thu, 09 Nov 2017 02:50:58 GMT):
What do you consider a transaction ?
rickr (Thu, 09 Nov 2017 14:07:25 GMT):
You may find this interesting https://chat.hyperledger.org/channel/fabric-orderer?msg=cGEhbX6RKcdfZvFDM
rickr (Thu, 09 Nov 2017 14:28:34 GMT):
*Volunteer Needed*
I keep getting asked on how to set up Eclipse for development. Would like someone preferably who has set it up already and knows all the gotcha's and hints and tips to get it working. No mad rush please : https://jira.hyperledger.org/browse/FAB-6939
chaitanya (Thu, 09 Nov 2017 17:08:05 GMT):
Hi everyone, I am getting a timeout issue (for 2 of my 6 chaincodes) despite all chaincode containers being up
```org.hyperledger.fabric.sdk.exception.ProposalException: Not enough endorsers for invoke RequestOpenChannel :500 endorser error:Sending proposal to peer0.org1.example.com failed because of timeout(20000 milliseconds) expiration. Was verified:false```
Can someone tell me what could be the reasons for the timeout error?
rickr (Thu, 09 Nov 2017 17:15:07 GMT):
It timed out :)
rickr (Thu, 09 Nov 2017 17:16:01 GMT):
Try looking at Config.getProposalWaitTime see how to change that
rickr (Thu, 09 Nov 2017 17:18:24 GMT):
On the fabric side look at the the docker containers instances that are your chaincode find ones that timed out look at the logs see if anything there is going on
aatkddny (Thu, 09 Nov 2017 23:03:16 GMT):
This might be a dumb question.
I have a channel that has 3 organizations attached to it. Each has two endorsing peers.
I need to have a transaction endorsed by two of them for it to be considered ok.
The channel currently is set to allow any one to endorse and it passes - I haven't tried iterating the possibilities yet.
My java code is adapted from the good old end to end sample.
My HFClient is for the first org. It has Org_One.peer0 and peer1 attached to it.
If I submit the TransactionProposalRequest using channel.sendTransactionProposal with my peer set I get two ProposalResponse replies (from the two peers for this channel).
How do I make sure it also is submitted to the other peers? More HFClients? It happens automagically? I add the peers to the channel (even though they are for the wrong client).
Anyone try this yet and can save me a little time?
aatkddny (Thu, 09 Nov 2017 23:03:16 GMT):
I have a channel that has 3 organizations attached to it. Each has two endorsing peers.
I need to have a transaction endorsed by two of them for it to be considered ok.
My java code is adapted from the good old end to end sample.
My HFClient is for the first org. It has Org_One.peer0 and peer1 attached to it.
If I submit the TransactionProposalRequest using channel.sendTransactionProposal with my peer set I get two ProposalResponse replies (from the two peers for this channel).
How do I make sure it also is submitted to the other peers? More HFClients? It happens automagically? I add the peers to the channel (even though they are for the wrong client).
Anyone try this yet and can save me a little time?
aatkddny (Thu, 09 Nov 2017 23:03:16 GMT):
I have a channel that has 3 organizations attached to it. Each has two endorsing peers.
I need to have a transaction endorsed by two of them for it to be considered ok.
My java code is adapted from the good old end to end sample.
My HFClient is for the first org. It has Org_One.peer0 and peer1 attached to it.
If I submit the TransactionProposalRequest using channel.sendTransactionProposal with my peer set I get two ProposalResponse replies (from the two peers for this channel).
When I submit to the orderer I get `java.util.concurrent.ExecutionException: org.hyperledger.fabric.sdk.exception.TransactionEventException: Received invalid transaction event. Transaction ID 7a5070e84ec423e5d5cb63cb18223b322e3233945a37bdc42f321530409e2eda status 10`
If I set it to OR it works just fine, so it is obviously something to do with the requests not propagating.
How do I make sure it also is submitted to the other peers? More HFClients?
Could I add the peers to the channel (even though they are for the wrong client). I think I tried that before and it failed abjectly.
Anyone try this yet and can save me a little time?
aatkddny (Thu, 09 Nov 2017 23:12:31 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=tazKSccFyv3yZrEeo) @rickr
The JavaSDK I assume? It's pretty simple apart from one wrinkle. If you don't have whatever it is you are using for checkstyle (I forgot already - did this a while back) you need to edit the .project file and delete the damn thing - keep only javabuilder and Maven2Nature. After that it's fairly standard - you import it, convert it to a maven project, run the maven -> generate sources and then it should compile cleanly. After that I used the mvn: on the command line as the doc says to run the tests.
aatkddny (Thu, 09 Nov 2017 23:13:59 GMT):
[x ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=wiHw8tTnFRce69jSW) @chaitanya
aatkddny (Thu, 09 Nov 2017 23:13:59 GMT):
[](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=wiHw8tTnFRce69jSW) @chaitanya
I had this happen a more than a few times when I first turned on security. If you look at the logs from the chain code containers attached to the peers (assuming they were instantiated properly) it'll tell you what went wrong.
takeo (Fri, 10 Nov 2017 07:29:32 GMT):
Has joined the channel.
takeo (Fri, 10 Nov 2017 07:43:33 GMT):
Hi! I have some questions about Java SDK.
Why does a User object need a key-value store? What does this way mean?
takeo (Fri, 10 Nov 2017 07:49:12 GMT):
Do I really have to use a key-value store?
takeo (Fri, 10 Nov 2017 08:15:02 GMT):
I need the smallest and simplest Java SDK example to only invoke a chaincode.
takeo (Fri, 10 Nov 2017 08:20:27 GMT):
I guess what class I have to make are classes that implement Enrollment and User. Is it correct?
takeo (Fri, 10 Nov 2017 08:20:27 GMT):
I guess what class I have to make are classes that implement Enrollment and User, except my main class. Is it correct?
chaitanya (Fri, 10 Nov 2017 11:14:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=MnaAsBYpaB5iz5Yun) @rickr I tried changing this via an application.properties, but it never seems to change from the `20000 milliseconds` value. Is there someplace other than `fooChain.setTransactionWaitTime(config.getTransactionWaitTime());` where I must be setting it?
rickr (Fri, 10 Nov 2017 13:52:30 GMT):
You should be able to set it with an environment variable, java system property or config.properties see top of Config.java
rickr (Fri, 10 Nov 2017 13:55:06 GMT):
Also if you are going from TLS to not TLS or visa versa you need to clean out your existing CC docker containers. There is in the sdkintegration directory a fabric.sh that does that for you if you want to do a restart
kedarr (Fri, 10 Nov 2017 14:03:21 GMT):
Has joined the channel.
chaitanya (Fri, 10 Nov 2017 18:38:36 GMT):
@rickr I have a Java SDK instance running, for a network of 2 orgs each containing 2 peers. As far as I understand the purpose of an anchor peer, I should only add the anchor peers to the SDK, right? Or does it make sense to add both the anchor and non-anchor peer to the SDK? By "adding a peer to the SDK" I mean adding them to a channel using the `Channel.addPeer()` function.
chaitanya (Fri, 10 Nov 2017 18:38:36 GMT):
@rickr I have a Java SDK instance running, for a network of 2 orgs each containing 2 peers. As far as I understand the purpose of an anchor peer, I should only add the anchor peers to the SDK, right? Or does it make sense to add both the anchor and non-anchor peer to the SDK?
By "adding a peer to the SDK" I mean adding them to a channel using the `Channel.addPeer()` function.
danielbharath (Sun, 12 Nov 2017 03:27:39 GMT):
Has joined the channel.
rickr (Mon, 13 Nov 2017 14:14:04 GMT):
AFAIK the minimum requirement is just a single peer attached to a channel. Any other peer will need to have gossip setup to keep it sync. In general, the SDK does not care about Anchor vs - non - anchor. That is more related to gossip something the SDK is really not aware of.
asaningmaxchain (Mon, 13 Nov 2017 15:01:50 GMT):
@rickr can you take a look #fabric-orderer
chaitanya (Mon, 13 Nov 2017 16:58:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=yFHFyS8ZxzCZ9SLt4) @rickr alright, thanks!
GayatriH (Tue, 14 Nov 2017 06:57:25 GMT):
Has joined the channel.
GayatriH (Tue, 14 Nov 2017 07:03:40 GMT):
Hi, has anyone tried to make fabric java-sdk v1.1 with docker on windows up and running with chaincode installed and instantiated?
I have run docker-compose.yml which pulls up 3 images - peers, orderer and ca and starts the containers. But when I go to bash for any container, I do no find anything on /opt folder. Also running this command "chaincode_example02 -i CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7051" does not start anything on port 7051.
I am really stuck here, I have multiple things online but there are some info is for v0.6 which is not relevant to v1.1.
Can someone please guide me with set up steps from beginning?
GayatriH (Tue, 14 Nov 2017 07:03:40 GMT):
Hi, has anyone tried to make fabric java-sdk v1.1 with docker on windows up and running with chaincode installed and instantiated?
I have run docker-compose.yml which pulls up 3 images - peers, orderer and ca and starts the containers. But when I go to bash for any container, I do no find anything on /opt folder. Also running this command "chaincode_example02 -i CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7051" does not start anything on port 7051.
I am really stuck here, I have tried multiple things online but some info is for v0.6 which is not relevant to v1.1.
Can someone please guide me with set up steps from beginning?
ascatox (Tue, 14 Nov 2017 14:04:43 GMT):
Hi All! Someone can explain the need to have an *Admin* and a *PeerAdmin* in the End2EndTest
ascatox (Tue, 14 Nov 2017 14:05:06 GMT):
What are the differences between them!Thanks in advance!
ascatox (Tue, 14 Nov 2017 14:05:06 GMT):
What are the differences between them?Thanks in advance!
rickr (Tue, 14 Nov 2017 14:09:36 GMT):
The Admin should be more properly named CARegistrar. That user can register with the CA additional users to `invoke` chaincode. The PeerAdmin is needed to join peer to channel, install CC, and instantiate CC.
ascatox (Tue, 14 Nov 2017 14:11:41 GMT):
They are both necessary, I can use only the Admin for everytihng
ascatox (Tue, 14 Nov 2017 14:11:41 GMT):
They are both necessary, I can use only the Admin for everything
rickr (Tue, 14 Nov 2017 14:12:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=4Yur6YBfRzCfvhWHH) Maybe this can help with windows ? I don't use windows so kind lost at helping out
rickr (Tue, 14 Nov 2017 14:15:22 GMT):
The Peer Admin can do almost anything except update chaincode that requires the Orderer Admin.
ascatox (Tue, 14 Nov 2017 14:18:00 GMT):
Thanks for the asnwer
ascatox (Tue, 14 Nov 2017 14:18:00 GMT):
Thanks for the asnwer!
ascatox (Tue, 14 Nov 2017 14:19:40 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=crLRw2BNp4kifzZAs) @rickr I can register a PeerAdmin using a CA Server?
rickr (Tue, 14 Nov 2017 14:23:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Ptz3Jxrxtuehbg644) Should have been :
The Peer Admin can do almost anything except update/modify the channel that requires the Orderer Admin.
mdanaci (Tue, 14 Nov 2017 15:03:34 GMT):
Hello, i can't call channel.initialize(); in my test environments. I'm using payara as a server. I'm getting "Jetty ALPN/NPN has not been properly configured."
```
Caused by: java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.
at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:153)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:130)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:119)
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:90)
at org.hyperledger.fabric.sdk.Endpoint.
berserkr (Tue, 14 Nov 2017 17:29:54 GMT):
Hi All, is there a guide to use the sdk with bmx without using composer?
berserkr (Tue, 14 Nov 2017 17:35:25 GMT):
also, one quick question, has anyone here tried the sdk on android?
berserkr (Tue, 14 Nov 2017 17:36:07 GMT):
I read that android is adding support for bouncy castle, which is a reason why many crypto suites were limited (e.g., spongy castle)
takeo (Wed, 15 Nov 2017 06:09:51 GMT):
@rickr Please let me know what is wrong...
``` HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
User user = User.getPeerAdminUser("crypto-config/peerOrganizations/peer.sbps-bcpoc.jp/users/Admin@peer.sbps-bcpoc.jp/msp", "Org1MSP");
client.setUserContext(user);
Peer peer = client.newPeer("peer0.peer.sbps-bcpoc.jp", "grpc://13.113.211.1:7051");
Channel channel = client.newChannel("bcpoc01ch");
channel.addPeer(peer);
ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName("testcc").setVersion("1.0").build();
TransactionProposalRequest tr = client.newTransactionProposalRequest();
QueryByChaincodeRequest queryByChaincodeRequest = client.newQueryProposalRequest();
queryByChaincodeRequest.setArgs(new String[] {"a"});
queryByChaincodeRequest.setFcn("get");
queryByChaincodeRequest.setChaincodeID(chaincodeId);
Collection
takeo (Wed, 15 Nov 2017 06:09:51 GMT):
@rickr Please let me know what is wrong...
``` HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
User user = User.getPeerAdminUser("crypto-config/peerOrganizations/peer.sbps-bcpoc.jp/users/Admin@peer.mydomain.jp/msp", "Org1MSP");
client.setUserContext(user);
Peer peer = client.newPeer("peer0.peer.mydomain.jp", "grpc://xxx.xxx.xxx.xxx:7051");
Channel channel = client.newChannel("mych");
channel.addPeer(peer);
ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName("testcc").setVersion("1.0").build();
TransactionProposalRequest tr = client.newTransactionProposalRequest();
QueryByChaincodeRequest queryByChaincodeRequest = client.newQueryProposalRequest();
queryByChaincodeRequest.setArgs(new String[] {"a"});
queryByChaincodeRequest.setFcn("get");
queryByChaincodeRequest.setChaincodeID(chaincodeId);
Collection
takeo (Wed, 15 Nov 2017 06:09:51 GMT):
@rickr Please let me know what is wrong...
``` HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
User user = User.getPeerAdminUser("crypto-config/peerOrganizations/peer.mydomain.jp/users/Admin@peer.mydomain.jp/msp", "Org1MSP");
client.setUserContext(user);
Peer peer = client.newPeer("peer0.peer.mydomain.jp", "grpc://xxx.xxx.xxx.xxx:7051");
Channel channel = client.newChannel("mych");
channel.addPeer(peer);
ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName("testcc").setVersion("1.0").build();
TransactionProposalRequest tr = client.newTransactionProposalRequest();
QueryByChaincodeRequest queryByChaincodeRequest = client.newQueryProposalRequest();
queryByChaincodeRequest.setArgs(new String[] {"a"});
queryByChaincodeRequest.setFcn("get");
queryByChaincodeRequest.setChaincodeID(chaincodeId);
Collection
takeo (Wed, 15 Nov 2017 06:09:51 GMT):
@rickr Please let me know what is wrong...
``` HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MyUser user = MyUser.getPeerAdminUser("crypto-config/peerOrganizations/peer.mydomain.jp/users/Admin@peer.mydomain.jp/msp", "Org1MSP");
client.setUserContext(user);
Peer peer = client.newPeer("peer0.peer.mydomain.jp", "grpc://xxx.xxx.xxx.xxx:7051");
Channel channel = client.newChannel("mych");
channel.addPeer(peer);
ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName("testcc").setVersion("1.0").build();
TransactionProposalRequest tr = client.newTransactionProposalRequest();
QueryByChaincodeRequest queryByChaincodeRequest = client.newQueryProposalRequest();
queryByChaincodeRequest.setArgs(new String[] {"a"});
queryByChaincodeRequest.setFcn("get");
queryByChaincodeRequest.setChaincodeID(chaincodeId);
Collection
takeo (Wed, 15 Nov 2017 06:09:51 GMT):
@rickr Please let me know what is wrong...
``` HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MyUser user = MyUser.getPeerAdminUser("crypto-config/peerOrganizations/peer.mydomain.jp/users/Admin@peer.mydomain.jp/msp", "Org1MSP");
client.setUserContext(user);
Peer peer = client.newPeer("peer0.peer.mydomain.jp", "grpc://xxx.xxx.xxx.xxx:7051");
Channel channel = client.newChannel("mych");
channel.addPeer(peer);
ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName("testcc").setVersion("1.0").build();
TransactionProposalRequest tr = client.newTransactionProposalRequest();
QueryByChaincodeRequest queryByChaincodeRequest = client.newQueryProposalRequest();
queryByChaincodeRequest.setArgs(new String[] {"a"});
queryByChaincodeRequest.setFcn("get");
queryByChaincodeRequest.setChaincodeID(chaincodeId);
Collection
takeo (Wed, 15 Nov 2017 06:09:51 GMT):
@rickr Please let me know what is wrong...
``` HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MyUser user = MyUser.getPeerAdminUser("crypto-config/peerOrganizations/peer.mydomain.jp/users/Admin@peer.mydomain.jp/msp", "Org1MSP");
client.setUserContext(user);
Peer peer = client.newPeer("peer0.peer.mydomain.jp", "grpc://xxx.xxx.xxx.xxx:7051");
Channel channel = client.newChannel("mych");
channel.addPeer(peer);
ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName("testcc").setVersion("1.0").build();
TransactionProposalRequest tr = client.newTransactionProposalRequest();
QueryByChaincodeRequest queryByChaincodeRequest = client.newQueryProposalRequest();
queryByChaincodeRequest.setArgs(new String[] {"a"});
queryByChaincodeRequest.setFcn("get");
queryByChaincodeRequest.setChaincodeID(chaincodeId);
Collection
takeo (Wed, 15 Nov 2017 06:09:51 GMT):
@rickr Please let me know what is wrong...
below command succeed.
```CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/crypto/peerOrganizations/peer.mydomain.jp/users/Admin@peer.mydomain.jp/msp \
CORE_PEER_ADDRESS=xxx.xxx.xxx.xxx:7051 \
CORE_PEER_LOCALMSPID="Org1MSP" \
peer chaincode query -C mych -n testcc -v 1.0 -c '{"Args":["query","a"]}'```
below Java program shows the exception.
``` HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MyUser user = MyUser.getPeerAdminUser("crypto-config/peerOrganizations/peer.mydomain.jp/users/Admin@peer.mydomain.jp/msp", "Org1MSP");
client.setUserContext(user);
Peer peer = client.newPeer("peer0.peer.mydomain.jp", "grpc://xxx.xxx.xxx.xxx:7051");
Channel channel = client.newChannel("mych");
channel.addPeer(peer);
ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName("testcc").setVersion("1.0").build();
TransactionProposalRequest tr = client.newTransactionProposalRequest();
QueryByChaincodeRequest queryByChaincodeRequest = client.newQueryProposalRequest();
queryByChaincodeRequest.setArgs(new String[] {"a"});
queryByChaincodeRequest.setFcn("get");
queryByChaincodeRequest.setChaincodeID(chaincodeId);
Collection
mdanaci (Wed, 15 Nov 2017 07:50:07 GMT):
you need to call channel.initialize(); [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=njXtfBW7T9m7J59yi) @takeo
takeo (Wed, 15 Nov 2017 08:37:54 GMT):
@mdanaci Thank you!
ascatox (Wed, 15 Nov 2017 10:15:20 GMT):
Hi All! Someone knows where can I find an example of users enrolling with a CA Server?
mdanaci (Wed, 15 Nov 2017 10:52:32 GMT):
Hello @rickr i added jetty-alpn-agent and alpn-boot jar files to payara's libs but no help. Do i need to use ibm jdk? [ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=k6CdGQLCwGmzBYG7t)
gauravgiri (Wed, 15 Nov 2017 10:58:04 GMT):
Hi @rickr Hi,
We are trying out concurrency tests(submitting multiple, say 4 transactions, unrelated, no conflict transactions, to the blockchain network at the same time) using fabric-sdk-java version 1.0.1 with a batch size of 1. However sometimes, we do get these errors during Channel.sendTransaction. The transactions proposals from peers are OK and verified. Still we get the below error. Any idea, why this could be happening?
I checked in fabric-sdk-java's class Channel. Here the Original Exception thrown by sendTransaction method is eaten up, and wrapped up inside a new Exception and throw it back to client, hence the original cause of the error on sendTransaction is not available to the client applications.
Can we get the source jar for maven 1.0.1 fabric-sdk-java jar?
java.util.concurrent.ExecutionException: java.lang.Exception: Channel testchannel failed to place transaction d92e5114cfbaaf427bb6cd9521066e746073771e3a4e6de8aa5bc4001a57988c on Orderer. Cause: UNSUCCESSFUL
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:368)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1926)
....
Caused by: java.lang.Exception: Channel testchannel failed to place transaction d92e5114cfbaaf427bb6cd9521066e746073771e3a4e6de8aa5bc4001a57988c on Orderer. Cause: UNSUCCESSFUL
at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:2183)
at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:2087)
at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:2073)
gauravgiri (Wed, 15 Nov 2017 10:58:04 GMT):
Hi @rickr ,
We are trying out concurrency tests(submitting multiple, say 4 transactions, unrelated, no conflict transactions, to the blockchain network at the same time) using fabric-sdk-java version 1.0.1 with a batch size of 1. However sometimes, we do get these errors during Channel.sendTransaction. The transactions proposals from peers are OK and verified. Still we get the below error. Any idea, why this could be happening?
I checked in fabric-sdk-java's class Channel. Here the Original Exception thrown by sendTransaction method is eaten up, and wrapped up inside a new Exception and throw it back to client, hence the original cause of the error on sendTransaction is not available to the client applications.
Can we get the source jar for maven 1.0.1 fabric-sdk-java jar?
java.util.concurrent.ExecutionException: java.lang.Exception: Channel testchannel failed to place transaction d92e5114cfbaaf427bb6cd9521066e746073771e3a4e6de8aa5bc4001a57988c on Orderer. Cause: UNSUCCESSFUL
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:368)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1926)
....
Caused by: java.lang.Exception: Channel testchannel failed to place transaction d92e5114cfbaaf427bb6cd9521066e746073771e3a4e6de8aa5bc4001a57988c on Orderer. Cause: UNSUCCESSFUL
at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:2183)
at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:2087)
at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:2073)
minhasr (Wed, 15 Nov 2017 13:46:50 GMT):
Has joined the channel.
rickr (Wed, 15 Nov 2017 14:37:33 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6P5L5vmZSTab3C3Eq)
https://github.com/hyperledger/fabric-sdk-java/blob/d4ff8c2e0041b72fbe0b03eb959a701b17ff1841/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L186 ?
rickr (Wed, 15 Nov 2017 14:37:33 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6P5L5vmZSTab3C3Eq)
https://github.com/hyperledger/fabric-sdk-java/blob/d4ff8c2e0041b72fbe0b03eb959a701b17ff1841/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L186 ?
As stated before the *IT.java testcases do 95% of what the JSDK can do.
rickr (Wed, 15 Nov 2017 14:58:47 GMT):
@gauravgiri _Original Exception thrown by sendTransaction method is eaten up_ Can you point me to where in the code (preferably a github url link to the code line) where the original exception is getting lost. Is not logged ?
Would like to fix that if it's still the case.
Source is always in github all published jars are https://oss.sonatype.org/content/repositories/releases/org/hyperledger/fabric-sdk-java/fabric-sdk-java/1.0.1/
At that small stack trace line 2183 on v101 would not the part of that execption I don't think
https://github.com/hyperledger/fabric-sdk-java/blob/11bd160a95fa8529d93582ec68556bb1c4652c21/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L2183
So is that really v101?
This with very limited information looks like Orderer itself is throwing that. If true, first we would need to find out why that was which would be asked on the #fabric-orderer channel. You'll probably need full logs and exactly when it giving that error.
berserkr (Thu, 16 Nov 2017 00:47:48 GMT):
@rickr I am getting the dreaded "bad_request" error when creating the channel foo. I am using the End2endIT.java scenario, I re-purposed it as a single java application, and am able to enroll users with the fabric ca. My network is the basic network you can configure using the fabric-samples/basic-network config
berserkr (Thu, 16 Nov 2017 00:48:02 GMT):
my understanding is that this is a crypto issue
berserkr (Thu, 16 Nov 2017 00:50:25 GMT):
however, what I ended up doing, which might be wrong is: copy over the `~/dev/src/github.com/hyperledger/fabric-samples/basic-network/crypto-config` contents onto the `fixture/sdkintegration/e2e-2Orgs/`
channel directory
berserkr (Thu, 16 Nov 2017 00:51:19 GMT):
From what I understood, the sdk will pick up the certificates from the crypto-config directory (for the Admin/User entities), and use that to send requests via the application/sdk
berserkr (Thu, 16 Nov 2017 00:58:41 GMT):
My working code is here, based on some of the work you guys have been doing: `https://github.com/berserkr/sample_java_app_hlfv1`
berserkr (Thu, 16 Nov 2017 01:38:00 GMT):
```2017-11-16 00:01:16.802 UTC [orderer/common/sigfilter] Apply -> DEBU 753 Forwarding validly signed message for policy &{%!s(*common.ImplicitMetaPolicy=&{Readers 0}) %!s(int=1) [%!s(*policies.implicitMetaPolicy=&{0xc420adcb80 1 [0xc420025768]}) %!s(*policies.implicitMetaPolicy=&{0xc420add0e0 1 [0xc4200257c8]})]}
2017-11-16 00:01:16.802 UTC [orderer/common/deliver] Handle -> DEBU 754 [channel: mychannel] Received seekInfo (0xc420b2a1c0) start:
berserkr (Thu, 16 Nov 2017 01:38:28 GMT):
my network is running on a separate server as well
lin2K (Thu, 16 Nov 2017 02:13:53 GMT):
in fabric java sdk 1.1 how to set custom propertys
lin2K (Thu, 16 Nov 2017 02:31:01 GMT):
// Default values
/**
* Timeout settings
**/
defaultProperty(PROPOSAL_WAIT_TIME, "20000");
defaultProperty(CHANNEL_CONFIG_WAIT_TIME, "15000");
defaultProperty(ORDERER_RETRY_WAIT_TIME, "200");
defaultProperty(ORDERER_WAIT_TIME, "10000");
defaultProperty(EVENTHUB_CONNECTION_WAIT_TIME, "1000");
defaultProperty(GENESISBLOCK_WAIT_TIME, "50000");
gauravgiri (Thu, 16 Nov 2017 03:07:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=iH5bmfGcNRcK9dW5Y) @rickr Thank you,
At the git source for v1.0.1 https://github.com/hyperledger/fabric-sdk-java/blob/v1.0.1/src/main/java/org/hyperledger/fabric/sdk/Channel.java, at line #2384 on sendTransaction if an Exception is thrown, it is caught at line #2391 by the ExceptionHandler. However the Exception information is not used to throw the error back to the client application at line #2409, with exception constructed at line #2407.
Also, I agree that the error is logged at line #2397, however for this we still need to configure commons-logging, would appreciate if the original error could be propogated back to the client application.
We are using the maven fabric-sdk-java 1.0.1 version at: https://mvnrepository.com/artifact/org.hyperledger.fabric-sdk-java/fabric-sdk-java. So maybe differences in line # because of maven version of 1.0.1 and original source at https://github.com/hyperledger/fabric-sdk-java/blob/v1.0.1/src/main/java/org/hyperledger/fabric/sdk/Channel.java?
Kindly suggest.
Thank You.
balmeida (Thu, 16 Nov 2017 10:28:24 GMT):
Has joined the channel.
rickr (Thu, 16 Nov 2017 15:37:48 GMT):
Thanks @gauravgiri I see now where we are not including the original error.
rickr (Thu, 16 Nov 2017 15:39:50 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=97xHgLNmmd8wBgHit) @lin2K
https://github.com/hyperledger/fabric-sdk-java/blob/ef748a8979b8203636a85e59b190a383c1086026/src/main/java/org/hyperledger/fabric/sdk/helper/Config.java#L32
doraemon7 (Fri, 17 Nov 2017 06:50:14 GMT):
Has joined the channel.
swettdj (Fri, 17 Nov 2017 09:15:30 GMT):
hello @here I'm tying to upgrade the chaincode on fabcar sample using the SDK. So first of all I send a `sendInstallProposa` with an `InstallProposalRequest` settend like this: `installProposalRequest.setChaincodeSourceLocation(new File("C:\\DeLauri\\WorkSpaces\\WorkSpaceFabric\\FAbricCarWEB"));
installProposalRequest.setChaincodeVersion("1.541");
installProposalRequest.setChaincodePath("\\");`. This request install the chaincode succefully.
swettdj (Fri, 17 Nov 2017 09:15:30 GMT):
hello @here I'm tying to upgrade the chaincode on fabcar sample using the SDK. So first of all I send a `sendInstallProposa` with an `InstallProposalRequest` settend like this: ```installProposalRequest.setChaincodeSourceLocation(new File("C:\\DeLauri\\WorkSpaces\\WorkSpaceFabric\\FAbricCarWEB"));
installProposalRequest.setChaincodeVersion("1.541");
installProposalRequest.setChaincodePath("\\");```. This request install the chaincode succefully.
swettdj (Fri, 17 Nov 2017 09:19:48 GMT):
after this I create an `UpgradeProposalRequest` like this: ```UpgradeProposalRequest upgradeProposal = hfClient.newUpgradeProposalRequest();
upgradeProposal.setChaincodeID(chaincodeID);
upgradeProposal.setChaincodeVersion("1.541");
upgradeProposal.setArgs(new String[]{""});
upgradeProposal.setChaincodePath("src\\");
ChaincodeEndorsementPolicy endorsmentPolicy = new ChaincodeEndorsementPolicy();
endorsmentPolicy.fromYamlFile(new File("C:\\DeLauri\\WorkSpaces\\WorkSpaceFabric\\FAbricCarWEB\\src\\chaincodeendorsementpolicy.yaml"));
upgradeProposal.setChaincodeEndorsementPolicy(endorsmentPolicy);``` but when I send this proposal I get this error: `Failed to generate platform-specific docker build: could not decode url: ChaincodeSpec's path/URL invalid`.
swettdj (Fri, 17 Nov 2017 09:20:01 GMT):
could someone help me?
wininani (Fri, 17 Nov 2017 12:33:36 GMT):
Has joined the channel.
aatkddny (Fri, 17 Nov 2017 13:45:25 GMT):
You need to set the relative directory path in the go/src directory. In my case my CC was in the /participate directory so my path was "/participant".
aatkddny (Fri, 17 Nov 2017 13:45:25 GMT):
You need to set the relative directory path in the go/src directory. In my case my CC was in the /participate directory so my path was "/participate".
aatkddny (Fri, 17 Nov 2017 13:45:25 GMT):
I think you need to set the relative directory path in the go/src directory. In my case my CC was in the /participate directory so my path was "/participate".
If you want to do it the other way, this worked:
`
log.info("***Creating install proposal for chaincode");
final String channelName = channel.getName();
client.setUserContext(org.getPeerAdmin());
InstallProposalRequest installProposalRequest = client.newInstallProposalRequest();
installProposalRequest.setChaincodeID(chaincodeID);
String goFolder = "/Users/alanatkinson/go/src/repparticipant";
String tgzPrefix = "src/" + CHAIN_CODE_PATH;
installProposalRequest.setChaincodeInputStream(Util.generateTarGzInputStream((Paths.get(goFolder).toFile()), tgzPrefix));
installProposalRequest.setChaincodeVersion(CHAIN_CODE_VERSION);
log.info("Sending install proposal");
Collection
aatkddny (Fri, 17 Nov 2017 13:45:25 GMT):
I think you need to set the relative directory path in the go/src directory. In my case my CC was in the /participate directory so my path was "/participate".
If you want to do it the other way, this worked:
`
log.info("***Creating install proposal for chaincode");
final String channelName = channel.getName();
client.setUserContext(org.getPeerAdmin());
InstallProposalRequest installProposalRequest = client.newInstallProposalRequest();
installProposalRequest.setChaincodeID(chaincodeID);
String goFolder = "/Users/alanatkinson/go/src/repparticipant";
String tgzPrefix = "src/" + CHAIN_CODE_PATH;
installProposalRequest.setChaincodeInputStream(Util.generateTarGzInputStream((Paths.get(goFolder).toFile()), tgzPrefix));
installProposalRequest.setChaincodeVersion(CHAIN_CODE_VERSION);
log.info("Sending install proposal");
Collection
aatkddny (Fri, 17 Nov 2017 13:45:25 GMT):
I think you need to set the relative directory path in the go/src directory. In my case my CC was in the /participate directory so my path was "/participate".
If you want to do it the other way, this worked:
`final String channelName = channel.getName();
client.setUserContext(org.getPeerAdmin());
InstallProposalRequest installProposalRequest = client.newInstallProposalRequest();
installProposalRequest.setChaincodeID(chaincodeID);
String goFolder = "/Users/alanatkinson/go/src/repparticipant";
String tgzPrefix = "src/" + CHAIN_CODE_PATH;
installProposalRequest.setChaincodeInputStream(Util.generateTarGzInputStream((Paths.get(goFolder).toFile()), tgzPrefix));
installProposalRequest.setChaincodeVersion(CHAIN_CODE_VERSION);
Collection
aatkddny (Fri, 17 Nov 2017 13:45:25 GMT):
I think you need to set the relative directory path in the go/src directory. In my case my CC was in the /participate directory so my path was "/participate".
If you want to do it the other way, this worked:
final String channelName = channel.getName();
client.setUserContext(org.getPeerAdmin());
InstallProposalRequest installProposalRequest = client.newInstallProposalRequest();
installProposalRequest.setChaincodeID(chaincodeID);
String goFolder = "/Users/alanatkinson/go/src/repparticipant";
String tgzPrefix = "src/" + CHAIN_CODE_PATH;
installProposalRequest.setChaincodeInputStream(Util.generateTarGzInputStream((Paths.get(goFolder).toFile()), tgzPrefix));
installProposalRequest.setChaincodeVersion(CHAIN_CODE_VERSION);
Collection
aatkddny (Fri, 17 Nov 2017 13:45:25 GMT):
I think you need to set the relative directory path in the go/src directory. In my case my CC was in the /participate directory so my path was "/participate".
If you want to do it the other way, this worked:
final String channelName = channel.getName();
client.setUserContext(org.getPeerAdmin());
InstallProposalRequest installProposalRequest = client.newInstallProposalRequest();
installProposalRequest.setChaincodeID(chaincodeID);
String goFolder = "/Users/alanatkinson/go/src/participate";
String tgzPrefix = "src/" + CHAIN_CODE_PATH;
installProposalRequest.setChaincodeInputStream(Util.generateTarGzInputStream((Paths.get(goFolder).toFile()), tgzPrefix));
installProposalRequest.setChaincodeVersion(CHAIN_CODE_VERSION);
Collection
aatkddny (Fri, 17 Nov 2017 13:56:35 GMT):
I hit this with spring-boot. Spent a while on it, but it was a little while ago, so don't remember exactly what the fix was. There's nothing in the classpath or extra exported jars though.
The only additional dep in my pom is this:
aatkddny (Fri, 17 Nov 2017 13:56:35 GMT):
@mdanaci I hit this with spring-boot. Spent a while on it, but it was a little while ago, so don't remember exactly what the fix was. There's nothing in the classpath or extra exported jars though.
The only additional dep in my pom is this:
swettdj (Fri, 17 Nov 2017 15:13:48 GMT):
@aatkddny the InstallationProposal works fine, my problem is with `pgradeProposal.setChaincodePath("src\\");`
swettdj (Fri, 17 Nov 2017 15:13:48 GMT):
@aatkddny the InstallationProposal works fine, my problem is with `upgradeProposal.setChaincodePath("src\\");`
aatkddny (Fri, 17 Nov 2017 16:29:45 GMT):
My bad. Lack of coffee. But I still think you need a path set relative to src.
berserkr (Fri, 17 Nov 2017 23:50:01 GMT):
has anyone seen the following trace before: ```
org.hyperledger.fabric.sdk.exception.InvalidArgumentException: Proposal response is invalid.
at org.hyperledger.fabric.sdk.ProposalResponse.getChaincodeActionResponsePayload(ProposalResponse.java:207)
at End2endIT.lambda$runChannel$0(End2endIT.java:409)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
at org.hyperledger.fabric.sdk.Channel$TL.lambda$fire$1(Channel.java:2793)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
java.lang.NullPointerException
at End2endIT.lambda$runChannel$1(End2endIT.java:449)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
at org.hyperledger.fabric.sdk.Channel$TL.lambda$fire$1(Channel.java:2793)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
org.hyperledger.fabric.sdk.exception.ProposalException: queryBlockchainInfo peer peer0.org1.example.com channel foo error Unable to query block channel info for channel foo from peer peer0.org1.example.com with message Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority, cause=null}
at org.hyperledger.fabric.sdk.Channel.queryBlockchainInfo(Channel.java:1817)
at org.hyperledger.fabric.sdk.Channel.queryBlockchainInfo(Channel.java:1778)
at End2endIT.runChannel(End2endIT.java:508)
at End2endIT.setup(End2endIT.java:198)
at End2endIT.go(End2endIT.java:91)
at Hello.main(Hello.java:5)
Caused by: org.hyperledger.fabric.sdk.exception.PeerException: Unable to query block channel info for channel foo from peer peer0.org1.example.com with message Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority, cause=null}
at org.hyperledger.fabric.sdk.Channel.queryBlockchainInfo(Channel.java:1805)
... 5 more
Caught an exception running channel foo
Test failed with error : queryBlockchainInfo peer peer0.org1.example.com channel foo error Unable to query block channel info for channel foo from peer peer0.org1.example.com with message Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority, cause=null}
That's all folks!
Process finished with exit code 0```
berserkr (Fri, 17 Nov 2017 23:50:50 GMT):
I am able to create the channel, install the cc, and instantiate it, but it is now going through: ````Constructing channel foo
Created channel foo
Peer peer0.org1.example.com joined channel foo
Finished initialization channel foo
Running channel foo
Creating install proposal
Sending install proposal
Successful install proposal response Txid: c2d30b9d4c8d94e3310ed2cc503b9f72f2679d3fbe21403201b06b1fa82bf336 from peer peer0.org1.example.com
Received 1 install proposal responses. Successful+verified: 1 . Failed: 0
Sending instantiateProposalRequest to all peers with arguments: a and b set to 100 and 200 respectively
Succesful instantiate proposal response Txid: 0bc66c075dd566cdfcc21a014e5d870508782ba3ee86aa8fc6fc2a2aa053fdc5 from peer peer0.org1.example.com
Received 1 instantiate proposal responses. Successful+verified: 1 . Failed: 0
Sending instantiateTransaction to orderer with a and b set to 100 and 200 respectively
Finished instantiate transaction with transaction id 0bc66c075dd566cdfcc21a014e5d870508782ba3ee86aa8fc6fc2a2aa053fdc5
sending transactionProposal to all peers with arguments: move(a,b,100)
Expected only one set of consistent proposal responses but got 0
Received 1 transaction proposal responses. Successful+verified: 0 . Failed: 1
Not enough endorsers for invoke(move a,b,100):1 endorser error: Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority, cause=null}. Was verified: false
Successfully received transaction proposal responses.
Caught an exception while invoking chaincode
Failed invoking chaincode with error : Proposal response is invalid.
Caught exception while running query
Failed during chaincode query with error : null```
berserkr (Fri, 17 Nov 2017 23:51:42 GMT):
My setup is simple, I have the fabric-samples/basic-network running on a server, and trying to access it through the sdk on my laptop - crypto-config and channel info were copied over to the channel directory
berserkr (Fri, 17 Nov 2017 23:52:25 GMT):
This is the last part of my peer's log: ```2017-11-17 23:46:29.983 UTC [couchdb] handleRequest -> DEBU 5a9 Entering handleRequest() method=PUT url=http://couchdb:5984/foo/statedb_savepoint
2017-11-17 23:46:29.983 UTC [couchdb] handleRequest -> DEBU 5aa HTTP Request: PUT /foo/statedb_savepoint HTTP/1.1 | Host: couchdb:5984 | User-Agent: Go-http-client/1.1 | Content-Length: 191 | Accept: application/json | Content-Type: application/json | If-Match: 1-9ba3fd32b8a121ab6eb633efa1c4bef2 | Accept-Encoding: gzip | |
2017-11-17 23:46:29.984 UTC [couchdb] handleRequest -> DEBU 5ab Exiting handleRequest()
2017-11-17 23:46:29.984 UTC [couchdb] SaveDoc -> DEBU 5ac Exiting SaveDoc()
2017-11-17 23:46:29.984 UTC [lockbasedtxmgr] Commit -> DEBU 5ad Updates committed to state database
2017-11-17 23:46:29.984 UTC [historyleveldb] Commit -> DEBU 5ae Channel [foo]: Updating history database for blockNo [1] with [1] transactions
2017-11-17 23:46:29.985 UTC [historyleveldb] Commit -> DEBU 5af Channel [foo]: Updates committed to history database for blockNo [1]
2017-11-17 23:46:29.985 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 5b0 Entry
2017-11-17 23:46:29.985 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 5b1 Channel [foo]: Block event for block number [1] contains transaction id: 0bc66c075dd566cdfcc21a014e5d870508782ba3ee86aa8fc6fc2a2aa053fdc5
2017-11-17 23:46:29.985 UTC [eventhub_producer] SendProducerBlockEvent -> INFO 5b2 Channel [foo]: Sending event for block number [1]
2017-11-17 23:46:29.985 UTC [eventhub_producer] Send -> DEBU 5b3 Entry
2017-11-17 23:46:29.985 UTC [eventhub_producer] Send -> DEBU 5b4 Event processor timeout > 0
2017-11-17 23:46:29.985 UTC [eventhub_producer] Send -> DEBU 5b5 Event sent successfully
2017-11-17 23:46:29.985 UTC [eventhub_producer] Send -> DEBU 5b6 Exit
2017-11-17 23:46:29.985 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU 5b7 Exit
2017-11-17 23:46:29.996 UTC [endorser] ProcessProposal -> DEBU 5b8 Entry
2017-11-17 23:46:29.996 UTC [protoutils] ValidateProposalMessage -> DEBU 5b9 ValidateProposalMessage starts for signed proposal 0xc421428ed0
2017-11-17 23:46:29.996 UTC [protoutils] validateChannelHeader -> DEBU 5ba validateChannelHeader info: header type 3
2017-11-17 23:46:29.996 UTC [protoutils] checkSignatureFromCreator -> DEBU 5bb checkSignatureFromCreator starts
2017-11-17 23:46:29.996 UTC [endorser] ProcessProposal -> DEBU 5bc Exit
2017-11-17 23:46:30.005 UTC [endorser] ProcessProposal -> DEBU 5bd Entry
2017-11-17 23:46:30.005 UTC [protoutils] ValidateProposalMessage -> DEBU 5be ValidateProposalMessage starts for signed proposal 0xc421429590
2017-11-17 23:46:30.005 UTC [protoutils] validateChannelHeader -> DEBU 5bf validateChannelHeader info: header type 3
2017-11-17 23:46:30.005 UTC [protoutils] checkSignatureFromCreator -> DEBU 5c0 checkSignatureFromCreator starts
2017-11-17 23:46:30.006 UTC [endorser] ProcessProposal -> DEBU 5c1 Exit
2017-11-17 23:46:30.333 UTC [eventhub_producer] Chat -> ERRO 5c2 error during Chat, stopping handler: rpc error: code = Canceled desc = context canceled
2017-11-17 23:46:30.333 UTC [eventhub_producer] deRegisterHandler -> DEBU 5c3 deregistering event type: BLOCK```
berserkr (Fri, 17 Nov 2017 23:53:12 GMT):
Finally, my policy is simple: ```# A Shotgun policy xx
identities: # list roles to be used in the policy
user1: {"role": {"name": "member", "mspId": "Org1MSP"}} # role member in org with mspid Org1MSP
#user2: {"role": {"name": "member", "mspId": "Org2MSP"}}
admin1: {"role": {"name": "admin", "mspId": "Org1MSP"}} # admin role.
#admin2: {"role": {"name": "admin", "mspId": "Org2MSP"}}
policy: # the policy .. could have been flat but show grouping.
1-of: # signed by one of these groups can be
berserkr (Fri, 17 Nov 2017 23:53:36 GMT):
I used the default policy provided by oneof the samples, and commented out the second org as we only have one org
berserkr (Sat, 18 Nov 2017 00:11:39 GMT):
does anyone know where the 'tls' folder comes from in the javasdkintegration example? : `src/test/fixture/sdkintegration/e2e-2Orgs/tls` - https://github.com/hyperledger/fabric-sdk-java/tree/master/src/test/fixture/sdkintegration/e2e-2Orgs/tls
mastersingh24 (Sun, 19 Nov 2017 13:13:04 GMT):
@berserkr - I'm not even sure it is used anymore?
swettdj (Mon, 20 Nov 2017 11:24:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=QTrLs3inrPDZRQpFf) @aatkddny my problem is this! I.e. I install the chaincode catch him from my local machine (`"C:\\DeLauri\\WorkSpaces\\WorkSpaceFabric\\FAbricCarWEB"`). But when I send the upgrade proposal I don't understand what path I must set: my local path ore some peer's local path?
swettdj (Mon, 20 Nov 2017 11:24:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=QTrLs3inrPDZRQpFf) @aatkddny my problem is this! I.e. I install the chaincode catch him from my local machine ( `"C:\\DeLauri\\WorkSpaces\\WorkSpaceFabric\\FAbricCarWEB"` ). But when I send the upgrade proposal I don't understand what path I must set: my local path ore some peer's local path?
SandySun2000 (Mon, 20 Nov 2017 19:25:13 GMT):
Any one has experience to check in files to Gerrit? I kept getting Permission Denied (publickey), even I already copy paste ~/.ssh/id_rsa.pub to settings/SSH Public Keys?
swettdj (Tue, 21 Nov 2017 10:50:19 GMT):
@here anyone could help/explain me??
SwatiRaj (Tue, 21 Nov 2017 11:25:42 GMT):
@swettdj your local path , because it will take it from your local where your java application is running.
swettdj (Tue, 21 Nov 2017 11:31:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=YSniN5LExv5zSCc66) @SwatiRaj so you are telling that I must specify my local machine path? maybe I haven't complete explain the situation: I'm tring to install and then update the chain code from my workstation with java sdk and the fabric si on a virtual and remote linux machine.
sanchezl (Tue, 21 Nov 2017 15:02:42 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=fdZBrp8jmeW8DDFWi) @swettdj To upgrage, you install the new version (using the local path) and then instantiate the new version (path is no longer needed).
swettdj (Tue, 21 Nov 2017 15:06:55 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bXXEEue7r8FBhTBMR) @sanchezl I will try, but according with documentation I understood that the two operations are different. I will try.
swettdj (Tue, 21 Nov 2017 15:31:54 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=snsFd6KNvDnv3xztH) During the instantiation I get this error `UNKNOWN: chaincode error (status 500, message: chaincode exists fabcar)`
yingmsky (Wed, 22 Nov 2017 00:28:34 GMT):
Has joined the channel.
greg2git (Wed, 22 Nov 2017 01:35:53 GMT):
Has joined the channel.
lkolisko (Wed, 22 Nov 2017 10:15:37 GMT):
Has joined the channel.
trongtoanRaD (Wed, 22 Nov 2017 12:46:15 GMT):
Has joined the channel.
jackeyliliang (Fri, 24 Nov 2017 03:02:09 GMT):
Has joined the channel.
netwalker2000 (Fri, 24 Nov 2017 08:51:57 GMT):
Has joined the channel.
PetrVlasekCA (Fri, 24 Nov 2017 10:52:18 GMT):
Has joined the channel.
ryokawajp (Mon, 27 Nov 2017 08:18:15 GMT):
Hi everyone. I have a question on the life cycle of Channel object and Channel.shutdown(). When we create a Channel object and initialize it, we will have EventHub objects to connect to peers. When are these EventHub connections closed? Will the connections be closed when the Channel object is removed by Garbage Collection? Or do we need to call Channel.shutdown() explicitly?
Background of this question is that, our team is trying to create a Channel object per each transaction, but we are not sure this will cause a leak of the network resource for EventHub connections.
rickr (Mon, 27 Nov 2017 20:32:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=P5o5cEZwhTqgZBcbQ) What version is this ? commit level ?
rickr (Mon, 27 Nov 2017 20:40:12 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=KuFnQ2KKED2GZrTPw)
Shutdown should stop all the eventhubs and clean up as much as possible. The final removal of the channel reference from your application code should clean up all.
Just de-referencing should eventually have it all cleaned up but it depends on when garbage collection gets around to it.
rickr (Mon, 27 Nov 2017 20:40:12 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=KuFnQ2KKED2GZrTPw)
Shutdown should stop all the eventhubs and clean up as much as possible. The final removal of the channel reference from your application code should clean up all.
Just de-referencing the channel won't cause it to be garbage collected since the Client has a reference to it still -- something that should probably get addressed :)
dherykw (Mon, 27 Nov 2017 20:45:16 GMT):
Has joined the channel.
rjones (Mon, 27 Nov 2017 22:36:30 GMT):
Has left the channel.
ryokawajp (Tue, 28 Nov 2017 01:00:13 GMT):
@rickr Thank you! We will ensure our code to release the channel object by Channel.shutdown().
pheneghan (Tue, 28 Nov 2017 03:26:24 GMT):
I have run the IBM JSDKHyperledgerSample and have no problems interacting with my Enterprise Plan IBM Blockchain on Bluemix. I have installed chaincode on my channel and now want to invoke my chaincode without going through the process of instantiating the chaincode as shown in the sample. How do I access an existing chaincode and invoke? It looks like I need to instantiate a ChaincodeID object? How do I do this by referencing my existing chaincode on IBM Bluemix rather than my local chaincode?
ryokawajp (Tue, 28 Nov 2017 12:03:05 GMT):
@pheneghan I have never used IBM Blockchain on Bluemix but I think that Chaincode ID is a string ID specified by a user when he or she deploys a chaincode in the public. I guess that you used a some kind of GUI tool to deploy the chaincode. That tool should be capable of specifying a Chaincode ID. The same Chaincode ID should be specified when you invoke the chaincode. For example, when one sends a invoke transaction, one needs to create a TransactionProposalRequest object, use TransactionProposalRequest.setChaincodeID() to set the Chaincode ID to a request and pass the request object to Channel.sendTransactionProposal(). Here is a sample code: https://github.com/hyperledger/fabric-sdk-java/blob/v1.0.1/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L363
ryokawajp (Tue, 28 Nov 2017 12:03:05 GMT):
@pheneghan I have never used IBM Blockchain on Bluemix. Chaincode ID is a string ID specified by a user when he or she deploys a chaincode into a fabric network. I guess that you used a some kind of GUI tool to deploy the chaincode. That tool should be capable of specifying a Chaincode ID. The same Chaincode ID should be specified when you invoke the chaincode from a Java client program. For example, when one sends a invoke transaction, one needs to create a TransactionProposalRequest object, use TransactionProposalRequest.setChaincodeID() to set the Chaincode ID to a request and pass the request object to Channel.sendTransactionProposal(). Here is a sample code: https://github.com/hyperledger/fabric-sdk-java/blob/v1.0.1/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L363
mzhk (Tue, 28 Nov 2017 13:23:04 GMT):
Has joined the channel.
mzhk (Tue, 28 Nov 2017 13:30:12 GMT):
Hi @here, is there a way to get payload from a chaincode peer.Response in the fabric-sdk in case an error is thrown?
In org/hyperledger/fabric/sdk/Channel when an exception is caught in sendProposalToPeers() it seems to have only Status and Message available.
Version: fabric-sdk-java-1.0.1
dave.enyeart (Tue, 28 Nov 2017 13:31:54 GMT):
@mzhk Please don't use at-here, they are reserved for important channel announcements
mzhk (Tue, 28 Nov 2017 13:32:47 GMT):
(sorry)
matrisis (Tue, 28 Nov 2017 14:59:37 GMT):
Has joined the channel.
albert.lacambra (Tue, 28 Nov 2017 18:13:28 GMT):
I am trying to create an enrolmnet using java SDK without FabricCA
albert.lacambra (Tue, 28 Nov 2017 18:13:56 GMT):
so I am using the private key contained into crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore to create the enrolmment object
albert.lacambra (Tue, 28 Nov 2017 18:14:53 GMT):
to convert from the BASE64 format I am using RSA algorithm witb bouncy castle provider
albert.lacambra (Tue, 28 Nov 2017 18:14:55 GMT):
"KeyFactory factory = KeyFactory.getInstance("RSA", "BC");
PemObject pemObject = pemReader.readPemObject();
PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(pemObject.getContent());"
albert.lacambra (Tue, 28 Nov 2017 18:15:00 GMT):
however it returns an error
albert.lacambra (Tue, 28 Nov 2017 18:15:34 GMT):
is the RSA the problem, the PKCS8? How can I create a mocked Enrollment to use the generate CryptoMaterial?
rickr (Tue, 28 Nov 2017 21:13:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=QugkKm4aPRXNDBZcz) I don't think so. If it failed I don't think there's anything in that can be trusted in the payload.
SDChoi (Wed, 29 Nov 2017 03:02:31 GMT):
Has joined the channel.
sahaaditya62 (Wed, 29 Nov 2017 08:50:36 GMT):
Has joined the channel.
sahaaditya62 (Wed, 29 Nov 2017 11:47:41 GMT):
Clipboard - November 29, 2017 5:15 PM
sahaaditya62 (Wed, 29 Nov 2017 11:48:33 GMT):
Clipboard - November 29, 2017 5:17 PM
sahaaditya62 (Wed, 29 Nov 2017 11:49:03 GMT):
Clipboard - November 29, 2017 5:18 PM
sahaaditya62 (Wed, 29 Nov 2017 11:49:16 GMT):
could anyone help me to solve the problem.if you need more details please do let me know.
ngeorge (Wed, 29 Nov 2017 12:18:05 GMT):
While upgrading the chaincode with version 2, I could see containers created with current(upgraded) version .The containers created while instantiating with version 1 is also running... Is this the normal behaviour?Does both the versions exist on a channel at the same time? Is the chaincode tagged to version? As in, does the previous version chaincode contain the upgraded code or old one?
rickr (Wed, 29 Nov 2017 13:59:35 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=FjM8hA9NPD8NavdmZ) Can you telnet to localhost 7054 to see if it connects ? Either not really running or something else is blocking
muralisr (Wed, 29 Nov 2017 14:10:46 GMT):
@ngeorge note that a chaincode could be accessed by many channels so in your example chaincode created in version 1 could be in use in other channels. Curently we don;t maintain a reference count of access across channels. If no channel is using it , its just a container that won't be used. There is some work on cleaning up "orphaned" containers based on timeout https://jira.hyperledger.org/browse/FAB-3326
ngeorge (Thu, 30 Nov 2017 05:14:38 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=xpraMvqipsryCGpXe) @muralisr Thank you.
mzhk (Thu, 30 Nov 2017 07:21:35 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=s3dRWvosQvDNjnXrK) @rickr thanks for feedback! PS. we wanted to send stacktrace over in case of an error.
matrisis (Thu, 30 Nov 2017 10:40:10 GMT):
Has left the channel.
sahaaditya62 (Fri, 01 Dec 2017 01:53:37 GMT):
Hi All , I am unable to get the CA information from my java class.any one have any idea how I can get the CA information from java class.
ikset (Fri, 01 Dec 2017 11:04:54 GMT):
User User_1 added by ikset.
smita0709 (Fri, 01 Dec 2017 11:46:09 GMT):
Hello,
smita0709 (Fri, 01 Dec 2017 11:46:33 GMT):
IHow to I retrive the configuration block of system channel in fabric sdk java?
Vadim (Fri, 01 Dec 2017 11:46:40 GMT):
Has left the channel.
kedarr (Fri, 01 Dec 2017 12:58:52 GMT):
Hello,
kedarr (Fri, 01 Dec 2017 13:01:54 GMT):
Hello,
I am trying to use fabric-java-sdk version 1.1.0-SNAPSHOT for registering users, creating channels, querying etc and created java shim using the latest fabric code. However, I am getting following exception when I try to run SimpleChainCode example. Looks like version issues.
Exception in thread "Thread-1" java.lang.NoSuchMethodError: io.grpc.netty.NettyChannelBuilder.build()Lio/grpc/internal/ManagedChannelImpl;
at org.hyperledger.fabric.shim.ChaincodeBase.newPeerClientConnection(ChaincodeBase.java:170)
at org.hyperledger.fabric.shim.ChaincodeBase.lambda$start$0(ChaincodeBase.java:94)
at java.lang.Thread.run(Thread.java:745)
Any help is greatly appreciated.
rickr (Fri, 01 Dec 2017 14:04:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Z9gdpu7s4ehctKCrQ)
Lot of examples of interacting with FabricCA here https://github.com/hyperledger/fabric-sdk-java/blob/a8d89513f554812eea70cc4362c40af4fd1e0d60/src/test/java/org/hyperledger/fabric_ca/sdkintegration/HFCAClientIT.java#L61
Also in the other End2end*IT testcases If that's what you're asking about.
rickr (Fri, 01 Dec 2017 14:06:29 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=WonSpbjPpwx4BoyZR) @kedarr
I think this is a error for running CC better asked on: #fabric-java-chaincode
rickr (Fri, 01 Dec 2017 16:42:33 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ZaAxHwMZLrRQCPrmS) @smita0709 What system channel ? Can you give details what it is you're trying to do ?
kedarr (Sat, 02 Dec 2017 01:01:55 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=aCbTkLDRv4HLczMrf) @rickr Thanks. I was able to resolved this issue.
sampath06 (Sat, 02 Dec 2017 15:15:06 GMT):
Has joined the channel.
harinikandadai (Sat, 02 Dec 2017 21:38:03 GMT):
Has joined the channel.
bizhenchao1201 (Sun, 03 Dec 2017 09:33:37 GMT):
Has joined the channel.
vijay5378 (Mon, 04 Dec 2017 07:30:09 GMT):
Has joined the channel.
vijay5378 (Mon, 04 Dec 2017 07:31:02 GMT):
I am trying to deploy java Chaincode on Hyperledger v1.1-preview. When
I try to register the Chaincode, I am getting an error message:
Dec 03, 2017 12:42:28 PM org.hyperledger.fabric.shim.ChaincodeBase
newPeerClientConnection
INFO: Configuring channel connection to peer.
Dec 03, 2017 12:42:28 PM org.hyperledger.fabric.shim.ChaincodeBase chatWithPeer
INFO: Connecting to peer.
Dec 03, 2017 12:42:28 PM io.grpc.internal.TransportSet$1 call
INFO: Created transport
io.grpc.netty.NettyClientTransport@12fa0810(/127.0.0.1:7051) for
/127.0.0.1:7051
Dec 03, 2017 12:42:28 PM
io.grpc.internal.TransportSet$TransportListener transportShutdown
INFO: Transport
io.grpc.netty.NettyClientTransport@12fa0810(/127.0.0.1:7051) for
/127.0.0.1:7051 is being shutdown
Dec 03, 2017 12:42:28 PM
io.grpc.internal.TransportSet$TransportListener transportTerminated
INFO: Transport
io.grpc.netty.NettyClientTransport@12fa0810(/127.0.0.1:7051) for
/127.0.0.1:7051 is terminated
Dec 03, 2017 12:42:28 PM org.hyperledger.fabric.shim.ChaincodeBase chatWithPeer
INFO: Registering as 'mycc' ... sending REGISTER
Dec 03, 2017 12:42:28 PM
io.netty.handler.codec.http2.Http2ConnectionHandler
processGoAwayWriteResult
WARNING: [id: 0x22581fa1] Sending GOAWAY failed: lastStreamId '0',
errorCode '2', debugData 'Connection refused: /127.0.0.1:7051'.
Forcing shutdown of the connection.
java.nio.channels.ClosedChannelException
Dec 03, 2017 12:42:28 PM org.hyperledger.fabric.shim.ChaincodeBase$1 onError
SEVERE: Unable to connect to peer server: UNAVAILABLE
I have been breaking my head over this. Can someone throw light on this error?
vijay5378 (Mon, 04 Dec 2017 07:31:02 GMT):
I have been breaking my head getting my Chaincode to deploy... I am getting the following error: Dec 06, 2017 5:39:08 AM org.hyperledger.fabric.shim.ChaincodeBase$1 onError
SEVERE: Unable to connect to peer server: UNIMPLEMENTED: unknown service protos.ChaincodeSupport when I try to run the Chaincode.jar file
smita0709 (Mon, 04 Dec 2017 10:06:36 GMT):
@rickr I am referring to ordering system channel. I want to update the system channel with CRL(certificate revocation list) . The MSP definitions in the ordering system channel are the MSP definitions that are used at channel creation time to initialize the new channel.
In fabric sdk java v1.0.1 there is a method getConfiguerationBytes() in Channel.java class to retrivies the configuration block of a channel. I know how to retrieve and update the configuration block of a regular channel, however I do not know how it is done for a system channel
ngeorge (Mon, 04 Dec 2017 12:35:04 GMT):
While trying to query a chaincode using JavaSDK, I am getting the below exception :
2017-12-04 11:12:37,609 ERROR Channel:2258 - Sending proposal to peer0.Org1 failed because of: gRPC failure=Status{code=UNKNOWN, description=Error executing chaincode: Failed to execute transaction (Timeout expired while executing transaction), cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: Error executing chaincode: Failed to execute transaction (Timeout expired while executing transaction)
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2258)
at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:2155)
at org.hyperledger.fabric.sdk.Channel.queryByChaincode(Channel.java:2130)
....
I have tried setting the userContext to user and also admin. Both failed with the same error. For user/admin, I provided the respective user certificate and the pem file from the cryptoconfig generated. The same chaincode could be queried from the cli successfully. Could anyone help me on this?
rickr (Mon, 04 Dec 2017 14:44:36 GMT):
If you did not name the system ordering channel the default name is `testchainid` . Try creating a channel by that name as in End2endAndBackAgainIT
I've not attempted this so disclaimer is YMMV :)
rickr (Mon, 04 Dec 2017 14:44:36 GMT):
If you did not name the system ordering channel the default name is `testchainid` . Try creating a channel by that name as in End2endAndBackAgainIT
I've not attempted this so disclaimer is _caveat utilitor_ :)
nikit-os (Mon, 04 Dec 2017 15:36:56 GMT):
Hi all! I'm trying create two Channel instances, from fabric-java-sdk, with one orderer service. But it fails with error:
```
Caused by: org.hyperledger.fabric.sdk.exception.InvalidArgumentException: Can not add orderer orderer.health.com to channel private-channel because it already belongs to channel general-channel.
```
As I understand by `MaxChannels` parameter from `configtx.yaml` - one orderer can handle multiple channels. But Orderer class in fabric-java-sdk has only one field for channel and setChannel() method throw exception when channel field already set.
`org.hyperledger.fabric.sdk.Orderer`:
```
void setChannel(Channel channel) throws InvalidArgumentException {
if (channel == null) {
throw new InvalidArgumentException("setChannel Channel can not be null");
}
if (null != this.channel && this.channel != channel) {
throw new InvalidArgumentException(format("Can not add orderer %s to channel %s because it already belongs to channel %s.",
name, channel.getName(), this.channel.getName()));
}
this.channel = channel;
}
```
Please, help me understand why restriction by channel count exists in Orderer class.
Or maybe there is no need to add multiple channels to one orderer and this should be done by adding separate orderer per channel?
skarim (Mon, 04 Dec 2017 18:00:28 GMT):
Has joined the channel.
skarim (Mon, 04 Dec 2017 18:00:52 GMT):
I am trying to get eclipse set up with the Java SDK, after importing the project I keep getting this error in eclipse.
Type mismatch: cannot convert from LinkedList
giacomo.minighin (Mon, 10 Dec 2018 11:37:29 GMT):
another question, how can I get information about peer joining a channel from a BlockInfo object?
AndresMartinezMelgar.itcl (Mon, 10 Dec 2018 12:55:18 GMT):
anyone knows any web where they explain how can i start a hyperledger proyect with eclipse? step by step.... imports... Thx!
rickr (Mon, 10 Dec 2018 13:05:05 GMT):
@AndresMartinezMelgar.itcl https://github.com/hyperledger/fabric-sdk-java#setting-up-eclipse best to at least read through the readme.md once
rickr (Mon, 10 Dec 2018 13:09:00 GMT):
@anjalinaik getting it signed by two orgs is simply send it to the two organizations orgs peers then send the signed endorsements to the orderer.
https://github.com/cr22rc/fabricSDKJavaMultiDomainSample
That shows if you follow the comments closely forcing the signing to two orgs.
rickr (Mon, 10 Dec 2018 13:11:22 GMT):
@doyajii1 You should be able to use the tls certs for the client generated by the CA; however it can be a bit involved.
rickr (Mon, 10 Dec 2018 13:15:04 GMT):
@giacomo.minighin https://github.com/hyperledger/fabric-sdk-java/blob/b9f61bd903f1a67c3608da7da515e2a09f3ae499/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L1016=L1076
giacomo.minighin (Mon, 10 Dec 2018 13:47:37 GMT):
@rickr sorry I've missed the point, I need transform that into an object, something like:
```
chaincodeName: "mycc",
chaincodeVersion: 1.0,
etc..
```
gravity (Mon, 10 Dec 2018 14:02:43 GMT):
hi all
are there any drawbacks in serializing channels, storing in db and deserializing them later for use?
rickr (Mon, 10 Dec 2018 16:03:22 GMT):
@giacomo.minighin I think that code walks through getting information from BlockInfo. Not helpful ?
rickr (Mon, 10 Dec 2018 16:08:56 GMT):
@gravity I would at what information you need to restore a channel in the End2endAndBackAgainIT Decided how you want the schema for your database to look like to store those artifacts. Table of Peers, Orderers with name, url, a key channel etc, Table channels, name etc.
gravity (Mon, 10 Dec 2018 16:24:51 GMT):
@rickr for example, if I have a table Channels and I want to store there channel's representation in byte + some meta info, so then I will be able to grab channel bytes from a database, deserialize, initialize and use it.
but there is one question: if I shutdown an application so the HFClient instance, that previously held the information about a channel, is destroyed and on the next startup I will deserialize a channel from bytes, will this channel object have the information about peers and orderers that were added to this channel?
or should I call `addPeer` and `addOrderer` methods to add the necessary information to a channel?
rickr (Mon, 10 Dec 2018 16:29:26 GMT):
@gravity Look at the End2endxxxxIT test they do this. Be advised that when the SDK goes to different versions there's no upgrade provided for any java serialization. I you do use that, it's something you'll have to take on. IMO I would not use that. Store what you need in your own application format.
giacomo.minighin (Mon, 10 Dec 2018 16:30:36 GMT):
@rickr Yes but not enough, I need more detailed infos on KVWrite object, but probably are not already implemented
doyajii1 (Tue, 11 Dec 2018 02:25:51 GMT):
@rickr thank you :)
louisliu2048 (Tue, 11 Dec 2018 03:29:53 GMT):
Has joined the channel.
KenvinNguyen (Tue, 11 Dec 2018 06:11:25 GMT):
Has joined the channel.
gravity (Tue, 11 Dec 2018 13:59:25 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=mTG53KfsBohwXLXsG) @rickr tried the same action for the service discovery with tls with the `TRACE` logging level, there is no additional output that might be helpful
service discovery still not working with TLS
rickr (Tue, 11 Dec 2018 14:24:40 GMT):
@gravity Just ran ServiceDiscoveryIT locally against Fabric1.3 with TLS enabled .. Discovered other peer and the orderer and what endorsers were needed.
https://ctrlv.it/id/158037/1142610691
gravity (Tue, 11 Dec 2018 14:31:26 GMT):
@rickr
that's weird
I've provided all the TLS certificates that are required for the discovery peer, but it's still arguing that
```
TLS handshake failed with error tls: client didn't provide a certificate {"server": "PeerServer", "remote address": "172.18.0.1:36570"}
```
gravity (Tue, 11 Dec 2018 14:33:31 GMT):
and there is one more message:
```
peer0 | 2018-12-11 14:25:13.227 UTC [core/comm] ServerHandshake -> ERRO 18a TLS handshake failed with error read tcp 172.18.0.32:7051->172.18.0.1:36566: i/o timeout {"server": "PeerServer", "remote address": "172.18.0.1:36566"}
```
where `172.18.0.32` is the address of the `peer0`
but this peer is running and available
gravity (Tue, 11 Dec 2018 14:42:51 GMT):
but there is no container with the IP `172.18.0.1`
doyajii1 (Wed, 12 Dec 2018 01:00:46 GMT):
i can see that we can unregister a blocklistener by providing blocklistener handler id, but is there way to unregister all the blocklistner at once?
doyajii1 (Wed, 12 Dec 2018 01:11:06 GMT):
and does blockevent received() happens only when the channel has an blockevent? if that is true, is there way to listen entire channel where peer have joined?
KenvinNguyen (Wed, 12 Dec 2018 03:55:52 GMT):
hi guys
KenvinNguyen (Wed, 12 Dec 2018 03:56:18 GMT):
how do I get the current block hash with java sdk based on transaction id
KenvinNguyen (Wed, 12 Dec 2018 03:57:37 GMT):
after I use queryByChainCode(..) then I got a collection of ProposalResponse, then I get the transaction from ProposalResponse.
after that I use channelClient.queryByTransactionId(transactionId) but I got error not entry found in my channel
KenvinNguyen (Wed, 12 Dec 2018 03:58:43 GMT):
I also use channel.queryBlockByTransactionID(transactionId) to get blockinfo, but I got the same error
doyajii1 (Wed, 12 Dec 2018 04:26:19 GMT):
@KenvinNguyen i might be wrong but maybe you are querying block info to different channel? I had similar issue, where blocklistener was listening different channel while chaincode produced block on the other channel i initialized with.
KenvinNguyen (Wed, 12 Dec 2018 04:28:56 GMT):
thanks for your answer @doyajii1 , but I just have only 1 channel on my network, I also check the channel that I had query too
AndresMartinezMelgar.itcl (Wed, 12 Dec 2018 07:22:45 GMT):
How can I navigate the ledger? It is mainly to see how it is.
I know how to look at the current block, see its previous hash and its own, but do not go backwards
ShobhitSrivastava (Wed, 12 Dec 2018 07:38:06 GMT):
Hey @rickr ..Once I migrate from sdk1.2 to 1.3 . There is one added check for Enrollment which happen in IdentityFactory.java class. I am not changing my way of creating SDKUser and creating the way it was in 1.2. But now in 1.3 I get "Invalid enrollment. Expected either X509Enrollment or IdemixEnrollment." exception. How should I create SDKuser to have either X509Enrollment or IdemixEnrollment enrollment?
anjalinaik (Wed, 12 Dec 2018 08:39:55 GMT):
If there is an AND endorsment policy for a 2 org[2 peer/org] , and if one of the peer couchdb is compromised, will the blockchain allow any further transactions?
ShobhitSrivastava (Wed, 12 Dec 2018 08:46:01 GMT):
@anjalinaik If any one couch db is not up you will not be able get endorsement and transaction wont be committed. You will see the logs in peer of endorsement failure
anjalinaik (Wed, 12 Dec 2018 08:50:39 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=MKmENB3YiDCp5dPuL) @ShobhitSrivastava suppose the couch db has been tampered from UI, then?
ShobhitSrivastava (Wed, 12 Dec 2018 10:12:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rYKpJj4SYnDymGWxX) @anjalinaik yeah I tried that also. In that case newer trnxs are getting committed. Ideally in production These UI of couch should not be accessible and if it is, this should have restricted usage. However if you will search for some txns which are deleted from UI and need some modification, in that case endorsement won't be met
anjalinaik (Wed, 12 Dec 2018 10:29:04 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Xvz57RMMNXg2qFJZo) @ShobhitSrivastava exactly my point..in my understanding if one of the couchdb is tampered, then none of the transactions should occur. But its the other way around
ShobhitSrivastava (Wed, 12 Dec 2018 11:09:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=9iqPSe2QGDTRGRp4Y) @anjalinaik yes, you are right. Ideally what everyone thinks that if you delete one entry in a block all there will not be any new transaction as previous block has got corrupted
ShobhitSrivastava (Wed, 12 Dec 2018 11:11:27 GMT):
but deleting txns from UI does not delete the txns from block. If you clear the data directory of couch of a peer. And restart the peer and couch. Those entries will again come.
anjalinaik (Wed, 12 Dec 2018 11:14:12 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=CzQ9zftksa37poWqQ) @ShobhitSrivastava the last point which you made is putting the peer down and then bringing it back again and joining the channel, therefore it retireves blocks from other peers, correct?
anjalinaik (Wed, 12 Dec 2018 11:18:02 GMT):
so , if we have to prove tamper proof ability of fabric , how do we do it?
ShobhitSrivastava (Wed, 12 Dec 2018 11:29:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Xxne4byEjkZzjiLaF) @anjalinaik I think it fetches from all the peers joined on a channel(from knowledge of gossip protocol). Measures to run ledger in restricted environment and at no cost reaveal this UI of couch. Then without endorsement deleting a data or modifying is not possible. For more details may be @rick or @dave.enyeart can provide more update.Thanks
ShobhitSrivastava (Wed, 12 Dec 2018 11:40:14 GMT):
Hey @anjalinaik . I found the same ques I asked 2 months back. Please find the @dave.enyeart answer as below " dave.enyeart October 24, 2018 3:38 PM
Clients send proposals to multiple peers and check consistency of results. If one peer doesn't match, clients won't trust that peer anymore and will not go to it anymore. Doing a verification of entire chain for each transaction is prohibitively expensive. You can do a verification of peer's blockchain using external tools instead. Think of statedb as a cache. If it's data is in doubt you can drop statedb and it will be rebuilt from the blockchain automatically upon peer restart. But I'd recommend lock down couchdb by not exposing couchdb port beyond the peer's docker network and have peer use username/password to ensure it cannot be tampered by external users in the first place."
anjalinaik (Wed, 12 Dec 2018 11:41:47 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=DXm7FueN9D9RAnW6B) @ShobhitSrivastava appreciate your help..thankyou.
Aschi (Wed, 12 Dec 2018 12:59:52 GMT):
Has joined the channel.
Aschi (Wed, 12 Dec 2018 13:30:14 GMT):
Hello, I'm trying to connect to java sdk to a 1.3 fabric network but im stuck on the eventhub and keep getting the following error:
`2018-12-12 13:37:17.920 WARN 26841 --- [ault-executor-0] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 2, name: eventhub01, channelName: mychannel, url: grpc://localhost:7053} terminated is false shutdown is false, retry count 351 has error UNAVAILABLE: Network closed for unknown reason.`
If I check how I did it in NodeJS I notice that you need to add the eventhub to the peer ( eventhub = channel.newChannelEventHub(peer) ), how can I do this in Java?
aatkddny (Wed, 12 Dec 2018 13:44:46 GMT):
isn't the eventhub deprecated in 1.3?
Aschi (Wed, 12 Dec 2018 13:49:47 GMT):
How do I create my channel then?
Aschi (Wed, 12 Dec 2018 13:49:47 GMT):
How do I get my channel then?
aatkddny (Wed, 12 Dec 2018 13:56:12 GMT):
Well my code's not as new as it could be, but I do this: `channel = client.loadChannelFromConfig(name, org.getNetworkConfig());` where `org.getNetworkConfig()` returns a cached `org.hyperledger.fabric.sdk.NetworkConfig`
aatkddny (Wed, 12 Dec 2018 13:56:12 GMT):
Well my code's not as new as it could be, but I do this: `channel = client.loadChannelFromConfig(name, org.getNetworkConfig());` where `org.getNetworkConfig()` returns a cached `org.hyperledger.fabric.sdk.NetworkConfig` that in one case I build myself from saved channel definition information and in the other I pull from the cloud provider that's hosting the network. Saved duplication and simplified vs manually joining all the peers and all that good stuff.
Aschi (Wed, 12 Dec 2018 14:15:40 GMT):
Thanks!
rickr (Wed, 12 Dec 2018 14:35:15 GMT):
@doyajii1 no way to unregistered multiple blockhandlers .. I wonder why you need to have more than one. I don't understand your second question. You get a blockevent from the Peer for each block that is committed to the channel.
rickr (Wed, 12 Dec 2018 14:38:18 GMT):
@AndresMartinezMelgar.itcl look for blockWalker in End2endIT.java for traversing the blocks in the ledger
rickr (Wed, 12 Dec 2018 14:42:18 GMT):
@Aschi EventHubs are gone in Fabric1.3 They're replaced by PeerEventingSevice see PeerRole .EVENT_SOURCE role when add a peer to a channel to get events in almost the very same way as with eventhubs.
Aschi (Wed, 12 Dec 2018 14:54:51 GMT):
@rickr Thank you so much!
alek (Wed, 12 Dec 2018 15:16:28 GMT):
Guys, i am trying to install and instantiate chaincode via java sdk and i am getting `java.lang.IllegalArgumentException: The proposal responses have 0 inconsistent groups with 2 that are invalid. Expected all to be consistent and none to be invalid.` I have one organization with `admin1` set us admin. chaincodeendorsementpolicy.yaml looks like this:
```
identities: # list roles to be used in the policy
admin1: {"role": {"name": "admin", "mspId": "Org1MSP"}} # admin role.
policy: # the policy .. could have been flat but show grouping.
1-of: # signed by one of these groups can be
alek (Wed, 12 Dec 2018 15:16:28 GMT):
Guys, i am trying to install and instantiate chaincode via java sdk and i am getting `java.lang.IllegalArgumentException: The proposal responses have 0 inconsistent groups with 2 that are invalid. Expected all to be consistent and none to be invalid.` I have one organization with `admin1` set us admin. chaincodeendorsementpolicy.yaml looks like this:
```
identities: # list roles to be used in the policy
admin1: {"role": {"name": "admin", "mspId": "Org1MSP"}} # admin role.
policy: # the policy .. could have been flat but show grouping.
1-of: # signed by one of these groups can be
alek (Wed, 12 Dec 2018 15:16:28 GMT):
Guys, i am trying to install and instantiate chaincode via java sdk and i am getting `java.lang.IllegalArgumentException: The proposal responses have 0 inconsistent groups with 2 that are invalid. Expected all to be consistent and none to be invalid.` I have one organization with `admin1` set us admin. chaincodeendorsementpolicy.yaml looks like this:
```
identities: # list roles to be used in the policy
admin1: {"role": {"name": "admin", "mspId": "Org1MSP"}} # admin role.
policy: # the policy .. could have been flat but show grouping.
1-of: # signed by one of these groups can be
alek (Wed, 12 Dec 2018 16:01:00 GMT):
Just for these who will encounter such exception, it can probably be caused by multiple issues but in my case some of external go package were missing
SandySun2000 (Thu, 13 Dec 2018 01:17:00 GMT):
Failed query proposal from peer (name: fabric-peer-org1-31923a, status: FAILURE, message: Sending proposal to fabric-peer-org1-31923a failed because of: gRPC failure=Status{code=RESOURCE_EXHAUSTED, description=io.grpc.netty.NettyClientTransport$3: Frame size 5095397 exceeds maximum: 4194304. , cause=null}
SandySun2000 (Thu, 13 Dec 2018 01:17:09 GMT):
Have you seen the above error before?
doyajii1 (Thu, 13 Dec 2018 02:10:17 GMT):
@rickr Thank you for your reply, and sorry with confusing question. I was trying to see all the block events happening at peer A, while peer A is joined to five different channels. In this case, don't I need to initialize/register block listener(5 block listener) for each channel?
KenvinNguyen (Thu, 13 Dec 2018 06:59:51 GMT):
how can I calculate current hash based on number block, previoushash, datahash in Java pls?
Aschi (Thu, 13 Dec 2018 07:40:08 GMT):
@rickr I still keep getting the error with adding a role
`
2018-12-13 08:35:48.742 WARN 30156 --- [ault-executor-2] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 2, name: eventhub, channelName: mychannel, url: grpc://localhost:7053} terminated is false shutdown is false, retry count 1 has error UNAVAILABLE: io exception.
2018-12-13 08:35:48.742 WARN 30156 --- [ault-executor-2] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 2, name: eventhub, channelName: mychannel, url: grpc://localhost:7053} :StatusRuntimeException Status Status{code=UNAVAILABLE, description=io exception, cause=java.io.IOException: Connection reset by peer
at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:648)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:583)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:500)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
}. Description io exception
`
Aschi (Thu, 13 Dec 2018 07:40:08 GMT):
@rickr I still keep getting the error with adding a role
`
2018-12-13 08:35:48.742 WARN 30156 --- [ault-executor-2] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 2, name: eventhub, channelName: mychannel, url: grpc://localhost:7053} terminated is false shutdown is false, retry count 1 has error UNAVAILABLE: io exception.
2018-12-13 08:35:48.742 WARN 30156 --- [ault-executor-2] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 2, name: eventhub, channelName: mychannel, url: grpc://localhost:7053} :StatusRuntimeException Status Status{code=UNAVAILABLE, description=io exception, cause=java.io.IOException: Connection reset by peer
at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:648)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:583)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:500)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
}. Description io exception
`
Aschi (Thu, 13 Dec 2018 07:40:08 GMT):
@rickr I still keep getting the error with adding a role
` 2018-12-13 08:35:48.742 WARN 30156 --- [ault-executor-2] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 2, name: eventhub, channelName: mychannel, url: grpc://localhost:7053} terminated is false shutdown is false, retry count 1 has error UNAVAILABLE: io exception.
2018-12-13 08:35:48.742 WARN 30156 --- [ault-executor-2] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 2, name: eventhub, channelName: mychannel, url: grpc://localhost:7053} :StatusRuntimeException Status Status{code=UNAVAILABLE, description=io exception, cause=java.io.IOException: Connection reset by peer
at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:648)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:583)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:500)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
}. Description io exception `
AndresMartinezMelgar.itcl (Thu, 13 Dec 2018 09:27:12 GMT):
Hello, is there a base project on which to work? I have only found 1 "blockchain-application-using-fabric-java-sdk-master" and I would like to have others to be able to contrast
rickr (Thu, 13 Dec 2018 15:03:13 GMT):
@SandySun2000 you need to up the server grpc frame or the SDKs Look at the README.md issues
rickr (Thu, 13 Dec 2018 15:04:30 GMT):
@doyajii1 yes -- but you could use the same blocklistener handler routine.
rickr (Thu, 13 Dec 2018 15:07:02 GMT):
@KenvinNguyen https://github.com/hyperledger/fabric-sdk-java/blob/b9f61bd903f1a67c3608da7da515e2a09f3ae499/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L934 ?
rickr (Thu, 13 Dec 2018 15:08:14 GMT):
@Aschi and no surprise .. why are you still adding and EventHub ? Their gone :)
rickr (Thu, 13 Dec 2018 15:08:14 GMT):
@Aschi and no surprise .. why are you still adding and EventHub ? Theyre gone :)
rickr (Thu, 13 Dec 2018 15:08:14 GMT):
@Aschi and no surprise .. why are you still adding and EventHub ? They're gone :)
SandySun2000 (Thu, 13 Dec 2018 16:33:30 GMT):
@rickr Thanks!
SandySun2000 (Thu, 13 Dec 2018 19:24:46 GMT):
@rickr Could you please provide me the full link for the README.md file?
rickr (Thu, 13 Dec 2018 19:44:18 GMT):
https://github.com/hyperledger/fabric-sdk-java#grpc-message-frame-size-exceeds-maximum
SandySun2000 (Thu, 13 Dec 2018 19:48:49 GMT):
@rickr Thanks again
doyajii1 (Thu, 13 Dec 2018 22:57:42 GMT):
@rickr thank you! :)
anjalinaik (Fri, 14 Dec 2018 06:04:19 GMT):
Hi everyone.. i want to reset my network, so i deleted all the volumes,images created by chaincode container, crypto-config files ,pruned the network. Still my new network throws MSP not found error for the previous configuration. May i please know what am i missing here?
anjalinaik (Fri, 14 Dec 2018 06:04:19 GMT):
Hi everyone.. i want to reset my network, so i deleted all the volumes,images created by chaincode container, crypto-config files ,pruned the network. Still my new network throws MSP not found error for the previous configuration. May i please know what am i missing here?```
2018-12-14 06:17:53.722 UTC [cauthdsl] deduplicate -> ERRO 54a Principal deserialization failure (the supplied identity is not valid: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.org1.com"))
``` my new network doesn't even define org1
GuillaumeTong (Mon, 17 Dec 2018 06:33:52 GMT):
Has joined the channel.
Thomas-tuo (Mon, 17 Dec 2018 06:51:17 GMT):
Has joined the channel.
GuillaumeTong (Mon, 17 Dec 2018 10:29:23 GMT):
Hello, I am trying to figure out how to use the Idemix features, and as far as I understand, the java SDK is the only place where the minimal product was implemented. Currently, I am trying to do something like this:
```
HFCAClient hfcaClient;
Enrollment normalEnrollReturn = null;
Enrollment idemixEnrollReturn = null;
```
GuillaumeTong (Mon, 17 Dec 2018 10:29:23 GMT):
Hello, I am trying to figure out how to use the Idemix features, and as far as I understand, the java SDK is the only place where the minimal product was implemented. Currently, I am trying to do something like this:
```
HFCAClient hfcaClient;
Enrollment normalEnrollReturn = null;
Enrollment idemixEnrollReturn = null;
hfcaClient = HFCAClient.createNewInstance("http://192.168.***.***:7054",null);
CryptoPrimitives crypto = new CryptoPrimitives();
crypto.init();
hfcaClient.setCryptoSuite(crypto);
normalEnrollReturn = hfcaClient.enroll("admin","pass");
idemixEnrollReturn = hfcaClient.idemixEnroll(normalEnrollReturn,"org1MSP");```
GuillaumeTong (Mon, 17 Dec 2018 10:34:11 GMT):
But I get some errors even when I stop at the x509 enrollment, here is a fragment of the error message:
```ERROR 240 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class org.bouncycastle.math.ec.WNafL2RMultiplier]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.bouncycastle.math.ec.WNafL2RMultiplier and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.hyperledger.fabric.sdk.identity.X509Enrollment[0]->org.hyperledger.fabric.sdk.identity.X509Enrollment["key"]->org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey["parameters"]->org.bouncycastle.jce.spec.ECParameterSpec["curve"]->org.bouncycastle.math.ec.custom.sec.SecP256R1Curve["multiplier"])] with root cause
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.bouncycastle.math.ec.WNafL2RMultiplier and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.hyperledger.fabric.sdk.identity.X509Enrollment[0]->org.hyperledger.fabric.sdk.identity.X509Enrollment["key"]->org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey["parameters"]->org.bouncycastle.jce.spec.ECParameterSpec["curve"]->org.bouncycastle.math.ec.custom.sec.SecP256R1Curve["multiplier"])
at [........]```
GuillaumeTong (Mon, 17 Dec 2018 10:37:56 GMT):
What is the simplest way to make and idemix enrollment using the ca url, username and password?
GuillaumeTong (Mon, 17 Dec 2018 10:37:56 GMT):
What is the simplest way to make an idemix enrollment using the ca url, username and password?
rebuild (Mon, 17 Dec 2018 12:46:32 GMT):
Has joined the channel.
rickr (Mon, 17 Dec 2018 14:01:30 GMT):
@GuillaumeTong https://github.com/hyperledger/fabric-sdk-java/blob/5b0239c1690d3dc97f7a3664f7788018607a84e4/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIdemixIT.java :wink:
IgorSim (Mon, 17 Dec 2018 15:07:47 GMT):
hi, any plans to support improved 'programming model' in java SDK? As we can see this will be supported only in NodeJs starting from 1.4 @rickr ?
versus (Mon, 17 Dec 2018 15:11:25 GMT):
Has joined the channel.
rickr (Mon, 17 Dec 2018 15:27:15 GMT):
Right now, I have no plans to go there myself.
GuillaumeTong (Tue, 18 Dec 2018 03:12:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=PavzBMciYHzfCdbTP) @rickr Thanks for the tip, but this test involves a very large number of different classes and files, and (from my current understanding) requires setting up config files as well as actual nodes on the network. Before moving on to that I would like to test smaller pieces of code with just the CA running.
In the cli enrollment is a one-line command involving just the ca's url, a username and a password.
I am also quite concerned by the error I am getting, which seems to indicate an error when parsing the response from the CA (feel free to correct me if I am wrong). Should i specify a specific crypto configuration?
GuillaumeTong (Tue, 18 Dec 2018 03:12:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=PavzBMciYHzfCdbTP) @rickr Thanks for the tip, but this test involves a very large number of different classes and files, and (from my current understanding) requires setting up config files as well as actual nodes on the network. Before moving on to that I would like to test smaller pieces of code with just the CA running.
In the cli, enrollment is a one-line command involving just the ca's url, a username and a password.
I am also quite concerned by the error I am getting, which seems to indicate an error when parsing the response from the CA (feel free to correct me if I am wrong). Should i specify a specific crypto configuration?
GuillaumeTong (Tue, 18 Dec 2018 03:12:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=PavzBMciYHzfCdbTP) @rickr Thanks for the tip, but this test involves a very large number of different classes and files, and (from my current understanding) requires setting up config files as well as actual nodes on the network. Before moving on to that I would like to test smaller pieces of code with just the CA running.
In the cli, enrollment is a one-line command involving just the ca's url, a username and a password.
I am also quite concerned by the error I am getting, which seems to indicate an error when serializing the response from the CA (feel free to correct me if I am wrong). Should i specify a specific crypto configuration?
GuillaumeTong (Tue, 18 Dec 2018 03:12:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=PavzBMciYHzfCdbTP) @rickr Thanks for the tip, but this test involves a very large number of different classes and files, and (from my current understanding) requires setting up config files as well as actual nodes on the network. Before moving on to that I would like to test smaller pieces of code with just the CA running.
In the cli, enrollment can be as simple as a one-line command involving the ca's url, a username and a password.
I am also quite concerned by the error I am getting, which seems to indicate an error when serializing the response from the CA (feel free to correct me if I am wrong). Should i specify a specific crypto configuration?
GuillaumeTong (Tue, 18 Dec 2018 03:12:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=PavzBMciYHzfCdbTP) @rickr Thanks for the tip, but this test involves a very large number of different classes and files, and (from my current understanding) requires setting up config files as well as actual nodes on the network. Before moving on to that I would like to test smaller pieces of code with just the CA running.
In the cli, enrollment can be as simple as a one-line command involving the ca's url, a username and a password.
I am also quite concerned by the error I am getting, which seems to indicate an error when serializing the response from the CA (feel free to correct me if I am wrong). Should i specify a specific crypto configuration?
GuillaumeTong (Tue, 18 Dec 2018 03:12:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=PavzBMciYHzfCdbTP) @rickr Thanks for the tip, but this test involves a very large number of different classes and files, and (from my current understanding) requires setting up config files as well as actual nodes on the network. Before moving on to that I would like to test smaller pieces of code with just the CA running.
In the cli, enrollment can be as simple as a one-line command involving the ca's url, a username and a password.
I am also quite concerned by the error I am getting, which seems to indicate an error when serializing the response from the CA (feel free to correct me if I am wrong). Should i specify a specific crypto configuration?
-------------
Edit: Never mind, my previous error seems to have been caused by me trying to fit the enrollment into an array, then print it.
However, I am still facing this error: ```org.hyperledger.fabric_ca.sdk.exception.EnrollmentException: Failed to get Idemix credential
[...]
Caused by: org.hyperledger.fabric_ca.sdk.exception.HTTPException: POST request to http://192.168.18.57:7054 failed request body {"request":null}. Response: 404 page not found
[...]```
The X509 enrollment succeeds, so I'm sure the CA URL and connection is correct. I can see the x509 enrollment showing up in my CA's log but nothing shows up about the idemix enrollment.
GuillaumeTong (Tue, 18 Dec 2018 03:12:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=PavzBMciYHzfCdbTP) @rickr Thanks for the tip, but this test involves a very large number of different classes and files, and (from my current understanding) requires setting up config files as well as actual nodes on the network. Before moving on to that I would like to test smaller pieces of code with just the CA running.
In the cli, enrollment can be as simple as a one-line command involving the ca's url, a username and a password.
I am also quite concerned by the error I am getting, which seems to indicate an error when serializing the response from the CA (feel free to correct me if I am wrong). Should i specify a specific crypto configuration?
-------------
Edit: Never mind, my previous error seems to have been caused by me trying to fit the enrollment into an array, then print it.
However, I am still facing this error: ```org.hyperledger.fabric_ca.sdk.exception.EnrollmentException: Failed to get Idemix credential
[...]
Caused by: org.hyperledger.fabric_ca.sdk.exception.HTTPException: POST request to http://192.168.18.57:7054 failed request body {"request":null}. Response: 404 page not found
[...]```
The X509 enrollment succeeds, so I'm sure the CA URL and connection is correct. I can see the x509 enrollment showing up in my CA's log but nothing shows up about the idemix enrollment. My current CA version is 1.4.0-snapshot-236dec5.
giacomo.minighin (Tue, 18 Dec 2018 09:35:58 GMT):
why `org.hyperledger.fabric.protos.ledger.rwset.kvrwset.KvRwset.KVWrite` is a key value object and not a list?
ShobhitSrivastava (Tue, 18 Dec 2018 12:30:04 GMT):
Hi @rick. I was using the multi org endorsement code from your github link. But one issue in that is it only works if the creator of channel suppose Org1Msp is the request client and needs endorsement for peers from its own and peers from other organisation However if I do it otherwise like send a request from Org2Msp for endorsement to Org1 peer, it gives access denied issue. How will this thing work in production, as there would be possibility of twp Orgs requires endorsement , if they are in same channel
ShobhitSrivastava (Tue, 18 Dec 2018 12:30:04 GMT):
Hi @rick. I was using the multi org endorsement code from your github link. But one issue in that is it only works if the creator of channel suppose Org1Msp is the request client and needs endorsement for peers from its own and peers from other organisation However if I do it otherwise like send a request from Org2Msp for endorsement to Org1 peer, it gives access denied issue. How will this thing work in production, as there would be possibility of twp Orgs requires endorsement , if they are in same channel...adding @rickr @dave.enyeart
iramiller (Tue, 18 Dec 2018 15:44:34 GMT):
Has joined the channel.
gravity (Tue, 18 Dec 2018 15:48:01 GMT):
HI all
I'm trying to instantiate a chaincode with the endorsement policy taken from there:
https://github.com/hyperledger/fabric-sdk-java/blob/release-1.3/src/test/fixture/sdkintegration/chaincodeendorsementpolicy.yaml
gravity (Tue, 18 Dec 2018 15:48:01 GMT):
HI all
I'm trying to instantiate a chaincode with the endorsement policy taken from there:
https://github.com/hyperledger/fabric-sdk-java/blob/release-1.3/src/test/fixture/sdkintegration/chaincodeendorsementpolicy.yaml
but getting the next error:
```
peer0 | 2018-12-18 15:41:19.458 UTC [gossip/privdata] StoreBlock -> INFO 108 [channel15451475883920] Received block [2] from buffer
peer0 | 2018-12-18 15:41:19.460 UTC [vscc] Validate -> ERRO 109 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for chaincode common1545147592248 in tx 2:0 failed: Error unmarshaling to SignaturePolicy: proto: can't skip unknown wire type 4
peer0 | 2018-12-18 15:41:19.460 UTC [committer/txvalidator] validateTx -> ERRO 10a VSCCValidateTx for transaction txId = 6b9de82e8ddeb1017e16d243d990e9e819879c64438167f6498020da8f33ba9f returned error: validation of endorsement policy for chaincode common1545147592248 in tx 2:0 failed: Error unmarshaling to SignaturePolicy: proto: can't skip unknown wire type 4
peer0 | 2018-12-18 15:41:19.460 UTC [committer/txvalidator] Validate -> INFO 10b [channel15451475883920] Validated block [2] in 1ms
peer0 | 2018-12-18 15:41:19.461 UTC [valimpl] preprocessProtoBlock -> WARN 10c Channel [channel15451475883920]: Block [2] Transaction index [0] TxId [6b9de82e8ddeb1017e16d243d990e9e819879c64438167f6498020da8f33ba9f] marked as invalid by committer. Reason code [ENDORSEMENT_POLICY_FAILURE]
peer1 | 2018-12-18 15:41:19.470 UTC [gossip/privdata] StoreBlock -> INFO 111 [channel15451475883920] Received block [2] from buffer
peer2 | 2018-12-18 15:41:19.470 UTC [gossip/privdata] StoreBlock -> INFO 100 [channel15451475883920] Received block [2] from buffer
peer2 | 2018-12-18 15:41:19.471 UTC [vscc] Validate -> ERRO 101 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for chaincode common1545147592248 in tx 2:0 failed: Error unmarshaling to SignaturePolicy: proto: can't skip unknown wire type 4
peer1 | 2018-12-18 15:41:19.471 UTC [vscc] Validate -> ERRO 112 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for chaincode common1545147592248 in tx 2:0 failed: Error unmarshaling to SignaturePolicy: proto: can't skip unknown wire type 4
peer1 | 2018-12-18 15:41:19.471 UTC [committer/txvalidator] validateTx -> ERRO 113 VSCCValidateTx for transaction txId = 6b9de82e8ddeb1017e16d243d990e9e819879c64438167f6498020da8f33ba9f returned error: validation of endorsement policy for chaincode common1545147592248 in tx 2:0 failed: Error unmarshaling to SignaturePolicy: proto: can't skip unknown wire type 4
peer1 | 2018-12-18 15:41:19.472 UTC [committer/txvalidator] Validate -> INFO 114 [channel15451475883920] Validated block [2] in 1ms
peer2 | 2018-12-18 15:41:19.471 UTC [committer/txvalidator] validateTx -> ERRO 102 VSCCValidateTx for transaction txId = 6b9de82e8ddeb1017e16d243d990e9e819879c64438167f6498020da8f33ba9f returned error: validation of endorsement policy for chaincode common1545147592248 in tx 2:0 failed: Error unmarshaling to SignaturePolicy: proto: can't skip unknown wire type 4
peer2 | 2018-12-18 15:41:19.471 UTC [committer/txvalidator] Validate -> INFO 103 [channel15451475883920] Validated block [2] in 1ms
peer2 | 2018-12-18 15:41:19.472 UTC [valimpl] preprocessProtoBlock -> WARN 104 Channel [channel15451475883920]: Block [2] Transaction index [0] TxId [6b9de82e8ddeb1017e16d243d990e9e819879c64438167f6498020da8f33ba9f] marked as invalid by committer. Reason code [ENDORSEMENT_POLICY_FAILURE]
peer1 | 2018-12-18 15:41:19.472 UTC [valimpl] preprocessProtoBlock -> WARN 115 Channel [channel15451475883920]: Block [2] Transaction index [0] TxId [6b9de82e8ddeb1017e16d243d990e9e819879c64438167f6498020da8f33ba9f] marked as invalid by committer. Reason code [ENDORSEMENT_POLICY_FAILURE]
```
fabric 1.3.0, java sdk 1.3.0
gravity (Tue, 18 Dec 2018 15:48:01 GMT):
HI all
I'm trying to instantiate a chaincode with the endorsement policy taken from there:
https://github.com/hyperledger/fabric-sdk-java/blob/release-1.3/src/test/fixture/sdkintegration/chaincodeendorsementpolicy.yaml
but getting the next error:
```
peer0 | 2018-12-18 15:41:19.458 UTC [gossip/privdata] StoreBlock -> INFO 108 [channel15451475883920] Received block [2] from buffer
peer0 | 2018-12-18 15:41:19.460 UTC [vscc] Validate -> ERRO 109 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for chaincode common1545147592248 in tx 2:0 failed: Error unmarshaling to SignaturePolicy: proto: can't skip unknown wire type 4
peer0 | 2018-12-18 15:41:19.460 UTC [committer/txvalidator] validateTx -> ERRO 10a VSCCValidateTx for transaction txId = 6b9de82e8ddeb1017e16d243d990e9e819879c64438167f6498020da8f33ba9f returned error: validation of endorsement policy for chaincode common1545147592248 in tx 2:0 failed: Error unmarshaling to SignaturePolicy: proto: can't skip unknown wire type 4
peer0 | 2018-12-18 15:41:19.460 UTC [committer/txvalidator] Validate -> INFO 10b [channel15451475883920] Validated block [2] in 1ms
peer0 | 2018-12-18 15:41:19.461 UTC [valimpl] preprocessProtoBlock -> WARN 10c Channel [channel15451475883920]: Block [2] Transaction index [0] TxId [6b9de82e8ddeb1017e16d243d990e9e819879c64438167f6498020da8f33ba9f] marked as invalid by committer. Reason code [ENDORSEMENT_POLICY_FAILURE]
```
fabric 1.3.0, java sdk 1.3.0
gravity (Tue, 18 Dec 2018 15:50:09 GMT):
what does it mean `unknown wire type 4`?
rickr (Tue, 18 Dec 2018 16:07:16 GMT):
@GuillaumeTong I would relook at the sample just to see if you're following the same pattern. If you still don't see the issue probably put both JSDK and Fabric CA logging on trace level and use https://ctrlv.it/ to paste them both and report it on the #fabric-ca channel so they look at why it's getting that return.
rickr (Tue, 18 Dec 2018 16:08:28 GMT):
@ShobhitSrivastava I thought it the sample went both ways.
rickr (Tue, 18 Dec 2018 16:16:00 GMT):
@gravity seems to be used in https://github.com/hyperledger/fabric-sdk-java/blob/5b0239c1690d3dc97f7a3664f7788018607a84e4/src/test/java/org/hyperledger/fabric/sdkintegration/End2endAndBackAgainIT.java#L407
IgorSim (Wed, 19 Dec 2018 07:08:34 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=5BZo5M2LdoZKEsB8f) @rickr tnx for answer, we're planning new project and some of programming model constructs sounds interesting and fit nice with new requirements, therefore we wanted to give them a try. But, our main knowledge is in Java SDK which we already(successfully) used for one project, deployed in production. Is there any document regarding requirements for programming model, what does it mean from SDK point of view to support this model?
NickXie (Wed, 19 Dec 2018 07:13:03 GMT):
Has joined the channel.
giacomo.minighin (Wed, 19 Dec 2018 08:49:15 GMT):
do you know why I receive 2 events from `org.hyperledger.fabric.sdk.Channel.registerBlockListener(BlockListener listener)`? could be because I have 2 peers on my network?
giacomo.minighin (Wed, 19 Dec 2018 08:49:15 GMT):
do you know why I receive 2 events from `org.hyperledger.fabric.sdk.Channel.registerBlockListener(BlockListener listener)`? could it be because I have 2 peers on my network?
ShobhitSrivastava (Wed, 19 Dec 2018 09:50:30 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rxCEWBpp8bEgAjnYk) @rickr @rickr . It worked for one way only for me. If you say it should work both ways. May be something wrong in code itself. I got the access denied when Org2 tried to get endorsement from Org1(provided Org1 created the channel).
GuillaumeTong (Wed, 19 Dec 2018 10:09:23 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=cdeKxiTZYBxJBN3z7) @rickr Thanks for the reply, It turns out my problem was coming from my fabric-ca-server binary, which would diplay v1.4.0-rc1 as its version but actually behaved as an older version where the idemix routes were disabled.
rickr (Wed, 19 Dec 2018 15:07:30 GMT):
@IgorSim Programming model questions would best be answered on #fabric-sdk-node or #composer channels.
rickr (Wed, 19 Dec 2018 15:07:30 GMT):
@IgorSim Programming model questions would best be asked on #fabric-sdk-node or #composer channels.
rickr (Wed, 19 Dec 2018 15:08:14 GMT):
@giacomo.minighin yes you get a notification for each
rickr (Wed, 19 Dec 2018 15:09:12 GMT):
@ShobhitSrivastava I have a hard time imagining it's the SDK the client doesn't do the enforcing
rickr (Wed, 19 Dec 2018 15:09:12 GMT):
@ShobhitSrivastava I have a hard time imagining it's the SDK the client doesn't do the enforcing of policies
tballast (Wed, 19 Dec 2018 15:47:25 GMT):
Does the comcept of having a single client performing actions for multiple organizations make sense, or should each organization have it's own client?
For example, in the End2EndIT.java there is only one HFClient object but it works on behalf of both organizations, though each org has a separate channel and separate peers and they are not mixed. Is this just for illustration purposes?
tballast (Wed, 19 Dec 2018 15:50:45 GMT):
I suppose that if two organizations are communicating on the same channel, each one should be running it's own client, or at very minumum a client object per org?
rickr (Wed, 19 Dec 2018 15:53:24 GMT):
@tballast Well in reality, I would find it highly unlikely that even in a single application instance running on behave of an organization would be using more than one client or organization. I would think the biggest use case is each application instance is just using one organization .
darapich92 (Thu, 20 Dec 2018 08:29:14 GMT):
Hello everybody, I have one question relates to the propose message that is sent by client to endorsers. The propose message include
schinivision (Thu, 20 Dec 2018 09:25:53 GMT):
Has joined the channel.
schinivision (Thu, 20 Dec 2018 09:59:13 GMT):
Hello there... I hope someone can help me out... I am a little bit stuck with the java sdk... I am trying to connect to a local running Hyperledger Fabric using this code.
val hyperledgerClient = HFClient.createNewInstance
val cryptoSuite = CryptoSuite.Factory.getCryptoSuite
hyperledgerClient.setCryptoSuite(cryptoSuite)
hyperledgerClient.setUserContext(user1) // admin loading certs created by configtxgen
val channel = hyperledgerClient.newChannel("channelname")
// TODO check if channel is null
channel.addPeer(hyperledgerClient.newPeer("peer0", "grpc://172.16.1.123:7051"))
channel.addOrderer(hyperledgerClient.newOrderer("orderer", "grpc://172.16.1.123:7050"))
channel.initialize
I fail to initialize with an error on the client -> java.io.IOException: An established connection was aborted by the software in your host machine
The connection it self reaches the peer server but the peer server logs this error
TLS handshake failed with error tls: first record does not look like a TLS handshake {"server": "PeerServer", "remote address": "SomeIp:49308"}
The user loads the admin certi
schinivision (Thu, 20 Dec 2018 09:59:13 GMT):
Hello there... I hope someone can help me out... I am a little bit stuck with the java sdk... I am trying to connect to a local running Hyperledger Fabric using this code.
val hyperledgerClient = HFClient.createNewInstance
val cryptoSuite = CryptoSuite.Factory.getCryptoSuite
hyperledgerClient.setCryptoSuite(cryptoSuite)
hyperledgerClient.setUserContext(user1) // admin loading certs created by configtxgen
val channel = hyperledgerClient.newChannel("channelname")
// TODO check if channel is null
channel.addPeer(hyperledgerClient.newPeer("peer0", "grpc://172.16.1.123:7051"))
channel.addOrderer(hyperledgerClient.newOrderer("orderer", "grpc://172.16.1.123:7050"))
channel.initialize
I fail to initialize with an error on the client -> java.io.IOException: An established connection was aborted by the software in your host machine
The connection it self reaches the peer server but the peer server logs this error
TLS handshake failed with error tls: first record does not look like a TLS handshake {"server": "PeerServer", "remote address": "SomeIp:49308"}
The user loads the admin certificate and the key from the keystore generated by the configtxgen... do I also have to add the TLS certs. and if so how and where?
ShobhitSrivastava (Thu, 20 Dec 2018 10:19:43 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=7cfE2HdkuWSqRwEtW) @rickr Rick. I may be not clear with my question? Stating again . I have one channel created by Org1 having mspId as Org1MSP. Second Org which is Org2 have mspId as Org2Msp.
If peer of org1 as PeerOrg1 and peer of org2 as PeerOrg2 joins the channel.
Now when if we make client using Org1 crypto material and needs endorsement from peer1 and peer2. It works. However If I create client using Org2 crypto materials need endorsement from
Peer1 and peer2. I get error from peer1 as “Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [mychannel] creator org [Org2MSP], cause=null}” Is this correct behavior.
Will I not get endorsement from peer1 if peer2 from org2 needs endorsement from peer1 of Org1(The creator of channel).
ShobhitSrivastava (Thu, 20 Dec 2018 12:42:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RRus77vwuxwhTcFsF) Hey @rickr . It is working. Sorry for asking. It is working both ways
rickr (Thu, 20 Dec 2018 16:10:51 GMT):
@schinivision IMO take the to get the End2endIT test running with TLS and see what is they do. Best follow in a debugger - take the time a day or so and will probably go a long way to making things easier. Your url isn't even grpcs and your server seems to want TLS .
mrudav.shukla (Thu, 20 Dec 2018 20:08:03 GMT):
How are identities managed while using Java sdk? For example, when we use composer, it gives back a card that is stored into user
mrudav.shukla (Thu, 20 Dec 2018 20:08:03 GMT):
How are identities managed while using Java sdk? For example, when we use composer, it gives back a card that is stored into user's wallet in the composer server and accessed via jwt auth. How are identities obtained using Java sdk and how are they managed for further transactions?
rickr (Thu, 20 Dec 2018 21:16:37 GMT):
The JSDK uses what Fabric uses. As a user you set at user context the key attributes of that which identifies an identity is the MSP ID and x509 Certificate or your derived idemix credentials.
httran88 (Fri, 21 Dec 2018 00:57:23 GMT):
please no composer references in java
httran88 (Fri, 21 Dec 2018 00:57:39 GMT):
play by composer, die by composer
mrudav.shukla (Fri, 21 Dec 2018 05:11:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=aQRXL47ccCzS7JJtQ) @httran88 :smiley:
mrudav.shukla (Sat, 22 Dec 2018 16:41:20 GMT):
Hi, I've cloned Java SDK repository and I'm trying to go through the code. However, the jar for "org.hyperledger.fabric.protos" seems to be missing. Am I doing it wrong or is there any issue?
ApurvTandon (Sun, 23 Dec 2018 20:11:51 GMT):
Hii can anyone tell me what is the sample result we get from getTransaction(txId) data returned from this function
IgorSim (Mon, 24 Dec 2018 06:58:37 GMT):
Hi, default CA has empty string for its name. But, in SDK, HFCAClient.createNewInstance(name, url, properties) throws an exception if name is empty. Is there any special reason why implementation doesn't allow to pass empty string when CA name is indeed empty string?
mrudav.shukla (Mon, 24 Dec 2018 08:45:22 GMT):
Are there any other tutorials/guides except for End2EndIT.java to learn and implement on java-sdk?
amolpednekar (Mon, 24 Dec 2018 10:06:27 GMT):
@mrudav.shukla I'd highly recommend referring to the IntegrationTests and they are written by the SDK developler himself, but if you want a guide on how to create a proper wrapper, you could take a look at this: https://github.com/IBM/blockchain-application-using-fabric-java-sdk
amolpednekar (Mon, 24 Dec 2018 10:06:27 GMT):
@mrudav.shukla I'd highly recommend referring to the IntegrationTests as they are written by the SDK developler himself (and they cover almost every feature of the SDK, but if you want a guide on how to create a proper wrapper, you could take a look at this: https://github.com/IBM/blockchain-application-using-fabric-java-sdk
amolpednekar (Mon, 24 Dec 2018 10:06:27 GMT):
@mrudav.shukla I'd highly recommend referring to the IntegrationTests as they are written by the SDK developler himself (and they cover almost every feature of the SDK), but if you want a guide on how to create a proper wrapper, you could take a look at this: https://github.com/IBM/blockchain-application-using-fabric-java-sdk
amolpednekar (Mon, 24 Dec 2018 10:06:27 GMT):
@mrudav.shukla I'd highly recommend referring to the IntegrationTests as they are written by the SDK developler himself (and they cover almost every feature of the SDK), but if you want a guide on how to create a wrapper, you could take a look at this: https://github.com/IBM/blockchain-application-using-fabric-java-sdk
amolpednekar (Mon, 24 Dec 2018 10:07:28 GMT):
amolpednekar (Mon, 24 Dec 2018 10:07:28 GMT):
anjalinaik (Mon, 24 Dec 2018 11:28:46 GMT):
Hi experts.. if we need to create a invoke request, do we need to redirect the request to only endorsing peers?
httran88 (Mon, 24 Dec 2018 20:43:52 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=7NQGZTkWHzBizpuLE) @mrudav.shukla there's no other better guide then reading the code itself and using copy and paste
halilkalkan (Tue, 25 Dec 2018 12:00:18 GMT):
Hi guys, have you ever tried a queue implementation for sdk, I have some issues with concurrent transactions so that I'm looking for solutions with queue so that each transaction should wait another to avoid conflictions.
halilkalkan (Tue, 25 Dec 2018 12:00:18 GMT):
Hi guys, have you ever tried a queue implementation for sdk, I have some issues with concurrent transactions so that I'm looking for solutions with queue so each transaction should wait another to avoid conflictions.
ShobhitSrivastava (Wed, 26 Dec 2018 09:44:43 GMT):
Audio record.mp3
IgorSim (Wed, 26 Dec 2018 21:13:32 GMT):
Guys, in HFCAClient.register() i don't see that caName is being used(for example like it is used in enroll method). How can i register user on CA that have multiple servers which means caName must be specified? Is this a bug?
yljgo (Thu, 27 Dec 2018 03:14:50 GMT):
Has joined the channel.
yljgo (Thu, 27 Dec 2018 03:16:00 GMT):
guys, how can I config channelclient connection pools using java sdk
anjalinaik (Thu, 27 Dec 2018 06:44:50 GMT):
Hi experts..if the endorsment policy is not satisfied then the block shouldnt be added to the chain, correct?However from below peer logs i see that the blocks are being added inspite of endorsement policy failure.Any explanation would be helpful.
```
org1peer2.1.t5ttto5ct9bp@CPU92 | 2018-12-27 06:13:57.935 UTC [committer/txvalidator] validateTx -> ERRO 019 VSCCValidateTx for transaction txId = 52e73a5c8f2d75062b6fe06e877559138a285aba5204466ca2dd40489c0088cb returned error: validation of endorsement policy for chaincode fabcarand in tx 48:0 failed: signature set did not satisfy policy
org1peer2.1.t5ttto5ct9bp@CPU92 | 2018-12-27 06:14:05.253 UTC [gossip/privdata] StoreBlock -> INFO 01a [mychannel] Received block [49] from buffer
```
knagware9 (Thu, 27 Dec 2018 07:22:10 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=x5TGrdNezh3g5gfZp) @anjalinaik you should ask question to only specific channel..please take care
anjalinaik (Thu, 27 Dec 2018 07:24:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=9uYYT3H5HdGXBeY7N) @knagware9 sure will do. apologies
anjalinaik (Thu, 27 Dec 2018 12:01:56 GMT):
How to know if CompletableFuture
liaoruohuai (Tue, 01 Jan 2019 12:19:46 GMT):
Has joined the channel.
liaoruohuai (Tue, 01 Jan 2019 19:25:00 GMT):
Hello, seriously, When can we use fabric-java-sdk to interact with fabric 1.4.0 ? @rickr
romanyuen1001 (Wed, 02 Jan 2019 02:37:05 GMT):
Has joined the channel.
mbanerjee (Wed, 02 Jan 2019 19:33:36 GMT):
Has joined the channel.
nileshyjadhav (Wed, 02 Jan 2019 20:56:10 GMT):
Has joined the channel.
BingoYan (Thu, 03 Jan 2019 03:35:23 GMT):
Has joined the channel.
BingoYan (Thu, 03 Jan 2019 03:35:34 GMT):
hey my fab-friends , im just create a network that contain three Orgs which have three orderers and three peers , and I have complete my chaincode with Golang. But now, I want to create a Java project to deploy , query and invoke my chaincode, and I just visit the associate fabric-java-sdk on github, but that project is a little difficult . so I want a help about how to user fabric-java-sdk to config , deloy , query, invoke my network. Thanks!
BingoYan (Thu, 03 Jan 2019 03:50:49 GMT):
e\
xaviarias (Thu, 03 Jan 2019 11:03:25 GMT):
Has joined the channel.
xaviarias (Thu, 03 Jan 2019 11:12:51 GMT):
Hi, I also tried to deploy the Java chaincode example in fabric-samples but cannot find ant docs on how to deploy a JAR or class file
xaviarias (Thu, 03 Jan 2019 11:12:51 GMT):
Hi, I also tried to deploy the Java chaincode example in fabric-samples but cannot find ant docs on how to deploy a JAR or class file. Maybe I should post on #fabric-samples ?
aatkddny (Thu, 03 Jan 2019 12:23:51 GMT):
try #fabric-java-chaincode
nileshyjadhav (Fri, 04 Jan 2019 04:56:09 GMT):
Is there a priority in terms of feature implementation between Node SDK and Java SDK? Some of the new features are available only in Java SDK? Should we choose Java SDK or Node SDK?
StefanKosc (Fri, 04 Jan 2019 08:55:02 GMT):
Has joined the channel.
StefanKosc (Fri, 04 Jan 2019 08:55:21 GMT):
Hello, I tried to install and instantiate two chaincodes concurrently using locust, peer endorses install and instantiation proposals and then it fails on sending instantiate proposal to orderer, does anyone has an idea what might be happening?
StefanKosc (Fri, 04 Jan 2019 08:55:21 GMT):
Hello, I tried to install and instantiate two chaincodes concurrently using locust, peer endorses install and instantiation proposals and then it freezes and then timeouts on sending instantiate proposal to orderer, does anyone has an idea what might be happening?
StefanKosc (Fri, 04 Jan 2019 08:55:21 GMT):
Hello, I tried to install and instantiate two chaincodes concurrently using locust, peer endorses install and instantiation proposals and then it freezes and then timeouts on sending instantiate proposal to orderer, does anyone has an idea what might be happening? the result is that the system breaks and chaincodes cannot be installed and instantiated anymore
StefanKosc (Fri, 04 Jan 2019 08:55:21 GMT):
Hello, I tried to install and instantiate two chaincodes concurrently using locust, sdk freezes after sending instantiate proposals to orderer. In orderer logs it looks that it is ok and proposals have been endorsed but nothing happens in sdk and it freezes, any ideas what might be happening?
StefanKosc (Fri, 04 Jan 2019 08:55:21 GMT):
Hello, I tried to install and instantiate two chaincodes concurrently using locust, sdk freezes after sending instantiate proposals to orderer. In orderer logs it looks that everything is ok and proposals have been endorsed but nothing else happens in sdk, any ideas what might be happening?
adamhardie (Fri, 04 Jan 2019 15:00:28 GMT):
hey all, I have a running hyperledger with TLS enabled, everything is running fine on server (2x peer, 2x orderer)
however when i try to connect a java sdk client, i am hitting the same errors as seen here
https://stackoverflow.com/questions/53625506/hyperledger-fabric-java-sdk-use-grpcs-for-peer-and-orderer-connections
adamhardie (Fri, 04 Jan 2019 15:06:15 GMT):
hey all,
I have a running hyperledger with TLS enabled. I have two peers running perfectly on server in docker containers, but I have problems connecting a Java client. However, when trying to get HfClient, I hit the same error found here:
https://stackoverflow.com/questions/53625506/hyperledger-fabric-java-sdk-use-grpcs-for-peer-and-orderer-connections
I have attempted to copy the sample found on the E2eIT :
https://github.com/hyperledger/fabric-sdk-java/blob/6cdf8df902c47f8bcf47815206a5e61853f3a990/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L269
but still no luck
adamhardie (Fri, 04 Jan 2019 15:07:16 GMT):
The answer on the stackoverflow page says I should copy the pem certs from the server, but shouldnt the client be able to request their own?
adamhardie (Fri, 04 Jan 2019 15:27:02 GMT):
got it -
String cert = "src/test/fixture/sdkintegration/e2e-2Orgs/FAB_CONFIG_GEN_VERS/crypto-config/peerOrganizations/DNAME/ca/ca.DNAME-cert.pem"
.replaceAll("DNAME", domainName).replaceAll("FAB_CONFIG_GEN_VERS", FAB_CONFIG_GEN_VERS);
adamhardie (Fri, 04 Jan 2019 15:27:15 GMT):
so i need to give these to all clients who want to connect to the Org?
adamhardie (Fri, 04 Jan 2019 15:28:50 GMT):
from here :
https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdk/testutils/TestConfig.java#L
adamhardie (Fri, 04 Jan 2019 15:28:50 GMT):
from here :
https://github.com/hyperledger/fabric-sdk-java/blob/6cdf8df902c47f8bcf47815206a5e61853f3a990/src/test/java/org/hyperledger/fabric/sdk/testutils/TestConfig.java#L201
adamhardie (Fri, 04 Jan 2019 15:42:38 GMT):
for now ill strip out TLS as it doesnt seem very nice to use for client connections ..
ShajiThiyarathodi (Fri, 04 Jan 2019 20:20:37 GMT):
Has joined the channel.
viprat (Sun, 06 Jan 2019 18:21:27 GMT):
Has joined the channel.
NavjotSingh1 (Mon, 07 Jan 2019 05:38:40 GMT):
Has joined the channel.
HarshiChandraSekar (Mon, 07 Jan 2019 06:43:08 GMT):
Has joined the channel.
rangeshsripathi (Mon, 07 Jan 2019 10:11:18 GMT):
Has joined the channel.
rickr (Mon, 07 Jan 2019 14:57:02 GMT):
@IgorSim The end2endIT scenario has configured a default and specific CA name.
https://github.com/hyperledger/fabric-sdk-java/blob/6cdf8df902c47f8bcf47815206a5e61853f3a990/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L170
rickr (Mon, 07 Jan 2019 14:59:00 GMT):
@anjalinaik You need to get endorsements from all organization's peers to satisfy the invocation endorsement policy.
rickr (Mon, 07 Jan 2019 15:02:50 GMT):
@halilkalkan The End2endIT shows waiting for transactions to complete on the peers before going on the next transactions by wait for the future to complete.
rickr (Mon, 07 Jan 2019 15:02:50 GMT):
@halilkalkan The End2endIT shows waiting for transactions to complete on the peers before going on the next transactions by wait for the future to complete.
https://github.com/hyperledger/fabric-sdk-java/blob/6cdf8df902c47f8bcf47815206a5e61853f3a990/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L673
rickr (Mon, 07 Jan 2019 15:02:50 GMT):
@halilkalkan The End2endIT shows waiting for transactions to complete on the peers before going on the next transactions by waiting for the future to complete.
https://github.com/hyperledger/fabric-sdk-java/blob/6cdf8df902c47f8bcf47815206a5e61853f3a990/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L673
rickr (Mon, 07 Jan 2019 15:06:34 GMT):
@liaoruohuai Yes, there were no features or api changes which relate to the client in Fabric 1.4 release. Should not be any problems using the SDK for 1.3 right now to connect to 1.4 Fabric Seriously :)
rickr (Mon, 07 Jan 2019 15:06:34 GMT):
@liaoruohuai Yes, there were no features or api changes which relate to the client in Fabric 1.4 release. Should not be any problems using the SDK for 1.3 right now to connect to 1.4 Fabric. Seriously :)
rickr (Mon, 07 Jan 2019 15:08:50 GMT):
@BingoYan Follow the integration tests. Start with End2endIT.java does all that you asked for.
liaoruohuai (Mon, 07 Jan 2019 15:12:01 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=mk6hBmwSC5A7NFkSQ) @rickr Nice to hear that , tks!!
rickr (Mon, 07 Jan 2019 15:15:53 GMT):
@StefanKosc There's way to little information known, or even _exactly_ what you mean by _freezes_ . Is your code trying to wait on the future returned by the sendTransaction ? If yes, are all the peers with eventingservice enabled reporting?. The SDK trace should show that if enabled on trace level.
versus (Mon, 07 Jan 2019 17:52:31 GMT):
@rickr first, thx for leading the jsdk development. we're using it for almost a year, appreciate your work. we were looking at things in hlf roadmap (namely: token management and finalization of private data collections in 2.x) and wondering whether these functionalities would require adjustments on sdk level. if so, are these already planned to be tackled in the near future?
rickr (Mon, 07 Jan 2019 18:07:43 GMT):
@versus I don't manage the features or roadmap of the Fabric. We try to keep the SDK on par with it's functionality (best we can :) ). If you really want to know that status of those or other features you'd need to ask on the #fabric-questions channel. Right now the way I read the tea leafs is 2.0 is coming next and AFAIK the only thing there for sure now is the new chaincode lifecycle .
That will be a future impact as it changes how chaincode will be installed and instantiated ( _defined_ ).
versus (Mon, 07 Jan 2019 18:12:17 GMT):
@rickr thx a lot, I will check out the mentioned channel :-)
kevinkbc (Mon, 07 Jan 2019 19:58:06 GMT):
@rickr (or anyone who can answer this) I saw this tutorial here https://medium.com/@lkolisko/hyperledger-fabric-sdk-java-basics-tutorial-a67b2b898410 based on sdk 1.0. Can it run with the newest sdk (1.3)?
kevinkbc (Mon, 07 Jan 2019 19:58:06 GMT):
@rickr (or anyone who can answer this) I saw this tutorial here https://medium.com/@lkolisko/hyperledger-fabric-sdk-java-basics-tutorial-a67b2b898410 based on sdk 1.0. Can it run with the newest sdk (1.3)? Are there any major changes to code using the sdk 1.3 artifact?
rickr (Mon, 07 Jan 2019 20:21:55 GMT):
@kevinkbc don't know wasn't involved with it. At first glance I don't think it does any more than the End2end test
raviranjan14 (Tue, 08 Jan 2019 07:21:57 GMT):
Has joined the channel.
giacomo.minighin (Tue, 08 Jan 2019 16:02:01 GMT):
I have this error trying to configure service discovery connection:
```
Received error on PeerEventServiceClient{id: 10, channel: mychannel, peerName: peer0.org1.example.com:7051, url: grpc://peer0.org1.example.com:7051}, attempts 1. UNAVAILABLE: NameResolver returned an empty list
```
giacomo.minighin (Tue, 08 Jan 2019 16:16:59 GMT):
I think is something related with the address grpc://peer0.org1.example.com:7051 because I'm working with in localhost
anjalinaik (Wed, 09 Jan 2019 10:02:30 GMT):
Hi..Can anybody help me resolve below error? I am using a external library for chaincode written in GO lang. I have downloaded the dependecy to $GOPATH.However i am receiving below error.````
test_pr1.1.lxebgzlyz8sz@CPU92 | 2019-01-09 09:56:56.223 UTC [endorser] SimulateProposal -> ERRO 065 [mychan][8c52895e] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 1 "chaincode/input/src/ehr3/ehr3.go:10:2: cannot find package "github.com/rs/xid" in any of:
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/go/src/github.com/rs/xid (from $GOROOT)
test_pr1.1.lxebgzlyz8sz@CPU92 | /chaincode/input/src/github.com/rs/xid (from $GOPATH)
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/gopath/src/github.com/rs/xid
test_pr1.1.lxebgzlyz8sz@CPU92 | "
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
``` `
anjalinaik (Wed, 09 Jan 2019 10:02:30 GMT):
Hi..Can anybody help me resolve below error? I am using a external library for chaincode written in GO lang. I have downloaded the dependecy to $GOPATH.However i am receiving below error.```
test_pr1.1.lxebgzlyz8sz@CPU92 | 2019-01-09 09:56:56.223 UTC [endorser] SimulateProposal -> ERRO 065 [mychan][8c52895e] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 1 "chaincode/input/src/ehr3/ehr3.go:10:2: cannot find package "github.com/rs/xid" in any of:
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/go/src/github.com/rs/xid (from $GOROOT)
test_pr1.1.lxebgzlyz8sz@CPU92 | /chaincode/input/src/github.com/rs/xid (from $GOPATH)
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/gopath/src/github.com/rs/xid
test_pr1.1.lxebgzlyz8sz@CPU92 | "
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
```
anjalinaik (Wed, 09 Jan 2019 10:02:30 GMT):
Hi..Can anybody help me resolve below error? I am using an external library for chaincode written in GO lang. I have downloaded the dependecy to $GOPATH.However i am receiving below error.```
test_pr1.1.lxebgzlyz8sz@CPU92 | 2019-01-09 09:56:56.223 UTC [endorser] SimulateProposal -> ERRO 065 [mychan][8c52895e] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 1 "chaincode/input/src/ehr3/ehr3.go:10:2: cannot find package "github.com/rs/xid" in any of:
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/go/src/github.com/rs/xid (from $GOROOT)
test_pr1.1.lxebgzlyz8sz@CPU92 | /chaincode/input/src/github.com/rs/xid (from $GOPATH)
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/gopath/src/github.com/rs/xid
test_pr1.1.lxebgzlyz8sz@CPU92 | "
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
```
anjalinaik (Wed, 09 Jan 2019 10:02:30 GMT):
Hi..Can anybody help me resolve below error? I am using an external library for chaincode written in GO lang. I have downloaded the dependency to $GOPATH.However i am receiving below error.```
test_pr1.1.lxebgzlyz8sz@CPU92 | 2019-01-09 09:56:56.223 UTC [endorser] SimulateProposal -> ERRO 065 [mychan][8c52895e] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 1 "chaincode/input/src/ehr3/ehr3.go:10:2: cannot find package "github.com/rs/xid" in any of:
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/go/src/github.com/rs/xid (from $GOROOT)
test_pr1.1.lxebgzlyz8sz@CPU92 | /chaincode/input/src/github.com/rs/xid (from $GOPATH)
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/gopath/src/github.com/rs/xid
test_pr1.1.lxebgzlyz8sz@CPU92 | "
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
```
anjalinaik (Wed, 09 Jan 2019 10:02:30 GMT):
Hi..Can anybody help me resolve below error? I am using an external library for chaincode written in GO lang. I have downloaded the dependency to $GOPATH.However i am receiving below error.```
test_pr1.1.lxebgzlyz8sz@CPU92 | 2019-01-09 09:56:56.223 UTC [endorser] SimulateProposal -> ERRO 065 [mychan][8c52895e] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 1 "chaincode/input/src/ehr3/ehr3.go:10:2: cannot find package "github.com/rs/xid" in any of:
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/go/src/github.com/rs/xid (from $GOROOT)
test_pr1.1.lxebgzlyz8sz@CPU92 | /chaincode/input/src/github.com/rs/xid (from $GOPATH)
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/gopath/src/github.com/rs/xid
test_pr1.1.lxebgzlyz8sz@CPU92 | "
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
``` I even mounted my GOPATH with the external dependency within it to peer container. I am still receiving the same error.
anjalinaik (Wed, 09 Jan 2019 10:02:30 GMT):
Hi..Can anybody help me resolve below error? I am using an external library for chaincode written in GO lang. I have downloaded the dependency to $GOPATH.However i am receiving below error.```
test_pr1.1.lxebgzlyz8sz@CPU92 | 2019-01-09 09:56:56.223 UTC [endorser] SimulateProposal -> ERRO 065 [mychan][8c52895e] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 1 "chaincode/input/src/ehr3/ehr3.go:10:2: cannot find package "github.com/rs/xid" in any of:
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/go/src/github.com/rs/xid (from $GOROOT)
test_pr1.1.lxebgzlyz8sz@CPU92 | /chaincode/input/src/github.com/rs/xid (from $GOPATH)
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/gopath/src/github.com/rs/xid
test_pr1.1.lxebgzlyz8sz@CPU92 | "
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
``` I even mounted my GOPATH with the external dependency within it to peer container. I am still receiving the same error.
anjalinaik (Wed, 09 Jan 2019 10:02:30 GMT):
Hi..Can anybody help me resolve below error? I am using an external library for chaincode written in GO lang. I have downloaded the dependency to $GOPATH.However i am receiving below error.```
test_pr1.1.lxebgzlyz8sz@CPU92 | 2019-01-09 09:56:56.223 UTC [endorser] SimulateProposal -> ERRO 065 [mychan][8c52895e] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 1 "chaincode/input/src/ehr3/ehr3.go:10:2: cannot find package "github.com/rs/xid" in any of:
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/go/src/github.com/rs/xid (from $GOROOT)
test_pr1.1.lxebgzlyz8sz@CPU92 | /chaincode/input/src/github.com/rs/xid (from $GOPATH)
test_pr1.1.lxebgzlyz8sz@CPU92 | /opt/gopath/src/github.com/rs/xid
test_pr1.1.lxebgzlyz8sz@CPU92 | "
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
test_pr1.1.lxebgzlyz8sz@CPU92 | error starting container
``` I even mounted my GOPATH with the external dependency within it to peer container. I am still receiving the same error. How to import external dependencies into the Chaincode file and make it available to the fabric-client to execute it?
rickr (Wed, 09 Jan 2019 14:16:15 GMT):
@anjalinaik Maybe it needs to be vendored ? https://github.com/hyperledger/fabric-sdk-java#go-lang-chaincode
anjalinaik (Thu, 10 Jan 2019 06:53:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RD5Sb4yhvw7m67ZHc) @rickr Hi..thankyou for your answer. i have useed go vendor to download the dependencies into the vendor folder of $GOPATH. However the java-sdk is not referring to the same. Any suggestions?
anjalinaik (Thu, 10 Jan 2019 06:53:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RD5Sb4yhvw7m67ZHc) @rickr Hi..thankyou for your answer. i have used go vendor to download the dependencies into the vendor folder of $GOPATH. However the java-sdk is not referring to the same. Any suggestions?
anjalinaik (Thu, 10 Jan 2019 06:53:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RD5Sb4yhvw7m67ZHc) @rickr Hi..thankyou for your answer. i have used go vendor to download the dependencies into the vendor folder of $GOPATH. However the java-sdk is not referring to the same. Any suggestions?```
```
anjalinaik (Thu, 10 Jan 2019 06:53:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RD5Sb4yhvw7m67ZHc) @rickr Hi..thankyou for your answer. i have used go vendor to download the dependencies into the vendor folder of $GOPATH. However the java-sdk is not referring to the same. Any suggestions?
Also the gopath [/opt/go/src/github.com/rs/xid ]contains the dependency files. Why is fabric-java-sdk not referring to it? Please correct me if my understanding is wrong.
akoenig (Thu, 10 Jan 2019 15:27:49 GMT):
Hi, what is the best way to check if the peer from the channel-object is available? e.g. I send my propsal to all peers. If one of the peers now will get an disconnect I will get an exception, that the peer is unavaible
akoenig (Thu, 10 Jan 2019 15:28:40 GMT):
is there a good way (e.g. the channel) check if all peers are availble? If not I can react? I saw something like the ServiceDiscoveryIT?
akoenig (Thu, 10 Jan 2019 15:28:40 GMT):
is there a good way to check if a peer is available?
IgorSim (Thu, 10 Jan 2019 16:24:03 GMT):
hi, i'm trying to execute 'getHFCAIdentities' from SDK, version 1.3. For some reason it doesn't work, i see in rca-server logs the following message: Invalid token in authorization header: Token signature validation failed
This snippet is also used in another project where 1.2 SDK version is used and it works fine. I noticed that 'getHTTPAuthCertificate' method in HFCAClient is changed a bit in 1.3 and wondering if i need to make some changes on SDK side for 1.3. Btw, fabric version is 1.4-rc2
giacomo.minighin (Thu, 10 Jan 2019 16:29:14 GMT):
@akoenig I suggest you to check ServiceDiscoveryIT https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/ServiceDiscoveryIT.java you check from your peer the status of the network
giacomo.minighin (Thu, 10 Jan 2019 16:29:14 GMT):
@akoenig I suggest you to check ServiceDiscoveryIT https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/ServiceDiscoveryIT.java
you check from your peer the status of the network
giacomo.minighin (Thu, 10 Jan 2019 16:29:14 GMT):
@akoenig I suggest you to check ServiceDiscoveryIT https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/ServiceDiscoveryIT.java
you can check from your peer the status of the network
rickr (Thu, 10 Jan 2019 18:12:47 GMT):
@akoenig you could use one of the apis that should always succeed like on channel BlockInfo queryBlockByNumber(Peer peer, long blockNumber) throws InvalidArgumentException, ProposalException for like block 0
venu.vemula (Thu, 10 Jan 2019 18:49:54 GMT):
Has joined the channel.
nickgaski (Thu, 10 Jan 2019 20:46:47 GMT):
Has left the channel.
vijay.bP (Thu, 10 Jan 2019 21:48:05 GMT):
Has joined the channel.
akoita (Fri, 11 Jan 2019 03:33:44 GMT):
Has joined the channel.
anjalinaik (Fri, 11 Jan 2019 06:30:26 GMT):
where do we add external go dependenices so that while deploying the chaincode using fabric-java-sdk , the chaincode builder picks it up accordingly?
akoenig (Fri, 11 Jan 2019 07:19:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=2fcdT9HF9WsDvGENu) @giacomo.minighin okay, thanks. But I don't see any example where the test checks the status of the peer? It checks if the the transaction was successfull or not (or am I wrong?) Because if this is the common method I can call a method first (like @rickr mention it) and check if the peer is available before I call it.
akoenig (Fri, 11 Jan 2019 07:21:34 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ByLe6HEwKxsLPFHMf) @anjalinaik you have to create a "vendor"-folder in the same path your chaincode is stored. see https://hyperledger-fabric.readthedocs.io/en/v1.1.0-alpha/chaincode4ade.html#managing-external-dependencies-for-chaincode-written-in-go
anjalinaik (Fri, 11 Jan 2019 08:38:59 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Dk8Y6P5Zbc2EyKey8) @akoenig so suppose my chaincode is stored in ../src/chaincode/chaincode.go then the vendor folder should be in ../src/vendor ,correct?
anjalinaik (Fri, 11 Jan 2019 08:38:59 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Dk8Y6P5Zbc2EyKey8) @akoenig so suppose my chaincode is stored in ../src/chaincode/chaincode.go then the external dependency should be in ../src/vendor ,correct?
anjalinaik (Fri, 11 Jan 2019 08:38:59 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Dk8Y6P5Zbc2EyKey8) @akoenig so suppose my chaincode is stored in ../src/chaincode/chaincode.go then the external dependency should be in ../src/vendor ,correct?
anjalinaik (Fri, 11 Jan 2019 08:38:59 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Dk8Y6P5Zbc2EyKey8) @akoenig so suppose my chaincode is stored in ../src/chaincode/chaincode.go then the external dependency should be in ../src/vendor ,correct? [But this gives me the same error back again]
akoenig (Fri, 11 Jan 2019 08:46:39 GMT):
../src/chaincode/vendor
akoenig (Fri, 11 Jan 2019 08:47:14 GMT):
and ../src/chaincode/chaincode.go with dependency to the files in the vendor folder
anjalinaik (Fri, 11 Jan 2019 09:12:57 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=NJi5eZD9HezNGAK6o) @akoenig Thankyou very much for clearing that for me. it works fine :)
IgorSim (Fri, 11 Jan 2019 12:06:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=kJPiz7wm33K3Wg3p9) I debug this issue and this looks like bug in case when HFCaClient have 'caName' set. Method 'addCAToURL' is invoked twice (once from 'getURL' , second time from 'getHTTPAuthCertificate') which will result appending caName twice thus creating incorrect signString
rickr (Fri, 11 Jan 2019 13:30:54 GMT):
@IgorSim Can you produce a simple example code that produces and open a JIRA with it ? @skarim ^^^
PradeepJaligama (Fri, 11 Jan 2019 18:36:58 GMT):
Has joined the channel.
mausomsaikia (Sat, 12 Jan 2019 08:52:12 GMT):
Has joined the channel.
AndresMartinezMelgar.itcl (Mon, 14 Jan 2019 08:06:15 GMT):
there is any example that implements sdk java ? i found https://github.com/hyperledger/fabric-sdk-java but i want other example to can compare. Thx
BingoYan (Mon, 14 Jan 2019 08:14:39 GMT):
Hello everyone . I got a warn : Failed to load any configuration from: config.properties. Using toolkit defaults
giacomo.minighin (Mon, 14 Jan 2019 08:54:54 GMT):
@AndresMartinezMelgar.itcl this one https://github.com/IBM/blockchain-application-using-fabric-java-sdk
giacomo.minighin (Mon, 14 Jan 2019 09:04:53 GMT):
@akoenig have a look at this: https://github.com/hyperledger/fabric-sdk-java/blob/master/src/main/java/org/hyperledger/fabric/sdk/Peer.java it has a hasConnected method and a DisconnectHandler
AndresMartinezMelgar.itcl (Mon, 14 Jan 2019 09:06:39 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=5atMiwd3bzjMS2DZq) @giacomo.minighin yeah! i am working with this example, i want other. I was wrong, i put link to sdk, not link to proyect
david-lsq (Mon, 14 Jan 2019 14:38:02 GMT):
Has joined the channel.
david-lsq (Mon, 14 Jan 2019 14:41:28 GMT):
hi guys,
I'm trying out the private data feature and i' having some issues.
I'm getting this on the peer side `2019-01-14 14:22:09.228 UTC [gossip.privdata] func1 -> ERRO 04a Failed disseminating private RWSet for TxID d98f251d83fa3431047480a15f2132c5183183eb05795c5d07d9b16001f4368d , namespace covenants collection COLLECTION_1_2_3 : Requested to send to at least 1 peers, but know only of 0 suitable peers
2019-01-14 14:22:09.228 UTC [gossip.service] DistributePrivateData -> ERRO 04b Failed to distributed private collection, txID d98f251d83fa3431047480a15f2132c5183183eb05795c5d07d9b16001f4368d channel covenants due to Failed disseminating 1 out of 1 private RWSets`
From what i've found, it is caused by the fact that my anchor peers were not added to the channel.
I'm now having issues finding out how to add the anchor peers to the channel. If you know what function to use to do so, i'd be happy if you could share that .
david-lsq (Mon, 14 Jan 2019 14:41:28 GMT):
hi guys,
I'm trying out the private data feature and i' having some issues.
I'm getting this on the peer side`2019-01-14 14:22:09.228 UTC [gossip.privdata] func1 -> ERRO 04a Failed disseminating private RWSet for TxID d98f251d83fa3431047480a15f2132c5183183eb05795c5d07d9b16001f4368d , namespace covenants collection COLLECTION_1_2_3 : Requested to send to at least 1 peers, but know only of 0 suitable peers
2019-01-14 14:22:09.228 UTC [gossip.service] DistributePrivateData -> ERRO 04b Failed to distributed private collection, txID d98f251d83fa3431047480a15f2132c5183183eb05795c5d07d9b16001f4368d channel covenants due to Failed disseminating 1 out of 1 private RWSets`
From what i've found, it is caused by the fact that my anchor peers were not added to the channel.
I'm now having issues finding out how to add the anchor peers to the channel. If you know what function to use to do so, i'd be happy if you could share that .
david-lsq (Mon, 14 Jan 2019 14:41:28 GMT):
hi guys,
I'm trying out the private data feature and i' having some issues.
I'm getting this on the peer side
From what i've found, it is caused by the fact that my anchor peers were not added to the channel.
I'm now having issues finding out how to add the anchor peers to the channel. If you know what function to use to do so, i'd be happy if you could share that .
david-lsq (Mon, 14 Jan 2019 14:41:28 GMT):
hi guys,
I'm trying out the private data feature and i' having some issues.
I'm getting this on the peer side
`2019-01-14 14:22:09.228 UTC [gossip.privdata] func1 -> ERRO 04a Failed disseminating private RWSet for TxID d98f251d83fa3431047480a15f2132c5183183eb05795c5d07d9b16001f4368d , namespace covenants collection COL$
2019-01-14 14:22:09.228 UTC [gossip.service] DistributePrivateData -> ERRO 04b Failed to distributed private collection, txID d98f251d83fa3431047480a15f2132c5183183eb05795c5d07d9b16001f4368d channel covenants d$
From what i've found, it is caused by the fact that my anchor peers were not added to the channel.
I'm now having issues finding out how to add the anchor peers to the channel. If you know what function to use to do so, i'd be happy if you could share that .
david-lsq (Mon, 14 Jan 2019 14:41:28 GMT):
hi guys,
I'm trying out the private data feature and i' having some issues.
I'm getting this on the peer side
`2019-01-14 14:22:09.228 UTC [gossip.privdata] func1 -> ERRO 04a Failed disseminating private RWSet for TxID d98f251d83fa3431047480a15f2132c5183183eb05795c5d07d9b16001f4368d , namespace covenants collection COL$
2019-01-14 14:22:09.228 UTC [gossip.service] DistributePrivateData -> ERRO 04b Failed to distributed private collection, txID d98f251d83fa3431047480a15f2132c5183183eb05795c5d07d9b16001f4368d channel covenants d$`
From what i've found, it is caused by the fact that my anchor peers were not added to the channel.
I'm now having issues finding out how to add the anchor peers to the channel. If you know what function to use to do so, i'd be happy if you could share that .
rickr (Mon, 14 Jan 2019 15:04:33 GMT):
@dave.enyeart ^^ ?
knagware9 (Mon, 14 Jan 2019 15:12:57 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8u2LjuXxqL8cYfnaf) @david-lsq Please check this if it help https://gerrit.hyperledger.org/r/#/c/26956/
david-lsq (Mon, 14 Jan 2019 15:35:33 GMT):
thanks @knagware9
SandySun2000 (Mon, 14 Jan 2019 22:42:04 GMT):
@rickr One enterprise plan network just was updated to V1.1, the client got "java.lang.NoSuchMethodError: io/netty/handler/codec/http2/Http2ConnectionEncoder.writePing(Lio/netty/channel/ChannelHandlerContext;ZJLio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture; (loaded from file:/opt/relay/integration-core-jar-with-dependencies.jar by sun.misc.Launcher$AppClassLoader@3549b660) called from class io.grpc.netty.NettyClientHandler (loaded from file:/opt/relay/integration-core-jar-with-dependencies.jar by sun.misc.Launcher$AppClassLoader@3549b660)."
SandySun2000 (Mon, 14 Jan 2019 22:42:26 GMT):
Is it a backward compatibility issue?
KenvinNguyen (Tue, 15 Jan 2019 06:35:46 GMT):
how we can get createdat of block via java sdk?
KenvinNguyen (Tue, 15 Jan 2019 06:35:46 GMT):
how we can get createdat of block via java sdk? and can we decrypt datahash on block?
schinivision (Tue, 15 Jan 2019 11:41:05 GMT):
Hi. If I invoke a query on a channel, e.g. channel.queryByChaincode(ccqu)... and this causes a shim.error in the chaincode that I am able to get the Content of the shim.error that is provided by the chaincode in the Java SDK? All I see is a InvalidArgumentException popping up stating Proposal response invalid.
rickr (Tue, 15 Jan 2019 14:32:58 GMT):
@SandySun2000 I think you don't have the right dependencies for the SDK
rickr (Tue, 15 Jan 2019 14:34:24 GMT):
@KenvinNguyen Data hash calculation on a block is done in the integration tests
rickr (Tue, 15 Jan 2019 14:42:10 GMT):
@schinivision https://github.com/hyperledger/fabric-sdk-java/blob/3495c0d29c00c6eee30ccbd9328451949c68c47b/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L704
schinivision (Tue, 15 Jan 2019 15:59:03 GMT):
@rickr Thanks for the Reply... But if I understand the code correctly than this is how you extract the payload from the chaincode query on a Success case... If L697 throws an error (which happens if the chaincode returns a shim.error) this exception will be caught in L711... But what I am interested is in the message that the shim.error returns in the chaincode... But the SDK just throws an Exception, and within that exception the message reads "Proposal response invalid"... is this because the SDK could not decode the response that is sent within shim.error?
schinivision (Tue, 15 Jan 2019 15:59:03 GMT):
@rickr Thanks for the Reply... But if I understand the code correctly than this is how you extract the payload from the chaincode query on a Success case... If L697 throws an error (which happens if the chaincode returns a shim.error) this exception will be caught in L711... But what I am interested is in the message that the shim.error returns in the chaincode... But the SDK just throws an Exception, and within that exception the message reads "Proposal response invalid"... is this because the SDK could not decode the response that is sent within shim.error? -> Example what shim.error could return is a String like this -> "{\"Invoke\":\"Failed\",\"Message\":\"Error JSON unmarshalling\"}"
dan13 (Tue, 15 Jan 2019 16:45:16 GMT):
Has joined the channel.
kevinkbc (Tue, 15 Jan 2019 17:06:36 GMT):
Hello, is there any pĺans to add android support for java sdk?
SandySun2000 (Tue, 15 Jan 2019 23:55:29 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=yWB4feigMCdreBZnx) @rickr Rick, thanks for your reply, which jar file or which version of jar file that they are missing?
shivann (Wed, 16 Jan 2019 12:20:30 GMT):
Has joined the channel.
shivann (Wed, 16 Jan 2019 12:20:36 GMT):
grpcs
rickr (Wed, 16 Jan 2019 15:10:41 GMT):
@schinivision I think I looked at this once before and it would mean parsing it. Something I won't do. I think your chaincode can set a response like 4xxx that won't throw an exception and would not be considered success and you can get that status code.
rickr (Wed, 16 Jan 2019 15:10:49 GMT):
@kevinkbc No.
rickr (Wed, 16 Jan 2019 15:12:18 GMT):
@SandySun2000 I have no idea. Double check the required dependencies needed for the specific JSDK version they're using.
kevinkbc (Wed, 16 Jan 2019 15:30:33 GMT):
thank you @rickr
SandySun2000 (Wed, 16 Jan 2019 17:34:50 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=5rqHhn3zFKXNZt6r4) @rickr ok. Thanks Rick
gaijinviki (Thu, 17 Jan 2019 04:59:58 GMT):
Has joined the channel.
KenvinNguyen (Thu, 17 Jan 2019 09:40:03 GMT):
hi guys, how to submit multiple transaction into 1 block?
schinivision (Thu, 17 Jan 2019 13:46:12 GMT):
@rickr Hi. I looked at the implementation of the go chaincode and there is just the two option -> shim.success returns a http 200 and -> shim.error returns a 500... therefore I wanted to parse the error.. because I am limited in the stati that I could interpret.
schinivision (Thu, 17 Jan 2019 13:49:36 GMT):
@KenvinNguyen as far as i know this is determined by the configtx.yml of the hyperledger that you connect to... Either the batch timeout will determine how much transactions will be in one block... (eg. you have a batch timeout of 2 seconds -> if you submit only one transaction per 2 seconds a block will only contain that one transaction) or the max message count (e.g. if you have a max message count of 10 then a block will never contain more than 10 transactions)
KenvinNguyen (Fri, 18 Jan 2019 03:42:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=vyE4QGg5Qh36oMXwZ) @schinivision Thanks @schinivision for your answer, but I still confuse if multi transaction from difference user submit in the same time so does it combine those transaction into one block? if yes so multi user can review a same block that contain their transaction.:thinking:
KenvinNguyen (Fri, 18 Jan 2019 03:42:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=vyE4QGg5Qh36oMXwZ) @schinivision Thanks @schinivision for your answer, but I still confuse if multi transaction from difference user submit in the same time so does it combine those transaction into one block? if yes so multi user can review a same block that contain their transaction. :thinking:
dan13 (Fri, 18 Jan 2019 15:37:00 GMT):
HLF 1.2 - a client calling chaincode requiring endorsement from peers in 2 orgs must have credentials for a user in each org in order to submit the proposal to the endorsing peer in each org, is that correct?
viktoriya (Sat, 19 Jan 2019 18:14:57 GMT):
Has joined the channel.
milko.mitropolitsky (Mon, 21 Jan 2019 09:58:25 GMT):
Has joined the channel.
milko.mitropolitsky (Mon, 21 Jan 2019 10:00:09 GMT):
Hello,
I know this question is relevant for #fabric-ca, but since I am using the fabric-sdk-java, I thought the question might be relevant here as well.
I am trying to implement the following scenario:
Org1 is creating a channel and is installing Java chaincode. Org2 and Org3 need to add a transaction, i.e. call a method of the chaincode, without revealing their identity. It is really important that no user from Org1 knows which organization created the transaction, i.e. if it is a member of Org2 or Org3. From my research I found out that this is supposed to be done with Idemix.
I am now stepping on top of the basic-network. I successfully managed to install the chaincode to the peer and am invoking it without problems. However, when I try to pass the user enrollment through the idemix `caClient.idemixEnroll`, the same scenario is not working. I have an `access denied` response. Error in the peer logs is: `ValidateProposalMessage -> WARN 056 channel [mychannel]: MSP error: could not decode the PEM structure`
I tried editing the policies in configtx.yml and in the chaincode configuration during instantiation, but without any success.
My question is, first: do you think this scenario that I described is feasable with fabric and fabric-ca, and second, what might be the problem with the Idemix enrollment?
milko.mitropolitsky (Mon, 21 Jan 2019 10:00:09 GMT):
Hello,
I know this question is relevant for #fabric-ca, but since I am using the fabric-sdk-java, I thought the question might be relevant here as well.
I am trying to implement the following scenario:
Org1 is creating a channel and is installing Java chaincode. Org2 and Org3 need to add a transaction, i.e. call a method of the chaincode, without revealing their identity. It is really important that no user from Org1 knows which organization created the transaction, i.e. if it is a member of Org2 or Org3. From my research I found out that this is supposed to be done with Idemix.
I am now stepping on top of the basic-network. I successfully managed to install the chaincode to the peer and am invoking it without problems. However, when I try to pass the user enrollment through the idemix `caClient.idemixEnroll`, the same scenario is not working. I have an `access denied` response. Error in the peer logs is: `ValidateProposalMessage -> WARN 056 channel [mychannel]: MSP error: could not decode the PEM structure`
I tried editing the policies in configtx.yml and in the chaincode configuration during instantiation, but without any success.
My question is, first: do you think this scenario that I described is feasable with fabric and fabric-ca, and second, what might be the problem with the Idemix enrollment? @adc ^^^
schinivision (Mon, 21 Jan 2019 14:03:48 GMT):
@KenvinNguyen I am not that deep into the user abstraction implementation. Here is how I understood it... In your scenario, if two users have the same read rights to the same channel (ledger) then yes, both could see all the results in the block (excluding the new private data feature, I haven't looked into that.) If you want to separate it you have to use different channels or look into the private data feature... But as far as I know... every transaction that is within the same ledger can be read by all participants that have a read permission on that ledger...@rickr knows maybe more about that.
rickr (Mon, 21 Jan 2019 14:37:47 GMT):
@dan13 It depends on your CC endorsement policy. There's something of an example that demos that in https://github.com/cr22rc/fabricSDKJavaMultiDomainSample if you follow the example comment real closely (needs run with older version of sdk but same principle)
rickr (Mon, 21 Jan 2019 14:45:52 GMT):
@milko.mitropolitsky Your beyond my understanding of idemix but you scenario _I think_ is exactly what Idemix is for. I really would post the error on #fabric-ca unless there seem to be an actual JSDK api issue. @adc ^^^
rickr (Mon, 21 Jan 2019 14:45:52 GMT):
@milko.mitropolitsky Your beyond my understanding of idemix but you scenario _I think_ is exactly what Idemix is for. I really would post the error on #fabric-ca unless there seem to be an actual JSDK api issue.
dan13 (Mon, 21 Jan 2019 15:07:54 GMT):
@rickr thanks, I'll dig into that -- scenario is chaincode policy requiring endorsement from at least one peer in 2 (both) Orgs, when I tried this having Org 1 client with Org 1 user sending proposal to Org 1 and Org2 peers (using single HFClient and Channel object), the Org 2 peer rejected the transaction because it was signed by user from Org 1 MSP (I will have to re-set up to capture exact error and report back)
pumicerD (Mon, 21 Jan 2019 19:39:54 GMT):
Has joined the channel.
bur (Tue, 22 Jan 2019 08:21:50 GMT):
Has joined the channel.
Jamie (Tue, 22 Jan 2019 17:14:16 GMT):
Has joined the channel.
incarose (Wed, 23 Jan 2019 00:26:41 GMT):
Has joined the channel.
ManjeetGambhir (Wed, 23 Jan 2019 18:54:29 GMT):
Hi @rickr , i am trying to implement EventHubDisconnected using fabric sdk 1.0.1 and implemented method "public void disconnected(EventHub eventHub) " to do recovery but couldn't able to figure out how to reconnect it ...there is no public method exposed to reconnect
can you please suggest?
or tell me the best way to reconnect
rickr (Wed, 23 Jan 2019 19:02:35 GMT):
Just looking and seems you can't .
ManjeetGambhir (Wed, 23 Jan 2019 19:03:25 GMT):
ok
ManjeetGambhir (Wed, 23 Jan 2019 19:03:45 GMT):
so there is no other way
rickr (Wed, 23 Jan 2019 19:03:52 GMT):
what are you trying to do ?
ManjeetGambhir (Wed, 23 Jan 2019 19:05:11 GMT):
it was observed that when eventhub disconnect with peer and reconnect after sometime, inbetween commited block got missed by eventhub
rickr (Wed, 23 Jan 2019 19:05:46 GMT):
you really should be using the peer eventing service
ManjeetGambhir (Wed, 23 Jan 2019 19:05:51 GMT):
i was to recover block events on reconnect
rickr (Wed, 23 Jan 2019 19:06:05 GMT):
2.0 is removing eventhubs
ManjeetGambhir (Wed, 23 Jan 2019 19:06:16 GMT):
I know ..but we are on production with fabric 1.0.1
ManjeetGambhir (Wed, 23 Jan 2019 19:07:01 GMT):
peer eventing model is planned later
rickr (Wed, 23 Jan 2019 19:10:06 GMT):
the peer eventing takes care of missed blocks by default
rickr (Wed, 23 Jan 2019 19:10:28 GMT):
it tries to start where it left off
rickr (Wed, 23 Jan 2019 19:10:55 GMT):
assuming the client stays up
kelvinzhong (Thu, 24 Jan 2019 02:47:44 GMT):
@rickr hi rick, i'm confusing that seems fabric try to implement a raft-based ordering service then move on to BFT-based ordering service, but as i know, the consensus of fabric is based on a transaction flow and the ordering service can't altered any transaction on it's own, why fabric care the consensus between the ordering service?
kelvinzhong (Thu, 24 Jan 2019 02:47:44 GMT):
@rickr hi rick, i'm confusing that seems fabric try to implement a raft-based ordering service then move on to BFT-based ordering service, but as i know, the consensus of fabric is based on a transaction flow and the ordering service can't altered any transaction on it's own, why fabric care the consensus between the orderer node?
kelvinzhong (Thu, 24 Jan 2019 02:47:44 GMT):
@rickr hi rick, i'm confusing that seems fabric try to implement a raft-based ordering service then move on to BFT-based ordering service, but as i know, the consensus of fabric is based on a transaction flow and the ordering service can't altered any transaction on it's own, why fabric care the consensus between the orderer nodes?
kelvinzhong (Thu, 24 Jan 2019 02:49:44 GMT):
even the BFT-based ordering service is delivered, i can't tell what's the different between Kaffka-based ordering service, even worse the BFT-based ordering service might slower in ordering.
gravity (Thu, 24 Jan 2019 21:05:03 GMT):
hello
are there any tools which can be used to run performance testing against sdk application?
or are there any test scenarios how do to this? I mean, should I measure the performance by sending request to an application? or are there any other ways to do this?
yulong12 (Fri, 25 Jan 2019 04:56:51 GMT):
Hi everyone. I want to ask a question. I set the endorpolicy is ```
dentities: # list roles to be used in the policy
user1: {"role": {"name": "member", "mspId": "Org1MSP"}} # role member in org with mspid Org1MSP
user2: {"role": {"name": "member", "mspId": "Org2MSP"}}
policy: # the policy each MUST sign
2-of: # signed by one of these groups can be
yulong12 (Fri, 25 Jan 2019 04:57:05 GMT):
so who can help me?
rickr (Fri, 25 Jan 2019 14:17:37 GMT):
@yulong12 its not the user signing it the peers (really the org the peer belongs to)
rickr (Fri, 25 Jan 2019 14:21:57 GMT):
@kelvinzhong If you're speaking of the new Raft based instead of Kafka Orderer _option_ there is no change in how the SDK will handle. I've been _told_ the Raft based allows a more simplified installation and overhead. For a more deep discussion I would recommend #fabric-orderer channel.
rickr (Fri, 25 Jan 2019 14:21:57 GMT):
@kelvinzhong If you're speaking of the upcoming v2.0 Raft based instead of Kafka Orderer _option_ there is no change in how the SDK will handle. I've been _told_ the Raft based allows a more simplified installation and overhead. For a more deep discussion I would recommend #fabric-orderer channel.
kelvinzhong (Mon, 28 Jan 2019 02:28:20 GMT):
@rickr sure, thx anyway:smile:
lehors (Mon, 28 Jan 2019 10:25:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=4Q5Yq5WdRT8YpJEPM) @kelvinzhong the order is still a sensitive operation, because when two transactions conflict with one another, the first one will be marked valid and the second one invalid at the time the block is committed to the ledger. so people worried about bad players on the network do care.
kevinkbc (Mon, 28 Jan 2019 12:17:15 GMT):
How do you disenroll a user? I am using golang chaincode and java sdk, fabric v 1.2
skarim (Mon, 28 Jan 2019 14:30:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=TpgNq2CDvkgfFuu2S) @kevinkbc You can revoke a user or a specific certificate, but if you are interested in "disenrolling" a user then you probably would like to revoke all it's certificate. See here for an example on how to revoke: https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric_ca/sdkintegration/HFCAClientIT.java#L326
kevinkbc (Mon, 28 Jan 2019 14:42:43 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=2QRSjwt8WSjGgjt3W) @skarim thank you
frgomes (Mon, 28 Jan 2019 14:58:57 GMT):
Has joined the channel.
windykiss (Tue, 29 Jan 2019 04:16:53 GMT):
Has joined the channel.
bestbeforetoday (Tue, 29 Jan 2019 13:40:51 GMT):
Has joined the channel.
GianlucaPinto (Tue, 29 Jan 2019 14:59:38 GMT):
Has joined the channel.
GianlucaPinto (Tue, 29 Jan 2019 15:02:11 GMT):
hi all, i have create a network with 5 peer and only 1 org starting from the "first-network" dir. so, now i have a network without a ca and a tls enabled. i have a java app that will interface the blockchain. how craete the right client for this case? thanks in advance :-)
rickr (Tue, 29 Jan 2019 22:58:56 GMT):
@GianlucaPinto The SDK provides examples in the integration test. IMO best to take the time with a debugger and walk through them.
https://github.com/hyperledger/fabric-sdk-java#end-to-end-test-scenario
kelvinzhong (Wed, 30 Jan 2019 01:51:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=JNgncY9gfm5cMnh8t) @lehors got it, thx for the info
gravity (Wed, 30 Jan 2019 14:48:51 GMT):
hi @rickr
what format of an endorsement policy should be used to convert it bytes and use it for method `ChaincodeEndorsementPolicy#fromBytes(policyBytes)`
that format is not working
https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/fixture/sdkintegration/chaincodeendorsementpolicy.yaml
I saw it is in use with method `ChaincodeEndorsementPolicy#fromYamlFile(yamlFile)` in the End2EndIT.java, but I'm interested in method `fromBytes`
I've tried to convert a string `OR('org1MSP.member')` to bytes, chaincode is instantiated successfully, but I'm getting the error during transactions:
```
2019-01-30 14:25:52.724 UTC [committer/txvalidator] validateTx -> ERRO 25b VSCCValidateTx for transaction txId = c298e55a7b1e2b4cc65a5d9685e0ea7ae633f2750fb66b40ebe21823c7f0e836 returned error: validation of endorsement policy for chaincode common in tx 2:0 failed: Error unmarshaling to SignaturePolicy: proto: can't skip unknown wire type 7
```
rickr (Wed, 30 Jan 2019 14:57:17 GMT):
@gravity Looking at the code all methods other than fromBytes converts and sets field policyBytes. So fromBytes sets that directly
gravity (Wed, 30 Jan 2019 15:05:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dkDsWRTZX5xRSCxJc) @rickr that's weird
because if I read a policy from a yaml file to bytes and set it here, it does not work
rickr (Wed, 30 Jan 2019 15:36:57 GMT):
No the bytes there would be raw protobuf not a yaml file that was read in as bytes
akoenig (Wed, 30 Jan 2019 15:44:15 GMT):
Hi, I have a peer that is in two channels. And we work with a BlockListener in the network. When we install now a chaincode we get this warning from the channel:
akoenig (Wed, 30 Jan 2019 15:44:25 GMT):
```
if (!Objects.equals(name, blockchainID)) {
logger.warn(format("Channel %s eventqueue got block event NOT FOR ME channelId %s from %s", name, blockchainID, from));
continue; // not targeted for this channel
}
```
akoenig (Wed, 30 Jan 2019 15:44:56 GMT):
are we doing something wrong/bad? Or is this the normal behaviour that one channel gets the event from another channel?
rickr (Wed, 30 Jan 2019 15:45:15 GMT):
do you have two peer objects for each channel ?
akoenig (Wed, 30 Jan 2019 15:45:21 GMT):
yes
akoenig (Wed, 30 Jan 2019 15:46:25 GMT):
we call `final Peer peer = client.newPeer(peerName, peerLocation, peerProperties);` for each peer
akoenig (Wed, 30 Jan 2019 15:46:25 GMT):
we call `final Peer peer = client.newPeer(peerName, peerLocation, peerProperties);` for each channel
rickr (Wed, 30 Jan 2019 15:47:44 GMT):
two different channles objects
akoenig (Wed, 30 Jan 2019 15:50:50 GMT):
yes, for each channel a new object with new peers
rickr (Wed, 30 Jan 2019 15:51:49 GMT):
is the channelId the other channel ?
akoenig (Wed, 30 Jan 2019 15:51:56 GMT):
yes
rickr (Wed, 30 Jan 2019 15:53:36 GMT):
are you getting all the events you expect on the respective channels ?
akoenig (Wed, 30 Jan 2019 15:53:43 GMT):
yes
akoenig (Wed, 30 Jan 2019 15:57:02 GMT):
we are using the same eventhubs might be this the failure?
akoenig (Wed, 30 Jan 2019 15:57:15 GMT):
our test org has always the same eventhubs
rickr (Wed, 30 Jan 2019 15:58:58 GMT):
you using eventhubs ?
rickr (Wed, 30 Jan 2019 15:59:25 GMT):
Please move over to peer eventing
akoenig (Wed, 30 Jan 2019 15:59:37 GMT):
thought we need eventhubs for the blockchainlistener or are they not needed?
rickr (Wed, 30 Jan 2019 15:59:57 GMT):
They've been deprecated for some time.
akoenig (Wed, 30 Jan 2019 16:00:13 GMT):
so they are not needed for blockevent-listener?
akoenig (Wed, 30 Jan 2019 16:00:16 GMT):
then i will remove them :D
rickr (Wed, 30 Jan 2019 16:00:31 GMT):
what version are you on ?
akoenig (Wed, 30 Jan 2019 16:00:35 GMT):
1.2
akoenig (Wed, 30 Jan 2019 16:00:43 GMT):
but we want to swtich to 1.4 soon
akoenig (Wed, 30 Jan 2019 16:03:31 GMT):
we have implemented a BlockListener from the Java-Sdk. And thought we need EventHubs for this (and saw them from the tutorial). But if they are not needed we can remove them.
rickr (Wed, 30 Jan 2019 16:03:48 GMT):
https://github.com/hyperledger/fabric-sdk-java/blob/master/docs/release_v1.1.0_notes.md#fabric-v10-considerations
rickr (Wed, 30 Jan 2019 16:05:58 GMT):
1.4 sdk still has eventhubs to connect back to older version but fabric 1.4 does not support them
2.0 sdk will have eventubs removed
akoenig (Wed, 30 Jan 2019 16:09:25 GMT):
Okay, thank you very much for the informatin. So I will remove the logic and will have a look if it works.
akoenig (Wed, 30 Jan 2019 16:24:25 GMT):
@rickr thanks for your help, it's working now :)
akoenig (Wed, 30 Jan 2019 16:30:03 GMT):
but do you know why the class is not annotated with "deprecated"? Or are they in 1.4?
rickr (Wed, 30 Jan 2019 16:42:01 GMT):
I thought I did -- oversight
bdjidi (Wed, 30 Jan 2019 20:11:45 GMT):
Has left the channel.
helpsolution (Thu, 31 Jan 2019 08:21:46 GMT):
Has joined the channel.
helpsolution (Thu, 31 Jan 2019 08:23:31 GMT):
Hello! I am using Java SDK. I need to subscribe to chaincode events starting from a given block. Is it possible? And how? Node js sdk allows it, but I did not find it in the source code of java sdk
pumicerD (Thu, 31 Jan 2019 08:37:39 GMT):
@helpsolution I would think either the _registerChaincodeEventListener_ or _registerBlockListener_ method of your _Channel_ instance
helpsolution (Thu, 31 Jan 2019 08:43:37 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=3gscpcjNo2irmiLWv) @pumicerD public String registerChaincodeEventListener(Pattern chaincodeId, Pattern eventName, ChaincodeEventListener chaincodeEventListener)
public String registerBlockListener(BlockListener listener)
fanjianhang (Thu, 31 Jan 2019 09:02:15 GMT):
@rickr hi, rick, i got the error ` Caused by: java.lang.NoSuchFieldError: id_tc26_signwithdigest_gost_3410_12_256` when i enroll a user in fabric-sdk-java 1.3. My machine is win7 with jdk1.8. Why does this error happened?
rickr (Thu, 31 Jan 2019 13:50:58 GMT):
@fanjianhang Just googling ( https://github.com/lightbody/browsermob-proxy/issues/712 ) seem to be a bouncy castle version error.
rickr (Thu, 31 Jan 2019 13:57:52 GMT):
@helpsolution there is something that starts a channnel peer listeners at a specific block
https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/test/java/org/hyperledger/fabric/sdkintegration/End2endAndBackAgainIT.java#L276-L296
helpsolution (Thu, 31 Jan 2019 14:48:55 GMT):
@rickr Thanks, but it is not convenient((
helpsolution (Thu, 31 Jan 2019 14:49:04 GMT):
@rickr Is it possible to add functionality for selecting block numbers when registering event listeners as in node js sdk?
rickr (Thu, 31 Jan 2019 14:51:54 GMT):
Not on the list so far. I think you can always create a new client / channel / peer for specific block listener .. not maybe optimal but do think workable
helpsolution (Thu, 31 Jan 2019 15:52:34 GMT):
@rickr Ok, thanks)
helpsolution (Thu, 31 Jan 2019 16:04:09 GMT):
@rickr I encountered the following problem. I have 100 blocks for example, next I subscribing to events starting 0 block and back I got events without keeping order of blocks. But this very important. How solve this problem?
rickr (Thu, 31 Jan 2019 16:39:47 GMT):
that can happen cause of java thread dispatching ... -> I've used this https://ctrlv.it/id/164213/2696686186
helpsolution (Fri, 01 Feb 2019 08:44:25 GMT):
Thanks, but this is not optimal for my task... Is it possible to use 1 thread to receive events?
rickr (Fri, 01 Feb 2019 13:39:20 GMT):
Not today . Why does that not work for you ? In theory you could put in that code snippet I gave just some code that puts the events in to a queue and then have your _1 thread_ read from it.
helpsolution (Fri, 01 Feb 2019 14:38:17 GMT):
It is right, but if i have 10000000.. blocks it reduces performance
helpsolution (Fri, 01 Feb 2019 14:38:17 GMT):
It is right, but if i have 10000000.. blocks for example, it reduces performance
helpsolution (Fri, 01 Feb 2019 14:38:17 GMT):
It is right, but if I have 10000000.. blocks for example, it reduces performance
rickr (Fri, 01 Feb 2019 14:40:46 GMT):
have you tried with 10000000 blocks ? Was it not acceptable ?
helpsolution (Fri, 01 Feb 2019 14:42:25 GMT):
No, but the approach is a bit strange.
rickr (Fri, 01 Feb 2019 14:46:26 GMT):
I'm _guessing_ what ever you're doing with processing each block will more than likely be significantly slower than any queuing and will be the processing you would not want do with just _1 thread_ if possible.
Doug-K1 (Fri, 01 Feb 2019 19:10:17 GMT):
Has joined the channel.
helpsolution (Sun, 03 Feb 2019 10:52:39 GMT):
The fabric sends messages with preservation of order, but on the side of sdk the order is broken due to multithreading. It's right?
If so, can I find out the number of threads?
AsifJaved (Sun, 03 Feb 2019 19:53:27 GMT):
hi everyone,
how can i create an purely Android App with hyperledger fabric integeration ?????
gravity (Sun, 03 Feb 2019 21:37:37 GMT):
Hi @rickr
are there any reasons in caching fabric-related objects in an application?
For example, HFClient. An object of HFClient class is created with the user context of the caller. Is it ok to create this object every time user sends query/transaction?
rickr (Mon, 04 Feb 2019 13:30:55 GMT):
@AsifJaved https://github.com/hyperledger/fabric-sdk-java#is-android-supported
rickr (Mon, 04 Feb 2019 13:34:46 GMT):
@gravity I don't think that would be optimal in general. It may be ok if your application is rarely sending work to the Fabric .. but I would think that would be atypical use
rickr (Mon, 04 Feb 2019 13:35:03 GMT):
@helpsolution Threads are created as needed.
pumicerD (Mon, 04 Feb 2019 13:58:34 GMT):
Hi, how would I use the Java SDK to register an admin user ?
Much like this example given for the CA client CLI :
`fabric-ca-client register --id.name admin2 --id.affiliation org1.department1 --id.attrs 'hf.Revoker=true,admin=true:ecert'`
I can set username and affiliation with `RegistrationRequest rr = new RegistrationRequest("admin2", "org1.department1")`
the revoker attribute with `rr.setType(HFCAClient.HFCA_ATTRIBUTE_HFREVOKER)`
what would be the way to set the admin attribute ?
rickr (Mon, 04 Feb 2019 14:01:20 GMT):
CA Admin is already registered. I don't think via the api you register another. @skarim
pumicerD (Mon, 04 Feb 2019 14:06:36 GMT):
The CA Admin is the bootstrap identity created when starting the server with `fabric-ca-server start -b
pumicerD (Mon, 04 Feb 2019 14:07:49 GMT):
That is the account I'm trying to register via the CA server, instead of cryptogen
rickr (Mon, 04 Feb 2019 14:09:32 GMT):
AFAIK You can't create a *Peer Admin* with the SDK api
rickr (Mon, 04 Feb 2019 14:10:27 GMT):
@skarim @smithbk ^^^
pumicerD (Mon, 04 Feb 2019 14:11:16 GMT):
Ok
smithbk (Mon, 04 Feb 2019 15:10:22 GMT):
@rickr The fabric-ca-server REST API allows specifying attributes. The question is whether the java SDK APIs supports that.
rickr (Mon, 04 Feb 2019 15:11:35 GMT):
@smithbk setting those attributes will give a user peer admin capablities ? Join channels, install chaincode etc
smithbk (Mon, 04 Feb 2019 15:13:02 GMT):
@rickr No, I thought @pumicerD was attempting to do the same thing that the `fabric-ca-client` command above does
rickr (Mon, 04 Feb 2019 15:13:35 GMT):
Thanks -- just want to make sure it's clear
pumicerD (Mon, 04 Feb 2019 15:14:53 GMT):
@smithbk @rickr I was trying to register a peer admin with this yeah
rickr (Mon, 04 Feb 2019 15:16:36 GMT):
Ok - then as stated that's not possible.
pumicerD (Mon, 04 Feb 2019 15:17:35 GMT):
alright, I'll just go with the CLI then, thanks
mahoney1 (Mon, 04 Feb 2019 15:24:49 GMT):
Has joined the channel.
mahoney1 (Mon, 04 Feb 2019 15:25:03 GMT):
hi Fabric Developers
just letting you know about the "Hyperledger Fabric Developer" community call (lasts approx 30-60 mins) currently scheduled for Thursday February 7th 5pm UTC (5pm UK, 12pm ET, 9am PT).
The plan is to initially host this community call bi-weekly via Zoom webconference and is aimed at :
- helping the worldwide Fabric Developer community grow in their development journey (eg. developing applications, smart contracts, chaincode, developing clients, using the SDK etc - eg. whether its NodeJS, Java, Go etc etc)
- caters for the developer perspective and the developer community.
- help developers understand / hear more about exciting new things in Fabric,eg. features upcoming or work in progress - ie things that appeal to the developer
- to foster more interest, best practices etc in developing with Hyperledger Fabric.
- opportunity to ask questions of the Fabric team eg. you may have feedback/questions on your experiences developing with Fabric
- to share stuff you've done with the community, eg sample code / sample use cases that others may be interested in
If you wish to share content on a call, just let me know via email direct or DM me on Rocketchat (ID: mahoney1) and I'll put an item on the agenda. Provide the following:
- the topic (state whether its presentation, or demo etc)
- the full name of the presenter, and
- approx length of your pitch in minutes
The Zoom webconference ID is https://zoom.us/my/hyperledger.community and the aim is to grow interest in the Fabric developer ecosystem (this 'Fabric Developer' call clearly has a much broader scope as indicated - feel free to make suggestions too !).
The current agenda is shown here -> https://wiki.hyperledger.org/display/fabric/Fabric+Developer+-+Meeting+Agendas+
many thanks for your time - feel free to forward this email if you think it is of interest to a colleague.
Paul O'Mahony
Community Lead
Fabric Developer
pumicerD (Mon, 04 Feb 2019 15:54:03 GMT):
I am trying to sign a query proposal with *Idemix* credentials.
Setup :
- added a MSP definition of type `idemix` in _configtx.yaml_ and added it to the profiles' _Organizations_
- generated the crypto material with both `cryptogen` and `idemixgen`, then channel artifacts with `configtxgen`
- mounted the generated _IssuerPublicKey_ and _RevocationPublicKey_ on the `fabric-ca` container I use as my organization's MSP
- get a `HFCAClient` instance for this server, enroll as the CA admin, register and enroll a regular user account (with the x509 MSP ID)
- get an `IdemixEnrollment` for this user (with the Idemix MSP ID)
- set the `HFClient` instance's user context to an `IdemixUser` created with this enrollment
- send the query proposal
I get the following error message in my _peer_'s logs :
2019-02-04 15:41:58.960 UTC [endorser] ProcessProposal -> DEBU 1914 Entering: request from 192.168.16.1:44874
`2019-02-04 15:41:58.960 UTC [protoutils] ValidateProposalMessage -> DEBU 1915 ValidateProposalMessage starts for signed proposal 0xc003300dc0
2019-02-04 15:41:58.960 UTC [protoutils] validateChannelHeader -> DEBU 1916 validateChannelHeader info: header type 3
2019-02-04 15:41:58.960 UTC [protoutils] checkSignatureFromCreator -> DEBU 1917 begin
2019-02-04 15:41:58.960 UTC [msp] GetManagerForChain -> DEBU 1918 Returning existing manager for channel 'mychannel'
2019-02-04 15:41:58.962 UTC [msp] deserializeIdentityInternal -> DEBU 1919 idemixmsp: deserializing identity
2019-02-04 15:41:58.963 UTC [protoutils] checkSignatureFromCreator -> DEBU 191a creator is &{idemixMSP1 `�̨�_b4q��H����As��&������i�E���2�����
�jEg�����8�
�a�c}
2019-02-04 15:41:58.963 UTC [msp] Validate -> DEBU 191b Validating identity &{NymPublicKey:0xc00331ef90 msp:0xc001dec420 id:0xc0032fa380 Role:msp_identifier:"idemixMSP1" role:CLIENT OU:msp_identifier:"idemixMSP1" organizational_unit_identifier:"org1" certifiers_identifier:"\326\202\233\006v\210}N\236w\344\243\t<\312d):\321EU\362Ow\224\021\357\007]-q\247" associationProof:[10 68 10 3 ...
2019-02-04 15:41:59.021 UTC [protoutils] ValidateProposalMessage -> WARN 191c channel [mychannel]: creator certificate is not valid: Failed verifing with opts [&{
pumicerD (Mon, 04 Feb 2019 15:54:03 GMT):
I am trying to sign a query proposal with *Idemix* credentials.
Setup :
- added a MSP definition of type `idemix` in _configtx.yaml_ and added it to the profiles' _Organizations_
- generated the crypto material with both `cryptogen` and `idemixgen`, then channel artifacts with `configtxgen`
- mounted the generated _IssuerPublicKey_ and _RevocationPublicKey_ on the `fabric-ca` container I use as my organization's MSP
- get a `HFCAClient` instance for this server, enroll as the CA admin, register and enroll a regular user account (with the x509 MSP ID)
- get an `IdemixEnrollment` for this user (with the Idemix MSP ID)
- set the `HFClient` instance's user context to an `IdemixUser` created with this enrollment
- send the query proposal
I get the following error message in my _peer_'s logs :
2019-02-04 15:41:58.960 UTC [endorser] ProcessProposal -> DEBU 1914 Entering: request from 192.168.16.1:44874
`2019-02-04 15:41:58.960 UTC [protoutils] ValidateProposalMessage -> DEBU 1915 ValidateProposalMessage starts for signed proposal 0xc003300dc0
2019-02-04 15:41:58.960 UTC [protoutils] validateChannelHeader -> DEBU 1916 validateChannelHeader info: header type 3
2019-02-04 15:41:58.960 UTC [protoutils] checkSignatureFromCreator -> DEBU 1917 begin
2019-02-04 15:41:58.960 UTC [msp] GetManagerForChain -> DEBU 1918 Returning existing manager for channel 'mychannel'
2019-02-04 15:41:58.962 UTC [msp] deserializeIdentityInternal -> DEBU 1919 idemixmsp: deserializing identity
2019-02-04 15:41:58.963 UTC [protoutils] checkSignatureFromCreator -> DEBU 191a creator is &{idemixMSP1 `�̨�_b4q��H����As��&������i�E���2�����
�jEg�����8�
�a�c}
2019-02-04 15:41:58.963 UTC [msp] Validate -> DEBU 191b Validating identity &{NymPublicKey:0xc00331ef90 msp:0xc001dec420 id:0xc0032fa380 Role:msp_identifier:"idemixMSP1" role:CLIENT OU:msp_identifier:"idemixMSP1" organizational_unit_identifier:"org1" certifiers_identifier:"\326\202\233\006v\210}N\236w\344\243\t<\312d):\321EU\362Ow\224\021\357\007]-q\247" associationProof:[10 68 10 3 ...
2019-02-04 15:41:59.021 UTC [protoutils] ValidateProposalMessage -> WARN 191c channel [mychannel]: creator certificate is not valid: Failed verifing with opts [&{
pumicerD (Mon, 04 Feb 2019 15:56:38 GMT):
Looks like the peer is detecting the type of credential correctly (idemix) but the MSP id expected is _idemixMSP1_
pumicerD (Mon, 04 Feb 2019 15:57:31 GMT):
Is there something else I forgot to set here ? I can send queries and transactions just fine when using x509 credentials
smallant (Mon, 04 Feb 2019 17:52:56 GMT):
Has joined the channel.
smallant (Mon, 04 Feb 2019 17:53:31 GMT):
Hi to all, I'm using java SDK e i would like to know wich property should i change to override this timeout:
Sending proposal to peer2-org1 failed because of timeout(20000 milliseconds) expiration
rickr (Tue, 05 Feb 2019 02:15:16 GMT):
@adc Any ideas on pumicerD issue above ?
rickr (Tue, 05 Feb 2019 02:19:25 GMT):
@smallant https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/main/java/org/hyperledger/fabric/sdk/helper/Config.java#L51
rickr (Tue, 05 Feb 2019 02:19:25 GMT):
@smallant https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/main/java/org/hyperledger/fabric/sdk/helper/Config.java#L51
and here https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/config.properties#L7
helpsolution (Tue, 05 Feb 2019 07:22:59 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=r2HdPtPaGnmZRQcep) @rickr Thanks. Can I manually control a number of threads? If not, will it possible in the future?
14gracel (Tue, 05 Feb 2019 16:39:48 GMT):
Has joined the channel.
bestbeforetoday (Tue, 05 Feb 2019 17:34:14 GMT):
Using NOfEvents to wait for transactions sent to the orderer to be commited on peers... say I have 2 peers I want to wait for but one of those peers drops offline, so will only going to get the transaction commit event from one of the two peers, is the CompletableFuture returned by `sendTransaction()` going to just hang forever (or fail with TimeoutException)? Or is there some logic in there that notices the peer dropping offline and will complete in some state with just the one (of two) events received?
bestbeforetoday (Tue, 05 Feb 2019 17:34:14 GMT):
Using NOfEvents to wait for transactions sent to the orderer to be commited on peers... say I have 2 peers I want to wait for but one of those peers drops offline, so I'm only going to get the transaction commit event from one of the two peers, is the CompletableFuture returned by `sendTransaction()` going to just hang forever (or fail with TimeoutException)? Or is there some logic in there that notices the peer dropping offline and will complete in some state with just the one (of two) events received?
rickr (Tue, 05 Feb 2019 19:15:21 GMT):
Users need to put a timeout on their Futures
rickr (Tue, 05 Feb 2019 19:15:21 GMT):
Users need to put a timeout on their Futures Note that peer eventing services will continue to try and connect and start where left off. So, if it's just a glitch it should still recover
bestbeforetoday (Wed, 06 Feb 2019 10:00:26 GMT):
So if I want to notice that one of the two peers I would like to receive commit events from has dropped offline so that I can unblock after receiving the commit event from the single active peer, I need to use the peer eventing service directly instead of NOfEvents? And is there a handy code example of how that is done anywhere?
rickr (Wed, 06 Feb 2019 13:34:41 GMT):
https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L4201 ?
rickr (Wed, 06 Feb 2019 13:35:23 GMT):
So what do you plan on doing when you unblock ?
rickr (Wed, 06 Feb 2019 13:37:31 GMT):
How will you know when it just a temporary glitch that can recover ?
bestbeforetoday (Wed, 06 Feb 2019 13:43:08 GMT):
@rickr That link points to the NOfEvents source, right? I recall that isn't the code that actually does the listening; just that keeps track of what things events have been received from? And you mentioned already that it doesn't deal with peers going offline so I'd like to know how I can write code to deal with that. Can you help?
rickr (Wed, 06 Feb 2019 13:58:18 GMT):
I don't have code that deals with peers off line . I kind of like to understand your use case. Like I stated what do you plan to do ? I think applications should have been written to wait on the future for a specified time. If the application then gets a timeout the application can decide what's appropriate for it's own recovery. It could just give up and report the error back up. It can continue to poll the peers needed to see if the transaction is there. Decided if it sees it on one continue to assume it's good. Or some other action
rickr (Wed, 06 Feb 2019 13:58:18 GMT):
I don't have code that deals with peers off line . I kind of like to understand your use case. Like I stated what do you plan to do ? I think applications should and have been written to wait on the future for a specified time. If the application then gets a timeout the application can decide what's appropriate for it's own recovery. It could just give up and report the error back up. It can continue to poll the peers needed to see if the transaction is there. Decided if it sees it on one continue to assume it's good. Or some other action
bestbeforetoday (Wed, 06 Feb 2019 14:08:26 GMT):
What I'd like is to say, look for commit events from all peers in a particular org, and to unblock when for every one of those peers I have either received a commit event or the peer is observed as offline. Then, provided I have received at least one successful commit and no errors, move on. I don't want to wait some arbitrary period of time for a peer that is observed as offline to (maybe or maybe not) come back online.
rickr (Wed, 06 Feb 2019 14:09:12 GMT):
How do you determine a peer is offline ?
bestbeforetoday (Wed, 06 Feb 2019 14:09:37 GMT):
Does the peer eventing service provide any notification of a communication failure with a peer?
rickr (Wed, 06 Feb 2019 14:10:29 GMT):
It has a connect handler that makes attempts to reconnect ...
bestbeforetoday (Wed, 06 Feb 2019 14:10:48 GMT):
Will that allow me to do what I described above?
rickr (Wed, 06 Feb 2019 14:11:38 GMT):
I don't know how you can say the peer is off line as opposed to just temporarily down or a network glitch
bestbeforetoday (Wed, 06 Feb 2019 14:12:11 GMT):
Let's treat all those as the same case. Not currently communicating. Will the connect handler allow me to achieve that?
rickr (Wed, 06 Feb 2019 14:12:48 GMT):
You can overried it do what you want
bestbeforetoday (Wed, 06 Feb 2019 14:13:13 GMT):
Are there any examples of this API in use? I'm struggling to find examples and documentation to understand usage
rickr (Wed, 06 Feb 2019 14:13:47 GMT):
you see the the what default handler is doing and start from there
bestbeforetoday (Wed, 06 Feb 2019 14:14:10 GMT):
Can you point me at the right point in the code for that?
rickr (Wed, 06 Feb 2019 14:15:48 GMT):
I thought I sent it to you already in a note
https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/main/java/org/hyperledger/fabric/sdk/Peer.java#L571
bestbeforetoday (Wed, 06 Feb 2019 14:23:40 GMT):
Thanks. So I'd need to:
1. Register a disconnect handler for all the peers.
2. Register a BlockListener with the channel to look for a specific transaction commit event.
3. Somehow tie together myself disconnects to current listening tasks.
Is that roughly correct?
bestbeforetoday (Wed, 06 Feb 2019 14:24:37 GMT):
Any way to get the current disconnect handler before calling `setPeerEventingServiceDisconnected()` so I can delegate to the original handler with my replacement safely?
bestbeforetoday (Wed, 06 Feb 2019 14:25:05 GMT):
How do I get information from the block events?
bestbeforetoday (Wed, 06 Feb 2019 14:26:42 GMT):
Am I just after `getTransactionID()` and `isValid()` on the transaction events to know I've received a successful commit?
rickr (Wed, 06 Feb 2019 15:18:13 GMT):
Sounds about right in general. Familiarize yourself with integration test they show most what the sdk has. There's in End2endIT that has blockwalker goes through a block
httran88 (Wed, 06 Feb 2019 15:57:26 GMT):
Hi Rick
gravity (Wed, 06 Feb 2019 22:14:32 GMT):
Hi all
is it possible to describe an endorsement policy so a transaction should be endorsed by 3 peers?
the actual question is, how an endorsement policy correlates with the number of endorser peers to which a transaction is sent?
I read the documentation about endorsement policies, but it is still quite confusing for me
thanks in advance
MHBauer (Wed, 06 Feb 2019 22:36:01 GMT):
Has joined the channel.
gaijinviki (Thu, 07 Feb 2019 06:41:34 GMT):
@rickr, Hi, I am getting some issues with the `sendTransactionProposalToEndorsers()` method in Channel.java.
I am calling the method like so : ```
request.setChaincodeId(.....
discoveryOptions = Channel.DiscoveryOptions.createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM);
channel1.sendTransactionProposalToEndorsers(request, discoveryOptions);```
I am getting a `NULL POINTER EXCEPTION` at
`org.hyperledger.fabric.sdk.Channel.sendTransactionProposalToEndorsers(Channel.java:3663)`
Line 3663 is `serviceDiscovery.networkDiscovery(transactionContext, true);`
I am unable to figure out the reason. It will be great it you can kindly help. Thanks!
gaijinviki (Thu, 07 Feb 2019 06:41:34 GMT):
@rickr, Hi, I am getting some issues with the `sendTransactionProposalToEndorsers()` method in Channel.java.
I am calling the method like so : ```
request.setChaincodeId(.....)
discoveryOptions = Channel.DiscoveryOptions.createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM);
channel1.sendTransactionProposalToEndorsers(request, discoveryOptions);```
I am getting a `NULL POINTER EXCEPTION` at
`org.hyperledger.fabric.sdk.Channel.sendTransactionProposalToEndorsers(Channel.java:3663)`
Line 3663 is `serviceDiscovery.networkDiscovery(transactionContext, true);`
I am unable to figure out the reason. It will be great it you can kindly help. Thanks!
helpsolution (Thu, 07 Feb 2019 07:00:04 GMT):
Hello, I have problem while connecting to fabric(tls enabled) with using java sdk.
I got next errors:
Sending proposal to peer0-ru failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
...
Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching peer0-ru found.
I using examples from github of java sdk.
`
private final static String PATH_CRYPTO_CONFIG ="cloud/network_resources/crypto-config";
private final static String ORG1_PEER0_NAME = "xxx";
private final static String ORG1_PEER0_ADDRESS = "grpcs://xxxx:xxxx";
private final static String ORG1_PEER0_CERT = PATH_CRYPTO_CONFIG + "/peerOrganizations/xxx/tls/server.crt";
private final static String ORDERER_NAME = "xxx";
private final static String ORDERER_ADDRESS = "grpcs://xxxx:xxxx";
private final static String ORDERER_CERT = PATH_CRYPTO_CONFIG + "/ordererOrganizations/xxx/tls/server.crt";
.....
Properties ordererProperties = new Properties();
ordererProperties.setProperty("trustServerCertificate", "true");
ordererProperties.setProperty("pemFile", ORDERER_CERT);
ordererProperties.setProperty("hostnameOverride", ORDERER_NAME);
ordererProperties.setProperty("sslProvider", "openSSL");
ordererProperties.setProperty("negotiationType", "TLS");
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[]{5L, TimeUnit.MINUTES});
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[]{8L, TimeUnit.SECONDS});
Orderer orderer = fabClient.getInstance().newOrderer(ORDERER_NAME, ORDERER_ADDRESS, ordererProperties);
Properties peer0MyOrgProperties = new Properties();
peer0MyOrgProperties.setProperty("trustServerCertificate", "true");
peer0MyOrgProperties.setProperty("pemFile", ORG1_PEER0_CERT);
peer0MyOrgProperties.setProperty("hostnameOverride", ORG1_PEER0_NAME );
peer0MyOrgProperties.setProperty("sslProvider", "openSSL");
peer0MyOrgProperties.setProperty("negotiationType", "TLS");
peer0MyOrgProperties.put("grpc.NettyChannelBuilderOption.maxInboundMessageSize", 9000000);
Peer peer = fabClient.getInstance().newPeer(ORG1_PEER0_NAME, ORG1_PEER0_ADDRESS, peer0MyOrgProperties);
channel.addPeer(peer);
channel.addOrderer(orderer);
channel.initialize();`
Can you help me?) thanks
helpsolution (Thu, 07 Feb 2019 07:00:04 GMT):
Hello, I have problem while connecting to fabric(tls enabled) with using java sdk.
I got next errors:
Sending proposal to peer0-ru failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
...
Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching peer0-ru found.
I using examples from github of java sdk.
`
private final static String PATH_CRYPTO_CONFIG ="cloud/network_resources/crypto-config";
private final static String ORG1_PEER0_NAME = "xxx";
private final static String ORG1_PEER0_ADDRESS = "grpcs://xxxx:xxxx";
private final static String ORG1_PEER0_CERT = PATH_CRYPTO_CONFIG + "/peerOrganizations/xxx/tls/server.crt";
private final static String ORDERER_NAME = "xxx";
private final static String ORDERER_ADDRESS = "grpcs://xxxx:xxxx";
private final static String ORDERER_CERT = PATH_CRYPTO_CONFIG + "/ordererOrganizations/xxx/tls/server.crt";
.....
Properties ordererProperties = new Properties();
ordererProperties.setProperty("trustServerCertificate", "true");
ordererProperties.setProperty("pemFile", ORDERER_CERT);
ordererProperties.setProperty("hostnameOverride", ORDERER_NAME);
ordererProperties.setProperty("sslProvider", "openSSL");
ordererProperties.setProperty("negotiationType", "TLS");
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[]{5L, TimeUnit.MINUTES});
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[]{8L, TimeUnit.SECONDS});
Orderer orderer = fabClient.getInstance().newOrderer(ORDERER_NAME, ORDERER_ADDRESS, ordererProperties);
Properties peer0MyOrgProperties = new Properties();
peer0MyOrgProperties.setProperty("trustServerCertificate", "true");
peer0MyOrgProperties.setProperty("pemFile", ORG1_PEER0_CERT);
peer0MyOrgProperties.setProperty("hostnameOverride", ORG1_PEER0_NAME );
peer0MyOrgProperties.setProperty("sslProvider", "openSSL");
peer0MyOrgProperties.setProperty("negotiationType", "TLS");
peer0MyOrgProperties.put("grpc.NettyChannelBuilderOption.maxInboundMessageSize", 9000000);
Peer peer = fabClient.getInstance().newPeer(ORG1_PEER0_NAME, ORG1_PEER0_ADDRESS, peer0MyOrgProperties);
channel.addPeer(peer);
channel.addOrderer(orderer);
channel.initialize();`
Can you help me?) thanks
gaijinviki (Thu, 07 Feb 2019 09:28:26 GMT):
Hello,
I am getting the following error when initializing a channel
```Exception in thread "main" java.lang.UnsatisfiedLinkError: failed to load the required native library
at io.netty.handler.ssl.OpenSsl.ensureAvailability(OpenSsl.java:327)
at io.netty.handler.ssl.ReferenceCountedOpenSslContext.
gaijinviki (Thu, 07 Feb 2019 09:28:26 GMT):
Hello,
I am getting the following error when initializing a channel
```Exception in thread "main" java.lang.UnsatisfiedLinkError: failed to load the required native library
at io.netty.handler.ssl.OpenSsl.ensureAvailability(OpenSsl.java:327)
at io.netty.handler.ssl.ReferenceCountedOpenSslContext.
gaijinviki (Thu, 07 Feb 2019 09:28:26 GMT):
Hello,
I am getting the following error when initializing a channel
```Exception in thread "main" java.lang.UnsatisfiedLinkError: failed to load the required native library
at io.netty.handler.ssl.OpenSsl.ensureAvailability(OpenSsl.java:327)
at io.netty.handler.ssl.ReferenceCountedOpenSslContext.
gravity (Thu, 07 Feb 2019 09:40:35 GMT):
@gaijinviki
met similar error previously
try to add these dependencies:
```
gaijinviki (Thu, 07 Feb 2019 09:40:54 GMT):
Thank you, let me try that.
gravity (Thu, 07 Feb 2019 09:42:59 GMT):
@helpsolution
try to add an additional property for peers and orderers:
```
properties.put("ssl-target-name-override", ${PEER_NAME | ORDERER_NAME})
```
gaijinviki (Thu, 07 Feb 2019 09:54:22 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=H7nxZ3PSBwqFM3TGn) @gravity , did not work. Still the same issue.
gaijinviki (Thu, 07 Feb 2019 09:54:22 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=H7nxZ3PSBwqFM3TGn) @gravity @gravity, did not work. Still the same issue.
gravity (Thu, 07 Feb 2019 10:01:11 GMT):
@gaijinviki
what is the flow to reproduce this?
gravity (Thu, 07 Feb 2019 10:02:02 GMT):
and which version of sdk do you use?
gaijinviki (Thu, 07 Feb 2019 10:19:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8uBzd3T5Z8esFKkRk) sorry my bad, the libs were not copied to the right place. It worked perfectly. Thank you!
mahoney1 (Thu, 07 Feb 2019 12:41:30 GMT):
a reminder that the Fabric Developer Community call later today is at 5pm UTC (5pm UK, 12pm ET, 9am PT) using Zoom: https://zoom.us/my/hyperledger.community . The agenda is here -> https://wiki.hyperledger.org/display/fabric/Fabric+Developer+-+Meeting+Agendas+ . Please come join us, hear about exciting new work in progress, give feedback, ask questions or share your stories ! More info on the call can be found in this mail -> https://lists.hyperledger.org/g/fabric/message/5475 ... later, Paul (Fabric Developer Community Lead)
DeepakDahiya (Thu, 07 Feb 2019 13:12:36 GMT):
Has joined the channel.
rickr (Thu, 07 Feb 2019 13:38:36 GMT):
@gravity I don't think there's a way to pick a specific peer. Endorsements are by organization
https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/test/fixture/sdkintegration/chaincodeendorsementpolicyAllMembers.yaml
That is an example of needing both peers organizations to sign the endorsement for the integration tests.
If the documentation is not clear I highly encourage you to bring this up in the #fabric-documentation so they can look on improving it.
rickr (Thu, 07 Feb 2019 13:48:36 GMT):
@gaijinviki and @gravity Our verification test are run with TLS enabled and pass. So I'm fairly certain the required dependencies are ok.
gaijinviki (Thu, 07 Feb 2019 14:01:19 GMT):
@rickr I had to add the dependencies to make it work. Maybe something wrong with my setup. And I am not using TLS, the error occurred during eventing initiation `org.hyperledger.fabric.sdk.Peer.initiateEventing(Peer.java:148)`
gravity (Thu, 07 Feb 2019 15:06:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=QmSd8F5Cth9JHchk6) @rickr Actually I do use an endorsement policy similar to this. But I confused it with the validation of transaction proposal responses from the endorsement peers. I thought that if I have a policy (now I know that this policy is invaild) `AND("org1.peer", "org1.peer", "org3.peer")`, means that a transaction proposal must be sent to at least 3 endorsement peers for the endorsement.
gravity (Thu, 07 Feb 2019 15:06:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=QmSd8F5Cth9JHchk6) @rickr Actually I do use an endorsement policy similar to this. But I confused it with the validation of transaction proposal responses from the endorsement peers. I thought that if I have a policy (now I know that this policy is invaild) `AND("org1.peer", "org1.peer", "org1.peer")`, means that a transaction proposal must be sent to at least 3 endorsement peers for the endorsement.
gravity (Thu, 07 Feb 2019 15:08:03 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=pohSEZbckh58Hcc8B) @rickr so you are saying that it should work without adding these dependencies explicitly to an application, right?
rickr (Thu, 07 Feb 2019 15:30:09 GMT):
Endorsements are by organization. You would need an endorsement from a peer for each organization in the case I pointed to. If you don't have that and your send your endorsements to the Orderer the committers SHOULD mark the transaction as bad.
jdfigure (Thu, 07 Feb 2019 15:59:38 GMT):
service discovery
jdfigure (Thu, 07 Feb 2019 16:17:30 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jSYC6qDCKRJWhiTbk) @gravity @gravity - I'm seeing this same error using Service Discovery - were you able to resolve?
mahoney1 (Thu, 07 Feb 2019 18:01:44 GMT):
the SDK deck from today's Fabric Developer call is attached to the JIRA FYI https://jira.hyperledger.org/browse/FABJ-400
gravity (Thu, 07 Feb 2019 18:11:06 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=JAo25Cki8xLFXfFJa) @jdfigure no, it did not work for me
gravity (Thu, 07 Feb 2019 18:12:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=HJe2RmrEh8iKzBaSr) @rickr now it's clear. transaction endorsement is done under the hood by the organization's entity that is requested in the policy.
jdfigure (Thu, 07 Feb 2019 21:06:26 GMT):
@gravity @rickr I think I've discovered why Service Discovery wasn't working (peer reporting `TLS handshake failed with error tls: client didn't provide a certificate`).
It seems there's a bug in the `org.hyperledger.fabric.sdk.Channel#addPeer(org.hyperledger.fabric.sdk.Peer, org.hyperledger.fabric.sdk.Channel.PeerOptions)`
method when using the `clientCertBytes` property instead of `clientCertFile`. This check fails to find the `clientCertBytes` property:
```
if (peerOptions.getPeerRoles().contains(PeerRole.SERVICE_DISCOVERY)) {
final Properties properties = peer.getProperties();
if ((properties == null) || (isNullOrEmpty(properties.getProperty("clientCertFile")) &&
isNullOrEmpty(properties.getProperty("clientCertBytes")))) {
TLSCertificateBuilder tlsCertificateBuilder = new TLSCertificateBuilder();
TLSCertificateKeyPair tlsCertificateKeyPair = tlsCertificateBuilder.clientCert();
peer.setTLSCertificateKeyPair(tlsCertificateKeyPair);
}
discoveryEndpoints.add(peer.getEndpoint());
}
```
Calling `properties.getProperty("clientCertBytes")` returns null because the property value is not a string. Instead, it should be using `properties.containsKey("clientCertBytes")`.
When I used `clientCertFile` instead, everything works. The reason the ServiceDiscoveryIT tests work is because they are also using cert files instead of cert bytes.
gravity (Thu, 07 Feb 2019 21:09:26 GMT):
@jdfigure
that's very interesting.
thanks for letting me know
dan13 (Thu, 07 Feb 2019 23:32:17 GMT):
Is there a Java SDK equivalent to Go SDK Client.Execute (https://godoc.org/github.com/hyperledger/fabric-sdk-go/pkg/client/channel#Client.Execute) which "automatically chooses endorsers, service discovery, requests endorsements, signature validation, submits to the ordering service, watches events for commit, configurable retries" per https://jira.hyperledger.org/browse/FABN-692?focusedCommentId=48582&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-48582? It seems the Java SDK requires sendTransactionProposal, sendTransaction, a CompleteableFuture.get, and some wrapping retry logic to accomplish same -- much more developer complexity required
anjalinaik (Fri, 08 Feb 2019 04:24:11 GMT):
Hi All.
Is there an option in fabric-java-sdk to upgrade a chaincode?
gaijinviki (Fri, 08 Feb 2019 05:23:47 GMT):
Hello, I am using java sdk to do service discovery during channel initiation. The peer external endpoint is set to `CORE_PEER_GOSSIP_EXTERNALENDPOINT=mycustomurl:8051` and so the sdk can connect to the peer, but the discovery peer is passing the orderer address as `orderer0.example.com`, and hence the sdk cannot resolve that. How can I change the external address of the orderer, preferably via some environment variable ?
gaijinviki (Fri, 08 Feb 2019 05:23:47 GMT):
Hello, I am using service discovery during channel initiation. The `CORE_PEER_GOSSIP_EXTERNALENDPOINT=mycustomurl:8051` and so the sdk can connect to the right peer, but the discovery peer is passing the orderer address as `orderer0.example.com`, and hence the sdk cannot resolve that. How can I change the address of the orderer, preferably via some environment variable ?
andrew-coleman (Fri, 08 Feb 2019 09:40:06 GMT):
@dan13 we are currently working on this for v2.0. See https://jira.hyperledger.org/browse/FABJ-400
bestbeforetoday (Fri, 08 Feb 2019 12:00:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=x7we86ME3KjKbYLfv) @jdfigure Is there a Jira for this? If not, it would be good to raise: https://jira.hyperledger.org/projects/FABJ/issues
kevinkbc (Fri, 08 Feb 2019 14:37:23 GMT):
does anyone have a good example of adding a lot of stuff at once on the ledger?
kevinkbc (Fri, 08 Feb 2019 14:39:36 GMT):
I've made method using an invoke "add" that adds a single record to the ledger. Now I want to add a list (10000+). i tried to use a for executing for each element in the list but I got this "EE-ManagedExecutorService-default-Thread-4) failed to execute transaction 441ff090abf44ae948fe8b7f0de0f36e48b2b0cce170785b66cb172005dc893d: failed to register event:1.4 as launching: chaincode event:1.4 has already been launched"
aatkddny (Fri, 08 Feb 2019 15:35:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Wetynfb4Cs9Z6Ej5j) @kevinkbc I only have an example from 1.2 - netty saturated and started throwing exceptions at about the 25 concurrent thread mark. I had a different issue to fix and never got back to it, so we (still) throttle.
kevinkbc (Fri, 08 Feb 2019 15:37:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=wAEp9yKBtwgHak6ro) @aatkddny I am usinh hyperleddeger fabric 1.2 and sdk 1.2
aatkddny (Fri, 08 Feb 2019 15:46:25 GMT):
then don't try to put too much in at once.
jdfigure (Fri, 08 Feb 2019 16:03:22 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=mKqTAcbGEC8HHkrLs) @bestbeforetoday I don't I have access to add a JIRA ticket.
bestbeforetoday (Fri, 08 Feb 2019 16:06:41 GMT):
@jdfigure I think you just need to be logged into Jira with a Linux Foundation ID, which I guess you have to connect to RocketChat
kevinkbc (Fri, 08 Feb 2019 16:56:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=omnXBTMyaNSdN3anc) @aatkddny I dont have much experience with multithread. Is there a simple way to control the number of threads?
kevinkbc (Fri, 08 Feb 2019 17:00:32 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dMZ7M8pJArWGAGEEZ) I noticed it is currently using 5 threads. So i guess i have to use more threads, or addmore information in a block
jdfigure (Fri, 08 Feb 2019 17:02:59 GMT):
@bestbeforetoday I'm oblivious to the obvious sometimes: https://jira.hyperledger.org/browse/FABJ-406
aatkddny (Fri, 08 Feb 2019 17:35:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dMZ7M8pJArWGAGEEZ) @kevinkbc I mean on your input side from the list. I was using a camel route as a consumer from a messaging system in my case.
Under the covers it's an ExecutorService and you can set the thread count in there.
You will hit the "my thread doesn't return until the orderer has cut a block" limit too if you are trying for throughput. You'll see...
smallant (Fri, 08 Feb 2019 17:56:01 GMT):
is there any way to change the transaction timeout? What property should i change?
Currently having this error after increasing the proposal timeout:
2019-02-08 14:14:07.179 ERROR 82913 --- [nio-9999-exec-1] org.hyperledger.fabric.sdk.Channel : Sending proposal to peer1-org1 failed because of: gRPC failure=Status{code=UNKNOWN, description=error executing chaincode: failed to execute transaction: timeout expired while executing transaction, cause=null}
circlespainter (Sun, 10 Feb 2019 14:56:29 GMT):
Has joined the channel.
mahoney1 (Mon, 11 Feb 2019 11:44:02 GMT):
FYI everyone - edited recording (zip containing MP4, transcripts) of the Fabric Developer Community call (Feb 7) is out on the Hyperledger Fabric wiki -> https://wiki.hyperledger.org/display/fabric/Community-Call-Recordings
kevinkbc (Mon, 11 Feb 2019 12:51:30 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=e9NdQrdAFeTgCntLQ) @aatkddny thanks
smallant (Mon, 11 Feb 2019 13:23:22 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=icThiTDYscSGWYxSQ) anyone that can help me on this?
knagware9 (Mon, 11 Feb 2019 13:45:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=RhjENhcurGkkkbGv2) @smallant first try to change with invoke.js file ,,there will be timeout paramter and second you can modify core.yaml file for timour
rickr (Mon, 11 Feb 2019 14:10:47 GMT):
@smallant https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L484 ?
and .. https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/config.properties#L6
and .. https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/main/java/org/hyperledger/fabric/sdk/helper/Config.java#L51
smallant (Mon, 11 Feb 2019 14:50:43 GMT):
the proposal time is high and i can change. This gives me after I execute an heavy duty chaincode that usually takes more than 30s
smallant (Mon, 11 Feb 2019 14:50:55 GMT):
the proposal timeout is currently on the 60 sec
kevinkbc (Mon, 11 Feb 2019 17:15:52 GMT):
failed to execute transaction f675475c11fea75da9751e1dd36fc53d43becc8c545d1ba442e6c5e8a2048c7c: failed to register [chaincode name]:[chaincode version] as launching: chaincode [chaincode name]:[chaincode version] has already been launched sdk and fabric v1.2
Any help on this?
vtech (Tue, 12 Feb 2019 04:39:39 GMT):
Has joined the channel.
chill37 (Tue, 12 Feb 2019 04:44:40 GMT):
ENDORSEMENT policy loading without service discovery.
Is it possible to load the endorsement policy layout without the service discovery in fabric JAVA Sdk?
I can't seem to find it....if anyone could give me a hint on this, I would greatly appreciate it.
biswaranjan (Tue, 12 Feb 2019 05:04:10 GMT):
Has joined the channel.
vtech (Tue, 12 Feb 2019 12:34:56 GMT):
Hi All,
Is there any example to test Idemix & Private data in single transaction? i found independent Junit for both but while trying to integrate both doesn't work as it fails in CA name assertion. Any help /pointer is really appreciated.
rickr (Tue, 12 Feb 2019 15:29:34 GMT):
@vtech I don't see from an SDK perspective it would make a difference. From the SDK the API is pretty much independent. With out any more details pointing to an SDK issue the question I think you should ask on the #fabric-peer-endorser-committer is what testing they've done prior to release that shows it's working.
rickr (Tue, 12 Feb 2019 15:29:34 GMT):
@vtech I don't see from an SDK perspective it would make a difference. From the SDK the API is pretty much independent. With out any more details pointing to an SDK issue the question I think you should ask on the #fabric-peer-endorser-committer is what testing they've done prior to release that shows they both work together
rickr (Tue, 12 Feb 2019 15:39:40 GMT):
@chill37 The endorsement policy is specified when the chaincode is instantiated. It can't be expected that the SDK knows what the endorsement policy really is for any any chaincode. The chaincode could have been instantiated by some entirety different organization than the client/SDK is running in. Thus service discovery. Short of that there _may_ be out of bound knowledge/agreement/policy what is needed.
loneimmortal (Tue, 12 Feb 2019 15:57:45 GMT):
Has joined the channel.
kocahan (Tue, 12 Feb 2019 20:14:31 GMT):
Has joined the channel.
chill37 (Wed, 13 Feb 2019 04:28:48 GMT):
@rickr I see.
But since the chaincode has its policy written (somewhere), can't I load the policy that is lying somewhere? isn't there a way to load this? somewhere from Channel.class or ChaincodeSpec?
I know and tested the service discovery where we can load and select peers based on the policy. I was hoping I could do the same without the discovery.
For now, my setup is that I'm instantiating the Chaincode with cli. Then I use JAVA Sdk to query/invoke. But I would like to know the policy so that I can only call the necessary peers.
Thanks!
anjalinaik (Wed, 13 Feb 2019 05:59:34 GMT):
Hi Experts.How do i install and instantiate a java chaincode using fabric-java-sdk?
chill37 (Wed, 13 Feb 2019 07:00:04 GMT):
@rickr oh now I get it. I can use service discovery to get the endorsement layout only right?
At first I thought service discovery should be only used when query/invoke.
is it possible to use service discovery functions even when I don't have any peers property as "discover:true"?
vtech (Wed, 13 Feb 2019 07:07:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=F3RKHXxaogs2KnaMj) @rickr Error trace I am getting as ```
Now query chaincode ChaincodeID(private_data_cc7_go:github.com/private_data_cc:1) on channel bar for the value of b expecting to see: 250
java.lang.AssertionError: Failed query proposal from peer peer0.org2.example.com status: FAILURE. Messages: Incorrect 'ou' returned, got '' expecting to end with 'department1'. Was verified : false
at org.junit.Assert.fail(Assert.java:88)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.queryChaincodeForExpectedValue(PrivateDataIT.java:588)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.lambda$1(PrivateDataIT.java:407)
```
vtech (Wed, 13 Feb 2019 07:07:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=F3RKHXxaogs2KnaMj) @rickr Error trace I am getting as below. I have verified idemix user is set up , am I missing anything ?```
Now query chaincode ChaincodeID(private_data_cc7_go:github.com/private_data_cc:1) on channel bar for the value of b expecting to see: 250
java.lang.AssertionError: Failed query proposal from peer peer0.org2.example.com status: FAILURE. Messages: Incorrect 'ou' returned, got '' expecting to end with 'department1'. Was verified : false
at org.junit.Assert.fail(Assert.java:88)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.queryChaincodeForExpectedValue(PrivateDataIT.java:588)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.lambda$1(PrivateDataIT.java:407)
```
vtech (Wed, 13 Feb 2019 07:07:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=F3RKHXxaogs2KnaMj) @rickr Error trace I am getting as below. I have verified idemix user is set up , am I missing anything ?```
Now query chaincode ChaincodeID(private_data_cc7_go:github.com/private_data_cc:1) on channel bar for the value of b expecting to see: 250
java.lang.AssertionError: Failed query proposal from peer peer0.org2.example.com status: FAILURE. Messages: Incorrect 'ou' returned, got '' expecting to end with 'department1'. Was verified : false
at org.junit.Assert.fail(Assert.java:88)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.queryChaincodeForExpectedValue(PrivateDataIT.java:588)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.lambda$1(PrivateDataIT.java:407)
```
vtech (Wed, 13 Feb 2019 07:07:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=F3RKHXxaogs2KnaMj) @rickr Error trace I am getting as below. I have verified idemix user is set up , am I missing anything ?```
Now query chaincode ChaincodeID(private_data_cc7_go:github.com/private_data_cc:1) on channel bar for the value of b expecting to see: 250
java.lang.AssertionError: Failed query proposal from peer peer0.org2.example.com status: FAILURE. Messages: Incorrect 'ou' returned, got '' expecting to end with 'department1'. Was verified : false
at org.junit.Assert.fail(Assert.java:88)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.queryChaincodeForExpectedValue(PrivateDataIT.java:588)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.lambda$1(PrivateDataIT.java:407)
``` I am trying to retrieve the idemix credential in private_data _chaincode ```
// Getting attributes from an idemix credential
ou, found, err := cid.GetAttributeValue(stub, "ou");
logger.Info("ou is *******************************: " + ou)
if !strings.HasSuffix(ou, "department1") {
return shim.Error(fmt.Sprintf("Incorrect 'ou' returned, got '%s' expecting to end with 'department1'", ou))
}
```
vtech (Wed, 13 Feb 2019 07:07:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=F3RKHXxaogs2KnaMj) @rickr Error trace I am getting as below. I have verified idemix user is set up , am I missing anything ?```
Now query chaincode ChaincodeID(private_data_cc7_go:github.com/private_data_cc:1) on channel bar for the value of b expecting to see: 250
java.lang.AssertionError: Failed query proposal from peer peer0.org2.example.com status: FAILURE. Messages: Incorrect 'ou' returned, got '' expecting to end with 'department1'. Was verified : false
at org.junit.Assert.fail(Assert.java:88)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.queryChaincodeForExpectedValue(PrivateDataIT.java:588)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.lambda$1(PrivateDataIT.java:407)
```
I am trying to retrieve the idemix credential in private_data _chaincode ```
Getting attributes from an idemix credential
ou, found, err := cid.GetAttributeValue(stub, "ou");
logger.Info("ou is *******************************: " + ou)
if !strings.HasSuffix(ou, "department1") {
return shim.Error(fmt.Sprintf("Incorrect 'ou' returned, got '%s' expecting to end with 'department1'", ou))
}
```
vtech (Wed, 13 Feb 2019 07:07:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=F3RKHXxaogs2KnaMj) @rickr Error trace I am getting as below. I have verified idemix user is set up , am I missing anything ?```
Now query chaincode ChaincodeID(private_data_cc7_go:github.com/private_data_cc:1) on channel bar for the value of b expecting to see: 250
java.lang.AssertionError: Failed query proposal from peer peer0.org2.example.com status: FAILURE. Messages: Incorrect 'ou' returned, got '' expecting to end with 'department1'. Was verified : false
at org.junit.Assert.fail(Assert.java:88)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.queryChaincodeForExpectedValue(PrivateDataIT.java:588)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.lambda$1(PrivateDataIT.java:407)
```
I am trying to retrieve the idemix credential in private_data _chaincode ```
//Getting attributes from an idemix credential
ou, found, err := cid.GetAttributeValue(stub, "ou");
logger.Info("ou is *******************************: " + ou)
if !strings.HasSuffix(ou, "department1") {
return shim.Error(fmt.Sprintf("Incorrect 'ou' returned, got '%s' expecting to end with 'department1'", ou))
}
```
vtech (Wed, 13 Feb 2019 07:07:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=F3RKHXxaogs2KnaMj) @rickr Error trace I am getting as below. I have verified idemix user is set up , am I missing anything ?```
Now query chaincode ChaincodeID(private_data_cc7_go:github.com/private_data_cc:1) on channel bar for the value of b expecting to see: 250
java.lang.AssertionError: Failed query proposal from peer peer0.org2.example.com status: FAILURE. Messages: Incorrect 'ou' returned, got '' expecting to end with 'department1'. Was verified : false
at org.junit.Assert.fail(Assert.java:88)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.queryChaincodeForExpectedValue(PrivateDataIT.java:588)
at org.hyperledger.fabric.sdkintegration.PrivateDataIT.lambda$1(PrivateDataIT.java:407)
```
I am trying to retrieve the idemix credential in private_data _chaincode ```
// Invoke makes payment of X units from A to B
func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
logger.Info("########### private_data_cc Invoke ###########")
function, args := stub.GetFunctionAndParameters()
// Getting attributes from an idemix credential
ou, found, err := cid.GetAttributeValue(stub, "ou");
logger.Info("ou is *******************************: " + ou)
if !strings.HasSuffix(ou, "department1") {
return shim.Error(fmt.Sprintf("Incorrect 'ou' returned, got '%s' expecting to end with 'department1'", ou))
}
```
Subhankar 3 (Wed, 13 Feb 2019 11:35:54 GMT):
tls
rickr (Wed, 13 Feb 2019 13:22:21 GMT):
@anjalinaik https://github.com/hyperledger/fabric-sdk-java/tree/a2140f9bba57a63c58d9ee8579fea7164bf3beb2#end-to-end-test-scenario ?
rickr (Wed, 13 Feb 2019 13:22:21 GMT):
@anjalinaik https://github.com/hyperledger/fabric-sdk-java/tree/a2140f9bba57a63c58d9ee8579fea7164bf3beb2#end-to-end-test-scenario
End2endIT.java ?
rickr (Wed, 13 Feb 2019 13:35:04 GMT):
@vtech Too little to go on and probably better asked on #fabric-chaincode-dev. We have a sample that is running I think that's doing the same. It appears to be ok. https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/test/fixture/sdkintegration/gocc/sampleIdemix/src/github.com/example_cc/example_cc.go#L88
rickr (Wed, 13 Feb 2019 13:39:11 GMT):
@chill37 Not sure I understand you question. The example for service discovery is there - https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/test/java/org/hyperledger/fabric/sdkintegration/ServiceDiscoveryIT.java
Adds peer with service discovery role and creates channel and invokes chaincode.
rickr (Wed, 13 Feb 2019 13:39:11 GMT):
@chill37 Not sure I understand your question. The example for service discovery is there - https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/test/java/org/hyperledger/fabric/sdkintegration/ServiceDiscoveryIT.java
Adds peer with service discovery role and creates channel and invokes chaincode.
vtech (Wed, 13 Feb 2019 15:20:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=gHA69is6pSXw4puu8) @rickr I am trying to execute private data with idemix set up. I have set up the idemix credentials and used the private data chaincode (https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/test/fixture/sdkintegration/gocc/samplePrivateData/src/github.com/private_data_cc/private_data_cc.go ). Now in this private data chaincode while retrieving the ou attributes `ou, found, err := cid.GetAttributeValue(stub, "ou");` throws the above error.
vtech (Wed, 13 Feb 2019 15:20:51 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=gHA69is6pSXw4puu8) @rickr I am trying to execute private data with idemix set up. I have set up the idemix credentials and used the private data chaincode (https://github.com/hyperledger/fabric-sdk-java/blob/a2140f9bba57a63c58d9ee8579fea7164bf3beb2/src/test/fixture/sdkintegration/gocc/samplePrivateData/src/github.com/private_data_cc/private_data_cc.go ). Now in this private data chaincode while retrieving the ou attributes `ou, found, err := cid.GetAttributeValue(stub, "ou");` throws the above error. What can be wrong/missing in this process ?
rickr (Wed, 13 Feb 2019 15:29:56 GMT):
@vtech can you _simplify_ ? Add to your chanincode a new function that just returns back a string "i'm good" and do that GetAttributeValue so there's no privadata involved. Also as stated I don't think the place to start here is on this channel. It's really a #fabric-chaincode-dev channel where issue rise while executing chaincode should be worked out. The experts on that should be monitoring it.
vtech (Wed, 13 Feb 2019 15:42:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=c3WqNhaonBfJxA8ww) @rickr Yeah with out private data it works fine and i am able to get the GetAttributeValue , but having issue while trying with private data. I will further ask it in #fabric-chaincode-dev . Thanks.
allenyang (Thu, 14 Feb 2019 08:40:17 GMT):
Has joined the channel.
danacr (Thu, 14 Feb 2019 20:05:30 GMT):
Has left the channel.
pchochu (Thu, 14 Feb 2019 20:58:37 GMT):
Has joined the channel.
jjean (Fri, 15 Feb 2019 09:22:18 GMT):
Has joined the channel.
jjean (Fri, 15 Feb 2019 09:43:22 GMT):
Hi, I'm trying to integrate the java Fabric sdk (v2.0) to my app built with Gradle (it's a JHipster generated app, with a Java, Spring back-end) to query and invoke my 1.4 Hyperledger Fabric network. After reading the fabric sdk README, I guess I have to add the maven dependencie and the .jar of the Fabric sdk somewhere, any hint/advice please ?
jjean (Fri, 15 Feb 2019 09:43:22 GMT):
Hi, I'm trying to integrate the java Fabric sdk to my app built with Gradle (it's a JHipster generated app, with a Java, Spring back-end) to query and invoke my 1.4 Hyperledger Fabric network. After reading the fabric sdk README, I guess I have to add the maven dependencie and the .jar of the Fabric sdk somewhere, any hint/advice please ?
dan13 (Fri, 15 Feb 2019 14:28:59 GMT):
@jjean is this what you are looking for? https://github.com/hyperledger/fabric-sdk-java
jjean (Fri, 15 Feb 2019 14:50:32 GMT):
Thank you for your answer @dan13, yes I found the fabric sdk here, I successfully added the .jar to my Gradle and I'm now trying to understand the End to end test to send query and invoke the Hyperledger network of the tutorial "build your first network"...
dan13 (Fri, 15 Feb 2019 15:52:28 GMT):
@jjean you may find https://github.com/IBM/blockchain-application-using-fabric-java-sdk and https://medium.com/@lkolisko/tutorial-invoking-chaincode-from-hyperledger-fabric-java-sdk-e8dea535a1be and https://github.com/vishal3152/HyperledgerFabric-Java-Client may be useful to get started.
dan13 (Fri, 15 Feb 2019 15:52:28 GMT):
@jjean you may find https://github.com/IBM/blockchain-application-using-fabric-java-sdk and https://medium.com/@lkolisko/tutorial-invoking-chaincode-from-hyperledger-fabric-java-sdk-e8dea535a1be and https://github.com/vishal3152/HyperledgerFabric-Java-Client are useful to get started. I have not found a good full solution example available anywhere yet.
rickr (Fri, 15 Feb 2019 19:33:47 GMT):
@jjean If _you're just starting off_ I'd recommend what the README.md suggest. Have it pass the Integration test. Build Successful indicates the tests are working with the fabric configuration provided (_fabric.sh_ script) and all is setup. Then import and get everything resolved in your IDE. Debugging the integration tests shows everything you can do and lets you follow the code. Once done you have a place to start copying code for your own application.
gravity (Mon, 18 Feb 2019 09:41:08 GMT):
hi @rickr
what is the point of setting up the `version` field in `ChaincodeID` for `TransactionProposalRequest` and `QueryByChaincodeRequest` when it's actually is ignored?
for example, if I install a chaincode on channel `ch1` version `1.0` and instatiate it, and later try to send transaction proposal or query request, I can put any other version to the ChaincodeID of the proposal/query, for example `1.0qwerty` and it will proceed. But, if do not put version to the `ChaincodeID`, it will throw NPE
jjean (Mon, 18 Feb 2019 12:38:53 GMT):
Hi, how could I turn off the following logs for Java SDK?
`2019-02-18 13:35:55.126 DEBUG 6061 --- [pool-3-thread-1] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 3, name: eventhub01, channelName: mychannel, url: grpc://localhost:7053} connect is done with connect status: false
2019-02-18 13:35:55.130 DEBUG 6061 --- [-worker-ELG-1-4] io.grpc.netty.NettyClientHandler`
rickr (Mon, 18 Feb 2019 13:59:09 GMT):
@jjean You can control sdk logging by using log4j . That is DEBUG and by default the SDK is in WARN level which should not produce that.
rickr (Mon, 18 Feb 2019 14:14:54 GMT):
@gravity ChaincodeID mirrored protobuf structure. It was to uniquely identify the chaincode but in the early days things kept chainging. The idea was if you set it appropriately the SDK would use from it what was needed. Please submit a JIRA for the NPE case you're observing with a quick example that should not happen. It must be a non common scenario as no one as reported it. There is a change coming in 2.0 that entirely changes chaincode deployment and ChaincodeID should will not be used anymore with that.
gravity (Mon, 18 Feb 2019 16:52:12 GMT):
@rickr
ok, will report that.
there is another question: what happens after chaincode upgrade? does the chaincode with the newer version become the default chaincode to be called on all subsequent chaincode invocations?
rickr (Mon, 18 Feb 2019 16:53:58 GMT):
@gravity yes only the latest.
gravity (Mon, 18 Feb 2019 16:58:21 GMT):
got it, thanks
jjean (Mon, 18 Feb 2019 17:23:21 GMT):
Thanks @rickr !
mahoney1 (Mon, 18 Feb 2019 17:29:49 GMT):
fyi / heads-up : next Fabric Developer Community call is planned for this Thurs February 21st - https://wiki.hyperledger.org/display/fabric/Meeting+Agendas%3A+Community+Call - contributions are welcome to the agenda ! More info on the call can be found [here](https://lists.hyperledger.org/g/fabric/topic/hyperledger_fabric_developer/29654592?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,29654592)
jjean (Tue, 19 Feb 2019 13:55:10 GMT):
Hi, could you tell me if the call to `channel.sendTransactionProposal(request, channel.getPeers())` (channel is an instance of `org.hyperledger.fabric.sdk.Channel`) is busy waiting ?
rickr (Tue, 19 Feb 2019 15:33:26 GMT):
@jjean It waits for peers to endorse (run) the chaincode or times out.
jjean (Tue, 19 Feb 2019 15:35:41 GMT):
@rickr I meant to ask : is `sendTransactionProposal` an asynchronous method ?
rickr (Tue, 19 Feb 2019 15:36:17 GMT):
no
jjean (Tue, 19 Feb 2019 15:36:45 GMT):
Ok, thanks
jdfigure (Tue, 19 Feb 2019 17:11:34 GMT):
Has anyone experienced a high number of connections from the Java SDK to an anchor peer? We're trying to track down a memory issue on our peers (seeing upwards of 20GB RAM used by our anchor peer). We're seeing that the SDK is establishing 22K connections to the anchor peer under load. It seems to be related to the default ExecutorPool settings in `HFClient`. We've turned off all event listeners. Any ideas?
rickr (Tue, 19 Feb 2019 18:11:25 GMT):
@jdfigure I've not heard of any issues. I knew one group that was creating the channel doing the request, shutting down the channel .. repeat for each request which caused problems. So what version of the SDK and when you say you turned off all event listeners .. I assume that just added info and the problem persists?
jdfigure (Tue, 19 Feb 2019 19:25:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bgMisZ9Ns3SQS4BXM) @rickr Yes, the fact that we turned off event listeners was added info. We were doing something similar (i.e. creating HFClient and channel per request).
Right now we're modifying our our approach to use a singleton HFClient instance, re-using channels on that client, and using the TransactionRequest.setUserContext for transaction-level user context. I assume that's a better model?
rickr (Tue, 19 Feb 2019 20:12:05 GMT):
@jdfigure yes
jdfigure (Tue, 19 Feb 2019 20:26:15 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=hzhxYoWAjQfqtQpwG) @rickr thanks for your input - our singleton HFClient and channel re-use refactor is showing tremendous improvements.
gravity (Tue, 19 Feb 2019 20:59:18 GMT):
Hello. How to handle the situation when the enrollment certificates for peers are expired? can I issue the reenroll request for peers from an application and expect that peer's enrollment cert will be renewed?
gravity (Tue, 19 Feb 2019 20:59:18 GMT):
Hello. How to handle the situation when the enrollment certificates for peers are expired? can I issue the reenroll request for peers from an application and expect that peer's enrollment cert will be renewed?
@skarim
gravity (Tue, 19 Feb 2019 20:59:18 GMT):
Hello. How to handle the situation when the enrollment certificates for peers are expired? can I issue the reenroll request for peers from an application and expect that peer's enrollment cert will be renewed?
rickr (Tue, 19 Feb 2019 21:08:21 GMT):
@gravity I don't think that will work. Probably better asked on #fabric-peer-endorser-committer channel
skarim (Tue, 19 Feb 2019 21:30:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=hfoYFGEt75SMtKWmW) @gravity If the certificate is expired, you would not be able to use `reenroll` as the certificate would fail to pass validation cause it's expired. In this case, you would have to use `enroll` using your username/password. Once, you enroll you will get back a new certificate and this certificate would have to be used by the peer.
gravity (Tue, 19 Feb 2019 22:02:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=yRGd8WWxT9jd3zovM) @skarim for example, if a certificate is going to be expired in, let's say, 5 days, I can `reenroll` peer's certificate, and to use this reenrolled certificate a peer must be restarted, right?
and the same for the `enroll` when the certificate expired - peer must be restarted, right?
are there any other actions to be done to accept this newly enrolled or re-enrolled certificate?
skarim (Tue, 19 Feb 2019 22:33:03 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=gkcw9Y2nRCdK2rprF) @gravity If it hasn't expired yet, then yes you can use `reenroll`. After getting the new certificate, a peer restart is required. I believe that should be it.
gravity (Tue, 19 Feb 2019 22:52:24 GMT):
@skarim got it, thanks
aatkddny (Tue, 19 Feb 2019 23:24:31 GMT):
haven't had a need to go through the sdk for a while. is there a way to tell events that haven't been
aatkddny (Tue, 19 Feb 2019 23:24:31 GMT):
haven't had a need to go through the sdk for a while, and i'll do so tomorrow, but i'm trying to save some time searching.
we've been losing events because we've had some issues with peer instability in the cloud.
is there an example of a way to tell the events that haven't been triggered on a peer and to replay them in the sdk at all, or something i can co-opt, or am i going to be walking the blocks and dummying events from the tx manually?
sandy (Wed, 20 Feb 2019 04:16:10 GMT):
Has joined the channel.
aatkddny (Wed, 20 Feb 2019 13:07:45 GMT):
Answering my own question - haven't been there for a while. testPeerServiceEventingReplay in End2endAndBackAgainIT.java looks like just what I need. I'll leave this here in case anyone else has this issue.
rickr (Wed, 20 Feb 2019 13:54:45 GMT):
Hi @aatkddny yes that should be where you look at. However the SDK using peereventing services should try to continue to connect and would start getting the last block it seen. You can change behavior https://github.com/hyperledger/fabric-sdk-java/blob/d2bc6d50e362a140970a509ade25f2f2c69e6c0f/src/main/java/org/hyperledger/fabric/sdk/Peer.java#L523-571
So if you're client is up and running and the peer goes down and comes back up -- it _shouldn't_ miss blocks.
Obviously this dependent on memory and if your client goes down that's not going to help. Ultimately if an application really needs to be bullet proof it needs some blocklistener that tracks the blocks it has processed and persists that somewhere so if it needs to restart it can begin at that point.
aatkddny (Wed, 20 Feb 2019 16:07:49 GMT):
@rickr and that's what it looks like i'm going to end up having to implement.
in my case this set of peers don't always necessarily going down - they have other problems too that i won't air here - and they aren't under my direct control.
what we are seeing though is that we aren't reliably getting all the events, and we need them to guarantee integrity.
aatkddny (Wed, 20 Feb 2019 16:07:49 GMT):
@rickr and that's what it looks like i'm going to end up having to implement.
in my case this set of peers don't always necessarily go down per se - they have other problems too that i won't air here - and they aren't under my direct control.
what we are seeing though is that we aren't reliably getting all the events, and we need them to guarantee integrity.
gravity (Wed, 20 Feb 2019 17:09:49 GMT):
Hi all
there is a question regarding the chaincode event listeners. if I set up an event to be thrown in a chaincode function, but this function returned `shim.Error()`, will I receive this event in the registered event listener on the application side?
thanks in advance
dave.enyeart (Wed, 20 Feb 2019 18:05:49 GMT):
@gravity you will not receive it... you only receive events as blocks/transactions are committed... a shim error doesn't get past endorsement phase
gravity (Wed, 20 Feb 2019 18:46:41 GMT):
@dave.enyeart understand, thanks
mahoney1 (Thu, 21 Feb 2019 12:22:27 GMT):
reminder that the Fabric Developer Community call is today at 5pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android:https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas%3A+Community+Call - be great to hear from you later ! :-) regards Paul
prakash04 (Thu, 21 Feb 2019 19:26:49 GMT):
Has joined the channel.
mahoney1 (Fri, 22 Feb 2019 09:48:26 GMT):
hi everyone - just to say: the recording of the Fabric Developer Community Call yesterday (02/21) can be downloaded from https://wiki.hyperledger.org/display/fabric/Community-Call-Recordings FYI
Jamie (Fri, 22 Feb 2019 11:07:37 GMT):
Hi. When running the ./fabric.sh restart from src/test/fixture/sdkintegration folder i am receiving an error. Error - Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/peer/msp: could not load a valid signer certificate from directory /etc/hyperledger/peer/msp/signcerts: stat /etc/hyperledger/peer/msp/signcerts: no such file or directory
Jamie (Fri, 22 Feb 2019 11:07:37 GMT):
Hi. When running the ./fabric.sh restart from src/test/fixture/sdkintegration folder i am receiving an error. Error - Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/peer/msp: could not load a valid signer certificate from directory /etc/hyperledger/peer/msp/signcerts: stat /etc/hyperledger/peer/msp/signcerts: no such file or directory
Jamie (Fri, 22 Feb 2019 11:07:37 GMT):
Hi. When running the ./fabric.sh restart from src/test/fixture/sdkintegration folder i am receiving an error. Error - Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/peer/msp: could not load a valid signer certificate from directory /etc/hyperledger/peer/msp/signcerts: stat /etc/hyperledger/peer/msp/signcerts: no such file or directory Something wrong with some access. in the mapped volume the folder does exists.
gravity (Fri, 22 Feb 2019 12:06:17 GMT):
Hi all
is it a good practice to have a singleton instance of the `HFClient` and set user context on transaction level (and do not set user context directly to the `HFClient`)?
our current implementation creates `HFClient` instance per user, but it seems like overhead.
rickr (Fri, 22 Feb 2019 14:17:06 GMT):
@Jamie Have to believe something local to your environment. I run that many times daily and so do many other users. This is the first report of an issue with it that I can remember.
rickr (Fri, 22 Feb 2019 14:20:35 GMT):
@gravity Most of the API lets you directly set the usercontext. I highly recommend doing that unless you only have one user. If your application is going to be multi-threaded there's no way you can control the user context by switching it on the client.
gravity (Fri, 22 Feb 2019 14:42:09 GMT):
@rickr
So, for example, I can create, let' say, 2 instances of `HFClient` - the first one for an admin (peer admin) and set user context for it after creating it. This instance I will be using only for admin actions, like create channel, install chaincode, instantiate etc. THere should be no problems because I have only one peer admin.
Also, I will create another HFClient instance, but won't set user context, only crypto primitives. This instance will be in use only for queries/transactions where I will set user context directly to the query/transaction proposals.
is this setup more or less ok?
rickr (Fri, 22 Feb 2019 14:44:57 GMT):
Yes that will work. But a bit overkill most likely, I think you should be able to just one instance of HFClient
gravity (Fri, 22 Feb 2019 14:46:34 GMT):
@rickr thanks a lot
gad0lim (Fri, 22 Feb 2019 20:02:58 GMT):
Has joined the channel.
gad0lim (Fri, 22 Feb 2019 20:03:14 GMT):
hey, is there any example of connectin with grpc from android?
gad0lim (Fri, 22 Feb 2019 20:03:14 GMT):
hey, is there any example of connection with grpc from android?
gad0lim (Fri, 22 Feb 2019 20:03:41 GMT):
readme.md mentions that android sdk is not supported
gad0lim (Fri, 22 Feb 2019 20:03:41 GMT):
readme.md for java sdk mentions that android sdk is not supported
gad0lim (Fri, 22 Feb 2019 20:03:41 GMT):
Readme.md for java sdk mentions that android sdk is not supported.
gad0lim (Fri, 22 Feb 2019 20:05:21 GMT):
I would like still try to have kind of minimal "fabric" client to interact with my contract directly by talking to peers
gad0lim (Fri, 22 Feb 2019 20:14:28 GMT):
other question would be what's the blocker for android support
gad0lim (Fri, 22 Feb 2019 20:53:37 GMT):
ah... have to switch to web3j
gad0lim (Fri, 22 Feb 2019 20:53:37 GMT):
ah... have to switch to web3j :(
gad0lim (Fri, 22 Feb 2019 20:53:37 GMT):
ah... have to switch to web3j and ethereum :(
rickr (Fri, 22 Feb 2019 22:55:04 GMT):
I would design my mobile app to not be _blockchain aware_. Have it concentrate on the UI experience. Use a REST request to the backend to an SDK to do the blockchain work. The same REST request could be used for both Android and IOS. Not tied to any specific backend technology. Just my two cents.
rickr (Fri, 22 Feb 2019 22:55:04 GMT):
@gad0lim I would design my mobile app to not be _blockchain aware_. Have it concentrate on the UI experience. Use a REST request to the backend to an SDK to do the blockchain work. The same REST request could be used for both Android and IOS. Not tied to any specific backend technology. Just my two cents.
dan13 (Sun, 24 Feb 2019 02:33:22 GMT):
As I understand it, a channel object is needed to transact/query, and userContext is required for HFClient to get context to a channel (e.g., via loadChannelFromConfig()). Assuming a per-transaction userContext is required during operation, what is the best practice for setting up the HFClient and Channels? Is there a any required relationship(s) between the User used to get context to the channel and the User used to transact/query?
dan13 (Sun, 24 Feb 2019 02:33:22 GMT):
As I understand it, a channel object is needed to transact/query, and userContext is required for HFClient to get context to a channel (e.g., via loadChannelFromConfig()). Assuming a per-transaction userContext is required during operation, what is the best practice for setting up the HFClient and Channels? Is there a any required relationship(s) between the User used to get context to the channel and the User used to transact/query? If a single API is operating on behalf of multiple Orgs, correct to say that an HFClient per Org is required?
ashutoshkapuskar (Sun, 24 Feb 2019 23:27:22 GMT):
Has joined the channel.
ashutoshkapuskar (Sun, 24 Feb 2019 23:29:13 GMT):
Where can I find Javadoc and/or any documentation about the APIs in fabric-sdk-java
yulong12 (Mon, 25 Feb 2019 02:14:50 GMT):
Hi everyone! I have a question.The application about fabric-sdk-java whether run in S390?
chill37 (Mon, 25 Feb 2019 07:32:44 GMT):
@ashutoshkapuskar I don't think there is one. you should just try with the example within the sdk. or some of these websites helped.
https://github.com/lkolisko/scratch/tree/master/hyperledger/fabric-sdk-java-scratch
https://github.com/IBM/blockchain-application-using-fabric-java-sdk
chill37 (Mon, 25 Feb 2019 07:35:41 GMT):
Hi @rickr
Is there a way to call system chaincode(LSCC to be specific) directly and without using chaincode-to-chaincode?
I see that Java SDK supports some SCC natively, (e.g. queryinstalledChaincodes...etc) but I would like to call LSCC.GetChaincodeData
But, too many methods are hidden with a private method so can't call necessary parameters (such as sendProposalToPeers() in Peer class)
Is there another way?
Jamie (Mon, 25 Feb 2019 08:38:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rJu6HvHAtS7F2bkAJ) @rickr @rickr The script was working fine for me sometime back, before i went for a vacation. I feel the volumes are not getting mapped in the docker container. I am sure it is some issue with the docker stale data. Any suggestions?
Jamie (Mon, 25 Feb 2019 08:38:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rJu6HvHAtS7F2bkAJ) @rickr The script was working fine for me sometime back, before i went for a vacation. I feel the volumes are not getting mapped in the docker container. I am sure it is some issue with the docker stale data. Any suggestions?
rickr (Mon, 25 Feb 2019 13:13:32 GMT):
@dan13 I think you should only really need one HFClient in an application instance for most cases. Each organization has it's own private credentials artifacts so it's doubtful there would be cases or sharing those. The SDK doesn't know you application requirements so how you use the client context is probably highly dependent on that. If your application is such that a single user will start it and give credentials then probable just set it on the HFClient and your done. If your application instance is going to be switching between users most all APIs have a version that accepts the usercontext and then that's probably the better way to go. There should be no problem with a usercontext that creates the channel and then another usercontext uses it. I little bit of this is sort of showed in:
https://github.com/cr22rc/fabricSDKJavaMultiDomainSample/blob/cd7a114cebd48ff50b6ec14e47d62cf79bda9d3d/src/main/java/org/cr22rc/MultiDomainSample.java
rickr (Mon, 25 Feb 2019 13:13:32 GMT):
@dan13 I think you should only really need one HFClient in an application instance for most cases. Each organization has it's own private credentials artifacts so it's doubtful there would be cases or sharing those. The SDK doesn't know your application requirements so how you use the client context is probably highly dependent on that. If your application is such that a single user will start it and give credentials then probable just set it on the HFClient and your done. If your application instance is going to be switching between users most all APIs have a version that accepts the usercontext and then that's probably the better way to go. There should be no problem with a usercontext that creates the channel and then another usercontext uses it. I little bit of this is sort of showed in:
https://github.com/cr22rc/fabricSDKJavaMultiDomainSample/blob/cd7a114cebd48ff50b6ec14e47d62cf79bda9d3d/src/main/java/org/cr22rc/MultiDomainSample.java
rickr (Mon, 25 Feb 2019 13:15:25 GMT):
@ashutoshkapuskar Follow the README.md
rickr (Mon, 25 Feb 2019 13:18:06 GMT):
@chill37 I don't think so. I think the SDK covers the calls to those that we expected the user to call.
rickr (Mon, 25 Feb 2019 13:21:35 GMT):
@Jamie Not really. You could to into the docker image and look. If this is just something you're _playing with_ maybe just delete everything including docker images and container instance and start over would be the quickest.
rickr (Mon, 25 Feb 2019 13:21:35 GMT):
@Jamie Not really. You could go into the docker container instances and look. If this is just something you're _playing with_ maybe just delete everything including docker images and container instance and start over would be the quickest.
rickr (Mon, 25 Feb 2019 13:29:06 GMT):
What I'm thinking has happened is that you left the peers and orderers running while on vacation and they continued to dump logging information filling up your docker volumes. The volumes are now full. ... just a theory.
dan13 (Mon, 25 Feb 2019 14:24:44 GMT):
@rickr thank you! a word from the experts is worth 100 hours of trying stuff :)
dan13 (Mon, 25 Feb 2019 14:24:44 GMT):
@rickr thank you! a word from the experts is worth 100 hours of trying stuff :)
chill37 (Tue, 26 Feb 2019 05:08:05 GMT):
@rickr because I wanted to call the LSCC.GetChaincodeData to get the ChaincodeData struct(to get the policy out of it).
I can see that I can extend the LSCCProposalBuilder to build my own LSCC caller, but I need the Channel.sendProposalToPeers() function public to actually to querying. Is there a way I could propose and fabric dev would implement it? (e.g. via JIRA)
Jamie (Tue, 26 Feb 2019 13:14:16 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=WLuEWizDBkvaNpkgs) @rickr I downgraded docker version to 18.0.3 and then it worked fine. Thanks for discussing the issue, it encourages.
anjalinaik (Wed, 27 Feb 2019 10:04:55 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=5wJfv97LDLjfY7Gnn) @rickr thankyou very much :)
anjalinaik (Thu, 28 Feb 2019 09:21:39 GMT):
when do we use chaincode event listener ?
allenyang (Thu, 28 Feb 2019 09:23:05 GMT):
who have good tool to generate "network-config.yaml"?
allenyang (Thu, 28 Feb 2019 09:28:07 GMT):
I use fabric-sdk-java to load the "network-config.yaml", I can work, I want know if there have good framework to generate "network-config.yaml"
rickr (Thu, 28 Feb 2019 13:35:43 GMT):
I don't know of any _tools_ to create a network-config.yaml other than _vi_ :)
FlorianStoica (Thu, 28 Feb 2019 14:49:59 GMT):
Has joined the channel.
FlorianStoica (Thu, 28 Feb 2019 14:57:21 GMT):
Hello, I have the following issue, I've used as a test the "SimpleChaincode.java" from fabric samples, deployed, instantiated, query works. The issue that I have is that invoke calls the contract I get the output "[nio-8080-exec-4] n.s.f.c.manager.ChaincodeManager : a: 90 b: 210" , but on the next query value of a is still 100 somehow stub.putState doesn't do the job, and I have no error anywhere.
This is the output from the chaincode docker:
INFO: new value of A: 90
Feb 28, 2019 2:52:49 PM org.hyperledger.fabric.example.SimpleChaincode invoke
INFO: new value of B: 210
Feb 28, 2019 2:52:49 PM org.hyperledger.fabric.example.SimpleChaincode invoke
INFO: Transfer complete
FlorianStoica (Thu, 28 Feb 2019 14:58:19 GMT):
Feb 28, 2019 2:52:56 PM org.hyperledger.fabric.example.SimpleChaincode query
INFO: Query Response:
Name: a, Amount: 100
rickr (Thu, 28 Feb 2019 15:41:23 GMT):
I'm _guessing_ you're not waiting for the committer peers to write the transaction. When you send the endorsements to the Orderer you would back a Future not till that future is done (.get()) would you know it's been written. Also this assumes you have peer's with the role of event listener. Another quick (hack) is to just after sending to the Orderer do a sleep for 30 sec :(
rickr (Thu, 28 Feb 2019 15:41:23 GMT):
I'm _guessing_ you're not waiting for the committer peers to write the transaction. When you send the endorsements to the Orderer you would get back a Future. Not till that future is done (.get()) would you know it's been written. Also this assumes you have peer's with the role of event listener. Another quick (hack) is to just after sending to the Orderer do a sleep for 30 sec :(
gravity (Thu, 28 Feb 2019 19:17:43 GMT):
hi @rickr
\text{\textquoteleft}Not till that future is done (.get()) would you know it's been written. Also this assumes you have peer's with the role of event listener. Another quick (hack) is to just after sending to the Orderer do a sleep for 30 sec\text{\textquoteright}
Do I need to have peers with the role event listener If I call `join` on the future that is returned from `sendTransaction`?
gravity (Thu, 28 Feb 2019 19:17:43 GMT):
hi @rickr
\text{\textquoteleft}Also this assumes you have peer's with the role of event listener. Another quick (hack) is to just after sending to the Orderer do a sleep for 30 sec\text{\textquoteright}
Do I need to have peers with the role event listener If I call `join` on the future that is returned from `sendTransaction`?
gravity (Thu, 28 Feb 2019 19:17:43 GMT):
hi @rickr
>>> Also this assumes you have peer's with the role of event listener. Another quick (hack) is to just after sending to the Orderer do a sleep for 30 sec
Do I need to have peers with the role event listener If I call `join` on the future that is returned from `sendTransaction`?
gravity (Thu, 28 Feb 2019 19:17:43 GMT):
hi @rickr
> Also this assumes you have peer's with the role of event listener. Another quick (hack) is to just after sending to the Orderer do a sleep for 30 sec
Do I need to have peers with the role event listener If I call `join` on the future that is returned from `sendTransaction`?
dan13 (Thu, 28 Feb 2019 19:26:48 GMT):
@rickr can you clarify "Not till that future is done (.get()) would you know it's been written" -- what exactly is "written" when the get() returns? Block created by orderer, block processed by all peers on channel, block processed by peer(s) you are listening to, that specific transaction committed by all peers on channel, that specific transaction committed by peers you are listening to, or something else?
FlorianStoica (Thu, 28 Feb 2019 21:25:00 GMT):
@rickr something else seems to be the problem even with sleep the result is the same
dan13 (Fri, 01 Mar 2019 01:22:36 GMT):
@FlorianStoica I ran https://medium.com/@aleksobol/explained-java-chaincode-in-hyperledger-fabric-fc63fccc84a3 -- perhaps that example will work better for you if you need java chaincode specifically. Doesn't take very long to get through.
anjalinaik (Fri, 01 Mar 2019 06:05:17 GMT):
Hi experts. I am running Service discovery to invoke a transaction. i am getting this error. Can anyone please guide me?```
ServiceDiscoveryException: Failed to find and endorsers for chaincode
```
anjalinaik (Fri, 01 Mar 2019 06:05:17 GMT):
Hi experts. I am running Service discovery to invoke a transaction. i am getting this error. Can anyone please guide me?```
ServiceDiscoveryException: Failed to find and endorsers for chaincode
``` Also in the grpc logs i am repeatedly getting the below warning.```
WARNING: [io.grpc.internal.ManagedChannelImpl-965] Failed to resolve name. status=Status{code=UNAVAILABLE, description=NameResolver returned an empty list, cause=null}
Mar 01, 2019 11:37:51 AM io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl onError
```
anjalinaik (Fri, 01 Mar 2019 06:05:17 GMT):
Hi experts. I am running Service discovery to invoke a transaction. i am getting this error. Can anyone please guide me?```
ServiceDiscoveryException: Failed to find and endorsers for chaincode
``` Also in the grpc logs i am repeatedly getting the below warning.```
WARNING: [io.grpc.internal.ManagedChannelImpl-965] Failed to resolve name. status=Status{code=UNAVAILABLE, description=NameResolver returned an empty list, cause=null}
Mar 01, 2019 11:37:51 AM io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl onError
```
anjalinaik (Fri, 01 Mar 2019 06:05:17 GMT):
Hi experts. I am running Service discovery to invoke a transaction. i am getting this error. Can anyone please guide me?```
ServiceDiscoveryException: Failed to find and endorsers for chaincode
``` Also in the grpc logs i am repeatedly getting the below warning.```
WARNING: [io.grpc.internal.ManagedChannelImpl-965] Failed to resolve name. status=Status{code=UNAVAILABLE, description=NameResolver returned an empty list, cause=null}
Mar 01, 2019 11:37:51 AM io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl onError
```
anjalinaik (Fri, 01 Mar 2019 06:05:17 GMT):
Hi experts. I am running Service discovery to invoke a transaction. i am getting this error. Can anyone please guide me?```
ServiceDiscoveryException: Failed to find and endorsers for chaincode
``` Also in the grpc logs i am repeatedly getting the below warning.
`WARNING: [io.grpc.internal.ManagedChannelImpl-965] Failed to resolve name. status=Status{code=UNAVAILABLE, description=NameResolver returned an empty list, cause=null}
Mar 01, 2019 11:37:51 AM io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl onError`
```
anjalinaik (Fri, 01 Mar 2019 06:05:17 GMT):
Hi experts. I am running Service discovery to invoke a transaction. I am getting this error. Can anyone please guide me?```
ServiceDiscoveryException: Failed to find and endorsers for chaincode
``` ```
``` Also in the grpc logs i am repeatedly getting the below warning.
`WARNING: [io.grpc.internal.ManagedChannelImpl-965] Failed to resolve name. status=Status{code=UNAVAILABLE, description=NameResolver returned an empty list, cause=null}
Mar 01, 2019 11:37:51 AM io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl onError`
anjalinaik (Fri, 01 Mar 2019 06:05:17 GMT):
Hi experts. I am running Service discovery to invoke a transaction. I am getting this error. Can anyone please guide me?```
ServiceDiscoveryException: Failed to find and endorsers for chaincode
``` ```
WARNING: [io.grpc.internal.ManagedChannelImpl-965] Failed to resolve name. status=Status{code=UNAVAILABLE, description=NameResolver returned an empty list, cause=null}
Mar 01, 2019 11:37:51 AM io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl onError
```
anjalinaik (Fri, 01 Mar 2019 06:05:17 GMT):
Hi experts. I am running Service discovery to invoke a transaction. I am getting this error. Can anyone please guide me?```
ServiceDiscoveryException: Failed to find and endorsers for chaincode
``` Also in the grpc logs i am repeatedly getting the below warning.
```
WARNING: [io.grpc.internal.ManagedChannelImpl-965] Failed to resolve name. status=Status{code=UNAVAILABLE, description=NameResolver returned an empty list, cause=null}
Mar 01, 2019 11:37:51 AM io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl onError
```
anjalinaik (Fri, 01 Mar 2019 06:05:17 GMT):
Hi experts. I am running Service discovery to invoke a transaction. I am getting this error. Can anyone please guide me?```
ServiceDiscoveryException: Failed to find and endorsers for chaincode
``` Also in the grpc logs, I am repeatedly getting the below warning.
```
WARNING: [io.grpc.internal.ManagedChannelImpl-965] Failed to resolve name. status=Status{code=UNAVAILABLE, description=NameResolver returned an empty list, cause=null}
Mar 01, 2019 11:37:51 AM io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl onError
```
yacovm (Fri, 01 Mar 2019 11:00:37 GMT):
@rickr ^
anjalinaik (Fri, 01 Mar 2019 12:10:40 GMT):
In a multi host network, what should be the value of `CORE_PEER_GOSSIP_EXTERNALENDPOINT` . Is it IP_OF_MACHINE: PORT or PEER_NAME:PORT
FlorianStoica (Fri, 01 Mar 2019 12:46:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=FoLGtjN9pjpmK3xug) @anjalinaik I used peer_name:port
skykira (Fri, 01 Mar 2019 12:52:33 GMT):
Who can tell me how to encrypt the parameters passed to the chaincode? thanks..
skykira (Fri, 01 Mar 2019 12:53:57 GMT):
I didn't find the code about `--transient`
rickr (Fri, 01 Mar 2019 13:05:09 GMT):
@skykira probably this: https://github.com/hyperledger/fabric-sdk-java/blob/d69047fed436eef746b0dc20fda1084122a85c1e/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L575-L590
rickr (Fri, 01 Mar 2019 13:07:55 GMT):
@gravity I've never used `join` Basically used two method calls *.get* which will make your code wait for the future to be resolved, essentially make it synchronous, or thenApply which is like a call back.
skykira (Fri, 01 Mar 2019 13:10:30 GMT):
thans,i see ~
gravity (Fri, 01 Mar 2019 13:13:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=agrCMmCzrXkjDvud8) @rickr so, If I use `get` or `thenApply`, there is no need to define peers with the role `event_listener`, right?
rickr (Fri, 01 Mar 2019 13:23:05 GMT):
@dan13 Your code sends endorsed proposal to the orderer (transaction) to be actually written to the ledger it gets a Future as the result. Roughly committing peers get blocks from the orderer that has that transaction and then writes them to the ledger. Between that time any query for your result will not show up. Peers your application has as PeerRole.EVENT_SOURCE get notified that the block has been written and will complete that Future. So if you are waiting for the future via _.get._ or _.thenApply_ and you query for you result it should be evident.
rickr (Fri, 01 Mar 2019 13:40:40 GMT):
@anjalinaik Basically it seems the peer hostname is not resolving from what I can tell. There was a bug in grpc 1.16 https://github.com/grpc/grpc-java/issues/5032 SDK 1.4 is using 1.17 but if you're on an older version could play a role.
rickr (Fri, 01 Mar 2019 13:40:40 GMT):
@anjalinaik Basically it seems the peer hostname is not resolving from what I can tell. There was a bug in grpc 1.16 https://github.com/grpc/grpc-java/issues/5032 The SDK 1.4 is using grpc 1.17 but if you're on an older version could play a role.
rickr (Fri, 01 Mar 2019 13:48:38 GMT):
@gravity @dan13 Most of this is shown the integration tests https://github.com/hyperledger/fabric-sdk-java/blob/d69047fed436eef746b0dc20fda1084122a85c1e/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L532-L546
gravity (Fri, 01 Mar 2019 14:20:35 GMT):
@rickr what will happen if I do not specify the number of events `nOfEvents` in transaction options?
rickr (Fri, 01 Mar 2019 15:03:21 GMT):
The default is wait for all the peers which are listening for blocks (PeerRole.EVENT_SOURCE)
indigogrape (Fri, 01 Mar 2019 20:44:32 GMT):
Has joined the channel.
indigogrape (Fri, 01 Mar 2019 21:28:02 GMT):
broken_pipe.txt
indigogrape (Fri, 01 Mar 2019 22:11:20 GMT):
Hey guys, I've created a single host setup using the fabric 1.1.0 images on an AWS instance and everything works fine on that setup.
I've then transitioned into using a multi-host setup with Docker swarm overlay network with 3 AWS instances. It seems to work fine for the most part except for every 2 hours where the peer resets the connection and I receive an error in the SDK (attached below). I thought it might have been affected by the network setup so I removed all the containers except for a single peer, single orderer, and single couchDB, but I still get the same error (still in an overlay network even though the other machines aren't used). The client that connects to the network is on a remote machine and uses only the default GRPC keepalive properties. Each request reuses a single HFClient and Channel object and not shutdown after the request finishes.
indigogrape (Fri, 01 Mar 2019 22:11:28 GMT):
broken_pipe.txt
rickr (Sat, 02 Mar 2019 00:39:12 GMT):
Only thing that comes to mind are setting that you say you're setting ->
https://github.com/hyperledger/fabric-sdk-java#firewalls-load-balancers-network-proxies
mujeeb (Sun, 03 Mar 2019 12:25:39 GMT):
Has joined the channel.
mahoney1 (Mon, 04 Mar 2019 10:15:39 GMT):
fyi / heads-up : next Fabric Developer Community call is planned for this Thurs March 7th - https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call - contributions are welcome to the agenda ! More info on the call can be found [here](https://lists.hyperledger.org/g/fabric/topic/next_hyperledger_fabric/30211987?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,30211987)
amolpednekar (Mon, 04 Mar 2019 11:53:32 GMT):
@rickr - Using Fabric SDK 1.2.2, I've integrated it with a SpringBoot REST API and am able to make requests
But my program console continuously gives me this warning
`2019-03-04 17:19:43.504 WARN 18732 --- [ault-executor-1] o.h.fabric.sdk.PeerEventServiceClient : Channel mychannel peer peer0.org1.persistent.com attempts 1230 Status returned failure code 404 (NOT_FOUND) during peer service event registration`
FlorianStoica (Mon, 04 Mar 2019 13:49:24 GMT):
Hello guys, after I do an Invoke/Query I periodically get this error messages:
2019-03-04 15:44:53.868 WARN 1012 --- [ault-executor-1] org.hyperledger.fabric.sdk.EventHub : EventHub{id: 3, name: eventhub01, channelName: mychannel, url: grpcs://localhost:7053} :StatusRuntimeException Status Status{code=UNAVAILABLE, description=io exception, cause=java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
I have a feeling that something remains opened did not see what could be can you give me a hint ?
anjalinaik (Tue, 05 Mar 2019 05:49:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=QjvRp8Yt7EgF5zife) @rickr Hi @rickr. I have upgraded the sdk version. I am receiving the same error again. Any suggestions? I am running the fabric version 1.3 though.
anjalinaik (Tue, 05 Mar 2019 05:49:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=QjvRp8Yt7EgF5zife) @rickr Hi @rickr. I have upgraded the SDK version. I am receiving the same error again. Any suggestions? I am running the fabric version 1.3 though.
anjalinaik (Tue, 05 Mar 2019 05:49:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=QjvRp8Yt7EgF5zife) @rickr Hi @rickr. I have upgraded the SDK version to 1.4.0, however I am receiving the same error again. Any suggestions? I am running the fabric version 1.3 though.
anjalinaik (Tue, 05 Mar 2019 05:52:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=oC3EeE42M5xosxcb9) @FlorianStoica thankyou for your reply. Are you able to run the discovery service with the said settings?
ashlinSajan (Tue, 05 Mar 2019 06:17:05 GMT):
Has joined the channel.
kalyan.aruru (Tue, 05 Mar 2019 07:02:39 GMT):
Has joined the channel.
kalyan.aruru (Tue, 05 Mar 2019 07:06:15 GMT):
Hi All,
Do we have any chaincode event handling examples or tutorials? Please let me know
anjalinaik (Tue, 05 Mar 2019 08:29:24 GMT):
Can anyone please help me with below error on Service Discovery```
[pool-5-thread-1] INFO org.hyperledger.fabric.sdk.ServiceDiscovery - Channel mychannel doing discovery with peer: Peer{ id: 3, name: pr1, channelName: mychannel, url: grpc://10.80.102.129:8051}
[pool-5-thread-1] ERROR org.hyperledger.fabric.sdk.ServiceDiscovery - Error failed constructing descriptor for chaincodes:
rickr (Tue, 05 Mar 2019 13:31:56 GMT):
@amolpednekar This usually means you have a peer eventing service going to a channel that doesn't exist or the peer hasn't joined the channel.
rickr (Tue, 05 Mar 2019 13:44:42 GMT):
@FlorianStoica Eventhubs are no longer supported https://github.com/hyperledger/fabric-sdk-java/blob/master/docs/release_v1.1.0_notes.md#fabric-v10-considerations
I think they were pulled in 1.2
rickr (Tue, 05 Mar 2019 13:49:17 GMT):
@kalyan.aruru https://github.com/hyperledger/fabric-sdk-java/blob/dbc41c1a119f9567ec7b39d972663813c45e0d04/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L369-L383
rickr (Tue, 05 Mar 2019 14:04:51 GMT):
@anjalinaik Seems that discovery didn't find any chaincodes for it. Was your chaincode initialized ?
matthewehoward (Tue, 05 Mar 2019 14:13:19 GMT):
Has joined the channel.
Antimttr (Tue, 05 Mar 2019 18:46:06 GMT):
Has joined the channel.
Antimttr (Tue, 05 Mar 2019 18:46:12 GMT):
is there a good example of a Java api like the nodejs api in balance-transfer?
im preferably looking for a java sdk implementation into an api like balance transfer does
rickr (Tue, 05 Mar 2019 18:50:41 GMT):
@Antimttr https://github.com/hyperledger/fabric-sdk-java#end-to-end-test-scenario ?
Antimttr (Tue, 05 Mar 2019 20:55:59 GMT):
@rickr do any of those build a restful api ala balance-transfer?
rickr (Tue, 05 Mar 2019 22:57:52 GMT):
It's not a back end to a REST HTTP API. Simple balance transfer moving quantity from one key to another
rickr (Tue, 05 Mar 2019 22:57:52 GMT):
It's not a back end to a REST HTTP API. Simple balance transfer moving quantity from one key in the ledger to another.
rickr (Tue, 05 Mar 2019 22:57:52 GMT):
It's not a back end to a REST HTTP API. Simple balance transfer moving specific quantity from one key in the ledger to another.
anjalinaik (Wed, 06 Mar 2019 04:18:39 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=L6yKpsDxYmumZvvZW) @rickr Yes the chaincode is instantiated. The docker container is formed as well.
Antimttr (Wed, 06 Mar 2019 04:53:21 GMT):
@rickr is there any more advanced example that implements a restful api?
daijianw (Wed, 06 Mar 2019 08:12:56 GMT):
@rickr https://jira.hyperledger.org/browse/FABN-855 fixed the problem of node sdk can't install packaged chaincode. Is fabric java sdk now able to install packaged chaincode? Thanks.
anjalinaik (Wed, 06 Mar 2019 11:41:18 GMT):
Screenshot from 2019-03-06 17-08-48.png
anjalinaik (Wed, 06 Mar 2019 11:41:18 GMT):
Screenshot from 2019-03-06 17-08-48.png
anjalinaik (Wed, 06 Mar 2019 11:41:18 GMT):
Screenshot from 2019-03-06 17-08-48.png
anjalinaik (Wed, 06 Mar 2019 11:41:18 GMT):
Screenshot from 2019-03-06 17-08-48.png
rickr (Wed, 06 Mar 2019 13:21:14 GMT):
@daijianw No not for <2.0 Everything changes with version 2.0 and I have code that will install the new chaincode package that it has.
rickr (Wed, 06 Mar 2019 13:32:27 GMT):
@anjalinaik No of test really required gossip working .. I'll be frank in that I'm not sure if gossip is set up right. Most of that was set up by someone else. I'll get some one to look at it
rickr (Wed, 06 Mar 2019 13:32:27 GMT):
@anjalinaik None of test really required gossip working .. I'll be frank in that I'm not sure if gossip is set up right. Most of that was set up by someone else. I'll get some one to look at it
gravity (Wed, 06 Mar 2019 13:36:40 GMT):
hi @rickr
I'm running a network v1.4.0 and JSDK v1.4.0
when I do initialize a channel, sometime I get this exception
https://pastebin.com/4s2a2YH1
what can cause this exception? is it critical?
thanks in advance
rickr (Wed, 06 Mar 2019 13:48:09 GMT):
@gravity When you initialize if you have any peers doing service discovery it will start that. I think in this case that peer is not ready. Service discovery should retry later or when it's services is needed and it hasn't completed. So the short answer is _I think_ it's ok.
james3443112 (Wed, 06 Mar 2019 14:27:34 GMT):
java-sdk.png
james3443112 (Wed, 06 Mar 2019 14:27:35 GMT):
cli.png
james3443112 (Wed, 06 Mar 2019 14:27:37 GMT):
hi guys , i have a question:
when i use java-sdk v1.4.0 to install(instantiated) a chaincode(https://github.com/hyperledger/fabric-samples/tree/release-1.4/chaincode/marbles02/go)
i find there is no index in couchdb
but when i use cli(peer chaincode) install/instantiated the same chaincode , i find index in couchdb
rickr (Wed, 06 Mar 2019 14:43:22 GMT):
@james3443112 I'm _guessing_ for the SDK you're not specifying the meta data correctly See End2endIT.java search for meta-inf
james3443112 (Wed, 06 Mar 2019 14:45:47 GMT):
thx, i will check it
Antimttr (Wed, 06 Mar 2019 15:52:21 GMT):
so theres no examples of java being used to communicate via api, what front ends to people write for the java sdk?
Antimttr (Wed, 06 Mar 2019 15:52:27 GMT):
is it all native software?
dan13 (Wed, 06 Mar 2019 17:14:18 GMT):
@Antimttr One (of a myriad) possible full stack would be something like React JS UI -> Java (Spring Boot?) UI Service APIs -> Java Fabric Services (i.e., code that calls chaincode via Java SDK) -> HLF Chaincode. It's up to you to decide how to expose your application on Fabric to other applications to want use it.
Antimttr (Wed, 06 Mar 2019 17:15:49 GMT):
right
Antimttr (Wed, 06 Mar 2019 17:16:50 GMT):
like on my current POC, i'm modifying balance transfer, so im doing Laravel Gateway -> Nodejs SDK Fabric Services API -> HLF Chaincode
Antimttr (Wed, 06 Mar 2019 17:17:32 GMT):
its allowed me to rapidly prototype, but no idemix so I'll have to start from scratch as far as the fabric services api
Antimttr (Wed, 06 Mar 2019 17:17:35 GMT):
w/java
Antimttr (Wed, 06 Mar 2019 17:18:13 GMT):
i was just hoping for some great examples on the java side similar to balance transfer
Antimttr (Wed, 06 Mar 2019 17:18:17 GMT):
but i guess that doesnt exist :/
anjalinaik (Thu, 07 Mar 2019 04:00:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=HiRbZTfz8NLHdDxQv) @rickr can you please guide me to the correct gossip settings
anjalinaik (Thu, 07 Mar 2019 06:05:52 GMT):
Hi Experts. In https://github.com/hyperledger/fabric-sdk-java/blob/8044bac1bfe9baf9d6360b067e0d6b5445cc953d/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java, on creation of first channel, isnt the channel definition updated to define the anchor peers in the organization?
anjalinaik (Thu, 07 Mar 2019 06:05:52 GMT):
Hi Experts. In https://github.com/hyperledger/fabric-sdk-java/blob/8044bac1bfe9baf9d6360b067e0d6b5445cc953d/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java, on creation of first channel, isnt the channel definition updated to define the anchor peers in the organization? Please correct me if i am wrong. Is the channel defination updation optional?
daijianw (Thu, 07 Mar 2019 09:08:32 GMT):
@rickr thanks for the information.
mahoney1 (Thu, 07 Mar 2019 11:24:41 GMT):
reminder that the Fabric Developer Community call is today at 5pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android:https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call - past Recordings & Slides (PDF) here: https://wiki.hyperledger.org/display/fabric/Community-Call-Recordings - be great to hear from you later ! 🙂 regards Paul
rickr (Thu, 07 Mar 2019 13:01:10 GMT):
@anjalinaik According to our Gossip expert @yacovm, in docker-compose.yaml and peer-base.yaml the only things to be done is remove all `CORE_PEER_GOSSIP_ENDPOINT` and `CORE_PEER_GOSSIP_SKIPHANDSHAKE` lines .
Example of how to add anchor peers:
https://github.com/hyperledger/fabric-sdk-java/blob/dbc41c1a119f9567ec7b39d972663813c45e0d04/src/test/java/org/hyperledger/fabric/sdkintegration/UpdateChannelIT.java#L220-L249
yacovm (Thu, 07 Mar 2019 13:02:06 GMT):
Rick don't go around telling people I am expert on stuff :(
yacovm (Thu, 07 Mar 2019 13:02:28 GMT):
They will flood my private chats :rolling_eyes:
rickr (Thu, 07 Mar 2019 13:03:11 GMT):
Ok Don't @anjalinaik don't remove those lines .. I was mistaken he's not an expert! :rofl:
yacovm (Thu, 07 Mar 2019 13:03:28 GMT):
the `CORE_PEER_GOSSIP_ENDPOINT` is for overriding the internal endpoint that the peer reports to other peers
yacovm (Thu, 07 Mar 2019 13:03:36 GMT):
usually you don't need to use that at all
yacovm (Thu, 07 Mar 2019 13:04:07 GMT):
the only use case where you want to use it, is if you have a peer in docker inside a VM, and another peer in docker, in another VM, and they are all in the same org
yacovm (Thu, 07 Mar 2019 13:04:22 GMT):
in such a case- both peers would have internal endpoints that are not routable to one another
yacovm (Thu, 07 Mar 2019 13:04:38 GMT):
setting `CORE_PEER_GOSSIP_ENDPOINT` to be the VM's external interface solves this
yacovm (Thu, 07 Mar 2019 13:04:47 GMT):
because it overrides the internal endpoints they report to peers within their own org
mahoney1 (Thu, 07 Mar 2019 15:33:27 GMT):
FYI - reminder that Fabric Developer Community call is today (in 90mins) at 5pm UTC (5pm UK, 12pm ET, 9am PT) https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
mahoney1 (Thu, 07 Mar 2019 18:22:51 GMT):
FYI - posted the recording file: `2019-0307-fabricdevcommunitycall.zip` (incl MP4 and chat transcript) from today's Fabric Developer Community Call at -> https://wiki.hyperledger.org/display/fabric/Community-Call-Recordings
ashutoshkapuskar (Fri, 08 Mar 2019 06:31:52 GMT):
The method "newSuccessResponse" is used in SimpleChaincode.java -- which is provided with the Fabric-java-sdk. But where (in which class) is this method defined? Thank you.
anjalinaik (Fri, 08 Mar 2019 09:25:37 GMT):
Hi Experts. I am running update channel configuration [ changing the timeout from 2s to 5s] after creation of a new channel. ```
/home/anjali/anjali/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/emBlock/WEB-INF/classes/emBlock/func.sh createChannelTransaction emudhra test12 /home/anjali/anjali/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/emBlock/WEB-INF/classes/emBlock/bin/configtxgen
[http-nio-8080-exec-3] WARN org.hyperledger.fabric.sdk.helper.Config - Failed to load any configuration from: config.properties. Using toolkit defaults
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel{id: 3, name: test12} joining Peer{ id: 5, name: peer1, channelName: null, url: grpc://10.80.102.129:8051}.
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Peer Peer{ id: 5, name: peer1, channelName: test12, url: grpc://10.80.102.129:8051} joined into channel Channel{id: 3, name: test12}
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel{id: 3, name: test12} joining Peer{ id: 8, name: peer2, channelName: null, url: grpc://10.80.102.129:8052}.
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Peer Peer{ id: 8, name: peer2, channelName: test12, url: grpc://10.80.102.129:8052} joined into channel Channel{id: 3, name: test12}
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel Channel{id: 3, name: test12} eventThread started shutdown: false thread: null
Got 200 status for encoding the new desired channel config bytes
``` so the logs show that the channel has been updated with the new configuration. However if i take out the responseString as json and verify, the changes are not reflected in it. what may be wrong?
anjalinaik (Fri, 08 Mar 2019 09:25:37 GMT):
Hi Experts. I am running update channel configuration [ changing the timeout from 2s to 5s] after creation of a new channel. ```
[http-nio-8080-exec-3] WARN org.hyperledger.fabric.sdk.helper.Config - Failed to load any configuration from: config.properties. Using toolkit defaults
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel{id: 3, name: test12} joining Peer{ id: 5, name: peer1, channelName: null, url: grpc://10.80.102.129:8051}.
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Peer Peer{ id: 5, name: peer1, channelName: test12, url: grpc://10.80.102.129:8051} joined into channel Channel{id: 3, name: test12}
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel{id: 3, name: test12} joining Peer{ id: 8, name: peer2, channelName: null, url: grpc://10.80.102.129:8052}.
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Peer Peer{ id: 8, name: peer2, channelName: test12, url: grpc://10.80.102.129:8052} joined into channel Channel{id: 3, name: test12}
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel Channel{id: 3, name: test12} eventThread started shutdown: false thread: null
Got 200 status for encoding the new desired channel config bytes
``` so the logs show that the channel has been updated with the new configuration. However if i take out the responseString as json and verify, the changes are not reflected in it. what may be wrong?
anjalinaik (Fri, 08 Mar 2019 09:25:37 GMT):
Hi Experts. I am running update channel configuration [ changing the timeout from 2s to 5s] after creation of a new channel. ```
[http-nio-8080-exec-3] WARN org.hyperledger.fabric.sdk.helper.Config - Failed to load any configuration from: config.properties. Using toolkit defaults
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel{id: 3, name: test12} joining Peer{ id: 5, name: peer1, channelName: null, url: grpc://10.80.102.129:8051}.
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Peer Peer{ id: 5, name: peer1, channelName: test12, url: grpc://10.80.102.129:8051} joined into channel Channel{id: 3, name: test12}
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel{id: 3, name: test12} joining Peer{ id: 8, name: peer2, channelName: null, url: grpc://10.80.102.129:8052}.
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Peer Peer{ id: 8, name: peer2, channelName: test12, url: grpc://10.80.102.129:8052} joined into channel Channel{id: 3, name: test12}
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel Channel{id: 3, name: test12} eventThread started shutdown: false thread: null
Got 200 status for encoding the new desired channel config bytes
``` so the logs show that the channel has been updated with the new configuration. However if i take out the responseString as json and verify, the changes are not reflected in it. what may be wrong?
anjalinaik (Fri, 08 Mar 2019 09:25:37 GMT):
Hi Experts. I am running update channel configuration [ changing the timeout from 2s to 5s] after creation of a new channel. ```
[http-nio-8080-exec-3] WARN org.hyperledger.fabric.sdk.helper.Config - Failed to load any configuration from: config.properties. Using toolkit defaults
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel{id: 3, name: test12} joining Peer{ id: 5, name: peer1, channelName: null, url: grpc://10.80.102.129:8051}.
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Peer Peer{ id: 5, name: peer1, channelName: test12, url: grpc://10.80.102.129:8051} joined into channel Channel{id: 3, name: test12}
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel{id: 3, name: test12} joining Peer{ id: 8, name: peer2, channelName: null, url: grpc://10.80.102.129:8052}.
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Peer Peer{ id: 8, name: peer2, channelName: test12, url: grpc://10.80.102.129:8052} joined into channel Channel{id: 3, name: test12}
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel Channel{id: 3, name: test12} eventThread started shutdown: false thread: null
Got 200 status for encoding the new desired channel config bytes
Got 200 status for updated config bytes needed for updateChannelConfiguration
``` so the logs show that the channel has been updated with the new configuration. However if i take out the responseString as json and verify, the changes are not reflected in it. what may be wrong?
anjalinaik (Fri, 08 Mar 2019 09:25:37 GMT):
Hi Experts. I am running update channel configuration [ changing the timeout from 2s to 5s] after creation of a new channel. ```
[http-nio-8080-exec-3] WARN org.hyperledger.fabric.sdk.helper.Config - Failed to load any configuration from: config.properties. Using toolkit defaults
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel{id: 3, name: test12} joining Peer{ id: 5, name: peer1, channelName: null, url: grpc://10.80.102.129:8051}.
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Peer Peer{ id: 5, name: peer1, channelName: test12, url: grpc://10.80.102.129:8051} joined into channel Channel{id: 3, name: test12}
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel{id: 3, name: test12} joining Peer{ id: 8, name: peer2, channelName: null, url: grpc://10.80.102.129:8052}.
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Peer Peer{ id: 8, name: peer2, channelName: test12, url: grpc://10.80.102.129:8052} joined into channel Channel{id: 3, name: test12}
[http-nio-8080-exec-3] INFO org.hyperledger.fabric.sdk.Channel - Channel Channel{id: 3, name: test12} eventThread started shutdown: false thread: null
Got 200 status for encoding the new desired channel config bytes
Got 200 status for updated config bytes needed for updateChannelConfiguration
``` so the logs show that the channel has been updated with the new configuration. However if i take out the responseString as json and verify, the changes are not reflected in it. what may be wrong? also, I am getting no logs from the configtxlator docker service
rickr (Fri, 08 Mar 2019 12:42:57 GMT):
@ashutoshkapuskar Did a grep for newSuccessResponse in my top SDK directory .. no hits
```
grep -sri newSuccessResponse .
find -name SimpleChaincode.java
```
Sure you're not using the version of SDK <1.0 ?
SatheeshNehru (Fri, 08 Mar 2019 13:05:26 GMT):
Has joined the channel.
SatheeshNehru (Mon, 11 Mar 2019 07:34:58 GMT):
how to generate certificate using java sdk using fabric ca
rickr (Mon, 11 Mar 2019 11:17:23 GMT):
@SatheeshNehru Integration samples show an Admin register other user and that user enroll to get a certificate. Suggestion set up and walk through the examples as the README.md states. https://github.com/hyperledger/fabric-sdk-java/tree/dbc41c1a119f9567ec7b39d972663813c45e0d04#end-to-end-test-scenario
JorgeNavarro (Mon, 11 Mar 2019 12:02:01 GMT):
Has joined the channel.
AndresMartinezMelgar.itcl (Mon, 11 Mar 2019 12:48:24 GMT):
Hi, someone knows a tutorial/video to learn to use java sdk? I have deploy my network in 3 pc, 4 orgs with 2 peer each one, and 1 channel, kafka orderer.
Next step is know how can i connect my components(peer, orderer, channel....) with sdk
thx for any help
aatkddny (Mon, 11 Mar 2019 13:03:07 GMT):
Not sure if this is a java thing or somewhere else tbh.
Network isn't new.
Kafka is set with
```
- name: KAFKA_MESSAGE_MAX_BYTES
value: "103809024"
- name: KAFKA_REPLICA_FETCH_MAX_BYTES
value: "103809024"
```
Configtx.yaml is set to
```
# Absolute Max Bytes: The absolute maximum number of bytes allowed for
# the serialized messages in a batch.
AbsoluteMaxBytes: 99 MB
```
But I'm getting this back:
```
"exceptionTrace" : "
com.mo.fabric.exception.FabricException: Not enough endorsers for invoke: createVerification. 2 endorser(s) returned with an error: Sending proposal to fabric-peer-org15-20654c failed because of: gRPC failure=Status{code=RESOURCE_EXHAUSTED, description=gRPC message exceeds maximum size 4194304: 4357851, cause=null}
```
Not really sure where this gRPC limit is set.
aatkddny (Mon, 11 Mar 2019 13:03:07 GMT):
Network isn't new.
Kafka is set with
```
- name: KAFKA_MESSAGE_MAX_BYTES
value: "103809024"
- name: KAFKA_REPLICA_FETCH_MAX_BYTES
value: "103809024"
```
Configtx.yaml is set to
```
# Absolute Max Bytes: The absolute maximum number of bytes allowed for
# the serialized messages in a batch.
AbsoluteMaxBytes: 99 MB
```
But I'm getting this back:
```
"exceptionTrace" : "
com.mo.fabric.exception.FabricException: Not enough endorsers for invoke: createVerification. 2 endorser(s) returned with an error: Sending proposal to fabric-peer-org15-20654c failed because of: gRPC failure=Status{code=RESOURCE_EXHAUSTED, description=gRPC message exceeds maximum size 4194304: 4357851, cause=null}
```
Not really sure where this gRPC limit is set.
A few seconds of google finds this - https://stackoverflow.com/questions/39753730/java-grpc-how-to-increase-the-message-size-limit-in-a-managedchannel
but I'm not sure if there's a property to up this without searching through the codebase.
aatkddny (Mon, 11 Mar 2019 13:03:07 GMT):
Network isn't new.
Kafka is set with
```
- name: KAFKA_MESSAGE_MAX_BYTES
value: "103809024"
- name: KAFKA_REPLICA_FETCH_MAX_BYTES
value: "103809024"
```
Configtx.yaml is set to
```
# Absolute Max Bytes: The absolute maximum number of bytes allowed for
# the serialized messages in a batch.
AbsoluteMaxBytes: 99 MB
```
But I'm getting this back:
```
"exceptionTrace" : "
com.mo.fabric.exception.FabricException: Not enough endorsers for invoke: createVerification. 2 endorser(s) returned with an error: Sending proposal to fabric-peer-org15-20654c failed because of: gRPC failure=Status{code=RESOURCE_EXHAUSTED, description=gRPC message exceeds maximum size 4194304: 4357851, cause=null}
```
Not really sure where this gRPC limit is set.
A few seconds of google finds this - https://stackoverflow.com/questions/39753730/java-grpc-how-to-increase-the-message-size-limit-in-a-managedchannel
but I'm not sure if there's a property to up this without searching through the codebase. I can try setting grpc.NettyChannelBuilderOption.maxInboundMessageSize in the properties I return for network config for the peer locally, but that doesn't help me when my production version is cloud hosted - I don't have access to edit the config (and nor imo should I be doing so).
aatkddny (Mon, 11 Mar 2019 13:03:07 GMT):
Network isn't new.
Kafka is set with
```
- name: KAFKA_MESSAGE_MAX_BYTES
value: "103809024"
- name: KAFKA_REPLICA_FETCH_MAX_BYTES
value: "103809024"
```
Configtx.yaml is set to
```
# Absolute Max Bytes: The absolute maximum number of bytes allowed for
# the serialized messages in a batch.
AbsoluteMaxBytes: 99 MB
```
But I'm getting this back:
```
"exceptionTrace" : "
com.mo.fabric.exception.FabricException: Not enough endorsers for invoke: createVerification. 2 endorser(s) returned with an error: Sending proposal to fabric-peer-org15-20654c failed because of: gRPC failure=Status{code=RESOURCE_EXHAUSTED, description=gRPC message exceeds maximum size 4194304: 4357851, cause=null}
```
Not really sure where this gRPC limit is set.
A few seconds of google finds this - https://stackoverflow.com/questions/39753730/java-grpc-how-to-increase-the-message-size-limit-in-a-managedchannel
but I'm not sure if there's a property to increase this value this without searching through the codebase.
The only one I can see locally is grpc.NettyChannelBuilderOption.maxInboundMessageSize in the properties I create for NetworkConfig for the peers in my local test instance, but I'm not sure that's the correct value and even if it is, that doesn't help me when my production version is cloud hosted - I don't have access to edit the config (and nor imo should I be doing so).
aatkddny (Mon, 11 Mar 2019 13:03:07 GMT):
Network isn't new.
Kafka is set with
```
- name: KAFKA_MESSAGE_MAX_BYTES
value: "103809024"
- name: KAFKA_REPLICA_FETCH_MAX_BYTES
value: "103809024"
```
Configtx.yaml is set to
```
# Absolute Max Bytes: The absolute maximum number of bytes allowed for
# the serialized messages in a batch.
AbsoluteMaxBytes: 99 MB
```
But I'm getting this back:
```
"exceptionTrace" : "
com.mo.fabric.exception.FabricException: Not enough endorsers for invoke: createVerification. 2 endorser(s) returned with an error: Sending proposal to fabric-peer-org15-20654c failed because of: gRPC failure=Status{code=RESOURCE_EXHAUSTED, description=gRPC message exceeds maximum size 4194304: 4357851, cause=null}
```
Not really sure where this gRPC limit is set.
A few seconds of google finds this - https://stackoverflow.com/questions/39753730/java-grpc-how-to-increase-the-message-size-limit-in-a-managedchannel and this https://github.com/grpc/grpc-java/issues/4451 but I'm not sure if there's a property to increase this value this without searching through the codebase.
The only one I can see locally is grpc.NettyChannelBuilderOption.maxInboundMessageSize in the properties I create for NetworkConfig for the peers in my local test instance, but I'm not sure that's the correct value and even if it is, that doesn't help me when my production version is cloud hosted - I don't have access to edit the config (and nor imo should I be doing so).
rickr (Mon, 11 Mar 2019 13:51:37 GMT):
@aatkddny https://github.com/hyperledger/fabric-sdk-java/tree/dbc41c1a119f9567ec7b39d972663813c45e0d04#javasecurityinvalidkeyexception-illegal-key-size ?
rickr (Mon, 11 Mar 2019 13:51:37 GMT):
@aatkddny https://github.com/hyperledger/fabric-sdk-java/tree/dbc41c1a119f9567ec7b39d972663813c45e0d04#grpc-message-frame-size-exceeds-maximum ?
aatkddny (Mon, 11 Mar 2019 13:56:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=sJhpfySNNC9gx5uTv) That's what I think I said I could set locally above.
My problem comes when the network properties are coming from another provider.
I don't think it's good practice for me to be editing their network configuration before trying to do a load from it.
aatkddny (Mon, 11 Mar 2019 13:56:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=sJhpfySNNC9gx5uTv) @rickr That's what I think I said I could set locally above.
My problem comes when the network properties are coming from another provider.
I don't think it's good practice for me to be editing their network configuration before trying to do a load from it.
rickr (Mon, 11 Mar 2019 14:07:12 GMT):
@aatkddny https://github.com/hyperledger/fabric-sdk-java/blob/dbc41c1a119f9567ec7b39d972663813c45e0d04/src/test/java/org/hyperledger/fabric/sdkintegration/NetworkConfigIT.java#L117-L141
Antimttr (Mon, 11 Mar 2019 21:20:31 GMT):
is there a reason that the end2endIT.java uses the GOlang chaincode and not the java chaincode?
Antimttr (Mon, 11 Mar 2019 21:20:44 GMT):
or is there no java chiancode?
yacovm (Mon, 11 Mar 2019 21:28:58 GMT):
there is a chaincode in java @Antimttr
yacovm (Mon, 11 Mar 2019 21:29:12 GMT):
#fabric-java-chaincode
Antimttr (Mon, 11 Mar 2019 21:29:39 GMT):
thats why they call you the expert :D
Antimttr (Mon, 11 Mar 2019 21:31:15 GMT):
ok i think i get it now, they're actualy sending out to golang or other sdks
Antimttr (Mon, 11 Mar 2019 21:31:31 GMT):
the configuration setting is called CHAIN_GOLANG_CODE
yacovm (Mon, 11 Mar 2019 21:32:47 GMT):
@gennadyl is the java chaincode expert
Antimttr (Mon, 11 Mar 2019 21:38:14 GMT):
have you written any http api for java yet? i'd love to talk to someone whose done that
yacovm (Mon, 11 Mar 2019 21:40:16 GMT):
HTTP API for fabric or in general?
Antimttr (Mon, 11 Mar 2019 21:40:25 GMT):
well for the java sdk
Antimttr (Mon, 11 Mar 2019 21:40:36 GMT):
i found the great one for nodejs in the balance transfer demo
yacovm (Mon, 11 Mar 2019 21:40:47 GMT):
no, i never tried using java SDK
Antimttr (Mon, 11 Mar 2019 21:40:53 GMT):
now i basically have to port it to java sdk
yacovm (Mon, 11 Mar 2019 21:41:07 GMT):
only once pushed a code change to it
Antimttr (Mon, 11 Mar 2019 21:41:37 GMT):
its a bummer cuz normally i'd avoid java like the plague
Antimttr (Mon, 11 Mar 2019 21:41:47 GMT):
but its the only sdk that supports idemix
yacovm (Mon, 11 Mar 2019 21:41:58 GMT):
you use idemix in fabric?
Antimttr (Mon, 11 Mar 2019 21:42:04 GMT):
i want to
yacovm (Mon, 11 Mar 2019 21:42:16 GMT):
nice
Antimttr (Mon, 11 Mar 2019 21:42:38 GMT):
the application im building requires a level of anonymity for its participants
Antimttr (Mon, 11 Mar 2019 21:42:47 GMT):
because they're competitors
Antimttr (Mon, 11 Mar 2019 21:44:41 GMT):
have you use idemix yet?
Antimttr (Mon, 11 Mar 2019 21:44:41 GMT):
have you used idemix yet?
yacovm (Mon, 11 Mar 2019 21:54:35 GMT):
no, @adc did.
Antimttr (Mon, 11 Mar 2019 21:57:05 GMT):
nice, maybe i'll see him on here one of these days
Antimttr (Mon, 11 Mar 2019 21:58:26 GMT):
my goal is to implement a complete management gateway, that can do single org or multi org management, with secure store, idemix and couchedb
Antimttr (Mon, 11 Mar 2019 21:58:48 GMT):
as well as the actual chaincode
Antimttr (Mon, 11 Mar 2019 22:07:38 GMT):
anyone know what the differences are between endtoendIT and endtoendandbackagainIT?
Antimttr (Mon, 11 Mar 2019 22:07:47 GMT):
second one seems to be slightly shorter than the first
Antimttr (Mon, 11 Mar 2019 22:08:22 GMT):
https://github.com/hyperledger/fabric-sdk-java
Antimttr (Mon, 11 Mar 2019 22:08:25 GMT):
that gives a few details
KyunghoKim (Tue, 12 Mar 2019 03:12:03 GMT):
Has joined the channel.
DLTChacha (Tue, 12 Mar 2019 10:28:45 GMT):
Has joined the channel.
gravity (Tue, 12 Mar 2019 11:47:43 GMT):
Hi all
are there any best practices on how to identify, authenticate and authorize a user in a chaincode?
is it enough to use `cn` from the `x509Certificate`?
rickr (Tue, 12 Mar 2019 11:49:28 GMT):
@gravity Better asked on #fabric-chaincode-dev
aatkddny (Tue, 12 Mar 2019 13:30:40 GMT):
Ok to flog my particular dead horse some more.
`grpc.NettyChannelBuilderOption.maxInboundMessageSize` is expected to be set in the properties for each of the peers/orderers et al.
It's propagated to the NettyChannelBuilder in Endpoint
Here's my problem. I call my "Enterprise Blockchain Network" provider for the NetworkConfig. It's passed back as a json payload which I coerce into a JsonObject (due to the NetworkConfig reqs).
This particular value isn't set.
Is there *really* an expectation that I go through the (multiple) JsonObjects returned - one per org - to find all of my peers/orderers and look for the properties - if there are any returned or create if not - in all of the network configurations for all of the orgs in this fabric and manually insert this value into every single one?
aatkddny (Tue, 12 Mar 2019 13:30:40 GMT):
Ok to flog my particular dead horse some more.
`grpc.NettyChannelBuilderOption.maxInboundMessageSize` is expected to be set in the properties for each of the peers/orderers et al.
It's propagated to the NettyChannelBuilder in Endpoint. I don't see an override where it can be set as an environment variable.
Here's my problem. I call my "Enterprise Blockchain Network" provider for the NetworkConfig. It's passed back as a json payload which I coerce into a JsonObject (due to the NetworkConfig reqs).
This particular value isn't set.
Is there *really* an expectation that I go through the (multiple) JsonObjects returned - one per org - to find all of my peers/orderers and look for the properties - if there are any returned or create if not - in all of the network configurations for all of the orgs in this fabric and manually insert this value into every single one?
rickr (Tue, 12 Mar 2019 13:38:58 GMT):
Hmm -- maybe a disconnect in understanding. The link I provided showed that you could adjust the peer/ordererer properties before you create the channel from the neteworkconfig. 1) is that not what you want ? 2) is that not working ?
aatkddny (Tue, 12 Mar 2019 13:51:12 GMT):
The disconnect is this. This is our production blockchain network and it's hosted by a third party that's rather involved in same technology.
There are a number of orgs in it. We are proxying access to all of them on their behalf, so we get multiple network configurations.
I get the network configurations from this supplier by making calls for same.
It comes back as a series of json payloads. If you want the code it looks like this:
```
JsonReader reader = Json.createReader(new StringReader(json));
JsonObject jo = (JsonObject) reader.read();
org.setJo(jo);
return NetworkConfig.fromJsonObject(jo);
```
This then gets passed into the channel create code to do a loadFromNetworkObject. I don't touch it after I received it.
Yes I could go through each of these NetworkConfig objects and edit the properties associated with each peer and each orderer and inject this same value into every single one of the properties in there, but this seems like the wrong way to do this. My network is such that every peer has the potential to see the same size of message (the size that's set in configtx.yaml for max message size).
If it's set once there, it seems wrong for me to have to inject it all over the place because of a bad default in a builder. I'd expect to set a global variable and have that used.
As a more philosophical question, it also seems wrong to edit a network configuration returned from a third party network to accommodate an SDK. The whole idea (I thought) was to not have to manually build this configuration any more.
aatkddny (Tue, 12 Mar 2019 13:51:12 GMT):
The disconnect is this. This is our production blockchain network and it's hosted by a third party that's rather involved in same technology.
There are a number of orgs in it. We are proxying access to all of them on their behalf, so we get multiple network configurations.
I get the network configurations from this supplier by making calls for same.
It comes back as a series of json payloads. If you want the code it looks like this:
```
JsonReader reader = Json.createReader(new StringReader(json));
JsonObject jo = (JsonObject) reader.read();
org.setJo(jo);
return NetworkConfig.fromJsonObject(jo);
```
This then gets passed into the channel create code to do a loadFromNetworkObject. I don't touch it after I received it.
Yes I could go through each of these NetworkConfig objects and edit the properties associated with each peer and each orderer and inject this same value into every single one of the properties in there, but this seems like the wrong way to do this. My network is such that every peer has the potential to see the same size of message (the size that's set in configtx.yaml for max message size).
If it's set once there, it seems wrong for me to have to inject it all over the place because of a bad default in a builder. I'd expect to set a global variable and have that used, or better to have it returned from the network provider so I can use it without having to worry that there's a mismatch.
As a more philosophical question, it also seems wrong to edit a network configuration returned from a third party network to accommodate an SDK. The whole idea (I thought) was to not have to manually build this configuration any more.
aatkddny (Tue, 12 Mar 2019 13:51:12 GMT):
The disconnect is this. This is our production blockchain network and it's hosted by a third party that's rather involved in same technology. My access is limited to interaction with APIs.
There are a number of orgs in it. We are proxying access to all of them on their behalf, so we get multiple network configurations.
I get the network configurations from this supplier by making calls for same.
It comes back as a series of json payloads. If you want the code it looks like this:
```
JsonReader reader = Json.createReader(new StringReader(json));
JsonObject jo = (JsonObject) reader.read();
org.setJo(jo);
return NetworkConfig.fromJsonObject(jo);
```
This then gets passed into the channel create code to do a loadFromNetworkObject. I don't touch it after I received it.
Yes I could go through each of these NetworkConfig objects and edit the properties associated with each peer and each orderer and inject this same value into every single one of the properties in there, but this seems like the wrong way to do this. My network is such that every peer has the potential to see the same size of message (the size that's set in configtx.yaml for max message size).
If it's set once there, it seems wrong for me to have to inject it all over the place because of a bad default in a builder. I'd expect to set a global variable and have that used, or better to have it returned from the network provider so I can use it without having to worry that there's a mismatch.
As a more philosophical question, it also seems wrong to edit a network configuration returned from a third party network to accommodate an SDK. The whole idea (I thought) was to not have to manually build this configuration any more.
rickr (Tue, 12 Mar 2019 13:59:18 GMT):
This seems to me a very easy adjust. The common code point (function, method) where you load the network would do this adjustment. Your application could then have a *global* variable (yuck) to what it's set.
aatkddny (Tue, 12 Mar 2019 14:04:04 GMT):
The question isn't whether I can. Obviously I *can*. It's whether this is the *correct* way to do this.
There's exactly *one* maximum message size for an entire fabric network and it's set when the network is created. In this case I can't even see configtx so I'm forced to guess that they kept the default value.
I will now have to write code to edit the network definitions I get back from my provider just so I can set the same value - that can't change - in around 400 places.
aatkddny (Tue, 12 Mar 2019 14:04:04 GMT):
The question isn't whether I can. Obviously I *can*. It's whether this is the *correct* way to do this.
There's exactly *one* maximum message size for an entire fabric network and it's set when the network is created. In this case I can't even see configtx so I'm forced to guess that they kept the default value.
I will now have to write code to edit the network definitions I get back from my provider just so I can set the same value - that can't change - in around 400 places.
AlessandroPrimavera (Tue, 12 Mar 2019 14:10:54 GMT):
Has joined the channel.
rickr (Tue, 12 Mar 2019 14:43:25 GMT):
@aatkddny AFAIK there was no defined property in the netwrokconfig for max message size. Setting this is different for each SDK grpc. The networkconfig had a `grpc.keepalive_time_ms` which really Node based :( The JSDK does for that do the remap. There would need to be some agreement on how a grpc message size should be specified in the Networkconfig.
I'm not understanding why changing in 400 places - when a common method call by your application to loading a network could do that adjustment.
lupass93 (Tue, 12 Mar 2019 15:11:02 GMT):
Has joined the channel.
aatkddny (Tue, 12 Mar 2019 15:22:15 GMT):
The 400 places is because I have a lot of nodes and a lot of channels.
aatkddny (Tue, 12 Mar 2019 15:33:55 GMT):
Ok I added a ticket for same.
https://jira.hyperledger.org/browse/FAB-14605
In this case, the 400 places is a consequence of the node count and the way network config is returned. 400 places in the set of network configurations, not the code.
aatkddny (Tue, 12 Mar 2019 15:33:55 GMT):
Ok I added a ticket for same.
https://jira.hyperledger.org/browse/FAB-14605
In this case, the 400 places is a consequence of the node count and the way network config is returned. 400 places in the set of network configurations, not the code. It's one piece of code, but it sets the same value many many times.
rickr (Tue, 12 Mar 2019 15:54:50 GMT):
@aatkddny
````
JsonReader reader = Json.createReader(new StringReader(json));
JsonObject jo = (JsonObject) reader.read();
org.setJo(jo);
NetworkConfig nwc= NetworkConfig.fromJsonObject(jo);
nwc.getPeerNames().forEach(peerName -> {
try {
Properties peerProperties = nwc.getPeerProperties(peerName);
peerProperties.setProperty("grpc.NettyChannelBuilderOption.maxInboundMessageSize", 9000000);
nwc(peerName, peerProperties);
} catch (InvalidArgumentException e) {
throw new RuntimeException(e);
}
});
return nwc;
```
rickr (Tue, 12 Mar 2019 15:54:50 GMT):
@aatkddny
````
JsonReader reader = Json.createReader(new StringReader(json));
JsonObject jo = (JsonObject) reader.read();
org.setJo(jo);
NetworkConfig nwc= NetworkConfig.fromJsonObject(jo);
nwc.getPeerNames().forEach(peerName -> {
try {
Properties peerProperties = nwc.getPeerProperties(peerName);
peerProperties.setProperty("grpc.NettyChannelBuilderOption.maxInboundMessageSize", 9000000);
nwc.setPeerProperties(peerName, peerProperties);
} catch (InvalidArgumentException e) {
throw new RuntimeException(e);
}
});
return nwc;
```
aatkddny (Tue, 12 Mar 2019 15:57:28 GMT):
Thx, but I already wrote the code.
I added same for orderer and event hub.
rickr (Tue, 12 Mar 2019 15:57:58 GMT):
and .. that's not what you wanted ?
aatkddny (Tue, 12 Mar 2019 15:58:42 GMT):
Not really. I want to not have to edit provided properties from a third party because of a limitation in the SDK.
rickr (Tue, 12 Mar 2019 15:59:11 GMT):
ok but that's 400 places you're changing :)
rickr (Tue, 12 Mar 2019 16:00:22 GMT):
If your're having to do that in 400 places I would agree OUCH .. but this doesn't seem to be that horrible to do
aatkddny (Tue, 12 Mar 2019 16:01:06 GMT):
Edit programatically or manually is irrelevant.
As a client to an SDK and to a fabric network I ought to not have to be acting as man in the middle. When - and it will - the network configuration layout changes, I as the client shouldn't be forced to change my code.
aatkddny (Tue, 12 Mar 2019 16:01:06 GMT):
Edit programatically or manually is irrelevant.
As a client to an SDK and to a fabric network I ought to not have to be acting as man in the middle. When - and it will - the network configuration layout changes, I as the client shouldn't be forced to change the glue code that I don't think I should have to write in the first place.
aatkddny (Tue, 12 Mar 2019 16:01:06 GMT):
Edit programatically or manually is irrelevant.
As a client to an SDK and to a fabric network I ought to not have to be acting as man in the middle. When - and it will - the network configuration layout changes, I as the client shouldn't be forced to change the glue code that I don't think I should have to write in the first place. I - as the client - am not a party to this contract. This forces me to become one.
aatkddny (Tue, 12 Mar 2019 16:01:06 GMT):
Edit programatically or manually is irrelevant.
As a client using an sdk to connect to a fabric network, I ought to not to be forced to act as man in the middle to a contract between sdk and fabric.
When - and it will - the network configuration layout changes, I the client, shouldn't be forced to change glue code that I don't think I should have to write in the first place.
I am not a party to this contract. This forces me to become one.
Antimttr (Tue, 12 Mar 2019 18:01:10 GMT):
@aatkddny i feel your pain, and i agree!
rickr (Tue, 12 Mar 2019 18:31:26 GMT):
There's no "contract" that specifies max message size. irregardless of the SDK. The contract you speak of the NetworkConfig/Connection Profile as I said had no specification for setting that.
aatkddny (Tue, 12 Mar 2019 18:52:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=gxLhmmAkJrf8RQpvX) But there *is* a contract between sdk and fabric.
A user shouldn't have to act as a man in the middle between these two because a required field is missing from that contract.
You either fix the contract or allow the user to pass in the field separately.
aatkddny (Tue, 12 Mar 2019 18:52:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=gxLhmmAkJrf8RQpvX) But there *is* a contract between sdk and fabric.
A user shouldn't have to act as a man in the middle between these two because a required field is missing from that contract.
You (one) either fix the contract or allow the user to pass in the field separately.
rickr (Tue, 12 Mar 2019 18:58:39 GMT):
@aatkddny Show me a specification that states setting the max message size please
SatheeshNehru (Wed, 13 Mar 2019 06:42:02 GMT):
whats difference between add peer and join peer?
AndresMartinezMelgar.itcl (Wed, 13 Mar 2019 08:39:11 GMT):
Hi, i am trying to install a chaincode in java. I think that it hasn't have mistakes, but when i try to install i receive theses errors
AndresMartinezMelgar.itcl (Wed, 13 Mar 2019 08:39:11 GMT):
Clipboard - March 13, 2019 9:39 AM
AndresMartinezMelgar.itcl (Wed, 13 Mar 2019 09:24:33 GMT):
ok, i solved it. I put wrong path
AndresMartinezMelgar.itcl (Wed, 13 Mar 2019 09:57:07 GMT):
): when i try to instantiated the chaincode i receive this:
AndresMartinezMelgar.itcl (Wed, 13 Mar 2019 09:57:10 GMT):
Clipboard - March 13, 2019 10:57 AM
AndresMartinezMelgar.itcl (Wed, 13 Mar 2019 10:08:15 GMT):
what is the function of hyperledger/fabric-javaenv docker image? It will be used to install and instantiated chaincodes?
AndresMartinezMelgar.itcl (Wed, 13 Mar 2019 10:09:57 GMT):
Is it look like fabric-tools?
rickr (Wed, 13 Mar 2019 12:41:06 GMT):
@SatheeshNehru You only ever *join* a peer belonging to _your own organization_ to a channel once at the beginning. You would only *add* peers from other organizations or peers of your own organization you've already *joined* when recreating the channel SDK object.
rickr (Wed, 13 Mar 2019 12:56:11 GMT):
@SatheeshNehru base java docker environment
rickr (Wed, 13 Mar 2019 12:56:11 GMT):
@SatheeshNehru base java chaincode docker environment
aatkddny (Wed, 13 Mar 2019 13:04:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=EzvWEgjdEdfyNvoHG) @rickr You an I both know there isn't one.
Yet.
But seeing the amount of grpc. specific stuff that has been stuffed into the connection profile, there's space for one more.
I'm counting 5 different grpc properties already in the one I'm looking at.
aatkddny (Wed, 13 Mar 2019 13:04:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=EzvWEgjdEdfyNvoHG) @rickr You an I both know there isn't one.
Yet.
But seeing the amount of grpc. specific stuff that has been stuffed into the connection profile, there's space for one more.
I'm counting 5 different grpc properties already in the one I'm looking at.
And as an aside having fixed that value in the SDK the message gets blown out by the network max kafka message size anyway. It's not even that big...
aatkddny (Wed, 13 Mar 2019 13:04:05 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=EzvWEgjdEdfyNvoHG) @rickr You and I both know there isn't one.
Yet.
But seeing the amount of grpc. specific stuff that has been stuffed into the connection profile, there's space for one more.
I'm counting 5 different grpc properties already in the one I'm looking at.
And as an aside having fixed that value in the SDK the message gets blown out by the network max kafka message size anyway. It's not even that big...
rickr (Wed, 13 Mar 2019 13:47:40 GMT):
Not in any specific details so every SDK can implement uniformly and authors know what to set : nothing for the SDK to do
rickr (Wed, 13 Mar 2019 13:52:24 GMT):
Besides -- I don't think it's even right for that to be there. That document general purpose is for infrastructure providers to give to clients so they can easily construct the network with SDK of their choice to work with it. But as an infrastructure provider I have no idea what chaincode you will be deploying and what it's requirements are. Even as the chaincode author you may not know. One request may come in and produce just a few bytes of results to the client. Another request could produce 300MB.
gravity (Wed, 13 Mar 2019 17:23:25 GMT):
Hi all. Is it actually reasonable to have more than one intermediate ca server? I mean, is it enough to have only one ica and scale it for better availability?
rickr (Wed, 13 Mar 2019 18:43:36 GMT):
@gravity Hate to push people elsewhere, but so others may benefit , please ask on #fabric-ca
gravity (Wed, 13 Mar 2019 20:01:26 GMT):
thanks, will ask
but, to be honest, this room is the most responsive among others :)
AndresMartinezMelgar.itcl (Thu, 14 Mar 2019 07:30:01 GMT):
Hi @rickr , I'm having a problem when I try to instantiate a chaincode written in java.
I'm doing exactly the same steps as the example byfn.sh but in kubernetes. I have changed what is necessary in the build.gradle file.
I have successfully installed the chaincode, but when I try to instantiate it I get maven-related problems.
I attach a couple of photos
AndresMartinezMelgar.itcl (Thu, 14 Mar 2019 07:31:08 GMT):
Installation
AndresMartinezMelgar.itcl (Thu, 14 Mar 2019 07:31:40 GMT):
instantiated
AndresMartinezMelgar.itcl (Thu, 14 Mar 2019 07:33:42 GMT):
folders and files system
daijianw (Thu, 14 Mar 2019 09:17:18 GMT):
updateAnchorPeer
sstone1 (Thu, 14 Mar 2019 09:40:47 GMT):
Error: could not update anchor peers
nkl199 (Thu, 14 Mar 2019 10:06:44 GMT):
Has joined the channel.
AndresMartinezMelgar.itcl (Thu, 14 Mar 2019 12:19:59 GMT):
Hi, i have a mistake when i want create a new channel with java sdk. I receive this log, but i cant find any info.
Thanks
AndresMartinezMelgar.itcl (Thu, 14 Mar 2019 12:20:02 GMT):
Clipboard - March 14, 2019 1:20 PM
AndresMartinezMelgar.itcl (Thu, 14 Mar 2019 12:20:42 GMT):
line 91 is: Channel mychannel = fabClient.getInstance().newChannel(Config.CHANNEL_NAME,orderer,channelConfiguration,channelConfigurationSignatures);
rickr (Thu, 14 Mar 2019 12:33:47 GMT):
@AndresMartinezMelgar.itcl Need to look at possibly the Orderer logs.
chill37 (Thu, 14 Mar 2019 12:45:06 GMT):
Hi. while going through endorsement policy,
how do I get MSPID for IDENTITY/ANONYMITY of MSP Principal?
I'm not really sure how the identity/anonymity would work from User's perspective as well.
Currently I'm trying to decode the Endorsement Policy, but Identity/ANonymity of MSPPrincipal only has type value and nothing else, so I'm curious. Thanx!
gravity (Thu, 14 Mar 2019 16:48:17 GMT):
Hi all
is there any difference between `HFCAClient.HFCA_TYPE_CLIENT` and `HFCAClient.HFCA_TYPE_USER`? from my observation, identities that are registered using these types are the same and they both behave like a common user
skarim (Thu, 14 Mar 2019 16:52:59 GMT):
The type of the identity ends up as an attribute in the certificate. You can then use cid library in chaincode to apply logic based on types if you'd like. Otherwise identities will behave the same.
gravity (Thu, 14 Mar 2019 17:18:30 GMT):
@skarim
got it, thanks
Antimttr (Thu, 14 Mar 2019 20:19:27 GMT):
hey @skarim ! you were responsible for writing idemix in the java sdk if i'm not mistaken?
skarim (Thu, 14 Mar 2019 21:13:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=6tPCYGrPBYEW8Crfh) @Antimttr I wrote the idemix end to end test case, but the actually java implementation was written by someone else
Antimttr (Thu, 14 Mar 2019 22:00:46 GMT):
@skarim ah nice, I have interest at my company to port the idemix from java to js. Right now im working on making a version of the balance transfer demo js api in java to get access to idemix
Antimttr (Thu, 14 Mar 2019 22:12:01 GMT):
In end2endIT.java theres a lot of references to SampleOrg, SampleStore, etc. So for a real implementation what data structure would these be replaced with?
Antimttr (Thu, 14 Mar 2019 22:12:10 GMT):
is there an Org and a Store class somewhere?
Antimttr (Thu, 14 Mar 2019 22:18:04 GMT):
seems like its just for staging test cases
Antimttr (Thu, 14 Mar 2019 22:18:39 GMT):
is there any non-test-case based java sdk example code anywhere?
Antimttr (Thu, 14 Mar 2019 22:19:04 GMT):
like from an actual implementation?
aatkddny (Thu, 14 Mar 2019 23:19:31 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=pZ7zPvJryCFWhASwE) FWIW - we stuck them all into a nosql database. Our app is a spring boot thing that's way too complicated to reproduce, but I'll give you our user definition to get you started.
```
@Document
public class FabricUser implements org.hyperledger.fabric.sdk.User {
@Id
private String id;
private String name;
private String organization;
private String mspId;
private String secret;
private String affiliation;
private Boolean admin;
private Boolean peerAdmin;
private Set
Antimttr (Fri, 15 Mar 2019 03:25:06 GMT):
@aatkddny ok interesting, thanks. I started with spring and it was horrifyingly complex, coming from like nodejs. I opted for jersey, way more straight forward, clean code imho
aatkddny (Fri, 15 Mar 2019 13:06:29 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=xMCxraAGa4grG2oNr) In this case the complexity is the logic, not the framework. The application I culled the user class from was custom written to build and instantiate any network from scratch (compose) or build (k8s) from a simple network definition file. It allows us to remove human error editing and submitting all the yaml files, and makes stopping and starting a fabric - something we've done a lot as we test - much quicker.
Antimttr (Fri, 15 Mar 2019 14:20:28 GMT):
@aatkddny I was just wondering what the business case was for storing all those records in perpetuity in a db? Is this to act as a backup for the ledger in case you need to rebuild corrupted data down the road?
aatkddny (Fri, 15 Mar 2019 14:22:06 GMT):
Well for the user you need to save the enrollment that the ca issues.
aatkddny (Fri, 15 Mar 2019 14:22:06 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=vTQJtPMs4N2QYZim7) @Antimttr We save the msp anchor tx - because we do them after we create the channel.
the channel.tx type records are used from disk when we create the channels, but we do that as part of creating the network.
Adding channels on the fly uses an external process.
Antimttr (Fri, 15 Mar 2019 14:22:31 GMT):
do you also save like the channel creation stuff?
Antimttr (Fri, 15 Mar 2019 14:26:40 GMT):
theres also a class they have called Sample store are you saving the data that fills up those objects?
Antimttr (Fri, 15 Mar 2019 14:28:39 GMT):
so the msp anchor is an artifact created by the use of idemix if im not mistaken?
aatkddny (Fri, 15 Mar 2019 14:31:11 GMT):
sample store is just a kv store. we save users, we load channels from a network configuration.
we have two flavors for this.
one that gets the config from our favorite blockchain service provider, and one that internally constructs a network config from our saved network properties for the stuff we have in our data center.
aatkddny (Fri, 15 Mar 2019 14:31:11 GMT):
sample store is just a kv store. we save users, we load channels from a network configuration.
we have two flavors for this.
one that gets the config from our favorite blockchain service provider, and one that internally constructs a network config from our saved network properties for the stuff we have in our data center. We save org, orderer and channel information in a configuration database.
Antimttr (Fri, 15 Mar 2019 14:40:47 GMT):
So the configuration database is just referenced by your hyperledger management tools? (your sdk implementation)
Antimttr (Fri, 15 Mar 2019 14:41:47 GMT):
Do you also keep offledger backups of all the ledger transactions for your implementation as well?
Antimttr (Fri, 15 Mar 2019 14:42:24 GMT):
@aatkddny have you run into the issue where the docker images will fill up your disk volumes with gossip logs? that happens to me about once a week
Antimttr (Fri, 15 Mar 2019 14:42:29 GMT):
w/the balance transfer demo
aatkddny (Fri, 15 Mar 2019 14:44:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ftYnoYaq5wASz8v83) @Antimttr We are moving that way.
As it Tx volume scales out the UI is starting to slow down. There's also an issue with maximum asset size - we were aggregating on chain and hit a roadblock there.
aatkddny (Fri, 15 Mar 2019 14:44:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ftYnoYaq5wASz8v83) @Antimttr We are moving that way. We knew we needed to for reporting, but the real tine stuff has pushed us to up the priority.
As it Tx volume scales out the UI is starting to slow down. There's also an issue with maximum asset size - we were aggregating on chain and hit a roadblock there.
dan13 (Fri, 15 Mar 2019 14:45:02 GMT):
Can someone explain the below? IBM Blockchain Platform Starter (HLF 1.2): 2 Orgs, Org 1 has 1 Peer, Org 2 currently has no (zero) peers. Java SDK-based Client app uses an Org 1 user and peer, and registers persistent (i.e., outside of any transactional context) Block and Chaincode Event listeners (logged under "EventService" below) at startup and is logging every event they receive. A single transaction is sent to a simple chaincode that emits an "event1" event. The questions are
1. Why are the listeners seeing the same event repeatedly?
2. Why is the period varying?
3. Why are some blocks coming from peer "null" (Lines 3 and 5) which then stops?
```
2019-03-14 15:21:16.898 INFO AppService : createAsset: Proposal Created: externalId=987, hash=306d70af59bb740d5bab5bd5b534dfb77f4f206c46eb8931a761dac6a643cc71, transactionId=02356529a8ace2cdfb1596fce10aa5d547ddc2e993dba55d82db6da27a4dc619
2019-03-14 15:21:18.623 INFO EventService : Received Block peer=org1-peer1, number=246, # trans=1
2019-03-14 15:21:18.623 INFO EventService : Received Block peer=null, number=246, # trans=1
2019-03-14 15:21:18.624 INFO EventService : Received Event peer=org1-peer1, handle=CHAINCODE_EVENTS_HANDLEcdcbc87d-28f3-4b37-a650-b1a6123d8d12CHAINCODE_EVENTS_HANDLE, chaincodeId=testApp, name=event1, transactionId=02356529a8ace2cdfb1596fce10aa5d547ddc2e993dba55d82db6da27a4dc619, payload=987
2019-03-14 15:21:18.624 INFO EventService : Received Event peer=null, handle=CHAINCODE_EVENTS_HANDLEcdcbc87d-28f3-4b37-a650-b1a6123d8d12CHAINCODE_EVENTS_HANDLE, chaincodeId=testApp, name=event1, transactionId=02356529a8ace2cdfb1596fce10aa5d547ddc2e993dba55d82db6da27a4dc619, payload=987
2019-03-14 15:21:18.624 INFO AppService : createAsset: Commit Successful: externalId=987, blockEvent=org.hyperledger.fabric.sdk.BlockEvent$TransactionEvent@4829380f
2019-03-14 15:29:58.199 INFO EventService : Received Block peer=org1-peer1, number=246, # trans=1
2019-03-14 15:29:58.199 INFO EventService : Received Event peer=org1-peer1, handle=CHAINCODE_EVENTS_HANDLEcdcbc87d-28f3-4b37-a650-b1a6123d8d12CHAINCODE_EVENTS_HANDLE, chaincodeId=testApp, name=event1, transactionId=02356529a8ace2cdfb1596fce10aa5d547ddc2e993dba55d82db6da27a4dc619, payload=987
2019-03-14 15:38:18.510 INFO EventService : Received Block peer=org1-peer1, number=246, # trans=1
2019-03-14 15:38:18.510 INFO EventService : Received Event peer=org1-peer1, handle=CHAINCODE_EVENTS_HANDLEcdcbc87d-28f3-4b37-a650-b1a6123d8d12CHAINCODE_EVENTS_HANDLE, chaincodeId=testApp, name=event1, transactionId=02356529a8ace2cdfb1596fce10aa5d547ddc2e993dba55d82db6da27a4dc619, payload=987
2019-03-14 15:48:19.391 INFO EventService : Received Block peer=org1-peer1, number=246, # trans=1
2019-03-14 15:48:19.391 INFO EventService : Received Event peer=org1-peer1, handle=CHAINCODE_EVENTS_HANDLEcdcbc87d-28f3-4b37-a650-b1a6123d8d12CHAINCODE_EVENTS_HANDLE, chaincodeId=testApp, name=event1, transactionId=02356529a8ace2cdfb1596fce10aa5d547ddc2e993dba55d82db6da27a4dc619, payload=987
2019-03-14 15:52:39.454 INFO EventService : Received Block peer=org1-peer1, number=246, # trans=1
2019-03-14 15:52:39.455 INFO EventService : Received Event peer=org1-peer1, handle=CHAINCODE_EVENTS_HANDLEcdcbc87d-28f3-4b37-a650-b1a6123d8d12CHAINCODE_EVENTS_HANDLE, chaincodeId=testApp, name=event1, transactionId=02356529a8ace2cdfb1596fce10aa5d547ddc2e993dba55d82db6da27a4dc619, payload=987
2019-03-14 16:02:40.944 INFO EventService : Received Block peer=org1-peer1, number=246, # trans=1
2019-03-14 16:02:40.944 INFO EventService : Received Event peer=org1-peer1, handle=CHAINCODE_EVENTS_HANDLEcdcbc87d-28f3-4b37-a650-b1a6123d8d12CHAINCODE_EVENTS_HANDLE, chaincodeId=testApp, name=event1, transactionId=02356529a8ace2cdfb1596fce10aa5d547ddc2e993dba55d82db6da27a4dc619, payload=987
2019-03-14 16:12:41.914 INFO EventService : Received Block peer=org1-peer1, number=246, # trans=1
2019-03-14 16:12:41.914 INFO EventService : Received Event peer=org1-peer1, handle=CHAINCODE_EVENTS_HANDLEcdcbc87d-28f3-4b37-a650-b1a6123d8d12CHAINCODE_EVENTS_HANDLE, chaincodeId=testApp, name=event1, transactionId=02356529a8ace2cdfb1596fce10aa5d547ddc2e993dba55d82db6da27a4dc619, payload=987
(reasonably sure this would have continued indefinitely if not stopped....)
```
Thanks!
Antimttr (Fri, 15 Mar 2019 14:47:16 GMT):
@aatkddny by maximum asset size you mean teh szie of any single ledger transaction? or do you mean the aggregate size of all transactions on the ledger?
aatkddny (Fri, 15 Mar 2019 14:49:47 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ut35mcF6XeQ2vGZCQ) @Antimttr single tx - the size of the message sent to the orderer is bound.
Antimttr (Fri, 15 Mar 2019 14:50:01 GMT):
Is your UI that's slowing down tightly coupled with your SDK implementation, or are you making RESTful api calls to it from a web app?
aatkddny (Fri, 15 Mar 2019 14:50:28 GMT):
@dan13 - you get an event from each peer. there are two kinds - block and actual event. the payload differs between the two.
aatkddny (Fri, 15 Mar 2019 14:55:23 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=EkojxfnmoJvJMezzT) @Antimttr We have a dashboard. It aggregates sets of assets from more than one channel by invoking chaincode on each of the channels.
As asset count increases response time also goes up.
Yes yes I know - a blockchain is a lousy database, but until the work to fix it is scheduled this is what we have. To reduce asset count we were aggregating a specific set of periodic assets (daily metrics) into one uber asset. This hit a size limitation in our cloud instance.
aatkddny (Fri, 15 Mar 2019 14:55:23 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=EkojxfnmoJvJMezzT) @Antimttr We have a dashboard. It aggregates sets of assets from more than one channel by invoking chaincode on each of the channels inside a rest endpoint.
As asset count increases response time also goes up.
Yes yes I know - a blockchain is a lousy database, but until the work to fix it is scheduled this is what we have. To reduce asset count we were aggregating a specific set of periodic assets (daily metrics) into one uber asset. This hit a size limitation in our cloud instance.
Antimttr (Fri, 15 Mar 2019 14:56:52 GMT):
Ahh ok. Yeah our use case is a bit different so that (probably) wont be an issue. Our typical record size will be under 1kb and we'll only be doing a few hundred transactions a day (max). But its good to keep these things in mind
Antimttr (Fri, 15 Mar 2019 14:57:18 GMT):
Your dashboard. does it use synchronis or asynchronis calls to the hyperledger? also are you doing any caching of your hyperledger api calls?
aatkddny (Fri, 15 Mar 2019 15:00:22 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=oawJBfbiaGA3MaXgm) The calls into the fabric are async.
We self-synchronize so we can aggregate in the endpoint before it goes back to the browser. It'll get fixed when we put in something a bit more performant and the ui guys rejig the code to paginate.
Antimttr (Fri, 15 Mar 2019 15:01:49 GMT):
did you implement the pagination options in your hyperledger sdk implementation? I'm glad that they put that in there, atleast its in the node sdk
Antimttr (Fri, 15 Mar 2019 15:01:53 GMT):
hopefuly its also in the java sdk
dan13 (Fri, 15 Mar 2019 15:43:39 GMT):
@aatkddny Thanks -- the question is why am I receiving the same event -- block and chaincode -- multiple times. See the trace -- the peer is pushing the same data repeatedly.
dan13 (Fri, 15 Mar 2019 15:43:39 GMT):
@aatkddny Thanks -- the question is why am I receiving the same event -- block and chaincode -- multiple times. See the trace -- the same (single) peer is pushing the same data repeatedly.
aatkddny (Fri, 15 Mar 2019 15:45:22 GMT):
its not the same event. one is for the block one for each tx in the block. since default cut rate is 2s you are probably getting one of each.
dan13 (Fri, 15 Mar 2019 15:48:37 GMT):
@aatkddny see the log trace above. I have a block listener and a chaincode listener. 1 transaction occurred on the network with 1 peer. I would expect 1 block listener log (the block event), and 1 chaincode listener log (the chaincode event). I get multiple with the exact same payload (per type). It sounds like you are confirming my expectation, but that doesn't match the logs. In any event, if you are confirming my expectation, then I will research further - thanks
aatkddny (Fri, 15 Mar 2019 15:49:26 GMT):
you get an event for each peer on the channel iirc.
Antimttr (Fri, 15 Mar 2019 15:56:13 GMT):
@aatkddny do you also store this data structure in your database? https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/SampleOrg.java
Antimttr (Fri, 15 Mar 2019 15:57:43 GMT):
seems like some of this data would also reside in the network.yaml and orgX.yaml
Antimttr (Fri, 15 Mar 2019 15:58:23 GMT):
from the end2endIT file they load it using checkConfig(), so right from the config files
Antimttr (Fri, 15 Mar 2019 15:58:37 GMT):
so it would seem redundant to also store it in another db table
Antimttr (Fri, 15 Mar 2019 15:58:50 GMT):
but maybe you'd want to see all the iterations/revision of the data
aatkddny (Fri, 15 Mar 2019 16:07:55 GMT):
we do it differently. we have a very simple internal format config file that describes the network - orgs, number of peers and channel relationships.
we do everything from that.
everything as in run any crypto, run any configtxgens, generate the yaml files for docker or k8s and save what we need to allow us to build a networkconfig so we can do a channel.loadfromnetworkconfig when our real applications go to use this fabric. that's why we save stuff to the db - there's no redundancy for us. our implementation is different.
aatkddny (Fri, 15 Mar 2019 16:07:55 GMT):
we do it differently. we have a very simple internal format config file that describes the network - orgs, number of peers and channel relationships.
we do everything from that.
everything as in run any crypto, run any configtxgens, generate the yaml files for docker or k8s and save what we need to allow us to build a networkconfig so we can do a channel.loadfromnetworkconfig when our real applications go to use this fabric. that's why we save stuff to the db - there's no redundancy for us. ymmv
Antimttr (Fri, 15 Mar 2019 16:09:34 GMT):
ok so basically
Antimttr (Fri, 15 Mar 2019 16:09:54 GMT):
you created your own configurator, which generates the logical hyperledger network configuration files
Antimttr (Fri, 15 Mar 2019 16:10:04 GMT):
does it also dynmically generate the docker-compose.yaml file?
aatkddny (Fri, 15 Mar 2019 16:10:11 GMT):
yes
Antimttr (Fri, 15 Mar 2019 16:10:25 GMT):
yeah i was thinking about making one of those for my administration gateway
aatkddny (Fri, 15 Mar 2019 16:11:39 GMT):
well ours has a switch - it'll do either compose or kubernetes. when you scale out more orgs compose falls flat. swarm isn't well supported so you end up moving (painfully in my case) to kubernetes.
Antimttr (Fri, 15 Mar 2019 16:11:59 GMT):
oh really?
Antimttr (Fri, 15 Mar 2019 16:12:12 GMT):
how many orgs did it take to get to that point?
Antimttr (Fri, 15 Mar 2019 16:12:21 GMT):
(and how many peers?)
Antimttr (Fri, 15 Mar 2019 16:12:57 GMT):
also were all these running on a single host server?
Antimttr (Fri, 15 Mar 2019 16:13:05 GMT):
or do you have them spread out amongst multiple servers?
Antimttr (Fri, 15 Mar 2019 16:13:34 GMT):
are the kubernetes images rolled for us like the docker images are?
Antimttr (Fri, 15 Mar 2019 16:13:38 GMT):
like by the hyperledger folks
Antimttr (Fri, 15 Mar 2019 16:13:43 GMT):
or did you have to roll your own?
Antimttr (Fri, 15 Mar 2019 16:14:17 GMT):
or can you use the docker images with kubernetes?
Antimttr (Fri, 15 Mar 2019 16:26:53 GMT):
it seems like you can
aatkddny (Fri, 15 Mar 2019 16:29:17 GMT):
we tapped out at about 8 two node orgs in docker. compose was single docker and single large server.
when we started this there were no kubernetes images - it was all roll your own. there are some published now that use helm charts so that'll make it easier, but there's still no tls in any of them.
aatkddny (Fri, 15 Mar 2019 16:29:17 GMT):
we tapped out at about 8 two node orgs in docker. compose was single docker and single large server. kubernetes is running 20 or so orgs on a 6 node cluster.
when we started this there were no kubernetes images - it was all roll your own. there are some published now that use helm charts so that'll make it easier, but there's still no tls in any of them.
Antimttr (Fri, 15 Mar 2019 16:30:13 GMT):
so you rolled your own to get around that limitation?
aatkddny (Fri, 15 Mar 2019 16:30:26 GMT):
yes. we autogen all the files.
aatkddny (Fri, 15 Mar 2019 16:30:26 GMT):
yes. we autogen all the files from the config
Antimttr (Fri, 15 Mar 2019 16:31:21 GMT):
are you able to just modify the existing not tls images, or you have to completely start from scratch?
Antimttr (Fri, 15 Mar 2019 16:31:21 GMT):
are you able to just modify the existing non-tls images, or you have to completely start from scratch?
PradeepJaligama (Fri, 15 Mar 2019 16:33:15 GMT):
there is also something called as network launcher that supports a wide variety of options..
Antimttr (Fri, 15 Mar 2019 16:33:31 GMT):
is that in kubernetes?
PradeepJaligama (Fri, 15 Mar 2019 16:34:05 GMT):
i dont think so
PradeepJaligama (Fri, 15 Mar 2019 16:34:11 GMT):
but could be useful for local deployments
PradeepJaligama (Fri, 15 Mar 2019 16:34:27 GMT):
https://github.com/hyperledger/fabric-test/tree/master/tools/NL
Antimttr (Fri, 15 Mar 2019 16:35:37 GMT):
says it is using codebase v1.0.0, i guess it hasnt been updated for 1.4? or does it work regardless of subversion?
aatkddny (Fri, 15 Mar 2019 16:38:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=oncL5AuzDmNMY5FLK) @Antimttr We started from scratch. the images didn't exist when we started this project.
Antimttr (Fri, 15 Mar 2019 16:39:01 GMT):
i wonder if theres any hyperledger docs that discuss rolling your own peer/orderer/ca nodes
Antimttr (Fri, 15 Mar 2019 16:39:13 GMT):
i've never rolled my own docker image before
aatkddny (Fri, 15 Mar 2019 16:40:24 GMT):
use scripts and substitute. i'll give you a simple kafka one to get you started - this is for HLF-1.4.0 {..} are the substitution points
```
apiVersion: v1
kind: Service
metadata:
name: kafka{ID}
spec:
ports:
- name: "9092"
protocol: TCP
port: 9092
- name: server
protocol: TCP
port: 9093
selector:
name: kafka{ID}
clusterIP: None
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: kafka{ID}
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
name: kafka{ID}
app: kafka
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: "app"
operator: In
values:
- "kafka"
topologyKey: "kubernetes.io/hostname"
terminationGracePeriodSeconds: 60
restartPolicy: Always
dnsPolicy: ClusterFirst
schedulerName: default-scheduler
containers:
- name: kafka{ID}
image: hyperledger/fabric-kafka:0.4.14
imagePullPolicy: IfNotPresent
env:
- name: KAFKA_BROKER_ID
value: "{ID}"
- name: KAFKA_ZOOKEEPER_CONNECT
value: {ZOOKEEPER}
- name: KAFKA_LOG_RETENTION_HOURS
value: "-1"
- name: KAFKA_MESSAGE_MAX_BYTES
value: "103809024"
- name: KAFKA_REPLICA_FETCH_MAX_BYTES
value: "103809024"
- name: KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE
value: "false"
- name: KAFKA_DEFAULT_REPLICATION_FACTOR
value: "{REPLICATION}"
- name: KAFKA_MIN_INSYNC_REPLICAS
value: "{INSYNC}"
- name: KAFKA_ADVERTISED_HOST_NAME
value: kafka{ID}
- name: KAFKA_CONTROLLED_SHUTDOWN_ENABLED
value: "true"
- name: KAFKA_LOG_DIR
value: /share
- name: KAFKA_LOG_DIRS
value: /share
- name: GODEBUG
value: netdns=go
volumeMounts:
- mountPath: /share
name: kfk
subPath: kafka/kafka{ID}
lifecycle:
preStop:
exec:
command:
- /opt/kafka/bin/kafka-server-stop.sh
volumes:
- name: kfk
persistentVolumeClaim:
claimName: {CLAIM}
---
```
aatkddny (Fri, 15 Mar 2019 16:40:24 GMT):
use scripts and substitute. i'll give you a simple kafka one to get you started - this is for HLF-1.4.0 {..} are the substitution points
```
apiVersion: v1
kind: Service
metadata:
name: kafka{ID}
spec:
ports:
- name: "9092"
protocol: TCP
port: 9092
- name: server
protocol: TCP
port: 9093
selector:
name: kafka{ID}
clusterIP: None
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: kafka{ID}
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
name: kafka{ID}
app: kafka
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: "app"
operator: In
values:
- "kafka"
topologyKey: "kubernetes.io/hostname"
terminationGracePeriodSeconds: 60
restartPolicy: Always
dnsPolicy: ClusterFirst
schedulerName: default-scheduler
containers:
- name: kafka{ID}
image: hyperledger/fabric-kafka:0.4.14
imagePullPolicy: IfNotPresent
env:
- name: KAFKA_BROKER_ID
value: "{ID}"
- name: KAFKA_ZOOKEEPER_CONNECT
value: {ZOOKEEPER}
- name: KAFKA_LOG_RETENTION_HOURS
value: "-1"
- name: KAFKA_MESSAGE_MAX_BYTES
value: "103809024"
- name: KAFKA_REPLICA_FETCH_MAX_BYTES
value: "103809024"
- name: KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE
value: "false"
- name: KAFKA_DEFAULT_REPLICATION_FACTOR
value: "{REPLICATION}"
- name: KAFKA_MIN_INSYNC_REPLICAS
value: "{INSYNC}"
- name: KAFKA_ADVERTISED_HOST_NAME
value: kafka{ID}
- name: KAFKA_CONTROLLED_SHUTDOWN_ENABLED
value: "true"
- name: KAFKA_LOG_DIR
value: /share
- name: KAFKA_LOG_DIRS
value: /share
- name: GODEBUG
value: netdns=go
volumeMounts:
- mountPath: /share
name: kfk
subPath: kafka/kafka{ID}
lifecycle:
preStop:
exec:
command:
- /opt/kafka/bin/kafka-server-stop.sh
volumes:
- name: kfk
persistentVolumeClaim:
claimName: {CLAIM}
---
```
PradeepJaligama (Fri, 15 Mar 2019 16:44:04 GMT):
ya, NL is not really updated since 1.0
Antimttr (Fri, 15 Mar 2019 16:48:07 GMT):
@aatkddny thanks for the info! im checking out this now: https://kubernetes.io/docs/tutorials/configuration/configure-redis-using-configmap/ seems like this would be a good scalable solution
Antimttr (Fri, 15 Mar 2019 16:48:41 GMT):
how many orgs are you working with now on your kubernetes setup?
aatkddny (Fri, 15 Mar 2019 17:39:19 GMT):
more than 20
aatkddny (Fri, 15 Mar 2019 17:42:09 GMT):
tbh if i was starting from scratch i'd look at adapting the hlf- stuff in here https://github.com/helm/charts/tree/master/stable
Patriq (Sun, 17 Mar 2019 12:10:44 GMT):
Has joined the channel.
aatkddny (Sun, 17 Mar 2019 22:31:59 GMT):
Anyone hit and figure a workaround for this? `HFCAClient url does not support path portion in url remove path`
Trying to put an ingress on my CA in k8s and need to use paths - have a bunch of endpoints that I need to differentiate between.
aatkddny (Sun, 17 Mar 2019 22:31:59 GMT):
Anyone hit and figure a workaround for this? `HFCAClient url does not support path portion in url remove path`
Trying to put an ingress on my CA in k8s and need to use paths - have a bunch of endpoints that I need to differentiate between.
With a path and a little rewrite voodoo something like this `http://localhost/firstca/api/v1/cainfo` becomes valid and I'm not restricted to defining NodePorts all over the place.
aatkddny (Sun, 17 Mar 2019 22:31:59 GMT):
Anyone hit and figure a workaround for this? `HFCAClient url does not support path portion in url remove path`
Trying to put an ingress on my CA in k8s and need to use paths - have a bunch of endpoints that I need to differentiate between.
With a path and a little rewrite voodoo something like this `http://localhost/firstca/api/v1/cainfo` becomes valid and I'm not restricted to defining NodePorts all over the place.
Edit: Looks like the peers and the orderers (parseGrpcUrl) are going to have the same problem.
aatkddny (Sun, 17 Mar 2019 22:31:59 GMT):
Anyone hit and figure a workaround for this? `HFCAClient url does not support path portion in url remove path`
Trying to put an ingress on my CA in k8s and need to use paths - have a bunch of endpoints that I need to differentiate between.
With a path and a little rewrite voodoo something like this `http://localhost/firstca/api/v1/cainfo` becomes valid and I'm not restricted to defining NodePorts all over the place.
Edit: Looks like the peers and the orderers (parseGrpcUrl) are going to have the same problem.
aatkddny (Sun, 17 Mar 2019 22:31:59 GMT):
Anyone hit and figure a workaround for this? `java.lang.IllegalArgumentException: HFCAClient url does not support path portion in url remove path:`
Trying to put an ingress on my CA in k8s and need to use paths - have a bunch of endpoints that I need to differentiate between.
With a path and a little rewrite voodoo something like this `http://localhost/firstca/api/v1/cainfo` becomes valid and I'm not restricted to defining NodePorts all over the place.
Edit: Looks like the peers and the orderers (parseGrpcUrl) are going to have the same problem.
aatkddny (Sun, 17 Mar 2019 22:31:59 GMT):
Anyone hit and figure a workaround for this? `java.lang.IllegalArgumentException: HFCAClient url does not support path portion in url remove path:`
Trying to put an ingress on my CA in k8s and need to use paths - have a bunch of endpoints that I need to differentiate between.
With a path and a little rewrite voodoo something like this `http://localhost:80/firstca/api/v1/cainfo` becomes a valid call to my CA and I'm not restricted to defining NodePorts all over the place.
Edit: Looks like the peers and the orderers (parseGrpcUrl) are going to have the same problem.
anjalinaik (Mon, 18 Mar 2019 08:50:27 GMT):
Hi all.. is there any tutorial for adding a organization to an exisiting fabric network dynamically using fabric-sdk-java?
anjalinaik (Mon, 18 Mar 2019 09:42:43 GMT):
@rickr Can you please guide me the changes needed to be done in configtx.yaml /crypto-config.yaml /docker-compose.yaml [peer settings] to enable service dicscovery in a multi-host network? `configtx.yaml` ```
Organizations:
- &ess
Name: org
ID: org
MSPDir: crypto-config/peerOrganizations/org.org.com/msp
AnchorPeers:
- Host:
anjalinaik (Mon, 18 Mar 2019 09:42:43 GMT):
@rickr Can you please guide me the changes needed to be done in configtx.yaml /crypto-config.yaml /docker-compose.yaml [peer settings] to enable service dicscovery in a multi-host network? `configtx.yaml` ```
Organizations:
- &ess
Name: org
ID: org
MSPDir: crypto-config/peerOrganizations/org.org.com/msp
AnchorPeers:
- Host:
anjalinaik (Mon, 18 Mar 2019 09:42:43 GMT):
@rickr Can you please guide me the changes needed to be done in configtx.yaml /crypto-config.yaml /docker-compose.yaml [peer settings] to enable service dicscovery in a multi-host network? `configtx.yaml` ```
Organizations:
- &ess
Name: org
ID: org
MSPDir: crypto-config/peerOrganizations/org.org.com/msp
AnchorPeers:
- Host:
anjalinaik (Mon, 18 Mar 2019 09:42:43 GMT):
@rickr Can you please guide me the changes needed to be done in configtx.yaml /crypto-config.yaml /docker-compose.yaml [peer settings] to enable service discovery in a multi-host network?
`configtx.yaml` ```
Organizations:
- &ess
Name: org
ID: org
MSPDir: crypto-config/peerOrganizations/org.org.com/msp
AnchorPeers:
- Host:
anjalinaik (Mon, 18 Mar 2019 09:42:43 GMT):
@rickr Can you please guide me the changes needed to be done in configtx.yaml /crypto-config.yaml /docker-compose.yaml [peer settings] to enable service discovery in a multi-host network?
`configtx.yaml` ```
Organizations:
- &ess
Name: org
ID: org
MSPDir: crypto-config/peerOrganizations/org.org.com/msp
AnchorPeers:
- Host:
anjalinaik (Mon, 18 Mar 2019 09:42:43 GMT):
@rickr Can you please guide me the changes needed to be done in configtx.yaml /crypto-config.yaml /docker-compose.yaml [peer settings] to enable service discovery in a multi-host network?
`configtx.yaml` ```
Organizations:
- &ess
Name: org
ID: org
MSPDir: crypto-config/peerOrganizations/org.org.com/msp
AnchorPeers:
- Host:
anjalinaik (Mon, 18 Mar 2019 09:42:43 GMT):
@rickr Can you please guide me the changes needed to be done in configtx.yaml /crypto-config.yaml /docker-compose.yaml [peer settings] to enable service discovery in a multi-host network?
`configtx.yaml` ```
Organizations:
- &ess
Name: org
ID: org
MSPDir: crypto-config/peerOrganizations/org.org.com/msp
AnchorPeers:
- Host:
anjalinaik (Mon, 18 Mar 2019 09:42:43 GMT):
@rickr Can you please guide me the changes needed to be done in configtx.yaml /crypto-config.yaml /docker-compose.yaml [peer settings] to enable service discovery in a multi-host network?
`configtx.yaml` ```
Organizations:
- &ess
Name: org
ID: org
MSPDir: crypto-config/peerOrganizations/org.org.com/msp
AnchorPeers:
- Host:
gravity (Mon, 18 Mar 2019 14:50:54 GMT):
Hi all
are there any critical reasons why JSDK does not have a method to fetch a single identity from a CA server but have a method to fetch a collection of identities by registrar?
as I can see, fabric ca has an endpoint to fetch an identity by its enrollment id
https://github.com/hyperledger/fabric-ca/blob/release-1.4/swagger/swagger-fabric-ca.json#L2275
mahoney1 (Mon, 18 Mar 2019 19:48:29 GMT):
fyi / heads-up : next Fabric Developer Community call is planned for this Thursday 21st March (5pm UTC - 5pm UK, 12pm ET, 9am PT ) contributions are welcome to the agenda ! More info on the call / latest agenda can be found here ->https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call - cheers Paul
gravity (Tue, 19 Mar 2019 08:13:50 GMT):
hi all
Have anyone tried to update `channel_group.groups.Application.groups.ORG_NAME.values.MSP.value.config.revocation_list` using the java sdk?
The way I've prepared a channel updated is the same compared to this test:
https://github.com/hyperledger/fabric-sdk-java/blob/release-1.4/src/test/java/org/hyperledger/fabric/sdkintegration/UpdateChannelIT.java
but, I've revoked a user with flag `genCRL:true` and put a returned string to the `channel_group.groups.Application.groups.ORG_NAME.values.MSP.value.config.revocation_list`, signed a transaction using the peer admin identity and sent a transactions
I've tried to do so, but getting the error:
```
Caused by: org.hyperledger.fabric.sdk.exception.TransactionException: Channel channel155297569344711552975708888 orderer orderer0 status returned failure code 400 (BAD_REQUEST) during orderer next
at org.hyperledger.fabric.sdk.OrdererClient$1.onNext(OrdererClient.java:182) ~[fabric-sdk-java-1.4.0.jar:na]
at org.hyperledger.fabric.sdk.OrdererClient$1.onNext(OrdererClient.java:174) ~[fabric-sdk-java-1.4.0.jar:na]
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onMessage(ClientCalls.java:421) ~[grpc-stub-1.17.1.jar:1.17.1]
at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33) ~[grpc-core-1.17.1.jar:1.17.1]
at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33) ~[grpc-core-1.17.1.jar:1.17.1]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:519) ~[grpc-core-1.17.1.jar:1.17.1]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.17.1.jar:1.17.1]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) ~[grpc-core-1.17.1.jar:1.17.1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_201]
... 1 common frames omitted
```
also, orderer node says the next:
```
2019-03-19 07:59:59.822 UTC [orderer.common.broadcast] ProcessMessage -> WARN 018 [channel: channel155297569344711552975708888] Rejecting broadcast of config message from 10.130.101.214:50220 because of error: error authorizing update: proto: can't skip unknown wire type 6
```
gravity (Tue, 19 Mar 2019 08:13:50 GMT):
hi all
Have anyone tried to update `channel_group.groups.Application.groups.ORG_NAME.values.MSP.value.config.revocation_list` using the java sdk?
The way I've prepared a channel updated is the same compared to this test:
https://github.com/hyperledger/fabric-sdk-java/blob/release-1.4/src/test/java/org/hyperledger/fabric/sdkintegration/UpdateChannelIT.java
but, I've revoked a user with flag `genCRL:true` and put a returned string to the `channel_group.groups.Application.groups.ORG_NAME.values.MSP.value.config.revocation_list`, signed a transaction using the peer admin identity and sent a transaction
I've tried to do so, but getting the error:
```
Caused by: org.hyperledger.fabric.sdk.exception.TransactionException: Channel channel155297569344711552975708888 orderer orderer0 status returned failure code 400 (BAD_REQUEST) during orderer next
at org.hyperledger.fabric.sdk.OrdererClient$1.onNext(OrdererClient.java:182) ~[fabric-sdk-java-1.4.0.jar:na]
at org.hyperledger.fabric.sdk.OrdererClient$1.onNext(OrdererClient.java:174) ~[fabric-sdk-java-1.4.0.jar:na]
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onMessage(ClientCalls.java:421) ~[grpc-stub-1.17.1.jar:1.17.1]
at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33) ~[grpc-core-1.17.1.jar:1.17.1]
at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33) ~[grpc-core-1.17.1.jar:1.17.1]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:519) ~[grpc-core-1.17.1.jar:1.17.1]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.17.1.jar:1.17.1]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) ~[grpc-core-1.17.1.jar:1.17.1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_201]
... 1 common frames omitted
```
also, orderer node says the next:
```
2019-03-19 07:59:59.822 UTC [orderer.common.broadcast] ProcessMessage -> WARN 018 [channel: channel155297569344711552975708888] Rejecting broadcast of config message from 10.130.101.214:50220 because of error: error authorizing update: proto: can't skip unknown wire type 6
```
rickr (Tue, 19 Mar 2019 12:55:36 GMT):
@anjalinaik Other than probably needing to add the anchorpeers to the configuration I'm not sure of any other requirement.
rickr (Tue, 19 Mar 2019 12:59:46 GMT):
@gravity https://github.com/hyperledger/fabric-sdk-java/blob/aaee816369cf8a5639fef7bd4dd223f355260dd1/src/test/java/org/hyperledger/fabric_ca/sdkintegration/HFCAClientIT.java#L602-L607
gravity (Tue, 19 Mar 2019 13:03:44 GMT):
@rickr
oops, I've missed this integration test at all. thanks
gravity (Tue, 19 Mar 2019 13:04:58 GMT):
@rickr and regarding the question about `revocation_list` update? is it supported by Java SDK?
https://chat.hyperledger.org/channel/fabric-sdk-java?msg=oMK3Brfg4Ab63LBAE
dan13 (Tue, 19 Mar 2019 16:54:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=NqhdukQ42tMNThuJT) @rickr if you have any quick thoughts about this issue (probably some concept I'm missing?) it would be much appreciated!
Antimttr (Tue, 19 Mar 2019 18:09:28 GMT):
In the java sdk's TestConfig.java file there are some default properties that get loaded: ```
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg1.mspid", "Org1MSP");
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg1.domname", "org1.example.com");
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg1.ca_location", "http://" + LOCALHOST + ":7054");
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg1.caName", "ca0");
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg1.peer_locations", "peer0.org1.example.com@grpc://" + LOCALHOST + ":7051, peer1.org1.example.com@grpc://" + LOCALHOST + ":7056");
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg1.orderer_locations", "orderer.example.com@grpc://" + LOCALHOST + ":7050");
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg2.mspid", "Org2MSP");
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg2.domname", "org2.example.com");
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg2.ca_location", "http://" + LOCALHOST + ":8054");
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg2.peer_locations", "peer0.org2.example.com@grpc://" + LOCALHOST + ":8051,peer1.org2.example.com@grpc://" + LOCALHOST + ":8056");
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg2.orderer_locations", "orderer.example.com@grpc://" + LOCALHOST + ":7050");
```
Antimttr (Tue, 19 Mar 2019 18:09:42 GMT):
Which of the configuration artifacts are these defaults replacing?
Antimttr (Tue, 19 Mar 2019 18:10:50 GMT):
the keys set dont seem to quite match any of the artifacts i've found so far, (like docker-compose.yaml, network-config.yaml, orgX.yaml
dan13 (Tue, 19 Mar 2019 18:24:05 GMT):
@Antimttr as I read it it is setting default JSDK network config values (values used to connect from java client to network) regardless of anything else (it's in a finally block)
Antimttr (Tue, 19 Mar 2019 18:24:33 GMT):
well yeah, but it first tries to read it from a file
Antimttr (Tue, 19 Mar 2019 18:24:44 GMT):
i was just wondering what configuration artifact that file corresponds to
Antimttr (Tue, 19 Mar 2019 18:25:29 GMT):
maybe its config.properties
Antimttr (Tue, 19 Mar 2019 18:25:40 GMT):
but this was a bit confusing because that file is totally commented out
Antimttr (Tue, 19 Mar 2019 18:26:30 GMT):
well thats in the Config.java anyways
Antimttr (Tue, 19 Mar 2019 18:26:41 GMT):
in TestConfig it tries to load testutils.properties
Antimttr (Tue, 19 Mar 2019 18:27:19 GMT):
Which doesnt exist in the repo i dled anywhere
Antimttr (Tue, 19 Mar 2019 18:28:15 GMT):
i would think in an actual implementation of the java sdk you'd want to read from actual configuration artifacts
Antimttr (Tue, 19 Mar 2019 18:28:32 GMT):
but the keys dont quite correspond to any of the keys in a real config file
Antimttr (Tue, 19 Mar 2019 18:28:45 GMT):
for instance: `defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg1.ca_location", "http://" + LOCALHOST + ":7054");`
Antimttr (Tue, 19 Mar 2019 18:29:01 GMT):
ca_location i can only find references to in this TestConfig.java file
Antimttr (Tue, 19 Mar 2019 18:29:22 GMT):
doesnt seem to be an actual property from any configuration artifact
Antimttr (Tue, 19 Mar 2019 18:31:07 GMT):
vs something like the *network-config.yaml* file from balance-transfer demo contains keys like: ```
certificateAuthorities:
ca-org1:
url: https://localhost:7054
# the properties specified under this object are passed to the 'http' client verbatim when
# making the request to the Fabric-CA server
httpOptions:
verify: false
tlsCACerts:
path: artifacts/channel/crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem
```
Antimttr (Tue, 19 Mar 2019 18:31:39 GMT):
does ca_location get translated to one of these values at some point?
Antimttr (Tue, 19 Mar 2019 18:31:58 GMT):
the logical one would be url
Antimttr (Tue, 19 Mar 2019 18:32:14 GMT):
but nothing in the sdk docs really indicates that this is the case
Antimttr (Tue, 19 Mar 2019 18:38:41 GMT):
or are these special kinds of configuration files
Antimttr (Tue, 19 Mar 2019 18:38:45 GMT):
that are specific to the java sdk?
Antimttr (Tue, 19 Mar 2019 18:39:03 GMT):
if so can they be extrapolated out of the normal configuration artifacts?
Antimttr (Tue, 19 Mar 2019 18:39:10 GMT):
if they can, is there already a tool to do so?
Antimttr (Tue, 19 Mar 2019 18:46:34 GMT):
like NetworkConfig.java seems to do that for the network-config.yaml
Antimttr (Tue, 19 Mar 2019 19:28:40 GMT):
@rickr SHOULD the java sdk implementation load configuration data from the traditional artifacts or should it implement its own configuration data like the End2EndIT test does?
Antimttr (Tue, 19 Mar 2019 19:29:01 GMT):
to compare I dont really see this behavior in the other SDKs
Antimttr (Tue, 19 Mar 2019 19:29:05 GMT):
seems to be a java thing
Antimttr (Tue, 19 Mar 2019 19:29:24 GMT):
but its not clear why the difference exists
Antimttr (Tue, 19 Mar 2019 19:55:28 GMT):
https://github.com/IBM/blockchain-application-using-fabric-java-sdk
Antimttr (Tue, 19 Mar 2019 19:55:37 GMT):
hadnt seen this yet
Antimttr (Tue, 19 Mar 2019 19:55:53 GMT):
its for an old version but atleast it gives clues on how to implement the client from the sdk
rickr (Tue, 19 Mar 2019 21:33:34 GMT):
@dan13 Not sure but what version are you using of the SDK and Eventbubs are no longer supported
rickr (Tue, 19 Mar 2019 21:41:18 GMT):
@Antimttr none of the Sample or TestConfig are part of the SDK.
https://github.com/cr22rc/fabricSDKJavaMultiDomainSample/blob/master/src/main/java/org/cr22rc/MultiDomainSample.java
that's old but maybe it can help you.
The `network-config.yaml` and NetworkConfigIT sample does the reconstructinon of the channel and CA as defined by that file.
SatheeshNehru (Wed, 20 Mar 2019 06:08:26 GMT):
can someone explain about system chaincode?
what it does?and why its needed?can someone explain about system chaincode?
what it does?and why its needed?
mahoney1 (Wed, 20 Mar 2019 09:23:30 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=WjM8octTLTRtqv9Ps) @SatheeshNehru the answers here -> https://stackoverflow.com/questions/47134059/what-is-system-chaincode-in-fabric and the official doc links should explain it for you
AndresMartinezMelgar.itcl (Wed, 20 Mar 2019 10:35:32 GMT):
Hi anyone knows an example of java sdk which it is implemented on kubernetes? i only found https://github.com/IBM/blockchain-application-using-fabric-java-sdk and it doesnt work for me ):
dan13 (Wed, 20 Mar 2019 14:41:50 GMT):
@rickr Sorry - HLF 1.2 (IBP Starter -- not the new v2 beta), and registration occurs via:
String eventListenerHandle = channel.registerChaincodeEventListener(Pattern.compile(".*"), Pattern.compile(Pattern.quote(eventName)), chaincodeEventListener);
This is the new way of registering, correct?
rickr (Wed, 20 Mar 2019 15:07:33 GMT):
@dan13 Not really sure there are cases where the peer eventing service reconnects (due to network issue or peer start/stops) that it could get the block again and this would happen.
rickr (Wed, 20 Mar 2019 15:08:40 GMT):
The peer = null is really odd. You could enable the SDK trace that may give some more insight ( what version of the sdk ? )
dan13 (Wed, 20 Mar 2019 15:37:43 GMT):
@rickr Thanks. fabric-sdk-java version is 1.2.1. Even after a couple days, restarting the client app resulted in the same repeated events (both block and chaincode) ad infinitum for the last block on the ledger. Theoretically any listener app needs duplicate rejection anyway if it has multiple peer event sources for the same channel (if I understand correctly).
rickr (Wed, 20 Mar 2019 15:46:03 GMT):
so old ? anyway I may want to take a look at an SDK log of that if were convenient to capture than https://ctrlv.it/ paste there
rickr (Wed, 20 Mar 2019 15:46:03 GMT):
so old ? anyway I may want to take a look at an SDK log of that if were convenient to capture then paste here: https://ctrlv.it/
dan13 (Wed, 20 Mar 2019 16:30:14 GMT):
@rickr https://ctrlv.it/id/168656/1503245437 -- I'm guessing this is the log of the cause? What is root cause, if known for this error?
"TRACE PeerEventServiceClient - Received error on peer eventing service on channel defaultchannel, peer org1-peer1, url grpcs://nfa574e3a3dd840e899b4acfffec2ba37-org1-peer1.us07.blockchain.ibm.com:31002, attempts 0. UNAVAILABLE: HTTP/2 error code: NO_ERROR
Received Rst Stream"
rickr (Wed, 20 Mar 2019 16:50:06 GMT):
Yeah we just faithfully reprocess the block. You'd need to probably look at the peer logs see if something is going on there.
Given it's probably behind a proxy (IBM BC) you may want to add this if you haven't done so ->
https://github.com/hyperledger/fabric-sdk-java/tree/aaee816369cf8a5639fef7bd4dd223f355260dd1#firewalls-load-balancers-network-proxies
dan13 (Wed, 20 Mar 2019 17:15:03 GMT):
thanks @rickr - much appreciated! you guys should have a tip jar :D
sgaddam (Wed, 20 Mar 2019 17:56:35 GMT):
Has joined the channel.
seanli (Thu, 21 Mar 2019 09:16:09 GMT):
Has joined the channel.
mahoney1 (Thu, 21 Mar 2019 13:08:19 GMT):
FYI - reminder that Fabric Developer Community call is today (in 90mins) at 5pm UTC (5pm UK, 12pm ET, 9am PT) Meeting Id: https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
mahoney1 (Thu, 21 Mar 2019 13:08:19 GMT):
FYI - reminder that Fabric Developer Community call is today at 5pm UTC (5pm UK, 12pm ET, 9am PT) Meeting Id: https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
mahoney1 (Thu, 21 Mar 2019 17:00:52 GMT):
https://zoom.us/my/hyperledger.community
mahoney1 (Thu, 21 Mar 2019 17:00:52 GMT):
Community call starting shortly https://zoom.us/my/hyperledger.community
mahoney1 (Thu, 21 Mar 2019 18:29:43 GMT):
hi everyone, today's Fabric Developer Community call recording (mp4) is available here -> https://wiki.hyperledger.org/display/fabric/Community-Call-Recordings (file: 2019-0321-fabricdevcommunitycall.zip)
mahoney1 (Thu, 21 Mar 2019 18:29:43 GMT):
hi everyone, today's Fabric Developer Community call recording (mp4) is available here -> https://wiki.hyperledger.org/display/fabric/Community-Call-Recordings (zipfile is 2019-0321-fabricdevcommunitycall)
Antimttr (Fri, 22 Mar 2019 18:56:46 GMT):
```
#
# The client section is SDK-specific. The sample below is for the node.js SDK
#
client:
# Which organization does this application instance belong to? The value must be the name of an org
# defined under "organizations"
organization: Org1
```
Antimttr (Fri, 22 Mar 2019 18:56:58 GMT):
So this is from balance transfer configuration artifacts
Antimttr (Fri, 22 Mar 2019 18:57:30 GMT):
this is the org1.yaml network connection profile, my question is, are there any examples of the java-sdk specific network connection profile?
Antimttr (Fri, 22 Mar 2019 18:58:37 GMT):
ive looked in fabric-samples but it seems completely devoid of any java-sdk content
Antimttr (Fri, 22 Mar 2019 19:29:09 GMT):
https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/fixture/sdkintegration/e2e-2Orgs/v1.3/configtx.yaml
Antimttr (Fri, 22 Mar 2019 19:29:11 GMT):
found this
Antimttr (Fri, 22 Mar 2019 19:29:36 GMT):
but no client section
Antimttr (Fri, 22 Mar 2019 19:41:44 GMT):
From the file i linked above: ```
# SampleOrg defines an MSP using the sampleconfig. It should never be used
# in production but may be used as a template for other definitions
- &OrdererOrg
```
Antimttr (Fri, 22 Mar 2019 19:41:56 GMT):
anyone know the significance of the & in that value?
Antimttr (Fri, 22 Mar 2019 19:42:06 GMT):
couldnt find anything about it in the yaml syntax docs
Antimttr (Fri, 22 Mar 2019 21:02:36 GMT):
https://medium.com/@kinghuang/docker-compose-anchors-aliases-extensions-a1e4105d70bd
Antimttr (Fri, 22 Mar 2019 21:02:38 GMT):
found it!
Antimttr (Fri, 22 Mar 2019 21:49:44 GMT):
Anyone know what file this is reffering to? ```
# SampleOrg defines an MSP using the sampleconfig. It should never be used
# in production but may be used as a template for other definitions
```
Antimttr (Fri, 22 Mar 2019 22:02:58 GMT):
Is there a reason netowrk connection profiles aren't part of the java sdk configuration artifacts?
Antimttr (Fri, 22 Mar 2019 22:03:12 GMT):
does teh java sdk not support network connection profiles?
Antimttr (Fri, 22 Mar 2019 22:05:32 GMT):
nm i foudn em
LucaPerico (Sun, 24 Mar 2019 13:09:15 GMT):
Has joined the channel.
gravity (Mon, 25 Mar 2019 13:56:06 GMT):
Hi all
Has anyone customized CSR fields (ST, O, OU) for fabric-ca? is it necessary or is everything is up to business needs?
SandySun2000 (Tue, 26 Mar 2019 00:44:26 GMT):
2019-03-01 22:29:57.989 [INFO ] [,,,] [pool-33-thread-1] com.caligo.shili.hl.listener.tasks.HyperLedgerEventListener.received (HyperLedgerEventListener.java:73) - HyperLedgerEventListener blockNumber:8035, c.event:CompoundEvent, c.payload:{"eventData":{"CampaignPublishedEvent":[{"ownerId":"owner","campaignId":"5c7a22e45866545f3c3f0391","ripCode":"YOUTE","retailerGroupId":"1","retailerProfileId":"2","retailerCode":"00101"}],"PromotionCreatedEvent":[{"promotionId":"5c7a22e35866545f3c3f0390","ownerId":"owner","newState":0}]}}, c.txid:8041ea5f181aa16f21351f5c616c2c681f4231c02cc75ac1cc9bdaf96a1f9987
2019-03-01 22:29:57.989 [DEBUG] [,,,] [pool-30-thread-1] org.hyperledger.fabric.sdk.Channel.fire (Channel.java:5630) - Completing future as exception for channel caligo and transaction id: 8041ea5f181aa16f21351f5c616c2c681f4231c02cc75ac1cc9bdaf96a1f9987, validation code: 0A
SandySun2000 (Tue, 26 Mar 2019 00:45:31 GMT):
@rickr Can we confirm that blockNumber 8035 was committed? What does Validation code:0A mean? successfully?
rickr (Tue, 26 Mar 2019 11:52:06 GMT):
@SandySun2000 https://github.com/hyperledger/fabric/blob/dce0e5d8e7bbce5315d0895e5d1460640700285b/protos/peer/transaction.proto#L126
SandySun2000 (Tue, 26 Mar 2019 17:02:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=CevZkKXzETPaHLALz) @rickr Thanks Rick!
SandySun2000 (Tue, 26 Mar 2019 17:38:11 GMT):
@rickr in order to solve the issue, how can we tell which endorsement policy that it violated ? What's rule that you are checking? which log that I need to look to figure out what was causing 0A?
gravity (Tue, 26 Mar 2019 17:40:12 GMT):
Hi all
Has anyone achieved some good throughput like 500-700 tps?
I mean, using the java sdk to send transactions to a network
my current setup has only 80 tps, but the environment where fabric is running is really poor
rickr (Tue, 26 Mar 2019 17:45:49 GMT):
@SandySun2000 when the CC is instantiated you specify an endorsement policy
SandySun2000 (Tue, 26 Mar 2019 17:47:09 GMT):
@rickr Do you have a sample code for me to follow?
rickr (Tue, 26 Mar 2019 18:35:42 GMT):
Samples in the integration tests
rickr (Tue, 26 Mar 2019 18:45:36 GMT):
The default is any Org can sign is sufficient. There's one caviet, If an org is later added it
rickr (Tue, 26 Mar 2019 18:45:36 GMT):
The default is any Org can sign is sufficient. There's one caviet, If an org is later added it's endorsement won't count till the CC si updated :(
SandySun2000 (Tue, 26 Mar 2019 18:48:23 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=d7ozyfL99fEPZcxYY) @rickr cool. got it. Thanks!
sandy (Wed, 27 Mar 2019 01:52:13 GMT):
@rickr
Is it possible to update the level state DB of a particular peer without chaincode endorsements ?
SatheeshNehru (Wed, 27 Mar 2019 05:25:37 GMT):
in what possible ways the data in hyperledger fabirc can be changed
what i mean is why there is need for endorsement??
rickr (Wed, 27 Mar 2019 08:19:39 GMT):
@sandy @SatheeshNehru ask on #fabric-questions
Antimttr (Wed, 27 Mar 2019 14:39:46 GMT):
@rickr hey rickr, i'm trying to talk to my CA server through the HFCAClient, the ca server is part of the balance transfer sample network. in the network-config.yaml theres an option being set: ```
httpOptions:
verify: false
```
Antimttr (Wed, 27 Mar 2019 14:40:16 GMT):
how can i apply this option to the java sdk's HFCAClient? Right now im getting an error that the host name doesnt match the certificate name
Antimttr (Wed, 27 Mar 2019 14:40:23 GMT):
i'm assuming this option is what disables that check
Antimttr (Wed, 27 Mar 2019 14:40:45 GMT):
but im unsure about where to apply the setting, should it go into the properties that i pass into the contructor fo the hfcaclient?
Antimttr (Wed, 27 Mar 2019 14:41:29 GMT):
this is the error being thrown by the sdk: ```
org.hyperledger.fabric_ca.sdk.exception.InfoException: Url:https://localhost:7054, Failed to get info
at org.hyperledger.fabric_ca.sdk.HFCAClient.info(HFCAClient.java:591)
at com.mctlive.mcthlf.Main.main(Main.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.net.ssl.SSLPeerUnverifiedException: Certificate for
Antimttr (Wed, 27 Mar 2019 16:18:36 GMT):
i think i found it: `properties.setProperty("allowAllHostNames", "true"); //testing environment only NOT FOR PRODUCTION!`
Antimttr (Wed, 27 Mar 2019 16:18:44 GMT):
that was in testconfig.java for reference
chill37 (Thu, 28 Mar 2019 00:52:30 GMT):
When sending a transaction, I see that there are options to select specific orderers.
Does it make it more efficient(and maybe faster) to specify specific orderers when we are using multiple orderers/kafka/zookeeper?
I thought kafka/zookeeper would do all the even distribution.
MHBauer (Thu, 28 Mar 2019 03:28:01 GMT):
Has left the channel.
rickr (Thu, 28 Mar 2019 12:40:48 GMT):
Allowing you to defined multiple orderers just lets the SDK provide mostly a simple fail over if one can't be connected. There is a _simplistic_ balancing by just picking a random one to start with. However the application should be allowed to select which orderer it really wants.
gravity (Thu, 28 Mar 2019 13:14:22 GMT):
Hi all
is it recommended way to have peers that joined multiple channels and serve requests for them?
gravity (Thu, 28 Mar 2019 13:14:40 GMT):
or is it better to have separate peers for every channel?
rickr (Thu, 28 Mar 2019 13:32:27 GMT):
Today you can only attach peers, orderers to one channel
rickr (Thu, 28 Mar 2019 13:32:27 GMT):
Today you can only attach sdk peers, orderers instances to one channel
aatkddny (Thu, 28 Mar 2019 14:34:55 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ZEkq2RWBqfsqdo8fd) Unless I completely misunderstood the question, you can attach peers to multiple channels for sure - we do it since we have a lot of channels - but you need a different channel object for each.
Caching the HFClient and the Channel objects speeds the whole process up significantly.
Of course you still have to read each channel separately, but you'd expect that from the way channels are implemented.
aatkddny (Thu, 28 Mar 2019 14:38:13 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=DXbjs6yLbG64NAK8b) You need to adjust the block cut rate and maximum message count in config.tx first.
When you tune that to your liking you'll hit the issue with threading that netty has and that'll limit you. We started failing in triple digits /s iirc, but our tx rate for the one project we care about is significantly lower. I'll search for the post about the threading issue in a minute or two. It's back in here last year somewhere
aatkddny (Thu, 28 Mar 2019 14:38:13 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=DXbjs6yLbG64NAK8b) You need to adjust the block cut rate and maximum message count in config.tx first.
When you tune that to your liking you'll hit the issue with threading that netty has and that'll limit you. We started failing in triple digits /s iirc, but our tx rate for the one project we care about is significantly lower. I'll search for the post about the threading issue in a minute or two. It's back in here last year somewhere - edit: https://jira.hyperledger.org/browse/FAB-10604
chill37 (Fri, 29 Mar 2019 04:39:57 GMT):
@rickr Thanks for the answer...I do have one more Q....
Is it possible to have the 2 responses of response.getChaincodeActionResponsePayload() same but get SDKUtil.getProposalConsistencySets != 1??
Few times, I do get this error and the Chaincode does not take any time-related input.
I thought since SDKUtil.getProposalConsistencySets() check for proposalResponse.getPayload(), it could be different from getChaincodeActionResponsePayload(). But I'm not really sure how that could be the case.
Could you give a hint?
SatheeshNehru (Fri, 29 Mar 2019 06:38:02 GMT):
is it possible to install two chaincode with same ID on different peers
SatheeshNehru (Fri, 29 Mar 2019 06:38:02 GMT):
is it possible to install two different chaincode with same ID on different peers
anjalinaik (Fri, 29 Mar 2019 07:09:31 GMT):
Hi All. In Golang chaincode can we manipulate the query string to have conditions such as `> || <` in `stub.GetQueryResult`. If so, can you please provide me an example.
rickr (Fri, 29 Mar 2019 12:56:04 GMT):
@anjalinaik best asked on #fabric-chaincode-dev
rickr (Fri, 29 Mar 2019 12:56:50 GMT):
consistency set is more than the payload but also read/write set
rickr (Fri, 29 Mar 2019 12:56:50 GMT):
@chill37 consistency set is more than the payload but also read/write set
smallant (Fri, 29 Mar 2019 15:06:24 GMT):
Hi to all.
Currently have a small network in one machine. We were doing some tests and got this error:
GET_STATE failed: transaction ID: 6d7fac50d4c921a98e604b0c1fe2b7b964b91d00471fe67bf81464de86be99ad: Get http://peer2-org1-CouchDB:5984/BC_lscc/BC?attachments=true: dial tcp: lookup peer2-org1-CouchDB on 127.0.0.11:53: dial udp 127.0.0.11:53: socket: too many open files.
We are making the calls trough java sdk and the network is 1.4
rickr (Fri, 29 Mar 2019 15:12:36 GMT):
Looks to be a peer error maybe they seen it on #fabric-peer-endorser-committer
adamhardie (Fri, 29 Mar 2019 15:15:13 GMT):
hello -
any idea what would cause this when committing a transaction ?
DEBUG | 2019-03-29 18:49:52.198 | earer_send | g.h.n.HyperLedgerNodeImpl | commitMessage : channel[messagebus] has successfully endorsed message id[8bfd7412-47f2-43a5-b4d4-3c7c2b4e7e72]; atempting commit
ERROR | 2019-03-29 18:49:52.216 | executor-1 | o.h.f.s.OrdererClient | org.hyperledger.fabric.sdk.OrdererClient$1@7c7c454e managed channel isTerminated: false, isShutdown: false, state: IDLE
ERROR | 2019-03-29 18:49:52.217 | executor-1 | o.h.f.s.OrdererClient | Received error on channel messagebus, orderer orderer.gmex-group, url grpc://10.186.182.165:7050, UNAVAILABLE: io exception
io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
at io.grpc.Status.asRuntimeException(Status.java:526)
adamhardie (Fri, 29 Mar 2019 15:15:13 GMT):
hello -
any idea what would cause this when committing a transaction ?
DEBUG | 2019-03-29 18:49:52.198 | earer_send | g.h.n.HyperLedgerNodeImpl | commitMessage : channel[messagebus] has successfully endorsed message id[8bfd7412-47f2-43a5-b4d4-3c7c2b4e7e72]; atempting commit
ERROR | 2019-03-29 18:49:52.216 | executor-1 | o.h.f.s.OrdererClient | org.hyperledger.fabric.sdk.OrdererClient$1@7c7c454e managed channel isTerminated: false, isShutdown: false, state: IDLE
ERROR | 2019-03-29 18:49:52.217 | executor-1 | o.h.f.s.OrdererClient | Received error on channel messagebus, orderer orderer.group, url grpc://10.186.182.165:7050, UNAVAILABLE: io exception
io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
at io.grpc.Status.asRuntimeException(Status.java:526)
adamhardie (Fri, 29 Mar 2019 15:15:13 GMT):
hello -
any idea what would cause this when committing a transaction ?
DEBUG | 2019-03-29 18:49:52.198 | earer_send | g.h.n.HyperLedgerNodeImpl | commitMessage : channel[messagebus] has successfully endorsed message id[8bfd7412-47f2-43a5-b4d4-3c7c2b4e7e72]; atempting commit
ERROR | 2019-03-29 18:49:52.216 | executor-1 | o.h.f.s.OrdererClient | org.hyperledger.fabric.sdk.OrdererClient$1@7c7c454e managed channel isTerminated: false, isShutdown: false, state: IDLE
ERROR | 2019-03-29 18:49:52.217 | executor-1 | o.h.f.s.OrdererClient | Received error on channel messagebus, orderer orderer.group, url grpc://10.x.x.x:7050, UNAVAILABLE: io exception
io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
at io.grpc.Status.asRuntimeException(Status.java:526)
adamhardie (Fri, 29 Mar 2019 15:20:13 GMT):
further down i see :mountain_bicyclist_tone3:
ERROR | 2019-03-29 18:49:52.261 | earer_send | o.h.f.s.OrdererClient | grpc status Code:io exception, Description UNAVAILABLE,
java.io.IOException: Connection reset by peer
adamhardie (Fri, 29 Mar 2019 15:20:13 GMT):
further down i see :
ERROR | 2019-03-29 18:49:52.261 | earer_send | o.h.f.s.OrdererClient | grpc status Code:io exception, Description UNAVAILABLE,
java.io.IOException: Connection reset by peer
smallant (Fri, 29 Mar 2019 15:22:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=DKNJpEpdGM4aPvz8X) @rickr thank you
rickr (Fri, 29 Mar 2019 15:40:59 GMT):
I assume the 'x.x.x' is just your editing in the url :) Was there anything in the orderer logs? Would need to take that to #fabric-orderer
gravity (Fri, 29 Mar 2019 15:47:00 GMT):
@rickr @aatkddny the original question was the next: is it recommended to have peers that serve requests only for a specific channel (peer0 and peer1 join channel0 and peer2 and peer3 join channel1)? or should it be better to join all peers(peer0, peer1, peer2, peer3) to all channels (channel0, channel1) and these peers will be serving requests for these channels?
and there is one more question: if I have four peers (peer0-3) that are joined to channels multiple channels (channel0, channel1), these peers have the same chaincode installed (with the same version) and this chaincode is instantiated on both channels (channel0, channel1), will this setup work without any conflicts between chaincodes on these channels?
adamhardie (Fri, 29 Mar 2019 15:49:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=EKeKFK4w2M6t7xDyr) @rickr haha yeah :) it seemed to work at first, now its fallen over. ill move to the other channel , thanks
aatkddny (Fri, 29 Mar 2019 20:27:02 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=HvtY4qarwKYLqCD6j) Q1 - doesn't it depend on the endorsement policy, and whether the peers need access to the data on the channel.
We for example have a bunch of contracts between pairs of orgs that must remain private only to that pair, so (say) Org1 and Org2 are parties on one channel and Org2 and Org 3 on another. Org 2 can see everything, Orgs1 and 3 can only see "their" data. Yes you can do that with a permissioned channel, but not if you can't allow Org 1 to know that Org3 is also transacting with Org2.
Q2 - it works fine. Or it does for at least as far as we tested it (multiple 10's of channels in a peer). The one caveat is that we always upgrade everything at once. Rolling updates haven't been tested.
aatkddny (Fri, 29 Mar 2019 20:27:02 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=HvtY4qarwKYLqCD6j) Q1 - doesn't it depend on the endorsement policy, and whether the peers need access to the data on the channel.
We for example have a bunch of contracts between pairs of orgs that must remain private only to that pair, so (say) Org1 and Org2 are parties on one channel and Org2 and Org 3 on another. Org 2 can see everything, Orgs1 and 3 can only see "their" data. Yes you can do that with a permissioned channel, but not if you can't allow Org 1 to know that Org3 is also transacting with Org2. Your use case should determine who connects where.
Q2 - it works fine. Or it does for at least as far as we tested it (multiple 10's of channels in a peer). The one caveat is that we always upgrade everything at once. Rolling updates haven't been tested.
AlexTotheroh (Fri, 29 Mar 2019 22:43:48 GMT):
Has joined the channel.
AlexTotheroh (Fri, 29 Mar 2019 22:44:32 GMT):
It looks like there's no way to healthcheck peers/orderers through the SDK? Is that accurate?
AlexTotheroh (Fri, 29 Mar 2019 22:50:57 GMT):
see https://hyperledger-fabric.readthedocs.io/en/release-1.4/operations_service.html
aatkddny (Fri, 29 Mar 2019 22:51:54 GMT):
It's a simple rest call. Seems overkill to fold it into the SDK, no?
AlexTotheroh (Fri, 29 Mar 2019 22:54:46 GMT):
maybe, seems nice to be able to do: `peer.checkHealth()`
AlexTotheroh (Fri, 29 Mar 2019 23:04:48 GMT):
Actually, sorry, what I'm really after is a check on the grpc connection, which the linked healthcheck above doesn't appear to be
AlexTotheroh (Fri, 29 Mar 2019 23:04:55 GMT):
Something like this from the Node SDK: https://jira.hyperledger.org/projects/FABN/issues/FABN-597?filter=allopenissues
AlexTotheroh (Fri, 29 Mar 2019 23:04:55 GMT):
Something like this from the Node SDK JIRA archive: https://jira.hyperledger.org/projects/FABN/issues/FABN-597?filter=allopenissues
aatkddny (Fri, 29 Mar 2019 23:32:35 GMT):
those you can get from prometheus without too much angst i think. there's a bunch of "grpc_" stuff in there.
gravity (Sat, 30 Mar 2019 09:10:27 GMT):
@aatkddny how many peers do you have per channel?
aatkddny (Sat, 30 Mar 2019 14:07:33 GMT):
averages at 6 per channel.
lupass93 (Mon, 01 Apr 2019 13:36:31 GMT):
Hello at All!
I have one question to ask.
I have a blockchain network fabric 1.4 customized with 3 Peer in one Organization with 3 CouchDB and 1 CA( MSP).
I have a Java SDK Client to connenct to blockchain network and invoke, query a chaincode and register and enroll new user.
But when I Connect with Admin Peer User, all query and invoke it works properly.
But when I Connect with a new User, registered and enrolled, I can't to do a Query Or Invoke because I have this message error:
lupass93 (Mon, 01 Apr 2019 13:36:43 GMT):
Peer0 docker logs is this : https://pastebin.com/eA0RUfLp
lupass93 (Mon, 01 Apr 2019 13:37:43 GMT):
Java Log Console Error: https://pastebin.com/dm7b21EB
lupass93 (Mon, 01 Apr 2019 13:42:25 GMT):
CA logs when register and enroll new User : https://pastebin.com/pU0dxUby
lupass93 (Mon, 01 Apr 2019 13:43:17 GMT):
Thank you very much!
sandy (Mon, 01 Apr 2019 14:52:56 GMT):
https://hyperledger-fabric.readthedocs.io/en/latest/network/network.html#adding-network-administrators . I have red this.. Here they are saying that one organisation can give admin permission to other. Am not able to understand it. What is network administrator?
aatkddny (Mon, 01 Apr 2019 15:00:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=yApAhYj3REJwknnmH) Your CA says you enrolled lucaclient. Your peer says Admin@Quid. Are you sure you are passing the right cert?
lupass93 (Mon, 01 Apr 2019 15:09:09 GMT):
I pass to HFCLient the User lucaclient and then invoke the chaincode
lupass93 (Mon, 01 Apr 2019 15:09:34 GMT):
If I pass AdminPeer it works properly
lupass93 (Mon, 01 Apr 2019 15:09:45 GMT):
If I pass lucaclient don't works
sandy (Mon, 01 Apr 2019 15:25:50 GMT):
is it possible to create network administrator without hyperledger composer?
xiaoningdev (Mon, 01 Apr 2019 15:34:10 GMT):
Has joined the channel.
gravity (Mon, 01 Apr 2019 18:09:58 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=eojhbHw62NDJktvck) @aatkddny there is no need in caching channel objects. once it's initialized using HFClient, the latter holds a reference to a channel in a hashmap. the same is for HFClient - as long as a single instance of HFClient is enough, it can be created during application startup and reuse this object for every transaction by setting a user context directly to a transaction context. @rickr please correct me if I'm wrong
gravity (Mon, 01 Apr 2019 18:16:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=hwZzxo92pTuwmA3b8) @aatkddny I have not met these errors and messages. my application has really low TPS, like, 100-175, but cpu consumption for app is near the 40%. also, every peer runs on a k8s node with 8 vCPU and 16 GB ram, resource utilization is varying from 15% to 30%. and during the load testing, avg response time is 5 sec for transactions. every transaction is processed synchronously by calling `join` on a transactions future. also, I've tried asynchronous processing, but tps remains on the same level. any advice on how to improve tps would be helpful
aatkddny (Mon, 01 Apr 2019 18:33:36 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=9npKHrKXP5mM2iBw5) When I said cache I meant per client (org). We have a bunch of them. We keep a map of client information in a cache - including an hfclient and the networkconfig for each.
aatkddny (Mon, 01 Apr 2019 18:36:52 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rw4o4bG8M8i4R97Dn) Your turnaround time is based on the block cut rate.
These 3 values in config.tx can be used to tune it. Reduce batch timeout and increase batch size.
```
# Batch Timeout: The amount of time to wait before creating a batch.
BatchTimeout: 2s
# Batch Size: Controls the number of messages batched into a block.
# The orderer views messages opaquely, but typically, messages may
# be considered to be Fabric transactions. The 'batch' is the group
# of messages in the 'data' field of the block. Blocks will be a few kb
# larger than the batch size, when signatures, hashes, and other metadata
# is applied.
BatchSize:
# Max Message Count: The maximum number of messages to permit in a
# batch. No block will contain more than this number of messages.
MaxMessageCount: 10
# Absolute Max Bytes: The absolute maximum number of bytes allowed for
# the serialized messages in a batch. The maximum block size is this value
# plus the size of the associated metadata (usually a few KB depending
# upon the size of the signing identities). Any transaction larger than
# this value will be rejected by ordering. If the "kafka" OrdererType is
# selected, set 'message.max.bytes' and 'replica.fetch.max.bytes' on
# the Kafka brokers to a value that is larger than this one.
AbsoluteMaxBytes: 10 MB
# Preferred Max Bytes: The preferred maximum number of bytes allowed
# for the serialized messages in a batch. Roughly, this field may be considered
# the best effort maximum size of a batch. A batch will fill with messages
# until this size is reached (or the max message count, or batch timeout is
# exceeded). If adding a new message to the batch would cause the batch to
# exceed the preferred max bytes, then the current batch is closed and written
# to a block, and a new batch containing the new message is created. If a
# message larger than the preferred max bytes is received, then its batch
# will contain only that message. Because messages may be larger than
# preferred max bytes (up to AbsoluteMaxBytes), some batches may exceed
# the preferred max bytes, but will always contain exactly one transaction.
PreferredMaxBytes: 512 KB
```
aatkddny (Mon, 01 Apr 2019 18:36:52 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=rw4o4bG8M8i4R97Dn) Your turnaround time is based on the block cut rate.
These 2 values in config.tx can be used to tune it. Reduce batch timeout and increase batch size - max message count.
```
# Batch Timeout: The amount of time to wait before creating a batch.
BatchTimeout: 2s
# Batch Size: Controls the number of messages batched into a block.
# The orderer views messages opaquely, but typically, messages may
# be considered to be Fabric transactions. The 'batch' is the group
# of messages in the 'data' field of the block. Blocks will be a few kb
# larger than the batch size, when signatures, hashes, and other metadata
# is applied.
BatchSize:
# Max Message Count: The maximum number of messages to permit in a
# batch. No block will contain more than this number of messages.
MaxMessageCount: 10
```
gravity (Mon, 01 Apr 2019 19:26:16 GMT):
@aatkddny I've tried to set timeout to 1s and diferent values(30, 50, 100, 250, 300) for max-message-count, but it did not help. the higher batchsize, the lower throughput. for testing purposes I've used JMeter with 50, 75, 100, 120 threads and Constant Throughput Timer was set to 1000 tps. the resulting tps was as I said 100-170 TPS. trandactions were sent to a single channel that has 4 peers (two of them are endorsers), all peers from the same org. the endorsement polucy is `OR("ORG1.peer")`
sandy (Tue, 02 Apr 2019 07:17:04 GMT):
hi.. As all the peers of the same channel has same ledger why we are getting endorsements from all the peers ?
Is there any possibility of ledgers in the different peers of the same channel to be different?
gravity (Tue, 02 Apr 2019 07:43:59 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=jr9n9SkHf59jqoRDr) @sandy for example, you can change the data in peers world state database and in this case your peers can have different data sets, hence endorsement can fail
sandy (Tue, 02 Apr 2019 07:47:05 GMT):
@gravity why would someone changes the data in their peer? is there any use case to modify the peer data?
dave.enyeart (Tue, 02 Apr 2019 10:49:46 GMT):
No, there is no use case to modify peer data, if you do so you are essentially corrupting your own peer. Endorsements of that data on the peer will fail and the other members of the channel may ostracize you.
dan13 (Tue, 02 Apr 2019 14:14:22 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Djaf8M6WGra72M2g6) @aatkddny Can you clarify? Does this mean that your single client app/service makes calls on behalf of multiple Orgs, and that the method by which you are doing that is to have a singular HFClient per Org within the app (e.g., a shared Map
aatkddny (Tue, 02 Apr 2019 14:24:15 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=PetDnoShZLSNnYTej) @dan13 Yes. Multiple orgs. One HFClient per org (per calling instance). We swap in the actual user or admin as required into the user context to make the calls.
aatkddny (Tue, 02 Apr 2019 14:24:15 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=PetDnoShZLSNnYTej) @dan13 Yes. Multiple orgs. One HFClient per org (per calling instance). We swap in the actual user or admin as required into the user context to make the calls. We don't have enough volume to worry about collisions - iirc it's thread safe after dispatch, so it's mostly in our app.
gravity (Tue, 02 Apr 2019 14:34:03 GMT):
@aatkddny Hi
How do initialize channel? From what I see, HFClient should have user context to initialize a channel correctly. But in this case the user context must be set directly to the HFClient and this makes it hard to reuse
dan13 (Tue, 02 Apr 2019 14:41:18 GMT):
@aatkddny Thank you! Can you explain "We don't have enough volume to worry about collisions - iirc it's thread safe after dispatch, so it's mostly in our app" -- where would those collisions possibly occur? I assume you build a TransactionProposalRequest applying the request-specific user context using setUserContext() and then use the matching HFClient/Channel to send the proposal and then transaction. All of that should be completely safe, right? @gravity I was told here earlier that there is no problem initializing HFClient with user A from Org 1 and then transacting with different users from Org 1 (by setting on proposal) -- is your experience different?
gravity (Tue, 02 Apr 2019 14:49:03 GMT):
@dan13 actually I do the same but was wondering whether I missed smth or not
dan13 (Tue, 02 Apr 2019 14:53:19 GMT):
@gravity same boat different ocean :D
gravity (Tue, 02 Apr 2019 17:17:14 GMT):
@dan13 how do you process transactions futures - synchronously(by calling `get()` or `join()` on future) or asynchronously(`thenApply()` or `thenAccept`)?
gravity (Tue, 02 Apr 2019 17:17:14 GMT):
@dan13 how do you process transactions futures - synchronously(by calling `get()` or `join()` on future) or asynchronously(`thenApply()` or `thenAccept()`)?
dan13 (Tue, 02 Apr 2019 17:51:37 GMT):
@gravity sync (get) at the moment. are you using async, and if so, did you switch from sync?
aatkddny (Tue, 02 Apr 2019 18:22:38 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=mxZvaKQ73GBHMGKgw) HFClient isn't synchronized in our app. We could (in theory) get something that overwrites the user context if we had two in flight transactions before it was sent to sdk.
Antimttr (Tue, 02 Apr 2019 18:53:17 GMT):
is there a specific place to report bugs in the java sdk?
Antimttr (Tue, 02 Apr 2019 19:31:02 GMT):
Is there a way to store enrollment information in a db and reconstitute it into an Enrollment object?
gravity (Tue, 02 Apr 2019 20:20:08 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=dGRnQTJzgvJu9m6kW) @dan13 well, I'm going to. what I see now in our app, synchronous way of transaction processing holds a lot of resources while waiting for the future to complete. for example, if I receive a request from the front end to issue a transaction for a particular user, I should fetch an enrollment object from the database for this user, then send send a proposal, send a transaction and wait for it to complete. and if if I understand correctly, all these actions happen in the same thread. also, as long as we send a request to a database from this thread, the latter can hold a thread (taken from the db connection pool). that means that a db thread is also blocked by synchronous call to `get()` or `join()` and you have have high transaction arrival rate, the db connection pool will be exhausted and a connection to a database will be lost. that is my observation. please correct me if I'm wrong
Antimttr (Tue, 02 Apr 2019 20:35:52 GMT):
@Antimttr was able to generate the enrollment object by using a pem->Keypair function i found on SO: ```
public static KeyPair keyToValue(String pkcs8key) {
Reader rdr = new StringReader(pkcs8key);
KeyPair pair = null;
try {
Object parsed = new org.bouncycastle.openssl.PEMParser(rdr).readObject();
pair = new org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter().getKeyPair((org.bouncycastle.openssl.PEMKeyPair) parsed);
} catch(Exception e) {
System.out.println("ERROR: Unable to generate enrollment: " + e.getMessage());
e.printStackTrace();
return null;
}
return pair;
}
}
```
dan13 (Tue, 02 Apr 2019 20:43:15 GMT):
@gravity I see. Yes, you would not want to tie db thread to the longer-lived ledger-interacting thread.
tzejan (Wed, 03 Apr 2019 03:29:47 GMT):
Has joined the channel.
gravity (Wed, 03 Apr 2019 06:36:17 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Rq3iJjLJkBppsfYLL) @Antimttr you can serialize this object using, for example, Kryo lib and encode it to Hex string (or smth else), and store it in a database. also, you can encrypt this string and store the encrypted version in a db
gravity (Wed, 03 Apr 2019 06:40:09 GMT):
@Antimttr and when you want to use an Enrollment object, fetch encrypted hex from db, decrypt it, decode from hex string to byte[] and deserialize using the same Kryo lib
Antimttr (Wed, 03 Apr 2019 14:27:13 GMT):
@gravity right now im serializing my POJO LedgerUser object i wrote and storing it in mongo without encrypting the key
Antimttr (Wed, 03 Apr 2019 14:27:28 GMT):
you think i should store it encrypted at rest though?
gravity (Wed, 03 Apr 2019 14:33:52 GMT):
@Antimttr
everything is up to app requirements
Antimttr (Wed, 03 Apr 2019 14:35:15 GMT):
i guess im looking more for best practices
Antimttr (Wed, 03 Apr 2019 14:35:20 GMT):
than a particular requirement
Antimttr (Wed, 03 Apr 2019 14:36:18 GMT):
quoting walmon from -questions: "You should safetly store the crypto objects generated after enroll"
Antimttr (Wed, 03 Apr 2019 14:36:33 GMT):
sounds like he's saying encrypt at rest is best practice
giteliot (Wed, 03 Apr 2019 15:43:10 GMT):
Has joined the channel.
mahoney1 (Wed, 03 Apr 2019 17:50:50 GMT):
FYI - reminder that Fabric Developer Community call tomorrow (Thurs) is at 4pm UTC (5pm UK, 12pm ET, 9am PT) Meeting Id: https://zoom.us/my/hyperledger.community - latest agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
Antimttr (Wed, 03 Apr 2019 21:37:08 GMT):
Hey there, question about HFClient. Should the instantiation of the HFClient be singleton wrt the entire client, or can you have instances you create for each thread?
Antimttr (Wed, 03 Apr 2019 21:37:43 GMT):
like im using Jersey to do my restful implementation, which has a threadpool and it loads a new thread for every query
Antimttr (Wed, 03 Apr 2019 21:37:59 GMT):
should it use the same instance of HFClient for every thread, or can i instantiate a new one for each thread?
Antimttr (Wed, 03 Apr 2019 21:46:24 GMT):
```
//example of setting keepAlive to avoid timeouts on inactive http2 connections.
// Under 5 minutes would require changes to server side to accept faster ping rates.
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {5L, TimeUnit.MINUTES});
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {8L, TimeUnit.SECONDS});
ordererProperties.put("grpc.NettyChannelBuilderOption.keepAliveWithoutCalls", new Object[] {true});
```
Antimttr (Wed, 03 Apr 2019 21:46:34 GMT):
Another question, what is the significance of these settings?
Antimttr (Wed, 03 Apr 2019 21:47:01 GMT):
what happens if an inactive http2 connection is timed out?
Antimttr (Wed, 03 Apr 2019 21:47:11 GMT):
does this effect channel creation? or orderer operation?
Antimttr (Wed, 03 Apr 2019 21:47:44 GMT):
That's from end2endIT.java btw
Antimttr (Wed, 03 Apr 2019 22:07:41 GMT):
Also, do i need a separate specific peerAdmin like they use in end2endIT, or can you use the org Admin to act as the peerAdmin? What is the point of having one admin do peer stuff and the other admin be the org admin?
rickr (Wed, 03 Apr 2019 23:39:57 GMT):
In general I don't see a wide use case for have more than one client .. if any.
As for those setting try reading the README.md end2end :) .. should be pointers in there.
Your application could create as many user it likes. There are basically four general types of users used by the sdk. There is orderer admin that can create the channel and update it like adding new organizations. There is a peerAdmin that can join organizations peers to the channel, deploy chaincode to the channel etc. There is an admin for the CA that we should IMO have named registrar that can register new regular users who then enroll to get their certificate/keys. Regular user can as the SDK is setup just invoke and query chaincode. There a lot of configuration that can be changed on both CA and Peers, Orderers (Fabric) that could change that. It's not for every SDK to document that. See the fabric documentation
rickr (Wed, 03 Apr 2019 23:39:57 GMT):
In general I don't see a wide use case for having more than one client .. if any.
As for those setting try reading the README.md end2end :) .. should be pointers in there.
Your application could create as many user it likes. There are basically four general types of users used by the sdk. There is orderer admin that can create the channel and update it like adding new organizations. There is a peerAdmin that can join organizations peers to the channel, deploy chaincode to the channel etc. There is an admin for the CA that we should IMO have named registrar that can register new regular users who then enroll to get their certificate/keys. Regular user can as the SDK is setup just invoke and query chaincode. There a lot of configuration that can be changed on both CA and Peers, Orderers (Fabric) that could change that. It's not for every SDK to document that. See the fabric documentation
Antimttr (Thu, 04 Apr 2019 02:53:17 GMT):
@rickr where is the name of the peerAdmin specified in the end2endIT example? all i can find is this: ```
sampleStore.getMember(sampleOrgName + "Admin",
sampleOrgName,
sampleOrg.getMSPID(),
Util.findFileSk(Paths.get(testConfig.getTestChannelPath(), "crypto-config/peerOrganizations/",
sampleOrgDomainName, format("/users/Admin@%s/msp/keystore", sampleOrgDomainName)).toFile()),
Paths.get(testConfig.getTestChannelPath(), "crypto-config/peerOrganizations/", sampleOrgDomainName,
format("/users/Admin@%s/msp/signcerts/Admin@%s-cert.pem", sampleOrgDomainName, sampleOrgDomainName)).toFile());
```
Antimttr (Thu, 04 Apr 2019 02:53:59 GMT):
which basically creates a new sampleuser object with that cert, however where is it specified that Org1Admin is the peer admin for org1?
Antimttr (Thu, 04 Apr 2019 02:53:59 GMT):
which basically creates a new sampleuser object with that cert. Where is it specified that Org1Admin is the peer admin for org1?
Antimttr (Thu, 04 Apr 2019 02:58:26 GMT):
my best guess is that its specified in the msp directory structure by an identifying certificate: `\src\test\fixture\sdkintegration\e2e-2Orgs\v1.3\crypto-config\peerOrganizations\org1.example.com\msp\admincerts\Admin@org1.example.com-cert.pem`
Antimttr (Thu, 04 Apr 2019 02:58:26 GMT):
my best guess is that its specified in the msp directory structure by an identifying certificate: `src\test\fixture\sdkintegration\e2e-2Orgs\v1.3\crypto-config\peerOrganizations\org1.example.com\users\Admin@org1.example.com\msp\keystore\581fa072e48dc2a516f664df94ea687447c071f89fc0b783b147956a08929dcc_sk`
Antimttr (Thu, 04 Apr 2019 02:58:26 GMT):
my best guess is that its specified in the msp directory structure by an identifying certificate: `src\test\fixture\sdkintegration\e2e-2Orgs\v1.3\crypto-config\peerOrganizations\org1.example.com\users\Admin@org1.example.com\msp\signcerts\Admin@org1.example.com-cert.pem`
Antimttr (Thu, 04 Apr 2019 02:58:30 GMT):
is this correct?
anjalinaik (Thu, 04 Apr 2019 06:26:20 GMT):
Hi All . Is there a fabric-sdk-java equivalent to below code to check the identity of the person who performs query/ invoke ? ```
const ClientIdentity = require('fabric-shim').ClientIdentity;
let cid = new ClientIdentity(stub); // "stub" is the ChaincodeStub object passed to Init() and Invoke() methods
if (cid.assertAttributeValue('hf.role', 'auditor'))
{ // proceed to carry out auditing}
```
anjalinaik (Thu, 04 Apr 2019 06:26:20 GMT):
Hi All . Is there a `fabric-sdk-java` code equivalent to below code to check the identity of the person who performs query/ invoke ? ```
const ClientIdentity = require('fabric-shim').ClientIdentity;
let cid = new ClientIdentity(stub); // "stub" is the ChaincodeStub object passed to Init() and Invoke() methods
if (cid.assertAttributeValue('hf.role', 'auditor'))
{ // proceed to carry out auditing}
```
mahoney1 (Thu, 04 Apr 2019 15:31:27 GMT):
FYI - reminder that the Fabric Developer Community call is in 30mins - 4pm UTC (5pm UK, 12pm ET, 9am PT) Meeting Id: https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
rolsonquadras (Thu, 04 Apr 2019 20:32:34 GMT):
Has joined the channel.
rickr (Thu, 04 Apr 2019 23:37:45 GMT):
@Antimttr think that's the peerAdmin cert for one of the the orgs
aatkddny (Fri, 05 Apr 2019 01:08:53 GMT):
As Rick said, it's the peer admin for org1 as generated by cryptogen. The directory structure and names are all by convention or from the crypto-config.yaml file you feed it.
There's a little on it here - https://hyperledger-fabric.readthedocs.io/en/release-1.4/build_network.html?highlight=cryptogen%20directory%20structure
adamhardie (Fri, 05 Apr 2019 14:55:37 GMT):
when i send a ProposalResponse collection to the channel with channel.sendTransaction, sometimes we wait for 1 minute and still do not find a response
adamhardie (Fri, 05 Apr 2019 14:56:06 GMT):
i can see the event appearing on the channel via my other applications, but the committer does not know if it is successful
adamhardie (Fri, 05 Apr 2019 14:56:39 GMT):
currently, we throw a timeout exception. but it is very difficult to know if it is caused by a bad error, or if we just have not heard a response
adamhardie (Fri, 05 Apr 2019 14:57:05 GMT):
is there a suggestion at what would prevent the SDK receiving the TransactionEvent CompletableFuture ?
rickr (Fri, 05 Apr 2019 15:04:26 GMT):
@adamhardie Not experienced that. If you wait for about 10min there is a routine that wil kick in that should print a warning log what events did not report. Also there should be extensive logging at trace showing what events are reporting .. what level of the SDK ?
adamhardie (Fri, 05 Apr 2019 15:05:18 GMT):
i will increase log level - and in fact this is being experienced in a server without much logging
adamhardie (Fri, 05 Apr 2019 15:05:31 GMT):
let me increase the timeout to 11 minutes and change the logging - will get back to you
rickr (Fri, 05 Apr 2019 15:06:04 GMT):
the logging on the client sdk side :wink:
Antimttr (Fri, 05 Apr 2019 15:46:27 GMT):
```
Logging for the SDK can be enabled with setting environment variables:
ORG_HYPERLEDGER_FABRIC_SDK_LOGLEVEL=TRACE
ORG_HYPERLEDGER_FABRIC_CA_SDK_LOGLEVEL=TRACE
ORG_HYPERLEDGER_FABRIC_SDK_DIAGNOSTICFILEDIR=
rickr (Fri, 05 Apr 2019 15:47:31 GMT):
client env
rickr (Fri, 05 Apr 2019 19:26:16 GMT):
@Antimttr By chance are you going through some proxy/firewall. If yes, look at the README.md FAQ for properties you may need to set
Antimttr (Fri, 05 Apr 2019 19:30:11 GMT):
Yeah I read about that. I am not but I'm just in a dev environment at this point. There's certainly a possibility that someone running the client could go through firewalls
Antimttr (Fri, 05 Apr 2019 19:31:23 GMT):
Is there a specific place in the artifacts or msp directory structures where the policy files are stored? I cant seem to find any
Antimttr (Fri, 05 Apr 2019 19:31:50 GMT):
trying to figure out where the policy is for determining how many orgs need to sign off on a particular channel creation
aatkddny (Sat, 06 Apr 2019 02:04:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=MPGmQAfyyM8ndEkEv) I think it gets encoded into the channel genesis block from configtx.yaml - from the ChannelDefaults under Admins, no? So the default would be majority.
aatkddny (Sat, 06 Apr 2019 02:04:41 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=MPGmQAfyyM8ndEkEv) I think it gets encoded into the channel genesis block from configtx.yaml - from the ChannelDefaults under Admins, no? So the default would be majority.
I may be dead wrong - we sorta cheat as I have access to *all* the channel member organization's peer admins.
I just build an array of all the `getChannelConfigurationSignature` results for all of them, so I never really have to think about it.
Randyshu2018 (Mon, 08 Apr 2019 02:16:18 GMT):
Clipboard - April 8, 2019 10:14 AM
adamhardie (Mon, 08 Apr 2019 09:43:38 GMT):
looking at HL logging - i can see
DEBUG | 2019-04-08 10:41:36.160 | earer_send | o.h.f.s.OrdererClient | OrdererClient-messagebus-orderer0.group(grpc://10.186.xxx.xxx:7050)Done waiting for reply! Got:status: SUCCESS
so we can see the send to orderer is successful
then the CompletableFuture
adamhardie (Mon, 08 Apr 2019 09:44:25 GMT):
here is the code to send the transaction
sentSuccessfully = chnl.sendTransaction(responses).get(MESSAGE_TIMEOUT_SECS, SECONDS).isValid();
this appears the same as in e2e it
gravity (Mon, 08 Apr 2019 10:15:50 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=qvZAHRRwemYfpxCXk) @aatkddny are these peers unique for this channel? or are they joined in other channels?
rickr (Mon, 08 Apr 2019 18:57:12 GMT):
@adamhardie In general, the future is not done when sent to orderer. It gets completed when all eventing peers have seen the block with the transaction. Which means on those peers the transaction is on the ledger.
SandySun2000 (Tue, 09 Apr 2019 00:53:42 GMT):
@rickr When the user tries to update chaincode, it failed at the first try: services.HLHelperService.lambda$createAndExecuteTransaction$2 (HLHelperService.[java:183)](java:183)) - Cause:{}
org.hyperledger.fabric.sdk.exception.TransactionEventException: Received invalid transaction event. Transaction ID 9472f24aad4871d3819391111902f8eb1fb1c21f24dc37f832338322078092a6 status 10
but when he uploaded and updated same version of CC then it works. Can you please help to find solution for his issue?
AliciaDominic (Tue, 09 Apr 2019 06:00:57 GMT):
Has joined the channel.
aatkddny (Tue, 09 Apr 2019 06:40:20 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=vAfBHndFSK6JwYJJW) Peers are members of multiple channels.
josephnicholas (Tue, 09 Apr 2019 07:12:27 GMT):
Has joined the channel.
AndresMartinezMelgar.itcl (Tue, 09 Apr 2019 08:21:18 GMT):
Hi, why my query method doent work?
private Response query(ChaincodeStub stub, List
adamhardie (Tue, 09 Apr 2019 09:14:53 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=DKAnQFpKbRRYPK8Qk) @rickr So, possibly the eventing peer in my network is either not receiving the block (although, the block is distributed to other listening peers)..
Or the orderer is unable to tell the committer that the block has been successfully pushed to the eventing peer
rickr (Tue, 09 Apr 2019 11:43:52 GMT):
@adamhardie There is extensive logging (trace) on the sdk on events it's getting.
rickr (Tue, 09 Apr 2019 11:46:30 GMT):
@SandySun2000 there was first time some issue with the endorsement conflicting ..
rickr (Tue, 09 Apr 2019 11:47:45 GMT):
@AndresMartinezMelgar.itcl Is this on the chaincode side ? I would work this on #fabric-chaincode-dev
AndresMartinezMelgar.itcl (Tue, 09 Apr 2019 11:51:32 GMT):
@rickr ok, right now i post there
adamhardie (Tue, 09 Apr 2019 13:18:30 GMT):
yes, so it is the DeliverResponse we are expecting that never arrives. example successful message has this logging after "onComplete received."
TRACE | 2019-04-09 12:40:23.816 | xecutor-16 | o.h.f.s.PeerEventServiceClient | DeliverResponse channel messagebus peer peer0.group resp status value:0 status UNKNOWN, typecase BLOCK
TRACE | 2019-04-09 12:40:23.816 | xecutor-16 | o.h.f.s.PeerEventServiceClient | Channel messagebus peer peer0.group got event block hex hashcode: 0000000017068e29, block number: 28695
rickr (Tue, 09 Apr 2019 14:22:43 GMT):
@adamhardie so the above is a block that you did receive but you have cases where you are expecting a block and that message above is not appear?
rickr (Tue, 09 Apr 2019 14:22:43 GMT):
@adamhardie so the above is a block that you did receive but you have cases where you are expecting a block and that message above is not appearing?
adamhardie (Tue, 09 Apr 2019 14:24:18 GMT):
indeed. deliver response never arrives
adamhardie (Tue, 09 Apr 2019 14:24:29 GMT):
seems a networking issue possibly
rickr (Tue, 09 Apr 2019 14:26:24 GMT):
are you running though a proxy/load balancer ?
rickr (Tue, 09 Apr 2019 14:27:37 GMT):
if yes, see README.md FAQ
adamhardie (Tue, 09 Apr 2019 14:39:56 GMT):
no proxy or LB
adamhardie (Tue, 09 Apr 2019 14:40:17 GMT):
seems that, after application restart, it takes 15 minutes for this to start happening.
adamhardie (Tue, 09 Apr 2019 14:40:28 GMT):
regularly the issue appears after 15 mins of normal working
rickr (Tue, 09 Apr 2019 14:42:50 GMT):
no errors ? No messages that the eventing service is reconnecting ?
rickr (Tue, 09 Apr 2019 14:43:14 GMT):
I've not had anyone else report issues
rickr (Tue, 09 Apr 2019 14:43:59 GMT):
Just for fun ... I would look at the README.md for the properties to add for loadbalancers just to see if that would help
adamhardie (Tue, 09 Apr 2019 15:01:19 GMT):
nothing.. on the unsuccessful i get this on SDK client
adamhardie (Tue, 09 Apr 2019 15:01:22 GMT):
DEBUG | 2019-04-09 14:08:02.226 | earer_send | o.h.f.s.Channel | Channel messagebus successful sent to Orderer transaction id: e30507683e39d9832eace0ae74bc31d0be9a1140b4128c1a8f765fed444d9422
TRACE | 2019-04-09 14:08:02.227 | xecutor-17 | o.h.f.s.OrdererClient | org.hyperledger.fabric.sdk.OrdererClient$1@43f7ad79 onComplete received.
adamhardie (Tue, 09 Apr 2019 15:01:31 GMT):
then the future times out
adamhardie (Tue, 09 Apr 2019 15:01:36 GMT):
and orderer log shows no error
adamhardie (Tue, 09 Apr 2019 15:03:06 GMT):
have pastebin of orderer if needs be
adamhardie (Tue, 09 Apr 2019 15:03:11 GMT):
i will check the readme now
adamhardie (Tue, 09 Apr 2019 15:36:46 GMT):
will try this deployment and get back to you :) thanks for the pointer
SandySun2000 (Tue, 09 Apr 2019 16:30:14 GMT):
@rickr but they don't need to fix anything but just invoke the update again then the issue is gone. Their question is why the update chaincode failed at the first invoke but success at the 2nd one?
SandySun2000 (Tue, 09 Apr 2019 16:30:14 GMT):
@rickr They don't need to fix anything but just invoke the update again then the issue is gone. Their question is why the update chaincode failed at the first invoke but success at the 2nd one?
rickr (Tue, 09 Apr 2019 16:46:21 GMT):
@SandySun2000 The sdk has little to do but send the update to fabric. The fact that it worked the second time and I have not heard any reported issue with the SDK doing updates makes me doubtful anything is wrong with was sent. The only way to know for sure is capture the issue with logging at debug both sdks and fabric. Then since the rejection is by the commiting peer and the SDK is just reporting it you would need to start them looking at it.
rickr (Tue, 09 Apr 2019 16:46:21 GMT):
@SandySun2000 The sdk has little to do but send the update to fabric. The fact that it worked the second time and I have not heard any reported issue with the SDK doing updates makes me doubtful anything is wrong with what was sent. The only way to know for sure is capture the issue with logging at debug both sdks and fabric. Then since the rejection is by the commiting peer and the SDK is just reporting it you would need to start them looking at it.
SandySun2000 (Tue, 09 Apr 2019 17:05:50 GMT):
@rickr thanks. Let me get the logs.
Randyshu2018 (Wed, 10 Apr 2019 05:44:11 GMT):
Anyone know how to fix it ? Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching localhost found.
Randyshu2018 (Wed, 10 Apr 2019 09:06:09 GMT):
why I continues receive block event even no new block produce?
rickr (Wed, 10 Apr 2019 11:59:05 GMT):
@Randyshu2018 Most likely cert does not match. See https://github.com/hyperledger/fabric-sdk-java/blob/ef153c833ba55f77e0ca12379691c82b79b975ce/src/test/java/org/hyperledger/fabric/sdk/testutils/TestConfig.java#L446
sets property to override what's the cert
adamhardie (Wed, 10 Apr 2019 12:31:37 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Je5b6w4X5z455oiNr) i have observed the 15 minute timeout issue once more - with the new orderer config fields
adamhardie (Wed, 10 Apr 2019 12:31:51 GMT):
we hang here for 5 seconds, then timeout
TRACE | 2019-04-10 13:30:57.285 | executor-5 | o.h.f.s.OrdererClient | org.hyperledger.fabric.sdk.OrdererClient$1@9cd1655 onComplete received.
Antimttr (Wed, 10 Apr 2019 20:40:25 GMT):
I just got channel creation working in my client implemenation. However there's a small issue. I am checking to see if the channel already exists by calling HFClient.getChannel(name), and this works fine as long as i dont restart the client. if i do this comes up empty, even though a channel exists on the hyperledger. so my question is how can i load the channel state from the hyperledger into the sdk client so this doesn't happen?
Antimttr (Wed, 10 Apr 2019 22:36:33 GMT):
OK so i solved it by serializing the channel after its created, storing it in mongo and then loading it up back into the HFClient after reloading my client.
Randyshu2018 (Thu, 11 Apr 2019 01:06:28 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=bTFrBm89nTw76pq4c) @rickr U are right~,I forgot to set pemFile properties.
jonathan-blood (Thu, 11 Apr 2019 07:08:04 GMT):
Has joined the channel.
Randyshu2018 (Thu, 11 Apr 2019 07:48:10 GMT):
Is fabric-sdk-java support to synchronize full blocks like fabric-sdk-node do?
Randyshu2018 (Thu, 11 Apr 2019 07:48:10 GMT):
Is fabric-sdk-java support to synchronize full blocks like fabric-sdk-node do when registerBlockEvent?
rickr (Thu, 11 Apr 2019 14:28:38 GMT):
Syncroized?
rickr (Thu, 11 Apr 2019 14:28:38 GMT):
Synchronized?
Antimttr (Thu, 11 Apr 2019 14:56:44 GMT):
@rickr In the end2endIT, i couldn't find an example of anchor peers being updated with a channel, like you have in the balance-transfer api
Antimttr (Thu, 11 Apr 2019 14:57:01 GMT):
am i just missing it or is that not a thing with the java sdk?
Antimttr (Thu, 11 Apr 2019 14:57:27 GMT):
that operation would use the /artifacts/channel/Org1MSPanchors.tx file
rickr (Thu, 11 Apr 2019 15:45:23 GMT):
Updating the channel example is provided... again (re)- look over the readme.md
Antimttr (Thu, 11 Apr 2019 16:02:19 GMT):
can't find any mention of anchor peers in the readme
Antimttr (Thu, 11 Apr 2019 16:02:41 GMT):
only normal peers
Antimttr (Thu, 11 Apr 2019 16:02:44 GMT):
which i'm already writing
Antimttr (Thu, 11 Apr 2019 16:04:15 GMT):
@rickr near as i can tell constructChannel() instantiates the orderers, creates the channel and then adds regular peers, no mention of anchor peers
Antimttr (Thu, 11 Apr 2019 16:04:30 GMT):
infact I cant even find any use of the word anchor in the readme or in end2endIT
Antimttr (Thu, 11 Apr 2019 16:05:09 GMT):
that's why i was wondering if this is even a part of the java sdk implementation
Antimttr (Thu, 11 Apr 2019 16:06:05 GMT):
likewise, I can't find any equivilent of the channel.initialize() sdk call in the nodejs implementation
Antimttr (Thu, 11 Apr 2019 16:06:25 GMT):
but it seems that the initialize() call can only be made after peers have been added
Antimttr (Thu, 11 Apr 2019 16:21:44 GMT):
@rickr so i did find mention of anchor peers in https://github.com/hyperledger/fabric-sdk-java/blob/8044bac1bfe9baf9d6360b067e0d6b5445cc953d/src/test/java/org/hyperledger/fabric/sdkintegration/UpdateChannelIT.java
Antimttr (Thu, 11 Apr 2019 16:21:53 GMT):
i assume this is what you're talking about
Antimttr (Thu, 11 Apr 2019 16:27:11 GMT):
```
/**
* Update channel scenario
* See http://hyperledger-fabric.readthedocs.io/en/master/configtxlator.html
* for details.
*/
``` dead link in the code
Antimttr (Thu, 11 Apr 2019 16:27:40 GMT):
im guessing it corresponds to this page: https://hyperledger-fabric.readthedocs.io/en/release-1.4/channel_update_tutorial.html?highlight=configtxlator
Antimttr (Thu, 11 Apr 2019 16:27:42 GMT):
but not really sure
Randyshu2018 (Fri, 12 Apr 2019 01:18:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ohWaRSXMro8CsF4sA) @Antimttr maybe u are looking for this https://github.com/siyuyifang/balance-transfer-java
Antimttr (Fri, 12 Apr 2019 02:05:34 GMT):
oh wow
Antimttr (Fri, 12 Apr 2019 02:05:55 GMT):
@Randyshu2018 thankyou x10000000000000
Antimttr (Fri, 12 Apr 2019 02:10:57 GMT):
interesting
Antimttr (Fri, 12 Apr 2019 02:11:16 GMT):
its based on 1.0 which is too bad cuz i think things have changed a lot
Antimttr (Fri, 12 Apr 2019 02:11:32 GMT):
and it doesnt have the whole channel update anchor peers thing
Antimttr (Fri, 12 Apr 2019 02:11:49 GMT):
still, very cool to see someone else implement that
Antimttr (Fri, 12 Apr 2019 02:18:11 GMT):
if only there was a more up to date example
Antimttr (Fri, 12 Apr 2019 02:18:38 GMT):
like do i really need to update the anchors like the nodejs sdk does
Antimttr (Fri, 12 Apr 2019 02:18:41 GMT):
not sure
Antimttr (Fri, 12 Apr 2019 02:24:32 GMT):
seems pretty straight forward updating the anchor peers by the command line, but the java example has all this code testing out the sdk so its hard to pull out from that what i actually need to execute to do it
Antimttr (Fri, 12 Apr 2019 02:26:18 GMT):
what's even more confusing is than in https://github.com/hyperledger/fabric-sdk-java/blob/d2bc6d50e362a140970a509ade25f2f2c69e6c0f/src/test/java/org/hyperledger/fabric/sdkintegration/UpdateChannelIT.java there's not really any reference to the configtxgen generated file Org1MSPanchors.tx which both the nodejs sdk implementation and the command line use
Antimttr (Fri, 12 Apr 2019 02:26:18 GMT):
what's even more confusing is that in https://github.com/hyperledger/fabric-sdk-java/blob/d2bc6d50e362a140970a509ade25f2f2c69e6c0f/src/test/java/org/hyperledger/fabric/sdkintegration/UpdateChannelIT.java there's not really any reference to the configtxgen generated file Org1MSPanchors.tx which both the nodejs sdk implementation and the command line use
Antimttr (Fri, 12 Apr 2019 02:26:25 GMT):
but maybe its burried in some helper funciton somewhere
Antimttr (Fri, 12 Apr 2019 14:34:22 GMT):
In updateChannelIT.java: ```
String responseAsString = configTxlatorDecode(httpclient, channelConfigurationBytes);
```
Antimttr (Fri, 12 Apr 2019 14:34:40 GMT):
is this the same as an `Org1MSPanchors.tx"` ?
Antimttr (Fri, 12 Apr 2019 14:36:58 GMT):
i guess im confused but it seems like this updatechannelit deal doesn't actually add anchor peers to the channel
Antimttr (Fri, 12 Apr 2019 15:09:04 GMT):
having reviewed the code from updatechannelit and the channel.java from the sdk once again i think i found what i need: ```
// Get config update for adding an anchor peer.
Channel.AnchorPeersConfigUpdateResult configUpdateAnchorPeers = fooChannel.getConfigUpdateAnchorPeers(fooChannel.getPeers().iterator().next(), sampleOrg.getPeerAdmin(),
Arrays.asList(PEER_0_ORG_1_EXAMPLE_COM_7051), null);
//Now add anchor peer to channel configuration.
fooChannel.updateChannelConfiguration(configUpdateAnchorPeers.getUpdateChannelConfiguration(),
client.getUpdateChannelConfigurationSignature(configUpdateAnchorPeers.getUpdateChannelConfiguration(), sampleOrg.getPeerAdmin()));
```
Antimttr (Fri, 12 Apr 2019 15:09:31 GMT):
near as i can tell this will add t he anchor and update the channel with the new configuration block
Antimttr (Fri, 12 Apr 2019 15:10:58 GMT):
Apparently you dont use, or don't need to use a 'Org1MSPanchors.tx' to do this, unlike in the other sdk examples?
Antimttr (Fri, 12 Apr 2019 15:11:00 GMT):
dunno
Antimttr (Fri, 12 Apr 2019 15:28:12 GMT):
so in the updatechannelit.java, it uses the format: "peer0.org1.example.com:7051" to tell the sdk what anchor peer to add. my question is, does the address have to be that of the physical listener, ie: localhost:7051 or can it be the name of the peer?
Antimttr (Fri, 12 Apr 2019 15:28:35 GMT):
i'm guessing its the latter, but how does it reconsile the peer name to the physical address/url?
Antimttr (Fri, 12 Apr 2019 15:28:35 GMT):
i'm guessing its the latter, but how does it resolve the peer name to the physical address/url?
Antimttr (Fri, 12 Apr 2019 19:50:21 GMT):
that was in fact the way to do it
gravity (Mon, 15 Apr 2019 08:39:58 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=AXBaQ9EKr7JPndfGz) @Antimttr peers run in docker containers and there is internal dns resolver.
bilalahmed (Mon, 15 Apr 2019 12:50:37 GMT):
Has joined the channel.
bilalahmed (Mon, 15 Apr 2019 12:55:09 GMT):
I have just started working with JAVA SDK after leaving composer. Can anyone please share a running example or guide that how should I start working with this?
bilalahmed (Mon, 15 Apr 2019 13:00:05 GMT):
I'm getting NullPointerException on:
Enrollment adminEnrollment = caClient.enroll("admin", "adminpw");
rickr (Mon, 15 Apr 2019 13:05:14 GMT):
@bilalahmed Have looked at the README ?
bilalahmed (Mon, 15 Apr 2019 13:17:03 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=2RW6xioeArhCMkaS2) @rickr README of https://github.com/hyperledger/fabric-sdk-java?
bilalahmed (Mon, 15 Apr 2019 13:51:51 GMT):
import org.hyperledger.fabric.protos
-->> Cannot resolve symbol 'protos'
rickr (Mon, 15 Apr 2019 13:53:43 GMT):
so your unit tests and integration test are passing ?
bilalahmed (Mon, 15 Apr 2019 13:57:56 GMT):
No, I'm getting error on all the packages from 'protoes' For example:
Error:(74, 44) java: package org.hyperledger.fabric.protos.common does not exist
rickr (Mon, 15 Apr 2019 13:58:20 GMT):
when doing what ?
bilalahmed (Mon, 15 Apr 2019 13:58:46 GMT):
while running End2endIT.java tests
rickr (Mon, 15 Apr 2019 13:58:57 GMT):
how are you running it ?
bilalahmed (Mon, 15 Apr 2019 14:00:04 GMT):
Screen Shot 2019-04-15 at 6.59.51 PM.png
rickr (Mon, 15 Apr 2019 14:00:24 GMT):
in ide ?
bilalahmed (Mon, 15 Apr 2019 14:00:35 GMT):
yeah, Intelij Idea
rickr (Mon, 15 Apr 2019 14:00:58 GMT):
Well I don't see that stated in the README.md :wink:
bilalahmed (Mon, 15 Apr 2019 14:02:10 GMT):
Can you please guide then how may I run these? Its a JAVA code so I opened in IDEA and ran following the way I run tests normally.
rickr (Mon, 15 Apr 2019 14:03:20 GMT):
What about this ?
https://github.com/hyperledger/fabric-sdk-java#running-the-integration-tests
bilalahmed (Mon, 15 Apr 2019 14:06:12 GMT):
Thanks, sorry I missed it, its downloading the missing repos now.
rickr (Mon, 15 Apr 2019 14:08:40 GMT):
Get the test and integration working first. Then you know your environment is all running and is good. *Then* as it says it the READM.md start working through the integration tests (best with a debugger)
The protos are generated code it your test all pass then they have to be there :wink:
rickr (Mon, 15 Apr 2019 14:08:40 GMT):
Get the test and integration working first. Then you know your environment is all running and is good. *Then* as it says it the READM.md start working through the integration tests (best with a debugger)
The protos are generated code if your test all pass then they have to be there :wink:
bilalahmed (Mon, 15 Apr 2019 14:10:13 GMT):
Okay, thanks a lot. Will follow your suggestions. To learn JAVA SDK should we start from unit tests and learn from code or is there any documentation for the development and deployment of chaincodes using JAVA SDK?
rickr (Mon, 15 Apr 2019 14:12:27 GMT):
As it says -- you should have some basic of fabric behind your belt. The integratons tests do 95% of what any application will do the sdk. Mostly just follow what's in those files ignore most of that's happening the the Sample stuff as that's not really part of the SDK
bilalahmed (Mon, 15 Apr 2019 14:16:08 GMT):
okay, perfect. I'll first try to run these tests.
quaider (Tue, 16 Apr 2019 06:31:49 GMT):
Has joined the channel.
quaider (Tue, 16 Apr 2019 06:32:13 GMT):
hi, i get IllegalArgumentException when instantiate chaincode
quaider (Tue, 16 Apr 2019 06:32:27 GMT):
the message is `The proposal responses have 2 inconsistent groups with 0 that are invalid`
quaider (Tue, 16 Apr 2019 06:32:41 GMT):
here is my test case
quaider (Tue, 16 Apr 2019 06:32:49 GMT):
install chaincode with couchdb indexes , instantiate chaincode with error above
install chaincode without indexes, instantiate chaincode success
quaider (Tue, 16 Apr 2019 06:34:35 GMT):
the only difference is use couchdb indexes or not
AndresMartinezMelgar.itcl (Tue, 16 Apr 2019 06:42:09 GMT):
Hi i receive this error when i try to create a new channel, java.security.NoSuchAlgorithmException: ECDSA KeyFactory not available
what is the meaning of these error?
quaider (Tue, 16 Apr 2019 06:44:47 GMT):
you should add this code ` Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());`
AndresMartinezMelgar.itcl (Tue, 16 Apr 2019 06:48:30 GMT):
@quaider where i must add this code?
quaider (Tue, 16 Apr 2019 06:54:50 GMT):
i am not sure, my error is different `java.security.NoSuchProviderException: no such provider: BC` with yours
gravity (Tue, 16 Apr 2019 07:04:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=p9pDE2CiLQAJoP4Ze) @quaider full stacktrace from peer where you instantiate a chaincode might be helpful to identify the problem
gravity (Tue, 16 Apr 2019 07:05:49 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=8S2PFFZPYPAe7tkY2) @AndresMartinezMelgar.itcl when do you get this exception?
chill37 (Tue, 16 Apr 2019 07:07:00 GMT):
HI, when I use channel.sendTransaction(responses, orderers);
is there a way to know which orderer node has actually made this transaction successful?
I guess I could see from the log, but I would like to make use of that info, so I was wondering if that orderer info (e.g. orderer1.example.com) is buried somewhere in the transaction info that I can look it up
quaider (Tue, 16 Apr 2019 07:10:27 GMT):
Clipboard - April 16, 2019 3:10 PM
quaider (Tue, 16 Apr 2019 07:13:00 GMT):
i found that the payload has a bit difference, i have 2 peer, but only occurs when use indexes
quaider (Tue, 16 Apr 2019 07:13:51 GMT):
@gravity
AndresMartinezMelgar.itcl (Tue, 16 Apr 2019 07:15:23 GMT):
Clipboard - April 16, 2019 9:15 AM
AndresMartinezMelgar.itcl (Tue, 16 Apr 2019 07:15:35 GMT):
@gravity
AndresMartinezMelgar.itcl (Tue, 16 Apr 2019 07:15:35 GMT):
@gravity i receive this error when i try to create a channel
gravity (Tue, 16 Apr 2019 07:16:46 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=HAWjZ8oPxzPZZzRCL) @quaider have you added your indexes to the chaincode directory?
https://hyperledger-fabric.readthedocs.io/en/release-1.4/couchdb_tutorial.html#cdb-add-index
quaider (Tue, 16 Apr 2019 07:18:22 GMT):
@gravity yes,
quaider (Tue, 16 Apr 2019 07:18:30 GMT):
Clipboard - April 16, 2019 3:18 PM
quaider (Tue, 16 Apr 2019 07:18:47 GMT):
Clipboard - April 16, 2019 3:18 PM
gravity (Tue, 16 Apr 2019 07:22:23 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=zQMpkJsYLjaHZTJye) @AndresMartinezMelgar.itcl try to add this before sending create channel tx:
```
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
```
gravity (Tue, 16 Apr 2019 07:27:21 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=uw45bfZzZfED6pAje) @quaider I can see that there is no chaincode sources near the indexes directory
quaider (Tue, 16 Apr 2019 07:30:04 GMT):
where the indexes dir should i put in? resources or src/main/java? @gravity
gravity (Tue, 16 Apr 2019 07:32:06 GMT):
@quaider what is a package structure under the `/src/main/java` ?
quaider (Tue, 16 Apr 2019 07:34:21 GMT):
Clipboard - April 16, 2019 3:34 PM
gravity (Tue, 16 Apr 2019 07:37:51 GMT):
@quaider try to put indexes to the package `com.cnabs.chaincode.fileapp` near the chaincode sources
the final structure should be `com.cnabs.chaincode.fileapp.META-INF/statedb/couchdb/indexes/index-filepath.json`
quaider (Tue, 16 Apr 2019 07:38:56 GMT):
ok, i will try, thanks :slight_smile:
quaider (Tue, 16 Apr 2019 07:41:32 GMT):
Clipboard - April 16, 2019 3:41 PM
gravity (Tue, 16 Apr 2019 07:43:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=fLsDXRTvAg9PZh9L9) @quaider you did this to avoid inconsistency? if you do, you shouldn't do this
quaider (Tue, 16 Apr 2019 08:07:02 GMT):
@gravity its my error
quaider (Tue, 16 Apr 2019 08:07:08 GMT):
when i install chaincode, i make a mistake,
i use `hardcode clone` to get a new InstallProposalRequest instance which i ignore to set the `chaincodeMetaInfLocation` property
this cause one peer get indexes, anthor not...
AndresMartinezMelgar.itcl (Tue, 16 Apr 2019 11:18:48 GMT):
hello, anyone knows some project that was developed with the java sdk in version 1.3?
rickr (Tue, 16 Apr 2019 12:16:51 GMT):
@chill37 Only really the log shows. I think if it's really important to your application you can send to just a specific Orderer ... should be easy to guess then :) May I ask why your application really cares? The use case?
Antimttr (Tue, 16 Apr 2019 16:44:35 GMT):
I am getting ' chaincodePath must be null for Node chaincode' when I'm attempting to install nodejs chaincode with the java sdk. Does this mean that javasdk can't install nodejs chaincode?
Antimttr (Tue, 16 Apr 2019 16:44:35 GMT):
I am getting 'chaincodePath must be null for Node chaincode' when I'm attempting to install nodejs chaincode with the java sdk. Does this mean that javasdk can't install nodejs chaincode?
Antimttr (Tue, 16 Apr 2019 16:44:35 GMT):
I am getting `chaincodePath must be null for Node chaincode` when I'm attempting to install nodejs chaincode with the java sdk. Does this mean that javasdk can't install nodejs chaincode?
Antimttr (Tue, 16 Apr 2019 16:49:48 GMT):
OK nm, all i had to do was remove chaincodepath, but still specify chaincode source
Antimttr (Tue, 16 Apr 2019 17:03:12 GMT):
Sweet, chaincode installed and instantiated for the first time!
Antimttr (Tue, 16 Apr 2019 17:03:19 GMT):
now time to write an invoker
Antimttr (Tue, 16 Apr 2019 20:07:15 GMT):
```
}).get(testConfig.getTransactionWaitTime(), TimeUnit.SECONDS);
```
Antimttr (Tue, 16 Apr 2019 20:07:34 GMT):
this is line 724 from end2endIT.java any idea at all what this is doing?
Antimttr (Tue, 16 Apr 2019 20:07:55 GMT):
is it required to send a transaction to the orderer?
Antimttr (Tue, 16 Apr 2019 20:10:32 GMT):
ok i think i found it, just seems to be something that performs a timeout
Antimttr (Tue, 16 Apr 2019 20:10:40 GMT):
so then not required but useful
chill37 (Wed, 17 Apr 2019 05:52:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=foH2bA5gEJaorf4vm) @rickr @rickr that's true, but I don't want to override the given functionality (i.e. get multiple orderers, try each one if it fails, break when success)
our usage is because we are making a separate log. so I am getting all the basic success/fail, input/output, interval, etc for all peers including the orderer.
I could get the output from peers, but I couldnt
chill37 (Wed, 17 Apr 2019 05:52:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=foH2bA5gEJaorf4vm) @rickr @rickr that's true, but I don't want to override the given functionality (i.e. get multiple orderers, try each one if it fails, break when success)
our usage is because we are making a separate log. so I am getting all the basic success/fail, input/output, interval, etc for all peers including the orderer.
I could get the output from peers, but I couldnt get it for the orderer other than the total success/fail
chill37 (Wed, 17 Apr 2019 05:52:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=foH2bA5gEJaorf4vm) @rickr @rickr that's true, but I don't want to override the given functionality (i.e. get multiple orderers, try each one if it fails, break when success)
our usage is because we are making our own log. so I am getting all the basic success/fail, input/output, interval, etc for all peers including the orderer.
I could get the output from peers, but I couldnt get it for the orderer other than the total success/fail
chill37 (Wed, 17 Apr 2019 05:52:07 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=foH2bA5gEJaorf4vm) @rickr @rickr that's true, but I don't want to override the given functionality (i.e. get multiple orderers, try each one if it fails, break when success)
our usage is because we are making our own log(for tracing). so I am getting all the basic success/fail, input/output, interval, etc for all peers including the orderer.
I could get the output from peers, but I couldnt get it for the orderer other than the total success/fail
bilalahmed (Wed, 17 Apr 2019 12:39:31 GMT):
Anyone encountered the issue: Unable to load the library 'netty_tcnative_osx_x86_64', trying other loading mechanism.
java.lang.UnsatisfiedLinkError: no netty_tcnative_osx_x86_64 in java.library.path
Antimttr (Wed, 17 Apr 2019 16:45:16 GMT):
i have
Antimttr (Wed, 17 Apr 2019 16:45:41 GMT):
i restarted my dockers and wiped them clean and it went away though
Antimttr (Wed, 17 Apr 2019 18:03:25 GMT):
are there any examples of how to unpack and use a TransactionEnvelopeInfo object from a TransactionEvent object?
Antimttr (Wed, 17 Apr 2019 18:18:32 GMT):
i think i found it, it's in BlockWalker()
chill37 (Thu, 18 Apr 2019 01:27:48 GMT):
@Antimttr where is this Blockwalker() that you just mentioned? which class?
bilalahmed (Thu, 18 Apr 2019 10:13:30 GMT):
Hello, Can anyone please guide that how can we pass peer/orderers certificates in JAVA SDK while playing with grpcs when TLS is enabled. Thanks
bilalahmed (Thu, 18 Apr 2019 10:20:39 GMT):
What is the use of EndPoint class in this context?
rickr (Thu, 18 Apr 2019 12:12:37 GMT):
@bilalahmed EndPoint is internal to the SDK not public. The READEM.md states how the Integration test can be run with TLS enabled so you can follow that. https://sdkjavadocs.github.io/org/hyperledger/fabric/sdk/HFClient.html newPeer newOrderer methods have explanation of the properties. You could have seen these being used in https://github.com/hyperledger/fabric-sdk-java/blob/df422e10fa38bf8a627dd81e7ad038404d625576/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L813-L824
and a few lines below that for the Peer. Take the time read the README.md follow the integration tests step for step :wink:
rickr (Thu, 18 Apr 2019 12:14:47 GMT):
@chill37 take time follow the integration test they show walking the blocks
bilalahmed (Thu, 18 Apr 2019 13:09:15 GMT):
@rickr I'm following Read.me but not being able to get rid of the following error: TransactionException: Channel mychannel, send transactions failed on orderer OrdererClient{id: 5, channel: ttchannel, name: orderer.example.com, url: grpcs://orderer.example.com:7050}. Reason: timeout after 10000 ms.
bilalahmed (Thu, 18 Apr 2019 13:19:09 GMT):
One suggestion: Not everyone use the same names of peer/orderers/ca etc. to build network setup which are being used the tutorials. Like I did, I gave my names to peers/orderers organisations etc. So, I can't use the provided SDK intergations. So, It would have been a much better approach that proper documentation is provided instead of taking SDK understanding from code. I'll write a detailed documentation on JAVA SDK once I cross all the hurdles.
Antimttr (Thu, 18 Apr 2019 13:25:10 GMT):
@chill37 its in End2EndIT.java towards the end after runtests
rickr (Thu, 18 Apr 2019 14:17:45 GMT):
@bilalahmed Don't understand your suggestion on the names. You can walk step for step in a debugger through the integration test that show the api in *action* and in context. You *know* the code is current and because the test actually are passing it's not stale like I've seen many _tutorials_ go. If you've taken some time and familiarized yourself with those examples writing your application is really a matter of copy/paste/modify.
Antimttr (Thu, 18 Apr 2019 15:02:41 GMT):
thats what i did, and although I wouldn't say it was easy. I was able to make a completely functioning POC client by extracting the relevant bits from the end2endit files
Antimttr (Thu, 18 Apr 2019 15:03:34 GMT):
If we don't end up using this implementation I wouldn't mind contributing it as another example application for the java sdk
medikent (Thu, 18 Apr 2019 16:08:54 GMT):
Has joined the channel.
chill37 (Fri, 19 Apr 2019 06:58:10 GMT):
@Antimttr @rickr Found it. Thanks!
OrestFremy (Fri, 19 Apr 2019 18:45:10 GMT):
Has joined the channel.
OrestFremy (Fri, 19 Apr 2019 18:50:11 GMT):
Hello, i am stucked with chaincode instantiate.
I have following exception : error starting container: error starting container: API error (400): OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"chaincode\": executable file not found in $PATH": unknown, on peerPeer{ id: 14, name: peer0.a.example.com, channelName: common, url: grpcs://peer0.a.example.com:7051} .
OrestFremy (Fri, 19 Apr 2019 18:50:11 GMT):
Hello, i am stucked with chaincode instantiate.
I have following exception : error starting container: error starting container: API error (400): OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"chaincode\": executable file not found in $PATH": unknown, on peerPeer{ id: 14, name: peer0.a.example.com, channelName: common, url: grpcs://peer0.a.example.com:7051} . Can anyone help me with this?
OrestFremy (Fri, 19 Apr 2019 18:50:11 GMT):
Hello, i am stucked with chaincode instantiate.
I have following exception : error starting container: error starting container: API error (400): OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"chaincode\": executable file not found in $PATH": unknown, on peerPeer{ id: 14, name: peer0.a.example.com, channelName: common, url: grpcs://peer0.a.example.com:7051} . Can anyone help me with this? I set the same chaincode path as when i installed it on peer
OrestFremy (Fri, 19 Apr 2019 18:50:11 GMT):
@rickr @Antimttr Hello, i am stucked with chaincode instantiate.
I have following exception : error starting container: error starting container: API error (400): OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"chaincode\": executable file not found in $PATH": unknown, on peerPeer{ id: 14, name: peer0.a.example.com, channelName: common, url: grpcs://peer0.a.example.com:7051} . Can anyone help me with this? I set the same chaincode path as when i installed it on peer
rickr (Sat, 20 Apr 2019 19:16:48 GMT):
FYI The latest SDK (master) has v2.0 chaincode lifecycle management APIs which is a major change to how chaincode is deployed. Previous APIs are deprecated. Once a channel is migrated to v2.0 capabilities the v1.x APIs can no longer be used.
Antimttr (Mon, 22 Apr 2019 00:39:17 GMT):
@rickr any example of 2.0 implementations for java yet? or is that all in the repo
anjalinaik (Mon, 22 Apr 2019 05:42:50 GMT):
How do we expose the chaincode functions to external applications? Do we need to create rest API specific to chaincode through fabric-java-sdk or is there an alternative?
knagware9 (Mon, 22 Apr 2019 06:36:09 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=TqQ6swhhsLtEywhhz) @anjalinaik yes we need to build rest api using java sdk or you can directly implement java sdk in your application without rest api
anjalinaik (Mon, 22 Apr 2019 08:12:14 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=mohpeYRLH3bkyWBqq) @knagware9 thankyou :)
anjalinaik (Mon, 22 Apr 2019 08:49:11 GMT):
Hi Team. Can we limit the identity of user for the visibility of chaincode events.
rickr (Mon, 22 Apr 2019 10:39:06 GMT):
Test
ZLL (Mon, 22 Apr 2019 11:12:47 GMT):
Has joined the channel.
rickr (Mon, 22 Apr 2019 11:55:28 GMT):
@anjalinaik What are you asking? Can you prevent a specific user from seeing chaincode events? Do you want in the chaincode events to not be able to identify the user? Something else ?
bilalahmed (Mon, 22 Apr 2019 12:50:45 GMT):
I've setup a whole network. Channel is created and peers/orderers already joined it. Now, I want to write a client application to perform transactions and invoke chaincode already deployed on peers on this network. Now, I can see in SDK client.newChannel(), so will this create a new channel or will acquire channel already setup on the network?
bilalahmed (Mon, 22 Apr 2019 12:51:53 GMT):
For new channel name, I'm getting the following error on orderer container logs:
[channel: baychannel] Rejecting broadcast of config message from 172.28.0.1:33414 because of error: error validating channel creation transaction for new channel 'newchannel', could not succesfully 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
bilalahmed (Mon, 22 Apr 2019 12:51:53 GMT):
For new channel name, I'm getting the following error on orderer container logs:
[channel: newchannel] Rejecting broadcast of config message from 172.28.0.1:33414 because of error: error validating channel creation transaction for new channel 'newchannel', 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
bilalahmed (Mon, 22 Apr 2019 12:54:07 GMT):
And when I pass the name of the channel which is already setup on the network, I get the following on orderer:
[channel: ttchannel] Rejecting broadcast of config message from 172.28.0.1:33424 because of error: error applying config update to existing channel 'ttchannel': error authorizing update: error validating ReadSet: proposed update requires that key [Group] /Channel/Application be at version 0, but it is currently at version 1
bilalahmed (Mon, 22 Apr 2019 12:54:15 GMT):
@rickr can you please help
bilalahmed (Mon, 22 Apr 2019 12:59:30 GMT):
This error usually occur when channel is already created!
rickr (Mon, 22 Apr 2019 13:09:52 GMT):
Show in the integration examples of how to connect to an existing channel.
rickr (Mon, 22 Apr 2019 13:09:52 GMT):
Shown in the integration examples of how to connect to an existing channel.
bilalahmed (Mon, 22 Apr 2019 13:12:02 GMT):
great, can you please share fileName or particular section? Thanjs
bilalahmed (Mon, 22 Apr 2019 13:12:02 GMT):
great, can you please share fileName or particular section? Thanks
bilalahmed (Mon, 22 Apr 2019 13:20:07 GMT):
client.getChannel("mychannel") is returning null
Antimttr (Mon, 22 Apr 2019 13:33:00 GMT):
@BilalAhmad its in the buildchannel() function i beleive
BilalAhmad (Mon, 22 Apr 2019 13:33:00 GMT):
Has joined the channel.
Antimttr (Mon, 22 Apr 2019 13:33:09 GMT):
in end2endit.java
Antimttr (Mon, 22 Apr 2019 13:33:49 GMT):
you have to install the channel, then join peers to it, then add orderers
Antimttr (Mon, 22 Apr 2019 13:33:49 GMT):
you have to install the channel, then join peers to it, then add anchors
chill37 (Mon, 22 Apr 2019 16:12:39 GMT):
rickr (Mon, 22 Apr 2019 17:51:53 GMT):
Have you tried with getting an endorsements from O1 and O2 outside of Service discovery?
yacovm (Mon, 22 Apr 2019 18:31:10 GMT):
@chill37 you can try and use the `discover` CLI and ask the peer the same query.
yacovm (Mon, 22 Apr 2019 18:32:03 GMT):
it should work...
sejalpawar (Tue, 23 Apr 2019 11:06:33 GMT):
Has joined the channel.
sejalpawar (Tue, 23 Apr 2019 11:07:23 GMT):
Hey, I am getting the following errors while running tests:
sejalpawar (Tue, 23 Apr 2019 11:08:26 GMT):
Running org.hyperledger.fabric.sdk.PeerTest
2019-04-23 10:52:06,454 main INFO SampleStore:91 - Could not find the file "/home/ubuntu/test.properties"
2019-04-23 10:52:06,462 main INFO SampleStore:91 - Could not find the file "/home/ubuntu/test.properties"
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.966 s - in org.hyperledger.fabric.sdk.PeerTest
[INFO] Running org.hyperledger.fabric.sdk.EndpointTest
2019-04-23 10:52:07,121 main ERROR Endpoint:466 - Failed endpoint grpcs://localhost:594 to parse certificate TLS client
sejalpawar (Tue, 23 Apr 2019 11:09:45 GMT):
I tried removing docker volumes (docker volume prune --force), deleting peer containers (docker rm -f $(docker ps -aq)) and restarting the network
sejalpawar (Tue, 23 Apr 2019 11:10:07 GMT):
The file test.properties does exist at the path
chill37 (Tue, 23 Apr 2019 11:41:22 GMT):
@rickr yes. when I used channel.queryByChaincode() instead of channel.sendProposalToEndorsers() using all peers, it worked successfully.
when I did some digging, I found out that, sdChaincodeMap outputs null when called from sendProposalToEndorsers()
Channel.class line3654: final Map
chill37 (Tue, 23 Apr 2019 11:41:22 GMT):
@rickr yes. when I used channel.queryByChaincode() instead of channel.sendProposalToEndorsers() using all peers, it worked successfully.
when I did some digging, I found out that, sdChaincodeMap outputs null when called from sendProposalToEndorsers()
Channel.class line3654: final Map
chill37 (Tue, 23 Apr 2019 11:41:22 GMT):
@rickr yes. when I used channel.queryByChaincode() instead of channel.sendProposalToEndorsers() using all peers, it worked successfully.
when I did some digging, I found out that, sdChaincodeMap outputs null when called from sendProposalToEndorsers()
Channel.class line3654: final Map
chill37 (Tue, 23 Apr 2019 11:41:22 GMT):
@rickr yes. when I used channel.queryByChaincode() instead of channel.sendProposalToEndorsers() using all peers, it worked successfully.
when I did some digging, I found out that, sdChaincodeMap outputs null when called from sendProposalToEndorsers()
Channel.class line3654: final Map
chill37 (Tue, 23 Apr 2019 11:42:54 GMT):
@sejalpawar are you sure its localhost:594 and not localhost:5984? just a simple observation
chill37 (Tue, 23 Apr 2019 11:42:54 GMT):
@sejalpawar are you sure its localhost:594 and not localhost:5984? just a simple observation
chill37 (Tue, 23 Apr 2019 11:43:46 GMT):
@yacovm unfortunately, I'm trying to make it work using the java-sdk. Thanks though!
chill37 (Tue, 23 Apr 2019 11:44:07 GMT):
@sejalpawar are you sure its localhost:594 and not localhost:5984? just a simple observation
sejalpawar (Tue, 23 Apr 2019 11:49:00 GMT):
I didn't modify any files and that's what the error says
rickr (Tue, 23 Apr 2019 12:05:53 GMT):
@sejalpawar https://github.com/hyperledger/fabric-sdk-java#running-the-unit-tests
rickr (Tue, 23 Apr 2019 12:10:43 GMT):
@chill37 What version of the SDK? Can you put the SDK in logging trace mode, reproduce the error and then paste the logs using https://ctrlv.it/
chill37 (Tue, 23 Apr 2019 12:11:54 GMT):
@rickr v1.4.0 hold on....let me give you the trace log
rickr (Tue, 23 Apr 2019 12:14:02 GMT):
if you can make sure it has included the point where the channel is being initialized to error.
chill37 (Tue, 23 Apr 2019 12:17:20 GMT):
@rickr https://ctrlv.it/id/174822/755764539 will this work?
chill37 (Tue, 23 Apr 2019 12:19:16 GMT):
@rickr https://ctrlv.it/id/174824/516370265 cleaner version
rickr (Tue, 23 Apr 2019 12:48:32 GMT):
@chill37 Can you try to see if what yacovm suggests to get another point of reference. Also include the peer log of that error
This maybe the SDK not sending the request ok, or environment setup doing the above will see if env. is ok.
chill37 (Tue, 23 Apr 2019 12:50:35 GMT):
@rickr
you mean just the discover command?
e.g.
1) discover --configFile conf.yaml --MSP Org1MSP --peerTLSCA /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/User1@org1.example.com/tls/ca.crt --userKey /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/bc777711397ae659a7d87ef5c9b6c6909b39757c0559b93637d1159f79bccf6e_sk --userCert /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem saveConfig
2) discover --configFile conf.yaml peers --channel mychannel --server peer0.org1.example.com:7051
chill37 (Tue, 23 Apr 2019 12:53:37 GMT):
OUTPUT: (got the whole peers)
https://ctrlv.it/id/174830/354665286
rickr (Tue, 23 Apr 2019 12:54:56 GMT):
check if there is an option for chaincode query
chill37 (Tue, 23 Apr 2019 12:55:03 GMT):
or did you mean the one with endorser layout
chill37 (Tue, 23 Apr 2019 12:55:03 GMT):
https://ctrlv.it/id/174831/18613710
rickr (Tue, 23 Apr 2019 12:56:33 GMT):
is there an option for chaincode to chaincode ?
chill37 (Tue, 23 Apr 2019 12:56:34 GMT):
mycc2: https://ctrlv.it/id/174832/1659874682
chill37 (Tue, 23 Apr 2019 12:57:45 GMT):
well I made a chaincode function that invokes mycc2.query() or mycc2.invoke() function with response := stub.InvokeChaincode(anotherCCName, chainCodeArgs, anotherChannel)
chill37 (Tue, 23 Apr 2019 12:57:45 GMT):
well I made a chaincode function that invokes mycc2.query() or mycc2.invoke() function with response := stub.InvokeChaincode(anotherCCName, chainCodeArgs, anotherChannel) in my chaincode-exmaple.go
rickr (Tue, 23 Apr 2019 12:59:00 GMT):
on the command line there must be a chaincode mycc then mycc2
rickr (Tue, 23 Apr 2019 12:59:39 GMT):
Can you also rerun the sdk with trace and include the peer trace too
chill37 (Tue, 23 Apr 2019 13:03:11 GMT):
I did the trace log with -Dlogging.level.org.hyperledger.fabric.sdk=trace so peer is there too... or did you want protos.peer/?
rickr (Tue, 23 Apr 2019 13:04:07 GMT):
fabric peer's log
chill37 (Tue, 23 Apr 2019 13:06:46 GMT):
peer: https://ctrlv.it/id/174833/130118697
chill37 (Tue, 23 Apr 2019 13:06:46 GMT):
peer: https://ctrlv.it/id/174833/130118697
hold on this is only info and above
rickr (Tue, 23 Apr 2019 13:10:40 GMT):
@yacovm can you tell if the sdk is sending this request ok https://ctrlv.it/id/174833/130118697
2019-04-23 12:18:41.076 UTC [discovery] chaincodeQuery -> ERRO 2362 Failed constructing descriptor for chaincode chaincodes:
rickr (Tue, 23 Apr 2019 13:11:25 GMT):
@chill37 do you have anchor peers defined in your network ?
chill37 (Tue, 23 Apr 2019 13:12:15 GMT):
yes. I'm basically using first network...modifying just a little. MSP1Anchor.tx and msp2anchor.tx is there and updated
chill37 (Tue, 23 Apr 2019 13:13:36 GMT):
this log is there when I do BYFN up .
#################################################################
####### Generating anchor peer update for Org1MSP ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
rickr (Tue, 23 Apr 2019 13:16:57 GMT):
ok that produces a file Org1MSPanchors.tx you then need to use that to do the actual update .. I assume your doing that
chill37 (Tue, 23 Apr 2019 13:18:47 GMT):
yes. I didn't change that part from the byfn
peer log in debug at that fail moment: https://ctrlv.it/id/174834/872116487
chill37 (Tue, 23 Apr 2019 13:21:19 GMT):
here is the update part
Updating anchor peers for org1...
+ peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org1MSPanchors.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2019-04-23 13:21:02.305 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-04-23 13:21:02.343 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org1MSP' on channel 'mychannel' =====================
Updating anchor peers for org2...
+ peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org2MSPanchors.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2019-04-23 13:21:05.456 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-04-23 13:21:05.487 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org2MSP' on channel 'mychannel' =====================
rickr (Tue, 23 Apr 2019 13:23:32 GMT):
@yacovm > https://ctrlv.it/id/174834/872116487 can you look at this? See if SDK is sending request ok. As a novice on the peer code it looks ok. Result is no endorsement however.
chill37 (Tue, 23 Apr 2019 13:24:17 GMT):
Thanks @rickr and @yacovm for helping out!
sejalpawar (Tue, 23 Apr 2019 13:24:18 GMT):
@rickr I have followed the method for test execution and tried commands "mvn install" and "mvn package"..
rickr (Tue, 23 Apr 2019 13:25:03 GMT):
Whats the final output if you `mvn clean install` ?
sejalpawar (Tue, 23 Apr 2019 13:29:43 GMT):
@rickr output: https://hastebin.com/ejaxihecux.cs
rickr (Tue, 23 Apr 2019 13:38:43 GMT):
was that it ?
sejalpawar (Tue, 23 Apr 2019 13:40:33 GMT):
Yes, it stopped on that for atleast a couple of minutes
rickr (Tue, 23 Apr 2019 13:42:30 GMT):
did not go on .. are you running this on a virtual machine ?
sejalpawar (Tue, 23 Apr 2019 13:42:37 GMT):
AWS
sejalpawar (Tue, 23 Apr 2019 13:42:55 GMT):
t3.medium instance
rickr (Tue, 23 Apr 2019 13:44:16 GMT):
most likely not enough entropy http://giovannitorres.me/increasing-entropy-on-virtual-machines.html
rickr (Tue, 23 Apr 2019 13:48:25 GMT):
for now you could in org/hyperledger/fabric/sdk/identity/IdemixIdentitiesTest.java add ignore :
@Ignore
public class IdemixIdentitiesTest {
rickr (Tue, 23 Apr 2019 13:49:11 GMT):
if you're not doing Idemix stuff should be ok. otherwise you'll need to fix the entropy on the machine
sejalpawar (Tue, 23 Apr 2019 13:54:18 GMT):
It shows the same error after increasing entropy
sejalpawar (Tue, 23 Apr 2019 13:55:22 GMT):
Wait.. it finished execution this time
sejalpawar (Tue, 23 Apr 2019 13:56:37 GMT):
https://hastebin.com/wehimojelo.cs
sejalpawar (Tue, 23 Apr 2019 13:56:44 GMT):
new output
sejalpawar (Tue, 23 Apr 2019 13:59:22 GMT):
Steps I took for running tests:
sejalpawar (Tue, 23 Apr 2019 13:59:24 GMT):
docker rm -f $(docker ps -aq)
docker volume prune --force
docker network prune --force
rm -rf test.properties
git clone https://github.com/hyperledger/fabric-sdk-java.git
cd fabric-sdk-java/src/test/fixture/sdkintegration
./fabric.sh clean
./fabric.sh restart
cd ../../../../
mvn clean install
sejalpawar (Tue, 23 Apr 2019 14:00:56 GMT):
Environment: openjdk version "1.8.0_191", docker version 18.09, docker-compose version 1.71.1
rickr (Tue, 23 Apr 2019 14:08:48 GMT):
says build success
Antimttr (Tue, 23 Apr 2019 14:40:31 GMT):
@rickr what would be a good way with the java sdk to check for chaincode instantiation?
Antimttr (Tue, 23 Apr 2019 14:40:45 GMT):
I know how to check for installation using queryInstalledChaincodes()
rickr (Tue, 23 Apr 2019 14:49:43 GMT):
Should be covered in the integration tests
Antimttr (Tue, 23 Apr 2019 14:50:47 GMT):
well
Antimttr (Tue, 23 Apr 2019 14:50:50 GMT):
it is and it isnt
Antimttr (Tue, 23 Apr 2019 14:51:00 GMT):
see the integration tests actualy send out the transaction proposals
Antimttr (Tue, 23 Apr 2019 14:51:15 GMT):
and they test to verify that the proposal was accepted by the orderer(s)
Antimttr (Tue, 23 Apr 2019 14:51:22 GMT):
but what if you dont have the proposal?
Antimttr (Tue, 23 Apr 2019 14:51:25 GMT):
how to test then?
rickr (Tue, 23 Apr 2019 14:51:39 GMT):
What integration test have you took the time to walk through ?
Antimttr (Tue, 23 Apr 2019 14:51:49 GMT):
end2endit and the other one
Antimttr (Tue, 23 Apr 2019 14:52:08 GMT):
servicediscoveryit
Antimttr (Tue, 23 Apr 2019 14:52:08 GMT):
updatechannel
rickr (Tue, 23 Apr 2019 14:53:57 GMT):
@Antimttr End2endAndBackAgainIT.java ?
Antimttr (Tue, 23 Apr 2019 14:54:07 GMT):
ill check that one
sejalpawar (Tue, 23 Apr 2019 14:54:32 GMT):
@rickr what about the line couldn't find file /home/ubuntu/test.properties? Is it an error that's supposed to occur or is it an error that occurs but we can ignore?
Antimttr (Tue, 23 Apr 2019 14:55:38 GMT):
` private static boolean checkInstantiatedChaincode` there it is!
rickr (Tue, 23 Apr 2019 14:56:17 GMT):
@sejalpawar
rickr (Tue, 23 Apr 2019 14:56:20 GMT):
Clipboard - April 23, 2019 10:56 AM
sejalpawar (Tue, 23 Apr 2019 15:00:30 GMT):
Thanks @rickr !
yacovm (Tue, 23 Apr 2019 15:19:44 GMT):
@chill37 @rickr I have a bug :(
yacovm (Tue, 23 Apr 2019 15:20:44 GMT):
the reduce function doesn't work well when the input to it is 2 sets that are identical
yacovm (Tue, 23 Apr 2019 15:24:09 GMT):
i'll fix it soon and push a fix
rickr (Tue, 23 Apr 2019 15:41:39 GMT):
`I have a bug` I'm going to record this for posterity !! LOL :wink:
yacovm (Tue, 23 Apr 2019 15:42:19 GMT):
hey even god makes mistakes
yacovm (Tue, 23 Apr 2019 15:43:50 GMT):
@chill37 can you open a JIRA please? http://jira.hyperledger.org/
rickr (Tue, 23 Apr 2019 15:43:54 GMT):
Thanks for help, Amen :pray_tone1:
rickr (Tue, 23 Apr 2019 15:43:54 GMT):
Thanks for the help, Amen :pray_tone1:
Antimttr (Tue, 23 Apr 2019 16:16:51 GMT):
@rickr correct me if i'm wrong but if you're using nodejs chaincode, then a call to private static boolean checkInstalledChaincode(HFClient client, Peer peer, String ccName, String ccPath, String ccVersion) shoudl contain a blank ccPath, since nodejs doesnt allow you to set a chaincode path when you're installing it originally, right?
Antimttr (Tue, 23 Apr 2019 16:16:51 GMT):
@rickr correct me if i'm wrong but if you're using nodejs chaincode, then a call to `private static boolean checkInstalledChaincode(HFClient client, Peer peer, String ccName, String ccPath, String ccVersion)` should contain a blank ccPath, since nodejs doesnt allow you to set a chaincode path when you're installing it originally, right?
Antimttr (Tue, 23 Apr 2019 16:17:35 GMT):
atleast I'm getting a blank chaincode path when i retrieve the chaincode info object from the client
Antimttr (Tue, 23 Apr 2019 16:17:49 GMT):
i assume its because im using nodejs chaincode
Antimttr (Tue, 23 Apr 2019 16:18:42 GMT):
and even though i set this: `installProposalRequest.setChaincodeSourceLocation(Paths.get(chaincodePath).toFile());` it doesn't actually mean i'm setting a chaincodePath like you would with java chaincode
yacovm (Tue, 23 Apr 2019 16:47:50 GMT):
@rickr @chill37 https://gerrit.hyperledger.org/r/#/c/31068/
rickr (Tue, 23 Apr 2019 17:18:00 GMT):
@Antimttr Not clear what your asking. When installing chaincode only GO type chaincode needs a chaincode path.
rickr (Tue, 23 Apr 2019 17:19:18 GMT):
which is really the GOPATH. Node and Java have no concept of that.
Antimttr (Tue, 23 Apr 2019 18:52:09 GMT):
@rickr when I call 'chaincodeIDBuilder.setPath(chaincodePath);' during installation of chaincode on a nodejs chaincode type it throws an exception
Antimttr (Tue, 23 Apr 2019 18:52:09 GMT):
@rickr when I call `chaincodeIDBuilder.setPath(chaincodePath);` during installation of chaincode on a nodejs chaincode type it throws an exception
Antimttr (Tue, 23 Apr 2019 18:52:16 GMT):
says that i shouldnt set the path for node chaincode
Antimttr (Tue, 23 Apr 2019 18:52:27 GMT):
so i only set the path if its not node
Antimttr (Tue, 23 Apr 2019 18:53:45 GMT):
then later, when im reading my chaincodeinfo object, for the nodejs chaincode the getPath() returns an empty string
rickr (Tue, 23 Apr 2019 19:02:21 GMT):
ok
rickr (Tue, 23 Apr 2019 19:02:55 GMT):
that's what the Fabric returns if you don't set it.
chill37 (Wed, 24 Apr 2019 00:21:13 GMT):
@yacovm @rickr Thanks yacovm. I just saw the msg about opening up the JIRA(different timezone. just came back to office). Saw that you've already opened and fixed the code
Thank you both for taking time to check on it! :pray:
anjalinaik (Wed, 24 Apr 2019 05:52:44 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=uNijkMWyNsSGuiLa5) @rickr yes I meant, Can we prevent a specific user from seeing a chaincode event.
anjalinaik (Wed, 24 Apr 2019 05:53:23 GMT):
Hi Team, is there a sample code for adding an organization dynamically to the channel using fabric-java-sdk
yyyyyyy9 (Wed, 24 Apr 2019 07:24:07 GMT):
Has left the channel.
JorgeNavarro (Wed, 24 Apr 2019 07:34:15 GMT):
Hello, someone has a basic example that explains how to create a channel with java sdk 1.3?
AndresMartinezMelgar.itcl (Wed, 24 Apr 2019 07:36:42 GMT):
Hi, if i have a 1.3 network version,can i use 1.0v from sdk?
yacovm (Wed, 24 Apr 2019 07:45:19 GMT):
@chill37 I merged the fix to all branches from 1.2 to the latest branch
rickr (Wed, 24 Apr 2019 11:08:49 GMT):
@anjalinaik I don't think so. If there is it would be a Fabric server config. I'd ask on #fabric-questions or #fabric-peer-endorser-committer
rickr (Wed, 24 Apr 2019 11:10:51 GMT):
@JorgeNavarro Nothing has changed on the SDK side. You need to create an orderer block using configtx tool It documented in the README.md
rickr (Wed, 24 Apr 2019 11:13:00 GMT):
@AndresMartinezMelgar.itcl Nothing that's ever tested. The expectation your app moves up with SDK version to match fabric. The SDK offers some _backward_ compatibility
AndresMartinezMelgar.itcl (Wed, 24 Apr 2019 11:40:30 GMT):
@rickr Thanks
anjalinaik (Thu, 25 Apr 2019 04:07:18 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=4ha6JjQ5yg84at6QQ) @rickr thankyou :smiley:
anjalinaik (Thu, 25 Apr 2019 05:08:10 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=D4iDXc8psaziXxNSx) @rickr how about this? Do we have a sample code for dynamic addition of orgs to a channel.
chill37 (Thu, 25 Apr 2019 05:19:56 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=LfR28s6c8av4MssTk) @yacovm I saw the updates. thanks!
AndresMartinezMelgar.itcl (Thu, 25 Apr 2019 06:23:51 GMT):
The variable "properties" of "Peer peer = client.new Peer (name, grpc URL, properties);" To which it refers? I know I have to create an object properties, but what do I have to put inside it?
bilalahmed (Thu, 25 Apr 2019 06:48:42 GMT):
Here is sample properties object:
Properties peerProperties = new Properties();
peerProperties.setProperty("sslProvider", "openSSL");
peerProperties.setProperty("negotiationType", "TLS");
peerProperties.setProperty("trustServerCertificate", "true"); //testing environment only NOT FOR PRODUCTION!
peerProperties.setProperty("hostnameOverride", "peer0.org1.example.com");
peerProperties.setProperty("pemFile", "/Users/BAY/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt");
bilalahmed (Thu, 25 Apr 2019 06:50:24 GMT):
please update accordingly
AndresMartinezMelgar.itcl (Thu, 25 Apr 2019 06:50:25 GMT):
@bilalahmed so properties doesnt come from any file?
bilalahmed (Thu, 25 Apr 2019 06:51:16 GMT):
it depends, you can specify properties/configs in some JSON/YAML file and read from that file to populate this properties object
bilalahmed (Thu, 25 Apr 2019 06:51:42 GMT):
please refer to the SDK Integration tests
AndresMartinezMelgar.itcl (Thu, 25 Apr 2019 06:52:08 GMT):
ok thx
bilalahmed (Thu, 25 Apr 2019 06:53:16 GMT):
you are welcome, lemme know if you further need any help as I recently worked with it so familiar with possible issues one encounters while implementing it.
anjalinaik (Thu, 25 Apr 2019 10:47:56 GMT):
Can anyone please guide me with below error. I have a network configured for a single organization with 2 peers in it. I have installed private_data_cc.go to verify private data. I have defined the collection.yaml file for all the members in org1. Yet i am unable to query data from org1peer2. [able to query data from org1peer1] .org1peer2 logs: ```
2019-04-25 10:40:05.166 UTC [ledgermgmt] CreateLedger -> INFO 0fa Creating ledger [mychan] with genesis block
2019-04-25 10:40:05.346 UTC [ledgermgmt] CreateLedger -> INFO 0fb Created ledger [mychan] with genesis block
2019-04-25 10:40:05.364 UTC [gossip/state] NewGossipStateProvider -> INFO 0fc Updating metadata information, current ledger sequence is at = 0, next expected block is = 1
2019-04-25 10:40:11.367 UTC [gossip/service] func1 -> INFO 0fd Elected as a leader, starting delivery service for channel mychan
2019-04-25 10:42:00.587 UTC [gossip/privdata] StoreBlock -> INFO 0fe [mychan] Received block [1] from buffer
2019-04-25 10:43:38.203 UTC [gossip/privdata] StoreBlock -> INFO 0ff [mychan] Received block [2] from buffer
2019-04-25 10:43:42.549 UTC [gossip/privdata] StoreBlock -> INFO 100 [mychan] Received block [3] from buffer
2019-04-25 10:43:46.449 UTC [endorser] ProcessProposal -> ERRO 101 [mychan][1cd2661f] simulateProposal() resulted in chaincode name:"privi" response status 500 for txid: 1cd2661f2065360b5d6ad34c2379765d30296f65b494b964501ce044cbe6a0da
2019-04-25 10:43:46.600 UTC [gossip/privdata] fetchPrivateData -> WARN 102 Do not know any peer in the channel( mychan ) that matches the policies , aborting
2019-04-25 10:43:46.600 UTC [gossip/privdata] fetchFromPeers -> WARN 103 Failed fetching private data for block 3 from peers: Empty membership
2019-04-25 10:43:51.606 UTC [gossip/privdata] fetchPrivateData -> WARN 104 Do not know any peer in the channel( mychan ) that matches the policies , aborting
2019-04-25 10:43:51.606 UTC [gossip/privdata] fetchFromPeers -> WARN 105 Failed fetching private data for block 3 from peers: Empty membership
2019-04-25 10:43:56.611 UTC [gossip/privdata] fetchPrivateData -> WARN 106 Do not know any peer in the channel( mychan ) that matches the policies , aborting
2019-04-25 10:43:56.611 UTC [gossip/privdata] fetchFromPeers -> WARN 107 Failed fetching private data for block 3 from peers: Empty membership
```
AndresMartinezMelgar.itcl (Thu, 25 Apr 2019 11:09:26 GMT):
Clipboard - April 25, 2019 1:08 PM
Fias (Fri, 26 Apr 2019 06:55:12 GMT):
Has joined the channel.
darapich92 (Fri, 26 Apr 2019 07:06:09 GMT):
hello everybody, today i try to instantiate Java Chaincode in the fabric java sdk 1.4.0. i got success from peers admin but when i instantiate this chaincode to Channel i receive message "Java chaincode is work-in-progress and disabled" and receive status Failure, Could you explain me Why?
rickr (Fri, 26 Apr 2019 11:54:09 GMT):
@AndresMartinezMelgar.itcl Please take not sdk issue to related channel #fabric-questions maybe?
rickr (Fri, 26 Apr 2019 11:54:09 GMT):
@AndresMartinezMelgar.itcl Please take non sdk issue to related channel #fabric-questions maybe?
rickr (Fri, 26 Apr 2019 11:56:52 GMT):
@darapich92 You must be going against a later Fabric version. I think java chaincode came in 1.3. If you are running that or later then ask on #fabric-java-chaincode
rickr (Fri, 26 Apr 2019 11:58:50 GMT):
@anjalinaik Best asked on #fabric-peer-endorser-committer
darapich92 (Fri, 26 Apr 2019 15:22:39 GMT):
@rickr thank you very much for your information.
ZLL (Sat, 27 Apr 2019 12:10:19 GMT):
How can fabric-sdk-java dynamically add node organization channel ? Is there a sample for reference?
pdintchev (Sat, 27 Apr 2019 17:39:06 GMT):
Has joined the channel.
tsnyder (Sun, 28 Apr 2019 10:46:13 GMT):
I have a network config of 5 Peers with 2 channels across a differing subset of the Peers. I am using Fabric 1.4.1, Java SDK, and have Service Discovery and the Eventing Services working within the client app. My question relates to periodically refreshing the Service Discovery info. Currently the service discovery happens within
APelser (Sun, 28 Apr 2019 17:49:09 GMT):
Has joined the channel.
APelser (Sun, 28 Apr 2019 18:11:25 GMT):
Hello people! I have set up a TLS-enable Hyperledger network on one machine, using Fabric 1.4.1 with Java chaincode. Cryptographic materials were generated using cryptogen, Docker is used for running the network components. Everything works absolutely fine when using CLI commands (e.g. "docker exec peer0.org0.example.com (...)"). When using the Java SDK (version 1.4.1 from Maven) however, I can only let the _first_ peer of the _first_ organisation validate my proposals (this is also the peer for which there is no port mapping).The steps I'm taking are: enrolling an admin with the CA (goes fine), registering and enrolling a user with the CA (goes fine),
APelser (Sun, 28 Apr 2019 18:53:52 GMT):
Hello people! I have set up a TLS-enables Hyperledger network on a single physical machine, using Fabric 1.4.1 with Java chaincode. Cryptographic materials were generated using cryptogen and Docker is used for running the network components. Everything works absolutely fine when using CLI commands (e.g. "docker exec peer0.org0.example.com (...)"). My goal is to use the Java SDK (version 1.4.1 from Maven) to connect to an existing channel, possibly with pre-generated crypto-materials, and query/invoke the (already installed/instantiated, and functioning chaincode). However, when the time comes to get my proposals validated, I can only let the _first_ peer of the _first_ organisation validate them (this is also the peer for which there is no port mapping, but I've tried changing ports, to no avail).
The steps I'm taking are: enrolling an admin with the CA (goes fine), registering and enrolling a user with the CA (goes fine), creating a new channel through `HFClient.newChannel`, adding peers and orderers to it, sending a query (`Channel.queryByChaincode`), and then waiting a second before reading the response. The following error is produced when calling `ProposalResponse.getChaincodeActionResponsePayload()`: `gRPC failure=Status{code=UNKNOWN, description=channel closed, cause=java.nio.channels.ClosedChannelException}`.
APelser (Sun, 28 Apr 2019 19:46:12 GMT):
Hello people! I have set up a TLS-enabled Hyperledger network on a single physical machine, using Fabric 1.4.1 with Java chaincode. Cryptographic materials were generated using cryptogen and Docker is used for running the network components. Everything works absolutely fine when using CLI commands (e.g. "docker exec peer0.org0.example.com (...)"). My goal is to use the Java SDK (version 1.4.1 from Maven) to connect to an existing channel, possibly with pre-generated crypto-materials, and query/invoke the (already installed/instantiated, and functioning chaincode). However, when the time comes to get my proposals validated, I can only let the peer that doesn't have its ports mapped do so. I've already tried using ports 7051/7053 for all peers though, to no avail (different errors, basically telling me the host can't be found).
The steps I'm taking are: enrolling an admin with the CA (goes fine), registering and enrolling a user with the CA (goes fine), creating a new channel through `HFClient.newChannel`, adding peers and orderers to it, sending a query (`Channel.queryByChaincode`), and then waiting a second before reading the response. The following error is produced when calling `ProposalResponse.getChaincodeActionResponsePayload()`: `gRPC failure=Status{code=UNKNOWN, description=channel closed, cause=java.nio.channels.ClosedChannelException}`.
During channel setup, the PEM-files I am providing are: tlsca.example.com-cert.pem (for the orderer), ca.org.example.com-cert.pem (for the CA) and `crypto-config/peerOrganizations/org.example.com/peers/peer
APelser (Sun, 28 Apr 2019 19:46:12 GMT):
Hello people! I have set up a TLS-enabled Hyperledger network on a single physical machine, using Fabric 1.4.1 with Java chaincode. Cryptographic materials were generated using cryptogen and Docker is used for running the network components. Everything works absolutely fine when using CLI commands (e.g. "docker exec peer0.org.example.com (...)"). My goal is to use the Java SDK (version 1.4.1 from Maven) to connect to an existing channel, possibly with pre-generated crypto-materials, and query/invoke the (already installed/instantiated, and functioning chaincode). However, when the time comes to get my proposals validated, I can only let the peer that doesn't have its ports mapped do so. I've already tried using ports 7051/7053 for all peers though, to no avail (different errors, basically telling me the host can't be found).
The steps I'm taking are: enrolling an admin with the CA (goes fine), registering and enrolling a user with the CA (goes fine), creating a new channel through `HFClient.newChannel`, adding peers and orderers to it, sending a query (`Channel.queryByChaincode`), and then waiting a second before reading the response. The following error is produced when calling `ProposalResponse.getChaincodeActionResponsePayload()`: `gRPC failure=Status{code=UNKNOWN, description=channel closed, cause=java.nio.channels.ClosedChannelException}`.
During channel setup, the PEM-files I am providing are: tlsca.example.com-cert.pem (for the orderer), ca.org.example.com-cert.pem (for the CA) and `crypto-config/peerOrganizations/org.example.com/peers/peer
APelser (Sun, 28 Apr 2019 19:46:12 GMT):
Hello people! I have set up a TLS-enabled Hyperledger network on a single physical machine, using Fabric 1.4.1 with Java chaincode. Cryptographic materials were generated using cryptogen and Docker is used for running the network components. Everything works absolutely fine when using CLI commands (e.g. "docker exec peer0.org.example.com (...)"). My goal is to use the Java SDK (version 1.4.1 from Maven) to connect to an existing channel, possibly with pre-generated crypto-materials, and query/invoke the (already installed/instantiated, and functioning chaincode). However, when the time comes to get my proposals validated, I can only let the peer that doesn't have its ports mapped do so - for all other peers, an error occurs (see down below). I've already tried using ports 7051/7053 for all peers though, to no avail (different errors, basically telling me the host can't be found).
The steps I'm taking are: enrolling an admin with the CA (goes fine), registering and enrolling a user with the CA (goes fine), creating a new channel through `HFClient.newChannel`, adding peers and orderers to it, sending a query (`Channel.queryByChaincode`), and then waiting a second before reading the response. The following error is produced when calling `ProposalResponse.getChaincodeActionResponsePayload()`: `gRPC failure=Status{code=UNKNOWN, description=channel closed, cause=java.nio.channels.ClosedChannelException}`.
During channel setup, the PEM-files I am providing are: tlsca.example.com-cert.pem (for the orderer), ca.org.example.com-cert.pem (for the CA) and `crypto-config/peerOrganizations/org.example.com/peers/peer
APelser (Sun, 28 Apr 2019 19:46:12 GMT):
Hello people! I have set up a TLS-enabled Hyperledger network on a single physical machine, using Fabric 1.4.1 with Java chaincode. Cryptographic materials were generated using cryptogen and Docker is used for running the network components. Everything works absolutely fine when using CLI commands (e.g. "docker exec peer0.org.example.com (...)"). My goal is to use the Java SDK (version 1.4.1 from Maven) to connect to an existing channel, possibly with pre-generated crypto-materials, and query/invoke the (already installed/instantiated, and functioning chaincode). However, when the time comes to get my proposals validated, I can only let the peer that doesn't have its ports mapped do so - for all other peers, an error occurs (see down below). I've already tried addressing all peers using ports 7051/7053 though, to no avail (different errors, basically telling me the host can't be found).
The steps I'm taking are: enrolling an admin with the CA (goes fine), registering and enrolling a user with the CA (goes fine), creating a new channel through `HFClient.newChannel`, adding peers and orderers to it, sending a query (`Channel.queryByChaincode`), and then waiting a second before reading the response. The following error is produced when calling `ProposalResponse.getChaincodeActionResponsePayload()`: `gRPC failure=Status{code=UNKNOWN, description=channel closed, cause=java.nio.channels.ClosedChannelException}`.
During channel setup, the PEM-files I am providing are: tlsca.example.com-cert.pem (for the orderer), ca.org.example.com-cert.pem (for the CA) and `crypto-config/peerOrganizations/org.example.com/peers/peer
APelser (Sun, 28 Apr 2019 19:46:12 GMT):
Hello people! I have set up a TLS-enabled Hyperledger network on a single physical machine, using Fabric 1.4.1 with Java chaincode. Cryptographic materials were generated using cryptogen and Docker is used for running the network components. Everything works absolutely fine when using CLI commands (e.g. "docker exec peer0.org.example.com (...)"). My goal is to use the Java SDK (version 1.4.1 from Maven) to connect to an existing channel, possibly with pre-generated crypto-materials, and query/invoke the (already installed/instantiated, and functioning chaincode). However, when the time comes to get my proposals validated, I can only let the peer that doesn't have its ports mapped do so - for all other peers, an error occurs (see down below). I've already tried addressing all peers using ports 7051/7053 though, to no avail (different errors, basically telling me the host can't be found).
The steps I'm taking are: enrolling an admin with the CA (goes fine), registering and enrolling a user with the CA (goes fine), creating a new channel through `HFClient.newChannel`, adding peers and orderers to it, sending a query ( `Channel.queryByChaincode` ), and then waiting a second before reading the response. The following error is produced when calling `ProposalResponse.getChaincodeActionResponsePayload()`: `gRPC failure=Status{code=UNKNOWN, description=channel closed, cause=java.nio.channels.ClosedChannelException}`.
During channel setup, the PEM-files I am providing are: tlsca.example.com-cert.pem (for the orderer), ca.org.example.com-cert.pem (for the CA) and `crypto-config/peerOrganizations/org.example.com/peers/peer
APelser (Sun, 28 Apr 2019 19:46:12 GMT):
Hello people! I have set up a TLS-enabled Hyperledger network on a single physical machine, using Fabric 1.4.1 with Java chaincode. Cryptographic materials were generated using cryptogen and Docker is used for running the network components. Everything works absolutely fine when using CLI commands (e.g. "docker exec peer0.org.example.com (...)"). My goal is to use the Java SDK (version 1.4.1 from Maven) to connect to an existing channel, possibly with pre-generated crypto-materials, and query/invoke the (already installed/instantiated, and functioning chaincode). However, when the time comes to get my proposals validated, I can only let the peer that doesn't have its ports mapped do so - for all other peers, an error occurs (see down below). I've already tried addressing all peers using ports 7051/7053 though, to no avail (different errors, basically telling me the host can't be found).
The steps I'm taking are: enrolling an admin with the CA (goes fine), registering and enrolling a user with the CA (goes fine), creating a new channel through `HFClient.newChannel`, adding peers and orderers to it, sending a query ( `Channel.queryByChaincode` ), and then waiting a second before reading the response. The following error is produced when calling `ProposalResponse.getChaincodeActionResponsePayload()`: `gRPC failure=Status{code=UNKNOWN, description=channel closed, cause=java.nio.channels.ClosedChannelException}`.
During channel setup, the PEM-files I am providing are: `tlsca.example.com-cert.pem` (for the orderer), `ca.org.example.com-cert.pem` (for the CA) and `crypto-config/peerOrganizations/org.example.com/peers/peer
APelser (Sun, 28 Apr 2019 19:46:12 GMT):
Hello people! I have set up a TLS-enabled Hyperledger network on a single physical machine, using Fabric 1.4.1 with Java chaincode. Cryptographic materials were generated using cryptogen and Docker is used for running the network components. Everything works absolutely fine when using CLI commands (e.g. "docker exec peer0.org.example.com (...)"). My goal is to use the Java SDK (version 1.4.1 from Maven) to connect to an existing channel, possibly with pre-generated crypto-materials, and query/invoke the (already installed/instantiated, and functioning chaincode). However, when the time comes to get my proposals validated, I can only let the peer that doesn't have its ports mapped do so - for all other peers, an error occurs (see down below). I've already tried addressing all peers using ports 7051/7053 though, to no avail (different errors, basically telling me the host can't be found).
The steps I'm taking are: enrolling an admin with the CA (goes fine), registering and enrolling a user with the CA (goes fine), creating a new channel through `HFClient.newChannel`, adding peers and orderers to it, sending a query ( `Channel.queryByChaincode` ), and then waiting a second before reading the response. The following error is produced when calling `ProposalResponse.getChaincodeActionResponsePayload()`: `gRPC failure=Status{code=UNKNOWN, description=channel closed, cause=java.nio.channels.ClosedChannelException}`.
During channel setup, the PEM-files I am providing are: `tlsca.example.com-cert.pem` (for the orderer), `ca.org.example.com-cert.pem` (for the CA) and `crypto-config/peerOrganizations/org.example.com/peers/peer
APelser (Sun, 28 Apr 2019 19:46:12 GMT):
Hello people! I have set up a TLS-enabled Hyperledger network on a single physical machine, using Fabric 1.4.1 with Java chaincode. Cryptographic materials were generated using cryptogen and Docker is used for running the network components. Everything works absolutely fine when using CLI commands (e.g. "docker exec peer0.org.example.com (...)"). My goal is to use the Java SDK (version 1.4.1 from Maven) to connect to an existing channel, possibly with pre-generated crypto-materials, and query/invoke the (already installed/instantiated, and functioning chaincode). However, when the time comes to get my proposals validated, I can only let the peer that doesn't have its ports mapped do so - for all other peers, an error occurs (see down below). I've already tried addressing all peers using ports 7051/7053 though, to no avail (different errors, basically telling me the host can't be found).
The steps I'm taking are: enrolling an admin with the CA (goes fine), registering and enrolling a user with the CA (goes fine), creating a new channel through `HFClient.newChannel`, adding peers and orderers to it, sending a query ( `Channel.queryByChaincode` ), and then waiting a second before reading the response. The following error is produced when calling `ProposalResponse.getChaincodeActionResponsePayload()`: `gRPC failure=Status{code=UNKNOWN, description=channel closed, cause=java.nio.channels.ClosedChannelException}`.
During channel setup, the PEM-files I am providing are: `tlsca.example.com-cert.pem` (for the orderer), `ca.org.example.com-cert.pem` (for the CA) and `crypto-config/peerOrganizations/org.example.com/peers/peer
AndresMartinezMelgar.itcl (Mon, 29 Apr 2019 09:12:32 GMT):
hello, in order to install and instantiate a java chaincode whit JAVA-SDK within the kubernetes cluster, do I need to implement a "fabric-javaenv" docker?
rickr (Mon, 29 Apr 2019 11:54:51 GMT):
@ZLL I don't know of a sample. The fabric should IMO document what needs to be done as it's not specific to the any SDK. UpdateChannelIT.java does show for the most simplistic change of a channel parameter (Batch size) changing. You'd roughly be doing that with I think the system channel.
rickr (Mon, 29 Apr 2019 12:08:58 GMT):
@tsnyder https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/helper/Config.java#L460
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L5159-L5169
rickr (Mon, 29 Apr 2019 12:15:57 GMT):
@APelser Some configuration issue I'm thinking which is hard to determine from just a description. But If you are creating the channel via the SDK then *joining* the peers via the sdk .. if this is a connection configuration issue .. how is that working ?
rickr (Mon, 29 Apr 2019 12:19:01 GMT):
@AndresMartinezMelgar.itcl I don't think so .. on production (GA'ed) It's been my experience that the peer will pull it down for you. @gennadyl
rickr (Mon, 29 Apr 2019 12:19:01 GMT):
@AndresMartinezMelgar.itcl I don't think so .. on production (GA'ed) It's been my experience that the peer will pull the javaenv down for you. @gennadyl
rickr (Mon, 29 Apr 2019 12:29:15 GMT):
@APelser if its a connection issue try looking at `openssl s_client -connect l` to get connection as an independent test .. it also usually gives back better error messages than grpc/ssl connection do.
rickr (Mon, 29 Apr 2019 12:29:15 GMT):
@APelser if its a connection issue try looking at `openssl s_client -connect ` to get connection as an independent test .. it also usually gives back better error messages than grpc/ssl connection do. google openssl s_client
APelser (Mon, 29 Apr 2019 13:53:19 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=h8bnHqQHc544KKyci) @rickr I don't think I am joining the peers, I am calling `Channel.addPeer()`/`Channel.addEventhub()`, and finally `Channel.initialize()` , as is done in the example I found online. As far as I understand, this is not the same as sending a join proposal - but please correct me if I'm wrong. Also, I actually managed to get things working by mapping _all_ ports to themselves in peers (7051->7051 in peer0, 7101->7101 in peer1, and so on) in the docker-compose file. I honestly have no idea why this would work better than what I did before (7051->7051 for peer0, 7101->7051 for peer1, ...). I'm not 100% sure this is a proper solution though, since mapping ports to themselves just feels silly - but maybe that's just due a lack of knowledge, of course. Any chance you could explain/know of a resource that will teach me how the ports used in the docker environment variables (CORE_PEER_ADDRESS, CORE_PEER_CHAINCODELISTENADDRESS, and so on) should relate to the port mappings? I thought I had this covered, since it was working without the Java SDK, but I clearly missed something. If you wish I can send the docker-compose file I am currently producing when I run the network.
APelser (Mon, 29 Apr 2019 13:53:19 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=h8bnHqQHc544KKyci) @rickr I don't think I am joining the peers, I am calling `Channel.addPeer()` / `Channel.addEventhub()`, and finally `Channel.initialize()` , as is done in the example I found online. As far as I understand, this is not the same as sending a join proposal - but please correct me if I'm wrong. Also, I actually managed to get things working by mapping _all_ ports to themselves in peers (7051->7051 in peer0, 7101->7101 in peer1, and so on) in the docker-compose file. I honestly have no idea why this would work better than what I did before (7051->7051 for peer0, 7101->7051 for peer1, ...). I'm not 100% sure this is a proper solution though, since mapping ports to themselves just feels silly - but maybe that's just due a lack of knowledge, of course. Any chance you could explain/know of a resource that will teach me how the ports used in the docker environment variables (CORE_PEER_ADDRESS, CORE_PEER_CHAINCODELISTENADDRESS, and so on) should relate to the port mappings? I thought I had this covered, since it was working without the Java SDK, but I clearly missed something. If you wish I can send the docker-compose file I am currently producing when I run the network.
APelser (Mon, 29 Apr 2019 14:09:12 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=eYdxnf7bjCNTjwzHQ) @rickr Thanks, I didn't know of this command before. Using it revealed that "there is no peer certificate available" at the address that I would expect peer1 to listen on. This certificate is available when I use the solution/workaround I mentioned in my previous post, so I think this explains the error - the SSL handshake can't take place.
APelser (Mon, 29 Apr 2019 14:09:12 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=eYdxnf7bjCNTjwzHQ) @rickr Thanks, I didn't know of this command before. Using it revealed that there is "no peer certificate available" at the address that I would expect peer1 to listen on. This certificate is available when I use the solution/workaround I mentioned in my previous post, so I think this explains the error - the SSL handshake can't take place.
darapich92 (Mon, 29 Apr 2019 15:04:47 GMT):
hello everybody, today i am trying to run Junit test with End2endIT.class but when i enroll user, i got error in `HFCAInfo info = ca.info();` and got this message `org.hyperledger.fabric_ca.sdk.exception.InfoException: Url:http://localhost:7054, Failed to get info` . could anybody tell me why? or localhost:7054 is offline?
ZLL (Tue, 30 Apr 2019 04:11:53 GMT):
@rickr Thanks, I found this file, but I am using Fabric 1.0.
Although I can't use it now, thank you for your answer.
tsnyder (Tue, 30 Apr 2019 07:14:26 GMT):
@rickr Thanks. Regarding the Service Discovery. When sending a transaction Proposal do you need to be using the channel.sendTransactionProposalToEndorsers(TransactionProposalRequest transactionProposalRequest, DiscoveryOptions discoveryOptions) method, or will any sendTransactionProposal method work to use updated Service Discovery info?
rickr (Tue, 30 Apr 2019 11:55:16 GMT):
@tsnyder I you're using SD you should be using that method for your endorsements.
sejalpawar (Tue, 30 Apr 2019 13:52:52 GMT):
@rickr Hey, is there support for Auditor in Idemix in Fabric Java sdk?
vhulendamoraba (Wed, 01 May 2019 01:05:55 GMT):
Has joined the channel.
darapich92 (Wed, 01 May 2019 14:14:44 GMT):
hi everybody, i wonder when i start fabric.sh up, i saw a command `Starting server in home directory: /etc/hyperledger/fabric-ca-server` but i could not find that file in that directory. do you know where is it?
rickr (Wed, 01 May 2019 16:27:01 GMT):
Probably in the docker container running the fabric-ca
Antimttr (Wed, 01 May 2019 17:16:23 GMT):
Is there any reason why or how a registrar could successfully enroll a user, but then the same registrar user fails this call: `identities = ca.getHFCAIdentities(orgAdmin);` ?
Antimttr (Wed, 01 May 2019 17:16:45 GMT):
Got this result: `[HTTP Status Code: 401] - Error while getting all users from url 'https://localhost:8054': GET request to https://localhost:8054 failed request body . Response: {"result":"","errors":[{"code":20,"message":"Authentication failure"}`
Antimttr (Wed, 01 May 2019 17:17:06 GMT):
yet the same registrar user is able to register new users just fine
Antimttr (Wed, 01 May 2019 17:17:30 GMT):
confirmed name and secret are the same as defined in network-config.yaml
rickr (Wed, 01 May 2019 17:19:22 GMT):
@skarim ^^^
skarim (Wed, 01 May 2019 17:24:37 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=WxnMjFfaG9hFA6FKp) @Antimttr The read the docs on listing identities describes the authorization checks that are performed. Please refer to: https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/users-guide.html#dynamically-updating-identities
The two things you should check to see if you can get a particular user are type and affiliation.
Antimttr (Wed, 01 May 2019 17:35:05 GMT):
@skarim according to the javadoc for getHFCAIdentities() should ` gets all identities that the registrar is allowed to see` so in my case i tried to use the registered org admin so it should see all the registered users in the org
Antimttr (Wed, 01 May 2019 17:36:46 GMT):
atleast thats what it does when i use the same operation with the node sdk
Antimttr (Wed, 01 May 2019 19:31:10 GMT):
why would a registrar which works fine to register and enroll new identities not be allowed to list them
Antimttr (Wed, 01 May 2019 19:31:12 GMT):
it makes no sense
Antimttr (Wed, 01 May 2019 21:19:41 GMT):
@skarim so i can get the identity lists with the client this way: `/fabric-ca-client identity list -u https://admin:adminpw@ca.org2.example.com:8054 --tls.certfiles /home/mwest/go/src/github.com/hyperledger/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org2.example.com/ca/ca.org2.example.com-cert.pem
Name: admin, Type: client, Affiliation: , Max Enrollments: -1, Attributes: [{Name:hf.Registrar.Attributes Value:* ECert:false} {Name:hf.AffiliationMgr Value:1 ECert:false} {Name:hf.Registrar.Roles Value:* ECert:false} {Name:hf.Registrar.DelegateRoles Value:* ECert:false} {Name:hf.Revoker Value:1 ECert:false} {Name:hf.IntermediateCA Value:1 ECert:false} {Name:hf.GenCRL Value:1 ECert:false}`
Antimttr (Wed, 01 May 2019 21:19:41 GMT):
@skarim so i can get the identity lists with the client this way: ```/fabric-ca-client identity list -u https://admin:adminpw@ca.org2.example.com:8054 --tls.certfiles /home/mwest/go/src/github.com/hyperledger/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org2.example.com/ca/ca.org2.example.com-cert.pem
Name: admin, Type: client, Affiliation: , Max Enrollments: -1, Attributes: [{Name:hf.Registrar.Attributes Value:* ECert:false} {Name:hf.AffiliationMgr Value:1 ECert:false} {Name:hf.Registrar.Roles Value:* ECert:false} {Name:hf.Registrar.DelegateRoles Value:* ECert:false} {Name:hf.Revoker Value:1 ECert:false} {Name:hf.IntermediateCA Value:1 ECert:false} {Name:hf.GenCRL Value:1 ECert:false}```
Antimttr (Wed, 01 May 2019 21:20:20 GMT):
however doing the same command through the sdk fails
Antimttr (Wed, 01 May 2019 21:20:33 GMT):
as i detailed above
Antimttr (Wed, 01 May 2019 21:23:07 GMT):
as far as i can tell the admin user is a valid registrar
Antimttr (Wed, 01 May 2019 21:23:17 GMT):
if im interperating that correctly
Antimttr (Wed, 01 May 2019 21:28:01 GMT):
@rickr is there any way through the sdk to specify a cert file for the user like i did with the command line client?
Antimttr (Wed, 01 May 2019 21:28:30 GMT):
all the user object has is its own Enrollment object which i dunno if thats the same data as the tls cert file but perhaps that's what it needs?
Antimttr (Wed, 01 May 2019 21:30:21 GMT):
``` Enrollment enroll = caClient.enroll(orgAdmin.getName(), config.GetAdminSecret(orgNum));
orgAdmin.setEnrollment(enroll);
orgAdmin.setEnrollmentSecret(config.GetAdminSecret(orgNum));
orgAdmin.setMspId(org.getMSPID());
orgAdmin.setTlsCertPEM(enroll.getCert());
orgAdmin.setTlsKeyPEM(Crypto.getPEMStringFromPrivateKey(enroll.getKey()));
orgAdmin.setEnrolled(true);
orgAdmin.setType("CA_ADMIN");
org.setAdmin(orgAdmin);
System.out.println("Admin username: " + orgAdmin.getName() + " pass: " + orgAdmin.getEnrollmentSecret());
System.out.println("Printing Enrollment Data for Registrar: ");
LedgerUserModel.outputEnrollmentAuth(orgAdmin, CryptoSuite.Factory.getCryptoSuite());
Collection
Antimttr (Wed, 01 May 2019 21:30:27 GMT):
here is the code from my client
Antimttr (Wed, 01 May 2019 21:30:51 GMT):
as you can see its literally enrolling the admin, then immediately using that enrollment object to query for identities
Antimttr (Wed, 01 May 2019 21:30:53 GMT):
and its failing
Antimttr (Wed, 01 May 2019 21:31:21 GMT):
however I can use the same user to register new identities with the same CA
Antimttr (Wed, 01 May 2019 21:37:24 GMT):
this is the result of that code: ```
INFO: Enrolling Admin for Org: Org2
Admin username: admin pass: adminpw
Printing Enrollment Data for Registrar:
User cert: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNBVENDQWFpZ0F3SUJBZ0lVQk5VTVF1TnczTjBYcWkveExURXM1NDZrWXZvd0NnWUlLb1pJemowRUF3SXcKY3pFTE1Ba0dBMVVFQmhNQ1ZWTXhFekFSQmdOVkJBZ1RDa05oYkdsbWIzSnVhV0V4RmpBVUJnTlZCQWNURFZOaApiaUJHY21GdVkybHpZMjh4R1RBWEJnTlZCQW9URUc5eVp6SXVaWGhoYlhCc1pTNWpiMjB4SERBYUJnTlZCQU1UCkUyTmhMbTl5WnpJdVpYaGhiWEJzWlM1amIyMHdIaGNOTVRrd05UQXhNVGN3TmpBd1doY05NakF3TkRNd01UY3gKTVRBd1dqQWhNUTh3RFFZRFZRUUxFd1pqYkdsbGJuUXhEakFNQmdOVkJBTVRCV0ZrYldsdU1Ga3dFd1lIS29aSQp6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVvNHYrbUlYb3FCbzB3cE5LVzdJaGRtSkxOSU1jTWU4SDBUZ3ZlOStuCkRhNjNOa3BaVGp4dVAwekFzWXJZWkJFWks4RWlrbk9wSmtSOTFtaDJSaUU1dWFOc01Hb3dEZ1lEVlIwUEFRSC8KQkFRREFnZUFNQXdHQTFVZEV3RUIvd1FDTUFBd0hRWURWUjBPQkJZRUZDcW5xQmFCSm1TKzZ1SndaTFBDaVRtZwpTMFZYTUNzR0ExVWRJd1FrTUNLQUlLZlVmdnBHcHJvSGN3eUZEKzBzRTNYZkp6WU5jaWYwak53dmdPVUZaNEFGCk1Bb0dDQ3FHU000OUJBTUNBMGNBTUVRQ0lIQnA0eWhuQ1JFV0phRlR4UDZvYXRoOHJMaE5TNTZLUjk2WWlrUlUKb1VTQ0FpQXc5ZXRDVHNScEpCOUIrMVExL2Q2d2NvVG56WExCSC9ET3Zhb0NJZ1ZWeEE9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
User key: MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgR7CZweZmztSTrcg8/1k7A/fjDZFJRv0HJ3TovPjO552gCgYIKoZIzj0DAQehRANCAASji/6YheioGjTCk0pbsiF2Yks0gxwx7wfROC9736cNrrc2SllOPG4/TMCxithkERkrwSKSc6kmRH3WaHZGITm5
ERROR: ListAllUsers: Identity Exception received: [HTTP Status Code: 401] - Error while getting all users from url 'https://localhost:8054': GET request to https://localhost:8054 failed request body . Response: {"result":"","errors":[{"code":20,"message":"Authentication failure"}
],"messages":[],"success":false}
```
Antimttr (Wed, 01 May 2019 21:37:58 GMT):
as you can see the username and password are correct, and the enrollmen data exists
Antimttr (Wed, 01 May 2019 21:38:40 GMT):
does the sdk need to be configured to use tls? i mean all the other operations i send to it work fine
Antimttr (Wed, 01 May 2019 21:38:43 GMT):
its just this one operation
rickr (Wed, 01 May 2019 22:06:01 GMT):
Nothing with TLS because you got a 401. I think if you go log at the fabric_ca logs you'll see it's processing it. So please take those logs to the #fabric-ca channel and and first find out why it's not working. If they indicate the sdk is somehow sending the wrong request then we can look at here.
rickr (Wed, 01 May 2019 22:06:01 GMT):
Nothing with TLS because you got a 401. I think if you go look at the fabric_ca logs you'll see it's processing it. So please take those logs to the #fabric-ca channel and and first find out why it's not working. If they indicate the sdk is somehow sending the wrong request then we can look at here.
Antimttr (Wed, 01 May 2019 22:07:30 GMT):
by fabric_ca logs you mean the logs generated on the fabric_ca docker, correct?
rickr (Wed, 01 May 2019 22:07:46 GMT):
That would be them
Antimttr (Wed, 01 May 2019 22:07:58 GMT):
ok ill figure out how to get to them
rickr (Wed, 01 May 2019 22:09:52 GMT):
BTW make sure you're also using the latest SDK
Antimttr (Wed, 01 May 2019 22:10:21 GMT):
i think i dled it when it was 1.4.0
Antimttr (Wed, 01 May 2019 22:10:25 GMT):
i havent updated since then
Antimttr (Wed, 01 May 2019 22:10:41 GMT):
ill update to 1.4.1
Antimttr (Wed, 01 May 2019 22:17:56 GMT):
```
2019/05/01 22:05:48 [DEBUG] Received request for /api/v1/identities?ca=ca-org2
2019/05/01 22:05:48 [DEBUG] Caller is using a x509 certificate
2019/05/01 22:05:48 [DEBUG] Failed to verify token based on new authentication header requirements: %!s(
Antimttr (Wed, 01 May 2019 22:18:06 GMT):
looks like it might have something to do with an old sdk going by line 3
Antimttr (Wed, 01 May 2019 22:27:55 GMT):
nm i just confirmed my client is using 1.4.1 sdk
Antimttr (Wed, 01 May 2019 22:28:14 GMT):
although the docker images might be 1.4.0....
Antimttr (Wed, 01 May 2019 22:29:34 GMT):
` [DEBUG] ca.Config: &{Version:1.4.0 Cfg:{Identities:{PasswordAttempts:10 AllowR...`
sejalpawar (Thu, 02 May 2019 09:39:53 GMT):
Hey I am trying to invoke a proposal using an idemix user and it shows the following error: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [mychannel] creator org [Org1IdemixMSP], cause=null}
sejalpawar (Thu, 02 May 2019 09:40:17 GMT):
My code for creating idemix enrollment:
sejalpawar (Thu, 02 May 2019 09:40:28 GMT):
UserContext idemixUser = new UserContext();
idemixUser.setName("idemixTestUser1");
RegistrationRequest rr = new RegistrationRequest(idemixUser.getName(), "org1");
String enrollmentSecret = ca_client.register(rr, caAdmin);
String mspID = "Org1IdemixMSP";
Enrollment x509Enrollment = ca_client.enroll(idemixUser.getName(), enrollmentSecret);
Enrollment idemixEnrollment = ca_client.idemixEnroll(x509Enrollment, mspID);
idemixUser.setEnrollment(idemixEnrollment);
idemixUser.setMspId("Org1IdemixMSP");
client.setUserContext(idemixUser);
sejalpawar (Thu, 02 May 2019 09:42:08 GMT):
I have included the idemix MSP in configtx.yaml and mounted the idemix IssuerPublicKey in $FABRIC_CA_HOME in docker container...
sejalpawar (Thu, 02 May 2019 09:42:27 GMT):
Any clues?
sejalpawar (Thu, 02 May 2019 09:46:07 GMT):
docker log: channel [mychannel]: creator certificate is not valid: Failed verifing with opts [&{
mahoney1 (Thu, 02 May 2019 11:34:34 GMT):
reminder that the Fabric Developer Community call today is at 4pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android:https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call - be great to hear from you later ! 🙂 regards Paul
Antimttr (Thu, 02 May 2019 16:05:34 GMT):
i made sure to upgrade my docker images to 1.4.1, didnt make any difference
Antimttr (Thu, 02 May 2019 16:53:01 GMT):
I confirmed all my crypto material is pointing to the correct files
Antimttr (Thu, 02 May 2019 16:53:40 GMT):
Comparing my previous log from fabric-ca to the log generated by the nodejs sdk: ```
2019/05/02 16:02:29 [DEBUG] Received request for /api/v1/identities?ca=ca-org1
2019/05/02 16:02:29 [DEBUG] Caller is using a x509 certificate
2019/05/02 16:02:29 [DEBUG] Failed to verify token based on new authentication header requirements: %!s(
Antimttr (Thu, 02 May 2019 16:54:12 GMT):
seems like the nodejs sdk also gets that message
Antimttr (Thu, 02 May 2019 16:54:24 GMT):
but simply carries on and continues to get the requested data
Antimttr (Thu, 02 May 2019 16:54:35 GMT):
where as the javasdk just stops after that 3rd line
rickr (Thu, 02 May 2019 17:54:30 GMT):
put the jsdk in trace mode logging and the CA output full!! and paste to https://ctrlv.it/ @skarim
rickr (Thu, 02 May 2019 17:54:30 GMT):
put the jsdk in trace mode logging and the CA output full!! and paste both using https://ctrlv.it/ @skarim
Antimttr (Thu, 02 May 2019 17:56:58 GMT):
ok
rickr (Thu, 02 May 2019 17:57:57 GMT):
and you're on JSDK >= v1.4 ?
rickr (Thu, 02 May 2019 17:59:02 GMT):
if thats the case you should never see that 3rd line because only the new authentication is actually used.
Antimttr (Thu, 02 May 2019 17:59:07 GMT):
java sdk 1.4.1
Antimttr (Thu, 02 May 2019 17:59:17 GMT):
i also updated the dockerr images to 1.4.1
rickr (Thu, 02 May 2019 17:59:45 GMT):
Have looked at the JSDK examples of using that api?
Antimttr (Thu, 02 May 2019 18:00:01 GMT):
yes, thats where i got the code from,
rickr (Thu, 02 May 2019 18:00:37 GMT):
probably the problem (just kidding )
Antimttr (Thu, 02 May 2019 18:01:01 GMT):
specifically: hfcaclientit.java line 648
Antimttr (Thu, 02 May 2019 18:01:23 GMT):
its pretty straight forward
rickr (Thu, 02 May 2019 18:01:30 GMT):
Are you using the docker fabric that the SDK comes whith ... or your own ?
Antimttr (Thu, 02 May 2019 18:01:35 GMT):
just grabs the ca admin, and then uses it to call the function
Antimttr (Thu, 02 May 2019 18:02:08 GMT):
im using the docker image i just grabbed this morning from the main hyperledger repo
Antimttr (Thu, 02 May 2019 18:02:34 GMT):
and the sdk i got via maven: ```
rickr (Thu, 02 May 2019 18:02:35 GMT):
but are you using the fabric set up in the SDK our your own ?
Antimttr (Thu, 02 May 2019 18:02:49 GMT):
oh im using balance-transfer
Antimttr (Thu, 02 May 2019 18:02:53 GMT):
from samples
Antimttr (Thu, 02 May 2019 18:04:35 GMT):
and didnt really change it much besides using a slightly modified chaincode
Antimttr (Thu, 02 May 2019 19:41:52 GMT):
@rickr Do i need to export ORG_HYPERLEDGER_FABRIC_SDK_DIAGNOSTICFILEDIR in order for the sdk to output, or is it outputting to stderr? I dont see any extra output on stdout
Antimttr (Thu, 02 May 2019 19:42:11 GMT):
or does it use some sort of logging system
Antimttr (Thu, 02 May 2019 19:45:33 GMT):
ahh ok i think you set it in properties that you feed to the client object
Antimttr (Thu, 02 May 2019 19:45:35 GMT):
ill try that
rickr (Thu, 02 May 2019 19:57:04 GMT):
You don't need ORG_HYPERLEDGER_FABRIC_SDK_DIAGNOSTICFILEDIR only for fabric not fabric-ca interaction
Antimttr (Thu, 02 May 2019 20:02:27 GMT):
ok set the export ORG_HYPERLEDGER_FABRIC_CA_SDK_LOGLEVEL=TRACE in the shell running my client and in the properties for HFCAClient i set LOGGERLEVEL to TRACE
Antimttr (Thu, 02 May 2019 20:02:27 GMT):
ok set the export ORG_HYPERLEDGER_FABRIC_CA_SDK_LOGLEVEL=TRACE in the shell running my client and in the properties for HFCAClient i set 'org.hyperledger.fabric.sdk.loglevel' to TRACE
Antimttr (Thu, 02 May 2019 20:02:29 GMT):
hoping that does
Antimttr (Thu, 02 May 2019 20:10:47 GMT):
also set in my docker-compose.yaml for both the ca's: FABRIC_LOGGING_SPEC=DEBUG
Antimttr (Thu, 02 May 2019 20:11:17 GMT):
though i think balance-transfer does that already
Antimttr (Thu, 02 May 2019 20:13:50 GMT):
ok here's my ca output: https://ctrlv.it/id/176614/70646644
Antimttr (Thu, 02 May 2019 20:14:52 GMT):
i didnt notice any extra output to my java client with those options enabled but heres the output anyways: https://ctrlv.it/id/176615/3301194123
rickr (Thu, 02 May 2019 20:22:01 GMT):
where is the corresponding SDK trace ?
Antimttr (Thu, 02 May 2019 20:22:12 GMT):
where does the sdk trace show up on?
Antimttr (Thu, 02 May 2019 20:22:23 GMT):
doesnt seem to go to sdtout
rickr (Thu, 02 May 2019 20:22:27 GMT):
by default to the console
Antimttr (Thu, 02 May 2019 20:22:39 GMT):
i pasted all the console output for my client
Antimttr (Thu, 02 May 2019 20:22:46 GMT):
but theres nothing extra for the sdk
Antimttr (Thu, 02 May 2019 20:23:09 GMT):
i exported the variable: ```
$ export
```
Antimttr (Thu, 02 May 2019 20:23:09 GMT):
i exported the variable: ```
$ export
```
Antimttr (Thu, 02 May 2019 20:23:43 GMT):
```
declare -x ORG_HYPERLEDGER_FABRIC_CA_SDK_LOGLEVEL="TRACE"
declare -x ORG_HYPERLEDGER_FABRIC_SDK_LOGLEVEL="TRACE"
```
Antimttr (Thu, 02 May 2019 20:26:30 GMT):
i wonder if its cuz im using maven?
skarim (Thu, 02 May 2019 20:26:54 GMT):
@Antimttr Thanks for the log. Will try to see if we can reproduce it.
Antimttr (Thu, 02 May 2019 20:31:48 GMT):
@skarim thanks for taking a look!
rickr (Thu, 02 May 2019 20:42:54 GMT):
@Antimttr would it be easy for you to change your ca name to remove the dash and see if that then works?
Antimttr (Thu, 02 May 2019 20:50:59 GMT):
i think so, its just in the artifacts config files
Antimttr (Thu, 02 May 2019 20:51:00 GMT):
let me try
Antimttr (Thu, 02 May 2019 20:58:30 GMT):
didn't seem to affect much: https://ctrlv.it/id/176635/3046120177
rickr (Thu, 02 May 2019 21:16:00 GMT):
@Antimttr I think we have it reproduced. But it may be next week before get any fix out
Antimttr (Thu, 02 May 2019 21:34:19 GMT):
oh wow, its an actual bug?
Antimttr (Thu, 02 May 2019 21:34:34 GMT):
ok, i'll wait patiently, thanks for your help :D
rickr (Thu, 02 May 2019 22:43:53 GMT):
@Antimttr I'm guessing your fabric-ca is not really using multiple instance (multiple ca names configured) you could try create the hfclient w/o any caname. It defaults to the root one if there is only one and that I think will get around the issue.
rickr (Thu, 02 May 2019 22:43:53 GMT):
@Antimttr I'm guessing your fabric-ca is not really using multiple instance (multiple ca names configured) you could try create the hfcaclient w/o any caname. It defaults to the root one if there is only one and that I think will get around the issue.
rickr (Thu, 02 May 2019 22:45:53 GMT):
It would be also helpful to know if that workes
rickr (Thu, 02 May 2019 22:45:53 GMT):
It would be also helpful to know if that works
yerganat (Fri, 03 May 2019 03:50:09 GMT):
Has joined the channel.
yerganat (Fri, 03 May 2019 03:50:24 GMT):
hello all
I am interested on collobarate in hyperladger fabric java sdk
How i can involved? where i can get tasks to make and request pull ?
rickr (Fri, 03 May 2019 11:37:52 GMT):
@yerganat some thing to get started is doc'ed in fabric docs
https://fabric-docs-test.readthedocs.io/en/latest/CONTRIBUTING/
Is probably the place to start. Take note of the gerrit part as github is not used.
Antimttr (Fri, 03 May 2019 14:41:11 GMT):
@rickr if i pass null for caname i get this: ```
ERROR: Failed to instantiate CA Client: name must not be null or an empty string.
org.hyperledger.fabric_ca.sdk.exception.InvalidArgumentException: name must not be null or an empty string.
at org.hyperledger.fabric_ca.sdk.HFCAClient.createNewInstance(HFCAClient.java:306)
at com.mctlive.mcthlf.model.OrganizationModel.initOrgs(OrganizationModel.java:41)
at com.mctlive.mcthlf.Main.main(Main.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:748)
ERROR: Failed to initialize organization data.
```
rickr (Fri, 03 May 2019 14:42:04 GMT):
no null is no good .. should be a method where there is no caname
Antimttr (Fri, 03 May 2019 14:42:30 GMT):
i see it, let me try
Antimttr (Fri, 03 May 2019 14:43:02 GMT):
it worked!
Antimttr (Fri, 03 May 2019 14:43:42 GMT):
interesting bug
Antimttr (Fri, 03 May 2019 14:47:25 GMT):
TGIF!
yerganat (Sat, 04 May 2019 06:11:00 GMT):
@rickr thanks
I have started install from docker
I will tell when i complite installation
Can I get tasks from JIRA(fabric-sdk-java)?
rickr (Sat, 04 May 2019 13:00:38 GMT):
Till v2.0 is out only addressing defects. Major work items are usually defined by new features on the Fabric side and I'm not aware at the moment any post v2.0
darapich92 (Sun, 05 May 2019 15:30:23 GMT):
hello everyone, i am learning HLF java sdk, End2endIT, but i wonder how endorsers endorse user's request? it is called from docker? i saw endorser address grpc://localhost:7056 but i couldn't access via browser, could anyone tell me? i am sorry, I am very new with HLF.
darapich92 (Sun, 05 May 2019 15:32:15 GMT):
Actually, i want to see endorser's code, could you guide me?
Pai (Mon, 06 May 2019 06:13:28 GMT):
Has joined the channel.
VivekAnandPanda (Mon, 06 May 2019 07:24:16 GMT):
Has joined the channel.
VivekAnandPanda (Mon, 06 May 2019 07:26:17 GMT):
Hi everyone, I am trying to deploy and initiate Java chaincode from Java SDK. But getting failure response. Can you please walkthrough how to deploy and initiate Java chaincode from Java client SDK?
rickr (Mon, 06 May 2019 11:53:50 GMT):
@darapich92 Starting with the SDK at _ground zero_ is not IMO the best bet. Look through the Fabric documentation to get some background first. Endorsement is done by the Peer that's in the SDK setup is running in docker. It's not http but grpc protocol that's used to communicate between SDKs and the Fabric.
sejalpawar (Mon, 06 May 2019 11:56:17 GMT):
Hey there, I am trying to invoke transaction using an idemix credential:
rickr (Mon, 06 May 2019 11:57:24 GMT):
@VivekAnandPanda If you follow the SDK README.md it guides you to get the Integration test running and passing. One of the integration test does deploy Java chaincode. The Readme.md does reference it. Please take the time to follow that
sejalpawar (Mon, 06 May 2019 11:57:58 GMT):
UserContext idemixUser = new UserContext();
idemixUser.setName("idemixTestUser18");
RegistrationRequest rr = new RegistrationRequest(idemixUser.getName(), "org1");
String enrollmentSecret = ca_client.register(rr, caAdmin);
String mspID = "Org1IdemixMSP";
Enrollment x509Enrollment = ca_client.enroll(idemixUser.getName(), enrollmentSecret);
Enrollment idemixEnrollment = ca_client.idemixEnroll(x509Enrollment, mspID);
System.out.println(idemixEnrollment.getCert()); //returns null
System.out.println(idemixEnrollment.getKey()); //returns null
idemixUser.setEnrollment(idemixEnrollment);
idemixUser.setMspId(mspID);
client.setUserContext(idemixUser);
sejalpawar (Mon, 06 May 2019 11:58:38 GMT):
On the SDK side, I get: Expecting a PEM-encoded X509 certificate; PEM block not found
org.hyperledger.fabric.sdk.exception.InvalidArgumentException: Proposal response is invalid.
sejalpawar (Mon, 06 May 2019 11:59:20 GMT):
Can someone please tell me what went wrong?
rickr (Mon, 06 May 2019 12:01:11 GMT):
Is the usercontext you're using set to a user with an Idemix mspid ?
rickr (Mon, 06 May 2019 12:02:16 GMT):
Please follow the code provided as an example in the Integration tests.
sejalpawar (Mon, 06 May 2019 12:07:49 GMT):
I have two MSPs: Org1MSP is an x509 MSP and Org1IdemixMSP is the idemix MSP
sejalpawar (Mon, 06 May 2019 12:08:05 GMT):
In the code above, I had set it to Idemix MSP
sejalpawar (Mon, 06 May 2019 12:08:18 GMT):
Is that incorrect?
rickr (Mon, 06 May 2019 12:09:53 GMT):
looks right
sejalpawar (Mon, 06 May 2019 12:17:15 GMT):
It ran once correctly and started failing thereafter. Is there some kind of default setting that I need to override on the CA side? I simply init and start the CA server fabric-ca-server start -b admin:adminpw --home $PWD
rickr (Mon, 06 May 2019 12:24:20 GMT):
You need to restart if you want to again register the same user .. ask on #fabric-ca
darapich92 (Mon, 06 May 2019 13:12:41 GMT):
@rickr thank you for your recommendation. Please correct me if i am wrong. I understand Endorsers who role to endorse the client's tx. Since i test that End2endIT java sdk, i don't know what kind of policy that endorsers check before endorse client's tx. Could you tell me how can i access to endorser's code?
sejalpawar (Mon, 06 May 2019 13:40:26 GMT):
okay I will look into it.. thanks
smallant (Mon, 06 May 2019 14:40:44 GMT):
hi to all
currently im having this following exception when invoking the chaincode:
Channel Channel{id: 1, name: mychannel} sending proposal with transaction 3b03a47f5e654d1dba96e4611435306228610dbbb328ae664a25dc9891d0e4fc to Peer{ id: 8, name: peer1.io, channelName: mychannel, url: grpcs://peer1.io:7051} failed because of timeout(35000 milliseconds) expiration. Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: 3b03a47f5e654d1dba96e4611435306228610dbbb328ae664a25dc9891d0e4fc to Peer{ id: 5, name: peer2.io, channelName: mychannel, url: grpcs://peer2.io:7051} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=javax.net.ssl.SSLException: handshake timed out
at io.netty.handler.ssl.SslHandler.handshake(...)(Unknown Source)
Does anyone have any idea? The certificates are correct for all the peers and for my machine
ranjan008 (Tue, 07 May 2019 04:55:34 GMT):
@rickr can I implement custom store to store keys and certificates through java-sdk ? If yes which interface should I override in java?
rickr (Tue, 07 May 2019 12:05:26 GMT):
No need for that
rickr (Tue, 07 May 2019 12:05:26 GMT):
No need for that. As an application store them in your own database in what ever fomat works best for your application
rickr (Tue, 07 May 2019 12:05:26 GMT):
No need for that. As an application store them in your own database in what ever format works best for your application. The SDK is IMO for interacting with Fabric. There are dozen of persistent technologies in Java that all the SDK would do is call your application back to do the actual store in whatever schema your application desired.
Antimttr (Tue, 07 May 2019 15:10:18 GMT):
i used mongodb for my state storage
Antimttr (Tue, 07 May 2019 17:51:35 GMT):
@rickr does the javasdk examples include a chaincode update routine anywhere?
rickr (Tue, 07 May 2019 19:39:43 GMT):
yes :)
Antimttr (Tue, 07 May 2019 19:41:39 GMT):
i looked through em all i couldnt find it :/
Antimttr (Tue, 07 May 2019 19:41:52 GMT):
update channel updates everything except the chaincode from what i could see
Antimttr (Tue, 07 May 2019 19:42:11 GMT):
which file is it in?
rickr (Tue, 07 May 2019 20:17:14 GMT):
Clipboard - May 7, 2019 4:17 PM
Antimttr (Tue, 07 May 2019 20:18:06 GMT):
thanks!
rickr (Tue, 07 May 2019 20:18:09 GMT):
That's actually deprecated .. the lifecycle example shows what it would be
Antimttr (Tue, 07 May 2019 20:18:12 GMT):
ill check that file
Antimttr (Tue, 07 May 2019 20:18:17 GMT):
oh
Antimttr (Tue, 07 May 2019 20:18:29 GMT):
deprecated for 2.0 or for 1.4?
rickr (Tue, 07 May 2019 20:18:38 GMT):
2.0
Antimttr (Tue, 07 May 2019 20:18:51 GMT):
is 2.0 about to come out? seems still far off
Antimttr (Tue, 07 May 2019 20:18:56 GMT):
but i dont know what the timetable is
Antimttr (Tue, 07 May 2019 20:20:02 GMT):
i saw notes in end2endit about using lifecycle stuff but i didnt see any examples of it
c-an (Wed, 08 May 2019 01:25:10 GMT):
Has joined the channel.
rickr (Wed, 08 May 2019 01:27:19 GMT):
Last I heard target was for end of June time frame.
c-an (Wed, 08 May 2019 01:40:46 GMT):
hello!
stone-ch (Wed, 08 May 2019 04:58:38 GMT):
Has joined the channel.
sejalpawar (Wed, 08 May 2019 08:09:57 GMT):
Hey there! I am invoking a transaction using an idemix user twice and returning the creator's public key from chaincode side which is used to raise the transaction. However, the byte[] array returned is different in the two transaction requests. Is there an issue with my implementation or is this intended?
sejalpawar (Wed, 08 May 2019 08:10:24 GMT):
This is my code to access public key of creator on chaincode side:
sejalpawar (Wed, 08 May 2019 08:10:54 GMT):
creator, err := stub.GetCreator()
if err != nil {
return shim.Error(err.Error())
}
sid := &msp.SerializedIdentity{}
err = proto.Unmarshal(creator, sid)
if err != nil {
return shim.Error("failed to unmarshal transaction invoker's identity "+err.Error())
}
idemixID := &msp.SerializedIdemixIdentity{}
err = proto.Unmarshal(sid.IdBytes, idemixID)
if err != nil {
return shim.Error("failed to unmarshal transaction invoker's idemix identity "+err.Error())
}
return shim.Success(idemixID.Nymx)
sejalpawar (Wed, 08 May 2019 08:13:37 GMT):
In Java SDK: byte[] res = responses.iterator().next().getChaincodeActionResponsePayload();
for(byte x: res) System.out.print(x+" ");
rickr (Wed, 08 May 2019 13:08:24 GMT):
Ok - not being the idemix guru I do think that's the intent. It should generate a new creator cert each time making it _non-linkable_
sejalpawar (Wed, 08 May 2019 15:07:09 GMT):
I am looking for the class org.hyperledger.fabric.protos.peer.FabricProposal.SignedProposal which is imported in https://github.com/hyperledger/fabric-sdk-java/blob/master/src/main/java/org/hyperledger/fabric/sdk/Channel.java
sejalpawar (Wed, 08 May 2019 15:07:22 GMT):
But I can't seem to be able to find it
sejalpawar (Wed, 08 May 2019 15:07:34 GMT):
Can someone please help?
rickr (Wed, 08 May 2019 20:49:35 GMT):
README.md FAQ
casstait (Thu, 09 May 2019 01:36:52 GMT):
Has joined the channel.
casstait (Thu, 09 May 2019 01:36:53 GMT):
Is there anyone that could guide me on how to update a client side application using the java fabric SDK connect to an IBP enterprise service when Mutual TLS is enabled?
casstait (Thu, 09 May 2019 06:11:10 GMT):
When mutual TLS is disabled on the IBP service, the code currently written works as expected, however when mutual TLS is enabled on the IBP service, I receive an error: Response: {"result":"","errors":[{"code":0,"message":"Registration of 'casstest' failed in affiliation validation: : scode: 401, local code: 44, local msg: Caller does not have authority to act on affiliation 'PeerOrg1', remote code: 20, remote msg: Authorization failure"} ],"messages":[],"success":false}. What do I need to do to alter the existing code to establish a mutual TLS connection? I used the following tutorial as a guide: https://developer.ibm.com/tutorials/hyperledger-fabric-java-sdk-for-tls-enabled-fabric-network/
tsnyder (Thu, 09 May 2019 10:57:05 GMT):
I have working code with the java sdk with uses Service Discovery to obtain the channel information and accesses both the Peers and Orderers using TLS. The Connections to the Peers and Service Discovery works fine. Endorsement works fine. If I have a solo Orderer sending to the Orderer works fine. However, if I use etcdraft Orderers I receive a certificate validation error as follows: 1759 [grpc-default-worker-ELG-1-2] DEBUG io.netty.handler.ssl.ReferenceCountedOpenSslContext - verification of certificate failed
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
tsnyder (Thu, 09 May 2019 11:00:09 GMT):
The gossip is working, the channel creation is working, Peer connection to the Orderers is working. It is only the Client APP to the etcdraft Orderer nodes where the SSL handshake does not work. Within the Orderer I see the following series of messages - 2019-05-09 06:45:56.898 UTC [core.comm] ServerHandshake -> ERRO 0b1 TLS handshake failed with error remote error: tls: internal error server=Orderer remoteaddress=172.17.0.14:56220
2019-05-09 06:45:56.972 UTC [core.comm] ServerHandshake -> ERRO 0b2 TLS handshake failed with error remote error: tls: internal error server=Orderer remoteaddress=172.17.0.14:56230
2019-05-09 06:45:57.023 UTC [core.comm] ServerHandshake -> ERRO 0b3 TLS handshake failed with error remote error: tls: internal error server=Orderer remoteaddress=172.17.0.14:56232
tsnyder (Thu, 09 May 2019 11:44:40 GMT):
Alll Fabric components including the Java SDK are 1.4.1
rickr (Thu, 09 May 2019 12:38:31 GMT):
@casstait does not appear as TLS error as it seems like it made the connection. Support for IBM IBP is through IBM you should open a support ticket.
rickr (Thu, 09 May 2019 12:48:46 GMT):
@tsnyder no way to guess from just that description. The SDK gets certs from SD so there's no way to know what it received was at fault or what it did with what it received is at fault :smile: The SDK is _clueless_ about whether Orderer is solo, kafka, or raft based. Would need complete logs at trace level for all involved SDK, orderer, and peers from the very begging to point of failure to even begin to isolate.
tsnyder (Thu, 09 May 2019 12:50:50 GMT):
@rickr I have the logs from the BasicConfiguration.configure() within the sdk. Only partial logs from the Orderer nodes. It is inside a Kubernetes environment.
tsnyder (Thu, 09 May 2019 12:51:12 GMT):
how can I send them to you? They are very long (pages)
rickr (Thu, 09 May 2019 12:52:09 GMT):
You could also override the SD add orderer and get the certificate or get the certificates from the logs and try and use openssl s_client to see if they work with it
rickr (Thu, 09 May 2019 12:52:33 GMT):
that would be insightful
rickr (Thu, 09 May 2019 12:53:45 GMT):
https://ctrlv.it/
tsnyder (Thu, 09 May 2019 12:54:17 GMT):
I was thinking of building the channel myself as a test - but maybe you are right. Just build the orderer, include it into the channel and see. Will try that this weekend. (Today is the start of my wseekend :) )
dan13 (Thu, 09 May 2019 19:59:27 GMT):
HLF 1.4.0, Java SDK 1.4.0, Go Chaincode: When using ServiceDiscovery in call to channel.sendTransactionProposalToEndorsers and chaincode exits with shim.Error("message"), I cannot get access to "message", as that method call throws org.hyperledger.fabric.sdk.exception.ProposalException: org.hyperledger.fabric.sdk.exception.ServiceDiscoveryException: Could not meet endorsement policy for chaincode. If do not use ServiceDiscovery, then I receive ProposalResponses with isVerified=false containing the "message" and other error info (status, etc.) that I can then read. Am I doing something wrong? How can I get the detailed error info when using ServiceDiscovery?
rickr (Thu, 09 May 2019 20:12:42 GMT):
@dan13 What was the actual error ? Maybe need an *improvement* on that error path.
dan13 (Thu, 09 May 2019 20:20:17 GMT):
@rickr Go chaincode: return shim.Error("No data found for " + id)
where the preceding operation was a query call to another chaincode on a different channel (this call worked, just returned no results which is an application error for our use case)
rickr (Thu, 09 May 2019 20:21:31 GMT):
So I should reproduce by have SD executed some chaincode that returns an error
dan13 (Thu, 09 May 2019 20:22:39 GMT):
yes, it should be that simple. For reference, the full method call for us is:
proposalResponses = channel.sendTransactionProposalToEndorsers(proposalRequest,
createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)
.setForceDiscovery(true));
dan13 (Thu, 09 May 2019 20:22:39 GMT):
yes, it should be that simple. For reference, the full method call for us is:
proposalResponses = channel.sendTransactionProposalToEndorsers(proposalRequest,
createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)
.setForceDiscovery(true));
as opposed to (non-SD):
proposalResponses = channel.sendTransactionProposal(proposalRequest, channel.getPeers(EnumSet.of(Peer.PeerRole.ENDORSING_PEER)));
rickr (Thu, 09 May 2019 20:25:08 GMT):
The actual fix is probably in the SD handler which is only a _reference implementation_ and can be replaced by the application :) :)
dan13 (Thu, 09 May 2019 20:30:27 GMT):
@rickr ah! I will look into that - thank you!
rickr (Thu, 09 May 2019 20:34:46 GMT):
.. was mostly _tongue in cheek_ .. still will look in to fixing it
dan13 (Fri, 10 May 2019 00:49:32 GMT):
the error seems to originate in Channel class, if I'm reading things correctly
tsnyder (Fri, 10 May 2019 14:42:30 GMT):
@ricker - Did you receive the logs I sent to the link you provided above?
tsnyder (Fri, 10 May 2019 14:42:30 GMT):
@rickr - Did you receive the logs I sent to the link you provided above?
dan13 (Fri, 10 May 2019 15:17:15 GMT):
@rickr My RTFM error: inspectResults: If service discovery does not find the the needed endorsers for a specific chaincode it will by default throw a ServiceDiscoveryException. Setting this to true will have the method return the all the endorsements it did obtained. Setting this true fixed my issue.
rickr (Fri, 10 May 2019 15:28:48 GMT):
Glad something does work _occasionally_
nitishbhardwaj19 (Sat, 11 May 2019 11:17:15 GMT):
Has joined the channel.
nitishbhardwaj19 (Sat, 11 May 2019 11:17:16 GMT):
Hi, I hope everyone is doing good. I am trying to use fabric-java-sdk. I am going through End2endAndBackAgainIt.java. It's well written, easy to follow, but, I am confused about from where does they are loading properties file. I couldn't find any properties file with the name HFCSampletest.properties anywhere. Could someone point me to the required properties file to run a fabric-java-sdk.
nitishbhardwaj19 (Sat, 11 May 2019 11:17:16 GMT):
Hi, I hope everyone is doing good. I am trying to use fabric-java-sdk. I am going through End2endAndBackAgainIt.java. It's well written, easy to follow, but, I am confused about from where does they are loading properties file. I couldn't find any properties file with the name HFCSampletest.properties anywhere. Could someone point me to the required properties file to run a fabric-java-sdk. ```
@rickr
```
nitishbhardwaj19 (Sat, 11 May 2019 11:17:16 GMT):
Hi, I hope everyone is doing good. I am trying to use fabric-java-sdk. I am going through End2endAndBackAgainIt.java. It's well written, easy to follow, but, I am confused about from where does they are loading properties file. I couldn't find any properties file with the name HFCSampletest.properties anywhere. Could someone point me to the required properties file to run a fabric-java-sdk.
@rickr
nitishbhardwaj19 (Sat, 11 May 2019 11:17:16 GMT):
Hi, I hope everyone is doing good. I am trying to use fabric-sdk-java. I am going through End2endAndBackAgainIt.java. It's well written, easy to follow, but, I am confused about from where does they are loading properties file. I couldn't find any properties file with the name HFCSampletest.properties anywhere. Could someone point me to the required properties file to run a fabric-sdk-java.
@rickr
nitishbhardwaj19 (Sat, 11 May 2019 11:17:16 GMT):
Hi, I hope everyone is doing good. I am trying to use fabric-sdk-java. I am going through End2endAndBackAgainIt.java. It's well written, easy to follow, but, I am confused about from where does they are loading properties file. I couldn't find any properties file with the name HFCSampletest.properties anywhere. Could someone point me to the required properties file to run a fabric-sdk-java.
@rickr Could you please share a sample properties file.
Jelle.Diet (Sat, 11 May 2019 12:37:01 GMT):
Hello everyone, I'm working with the java sdk at the moment and reading my connection details from a json/yaml file. However I can't seem to find how to get the peer and orderer url from the NetworkConfig class? Can anyone help me out?
Jelle.Diet (Sat, 11 May 2019 12:37:01 GMT):
Hello everyone, I'm working with the java sdk at the moment and reading my connection details from a json/yaml file. However I can't seem to find how to get the peer and orderer url from the NetworkConfig class? Can anyone help me out? Edit: using fabric-java-sdk 1.4.1
nitishbhardwaj19 (Sat, 11 May 2019 12:58:29 GMT):
@ju
nitishbhardwaj19 (Sat, 11 May 2019 13:00:51 GMT):
I am struggling to get this as well. I haven't found any sample for it yet. Please let me know if you find anything.
Jelle.Diet (Sat, 11 May 2019 13:09:02 GMT):
I took a look at the code and file seems to be created when running the setup
nitishbhardwaj19 (Sat, 11 May 2019 13:11:55 GMT):
ohh that's great. I can't run it in my local due to some technical restrictions. Will it be possible for you to share the generated file? I am curious to know how we can use the connection.json to configure required properties in this SDK.
Jelle.Diet (Sat, 11 May 2019 13:14:38 GMT):
I think I have the connection yaml file for the basic network somewhere hold on
rickr (Sat, 11 May 2019 14:07:12 GMT):
@Jelle.Diet Not following exactly what it is you're doing. Should not be necessary. Follow the NetworkconfigIT example it loads the channel from the connection property file. Once loaded you _could_ query the channel for peers and orderers that have the URL but not sure why that is even needed.
https://github.com/hyperledger/fabric-sdk-java/blob/433432f4fb7f04251f40af0b2e1af96678169804/src/test/java/org/hyperledger/fabric/sdkintegration/NetworkConfigIT.java
rickr (Sat, 11 May 2019 14:07:12 GMT):
@Jelle.Diet Not following exactly what it is you're doing. Should not be necessary. Follow the NetworkconfigIT example it loads the channel from the connection profile file. Once loaded you _could_ query the channel for peers and orderers that have the URL but not sure why that is even needed.
https://github.com/hyperledger/fabric-sdk-java/blob/433432f4fb7f04251f40af0b2e1af96678169804/src/test/java/org/hyperledger/fabric/sdkintegration/NetworkConfigIT.java
rickr (Sat, 11 May 2019 14:16:37 GMT):
@nitishbhardwaj19 HFCSampletest.properties you won't find it. It's created as the test is run. Should be deleted after testing is done.
Jelle.Diet (Sat, 11 May 2019 14:39:43 GMT):
Ah I made it work, I was creating a new channel and adding a peer and orderer to it manually
tsnyder (Sun, 12 May 2019 07:23:32 GMT):
@rickr - I have isolated the problem with the Service Discovery, TLS and Raft. The issue is that when each node (Peer or Orderer) is built within the EndPoint it first does not find the SSL Context. It then goes and finds the TLS Cert. For the orderer nodes it always uses the orderer1 cert and not the orderer orgs tls cert. I ran the test using the BasicConfigure and SSL tracing. I have raised a jira item on this. I attached the console log, configtx.yaml, and crypto-config.yaml to the jira item.
nitishbhardwaj19 (Sun, 12 May 2019 14:27:12 GMT):
Thanks @rickr for your quick response.
nitishbhardwaj19 (Sun, 12 May 2019 15:42:06 GMT):
Hi @rickr What is the optimal way for creating an instance of HFCAClient and HFClient. Should it be created just once for each org or a new instance must be created for each operation?
rickr (Sun, 12 May 2019 18:20:16 GMT):
@nitishbhardwaj19 https://github.com/hyperledger/fabric-sdk-java/tree/433432f4fb7f04251f40af0b2e1af96678169804#should-an-application-create-more-than-one-hfclient
AndresMartinezMelgar.itcl (Mon, 13 May 2019 06:29:56 GMT):
Hi, I'm using the java sdk. When I make a valid transaction a new block is created (normal behavior) but when I make a query I also create a block.
I understand that this behavior is not normal, but I do not know for sure.
I think i am not using correct function
oborovyk (Mon, 13 May 2019 11:36:47 GMT):
Hi @rickr . Are the readme params(https://github.com/hyperledger/fabric-sdk-java#firewalls-load-balancers-network-proxies) enough for grpc problem solving?
oborovyk (Mon, 13 May 2019 11:39:44 GMT):
we are using loadChannelFromConfig(...) but it can't read the keepAliveWithoutCalls boolean property. there's a workaround for keepAliveTimeout, keepAliveTime in NetworkConfig though
rickr (Mon, 13 May 2019 11:52:33 GMT):
@oborovyk NetworkConfigIT shows how you can add any propertes or change them before any channel is loaded.
rickr (Mon, 13 May 2019 11:55:58 GMT):
@AndresMartinezMelgar.itcl block should not be written if your chaincode doing the query is not changing any properties. Also if it's just a query using your chaincode it should not be sent to the Orderer by your application.
oborovyk (Mon, 13 May 2019 12:39:59 GMT):
cool that worked. Can we add a pull request to fix the loadChannelFromConfig method?
rickr (Mon, 13 May 2019 12:53:39 GMT):
nothing is broken
oborovyk (Mon, 13 May 2019 12:59:10 GMT):
I think it should work with json only without adding properties manually. Or was it intended for partial load? Look at: private Node createNode.. in NetworkConfig.java. Wdyt?
rickr (Mon, 13 May 2019 13:01:15 GMT):
The document was for network providers to tell how to configure your network for what they provided. Those properties are specific to your client. Your application may behind a firewall and need them some other application may not.
Igor-Ivaniuk (Mon, 13 May 2019 13:05:59 GMT):
The point was that the defined properties are not parsed according to JSON types, but rather are provided as Strings
Igor-Ivaniuk (Mon, 13 May 2019 13:07:09 GMT):
Which is not compatible with, for example, Netty GRPC implementation
oborovyk (Mon, 13 May 2019 13:09:41 GMT):
Indeed and there's a workaround in NetworkConfig but only for 2 props if (null != props) {
String value = props.getProperty("grpc.keepalive_time_ms");
if (null != value) {
props.remove("grpc.keepalive_time_ms");
props.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {new Long(value), TimeUnit.MILLISECONDS});
}
value = props.getProperty("grpc.keepalive_timeout_ms");
if (null != value) {
props.remove("grpc.keepalive_timeout_ms");
props.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {new Long(value), TimeUnit.MILLISECONDS});
}
}
oborovyk (Mon, 13 May 2019 13:09:41 GMT):
Indeed and there's a workaround in NetworkConfig but only for 2 props
` if (null != props) {
String value = props.getProperty("grpc.keepalive_time_ms");
if (null != value) {
props.remove("grpc.keepalive_time_ms");
props.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {new Long(value), TimeUnit.MILLISECONDS});
}
value = props.getProperty("grpc.keepalive_timeout_ms");
if (null != value) {
props.remove("grpc.keepalive_timeout_ms");
props.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {new Long(value), TimeUnit.MILLISECONDS});
}
}`
oborovyk (Mon, 13 May 2019 13:09:41 GMT):
Indeed and there's a workaround in NetworkConfig but only for 2 props
``` if (null != props) {
String value = props.getProperty("grpc.keepalive_time_ms");
if (null != value) {
props.remove("grpc.keepalive_time_ms");
props.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {new Long(value), TimeUnit.MILLISECONDS});
}
value = props.getProperty("grpc.keepalive_timeout_ms");
if (null != value) {
props.remove("grpc.keepalive_timeout_ms");
props.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {new Long(value), TimeUnit.MILLISECONDS});
}
}```
nitishbhardwaj19 (Tue, 14 May 2019 07:49:45 GMT):
Where does artifacts folder(with all the crypto certs) needs to be added? I am getting connection timeout with hfcaClient.info();```
``connection.json```
{
"name": "orga-network",
"x-type": "hlfv1",
"version": "1.0.0",
"client": {
"organization": "orga",
"connection": {
"timeout": {
"peer": { "endorser": "300", "eventHub": "300", "eventReg": "300"},
"orderer": "300"
}
}
},
"channels": {
"firstchannel": {
"orderers": [
"orderer2nd-orgc"
],
"peers": {
"peer1st-orgb": {
"endorsingPeer": true, "chaincodeQuery": true, "eventSource": true
},
"peer2nd-orgb": {
"endorsingPeer": true, "chaincodeQuery": true, "eventSource": true
}
}
}
},
"organizations": {
"orga": {
"mspid": "orga",
"peers": [
],
"certificateAuthorities": [
"ca1st-orga"
]
},
"orgb": {
"mspid": "orgb",
"peers": [
"peer1st-orgb",
"peer2nd-orgb"
],
"certificateAuthorities": [
"ca1st-orgb"
]
}
},
"orderers": {
"orderer2nd-orgc": {
"url": "grpc://xx.xx.xx.xx:7050",
"grpcOptions": {
"ssl-target-name-override": "orderer2nd-orgc"
},
"tlsCACerts": {
"pem": "artifacts/keyfiles/orgc/orderers/orderer2nd-orgc.orgc/tls/ca.crt"
}
}
},
"peers": {
"peer1st-orgb": {
"url": "grpc://xx.xx.xx.xx:7051",
"eventUrl": "grpc://xx.xx.xx.xx:7053",
"grpcOptions": {
"ssl-target-name-override": "peer1st-orgb"
},
"tlsCACerts": {
"pem": "artifacts/keyfiles/orgb/tlsca/tlsca.orgb-cert.pem"
}
},
"peer2nd-orgb": {
"url": "grpc://xx.xx.xx.xx:7051",
"eventUrl": "grpc://xx.xx.xx.xx:7053",
"grpcOptions": {
"ssl-target-name-override": "peer2nd-orgb"
},
"tlsCACerts": {
"pem": "artifacts/keyfiles/orgb/tlsca/tlsca.orgb-cert.pem"
}
}
},
"certificateAuthorities": {
"ca1st-orga": {
"url": "http://xx.xx.xx.xx:7054",
"caName": "ca1st-orga",
"httpOptions": {"verify": false},
"tlsCACerts": {
"path": "artifacts/keyfiles/orga/tlsca/tlsca.orga-cert.pem"
}
},
"ca1st-orgb": {
"url": "http://xx.xx.xx.xx:7054",
"caName": "ca1st-orgb",
"httpOptions": {"verify": false},
"tlsCACerts": {
"path": "artifacts/keyfiles/orgb/tlsca/tlsca.orgb-cert.pem"
}
}
}
}
``` `` NOTE: I am using spring boot and added connection.json and artifacts folder under resources
```
nitishbhardwaj19 (Tue, 14 May 2019 07:49:45 GMT):
@rickr @Igor-Ivaniuk Where does artifacts folder(with all the crypto certs) needs to be added? I am getting connection timeout with hfcaClient.info();```
``connection.json```
{
"name": "orga-network",
"x-type": "hlfv1",
"version": "1.0.0",
"client": {
"organization": "orga",
"connection": {
"timeout": {
"peer": { "endorser": "300", "eventHub": "300", "eventReg": "300"},
"orderer": "300"
}
}
},
"channels": {
"firstchannel": {
"orderers": [
"orderer2nd-orgc"
],
"peers": {
"peer1st-orgb": {
"endorsingPeer": true, "chaincodeQuery": true, "eventSource": true
},
"peer2nd-orgb": {
"endorsingPeer": true, "chaincodeQuery": true, "eventSource": true
}
}
}
},
"organizations": {
"orga": {
"mspid": "orga",
"peers": [
],
"certificateAuthorities": [
"ca1st-orga"
]
},
"orgb": {
"mspid": "orgb",
"peers": [
"peer1st-orgb",
"peer2nd-orgb"
],
"certificateAuthorities": [
"ca1st-orgb"
]
}
},
"orderers": {
"orderer2nd-orgc": {
"url": "grpc://xx.xx.xx.xx:7050",
"grpcOptions": {
"ssl-target-name-override": "orderer2nd-orgc"
},
"tlsCACerts": {
"pem": "artifacts/keyfiles/orgc/orderers/orderer2nd-orgc.orgc/tls/ca.crt"
}
}
},
"peers": {
"peer1st-orgb": {
"url": "grpc://xx.xx.xx.xx:7051",
"eventUrl": "grpc://xx.xx.xx.xx:7053",
"grpcOptions": {
"ssl-target-name-override": "peer1st-orgb"
},
"tlsCACerts": {
"pem": "artifacts/keyfiles/orgb/tlsca/tlsca.orgb-cert.pem"
}
},
"peer2nd-orgb": {
"url": "grpc://xx.xx.xx.xx:7051",
"eventUrl": "grpc://xx.xx.xx.xx:7053",
"grpcOptions": {
"ssl-target-name-override": "peer2nd-orgb"
},
"tlsCACerts": {
"pem": "artifacts/keyfiles/orgb/tlsca/tlsca.orgb-cert.pem"
}
}
},
"certificateAuthorities": {
"ca1st-orga": {
"url": "http://xx.xx.xx.xx:7054",
"caName": "ca1st-orga",
"httpOptions": {"verify": false},
"tlsCACerts": {
"path": "artifacts/keyfiles/orga/tlsca/tlsca.orga-cert.pem"
}
},
"ca1st-orgb": {
"url": "http://xx.xx.xx.xx:7054",
"caName": "ca1st-orgb",
"httpOptions": {"verify": false},
"tlsCACerts": {
"path": "artifacts/keyfiles/orgb/tlsca/tlsca.orgb-cert.pem"
}
}
}
}
``` `` NOTE: I am using spring boot and added connection.json and artifacts folder under resources
```
nitishbhardwaj19 (Tue, 14 May 2019 08:18:34 GMT):
debug.png
nitishbhardwaj19 (Tue, 14 May 2019 17:21:20 GMT):
It actually fails at hfcaClient.info() when it tries to call CA http://xx.xxx.xxx.xxx:7054/api/v1/cainfo, gets Connection Timeout. But, I can't find any logs on CA. Seems like it's not able to reachout to CA. Strange thing is that the same configuration worked with Node SDK. It would be really great if someone can help me out with this.
nitishbhardwaj19 (Wed, 15 May 2019 01:34:33 GMT):
POSTCall.png
AndresMartinezMelgar.itcl (Wed, 15 May 2019 07:28:36 GMT):
Hi, how can i know if an user exist within CA server and recover this user(if exist)
AndresMartinezMelgar.itcl (Wed, 15 May 2019 07:28:36 GMT):
Hi, how can i know if an user exist within CA server and recover this user(if exist). With Java SDK
rickr (Wed, 15 May 2019 11:49:50 GMT):
@AndresMartinezMelgar.itcl look at https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric_ca/sdkintegration/HFCAClientIT.java
search for HFCAIdentity see if those APIs help
rickr (Wed, 15 May 2019 12:00:52 GMT):
@nitishbhardwaj19 The SDK tests run with TLS enabled connecting the HFCAClient and are passing. Have you followed it? As an independent connect try using `openssl s_client -connect` to see if that works
rickr (Wed, 15 May 2019 12:02:58 GMT):
Also I see a url in that one picture that looks to be url="http:/..." if this is tls I think *https* is going to work better.
nitishbhardwaj19 (Wed, 15 May 2019 12:58:03 GMT):
@rickr Thanks for replying. I have not configured TLS anywhere in HLF network. This is just a test network to check the connectivity with SDK. I am able to connect with Postman though. I am not sure why it doesn't connect with SDK client, trying to enable fiddler logs to get more information. I will update you soon.
rickr (Wed, 15 May 2019 13:09:29 GMT):
@nitishbhardwaj19 what is the level of fabric you're using ?
rickr (Wed, 15 May 2019 13:09:29 GMT):
@nitishbhardwaj19 what is the level/version of fabric you're using ?
nitishbhardwaj19 (Wed, 15 May 2019 13:16:54 GMT):
Fabric version is 1.4. I found the issue. It's because of the proxy which is being configured. The Proxy isn't allowing any http communication and I get connection timeout. Fiddler actually helped me to identify it. @rickr Thanks alot for looking into this. Though I am getting another error now, but at least the first one is resolved. :)
kevinkbc (Wed, 15 May 2019 13:36:15 GMT):
I am using hyperledger fabric 1.2 in IBM cloud starter plan and I want to connect with my java application (did everything until now with dockers) using java sdk 1.2 also. I got a connection profile - json file - with infos about url, ports, etc. There is also pems for ca. Got kinda lost. Does anyone have any material / tutorial about this?
kevinkbc (Wed, 15 May 2019 13:38:19 GMT):
I saw that node sdk have a loadFromConfig who gets this json. I am also searching for something similar in java
rickr (Wed, 15 May 2019 13:55:03 GMT):
@kevinkbc Searched README.md for connection profile?
rickr (Wed, 15 May 2019 13:55:03 GMT):
@kevinkbc Searched README.md for connection profile? Glad to help on specific JSDK questions, but support for IBM BC should be through IBM :wink:
kevinkbc (Wed, 15 May 2019 14:28:52 GMT):
thanks, I found it now. The problem was that I was looking in release 1.2 branch, but even though NetworkConfig is already there in this version, there is nothing about it in readme (only in 1.3+)
rickr (Wed, 15 May 2019 14:39:29 GMT):
@kevinkbc I think you should consider working with the latest 1.4.x JSDK
kevinkbc (Wed, 15 May 2019 14:45:23 GMT):
I will see the differences, but I am leving the company at the end of this month. So, that is not my decision.
kevinkbc (Wed, 15 May 2019 14:45:23 GMT):
I will see the differences, but I am leaving the company at the end of this month. So, that is not my decision.
mahoney1 (Thu, 16 May 2019 10:28:03 GMT):
reminder that the Fabric Developer Community call today is at 4pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call - be great to hear from you later ! 🙂 regards Paul
balamcyril (Thu, 16 May 2019 12:43:46 GMT):
Has joined the channel.
balamcyril (Thu, 16 May 2019 12:43:49 GMT):
hello, i have clone the fabric sdk java 1.4.1, setup all the dependencies with maven and start all the docker containner. But i don't know how to run each endtoend demo?
rickr (Thu, 16 May 2019 13:03:24 GMT):
@balamcyril Have your read the README.md ?
mauricio (Thu, 16 May 2019 13:08:59 GMT):
Has joined the channel.
mauricio (Thu, 16 May 2019 13:10:51 GMT):
Hi, can I use Scala instead of Java for chaincode and sdk ? Scala has interoperability with java then I can use chaincode java and sdk libraries. Someone has tried it?
balamcyril (Thu, 16 May 2019 13:31:08 GMT):
yes i have read it, i finish all the installation process. but i have some error on maven install "[ERROR] /home/cyril/go/src/fabric-sdk-java/src/main/java/org/hyperledger/fabric/sdk/security/CryptoPrimitives.java:[700,25] cannot find symbol"
rickr (Thu, 16 May 2019 13:33:48 GMT):
@balamcyril not seen that before. I have seen where doing a` mvn clean install` again once all has been downloaded from maven fix some oddities
balamcyril (Thu, 16 May 2019 13:35:08 GMT):
what is the best version of java to use to deploy fabric-sdk-java, i'm using java 11 and it seems there is a lot of problemm
rickr (Thu, 16 May 2019 13:35:17 GMT):
@mauricio google it? I don't know any direct effort for Scala .. did see some reference out there.
mauricio (Thu, 16 May 2019 13:35:56 GMT):
I already google it and I found only a couple posts
mauricio (Thu, 16 May 2019 13:36:08 GMT):
Thanks!
rickr (Thu, 16 May 2019 13:36:28 GMT):
@balamcyril we only test with 8
rickr (Thu, 16 May 2019 13:36:52 GMT):
IMO should step back and try to get that doing first
balamcyril (Thu, 16 May 2019 13:38:58 GMT):
ok thanks, i will try to test with java 8
Jelle.Diet (Thu, 16 May 2019 13:44:42 GMT):
When you getHistory for a key you get all the transactions, timestamps and an isDelete flag
Jelle.Diet (Thu, 16 May 2019 13:45:02 GMT):
But when will the isDelete flag be true, since you can no longer get the history when the key is deleted?
Jelle.Diet (Thu, 16 May 2019 13:45:02 GMT):
Is it also possible to get history for all deleted records for example? or query for history?
balamcyril (Thu, 16 May 2019 13:50:05 GMT):
I try with java 8 and is work fine, the is to many DEPRECATED library in java 9n 10 and 11
balamcyril (Thu, 16 May 2019 13:50:32 GMT):
it seems that fabric-sdk-java is juste work with java8
rickr (Thu, 16 May 2019 14:58:22 GMT):
@balamcyril not sure however I do remember ->
https://chat.hyperledger.org/channel/fabric-sdk-java?msg=DKkyx7pztXXbzugyF
mauricio (Thu, 16 May 2019 15:08:27 GMT):
Has left the channel.
rickr (Thu, 16 May 2019 20:00:27 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=xdh2Xr9c7iMH84MWQ) @jeffgarratt
sejalpawar (Fri, 17 May 2019 07:25:13 GMT):
@rickr Can you take a look at this jira? I have mentioned you in a comment: https://jira.hyperledger.org/browse/FABJ-439
balamcyril (Fri, 17 May 2019 07:26:48 GMT):
Hello, i finaly setup all and include the project in eclipse, but i face a last problem, all the "import org.hyperledger.fabric.protos.*" is doen't work, it seems that the project don't see all the .proto file
Jelle.Diet (Fri, 17 May 2019 09:58:26 GMT):
After I get the history of transactions for a certain key, how can I get the User that initiated that transaction from the transactioninfo in the sdk? I can't seem to figure it out
rickr (Fri, 17 May 2019 10:54:25 GMT):
@balamcyril https://github.com/hyperledger/fabric-sdk-java/tree/433432f4fb7f04251f40af0b2e1af96678169804#missing-protobuf-classes
rickr (Fri, 17 May 2019 10:57:37 GMT):
@Jelle.Diet I think that's shown in the Integration tests.
Jelle.Diet (Fri, 17 May 2019 11:21:05 GMT):
I only found a small sample in End2endIT that shows how to get the transaction ID and validation code of a transactionInfo, not any information about the user
rickr (Fri, 17 May 2019 11:28:00 GMT):
blockwalker routine doesn't have it?
Jelle.Diet (Fri, 17 May 2019 11:49:12 GMT):
Ah yes from the blockinfo it gets the mspId and certificate of the user, can it also be used to get the name? and can the same be done from TransactionInfo instead of BlockInfo?
rickr (Fri, 17 May 2019 12:05:18 GMT):
There is no `name`, Only mspid and the signers signature Whats there is what I know is available
Jelle.Diet (Fri, 17 May 2019 12:06:08 GMT):
how would you recommend getting the signing User from that information?
dan13 (Fri, 17 May 2019 14:21:11 GMT):
@Jelle.Diet the cert contains the username, right?
SandySun2000 (Fri, 17 May 2019 16:37:15 GMT):
@rickr The tutorial "https://developer.ibm.com/tutorials/hyperledger-fabric-java-sdk-for-tls-enabled-fabric-network" helps to connect to an IBP instance where the TLS was enabled, that could help to establish mTLS, but the tutorial didn't show the steps how the IBP instance will authenticate to the app using its certificate. Do you have any doc or tutorial to explain the missing steps?
rickr (Fri, 17 May 2019 17:17:01 GMT):
Mutual TLS if that's what your asking about is done by the grpcs /ssl connection layer. The only requirement is the client/sdk/application needs to provide for the connecit is a client certificate.
rickr (Fri, 17 May 2019 17:17:01 GMT):
Mutual TLS if that's what your asking about is done by the grpcs /ssl connection layer. The only requirement is the client/sdk/application needs to provide for the connecit is a client tls certificate/key.
gennadyl (Sun, 19 May 2019 11:50:20 GMT):
I wrote chaincode in Kotlin and it worked, so I assume Scala will work as well
yeousunn (Mon, 20 May 2019 03:26:24 GMT):
Has joined the channel.
yeousunn (Mon, 20 May 2019 05:48:26 GMT):
Hi, anyone facing `package org.hyperledger.fabric.protos.idemix does not exist` error? I am using Intellij IDEA to open the project. mvn install works fine, however IDE shows error when I build. The project is unable to find `protos` package.
kakali (Mon, 20 May 2019 06:02:51 GMT):
Has joined the channel.
kakali (Mon, 20 May 2019 06:02:52 GMT):
can anyone help me ? I have this issue when I compile fabric-sdk-java.
fabric-sdk-java/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java:[62,22] package javax.xml.bind does not exist
tballast (Mon, 20 May 2019 08:42:33 GMT):
@kakali take a look at this: https://stackoverflow.com/questions/52502189/java-11-package-javax-xml-bind-does-not-exist
Likely that you're using a new version of java where the modules were removed.
DVasin (Mon, 20 May 2019 13:04:14 GMT):
Has joined the channel.
DVasin (Mon, 20 May 2019 13:04:14 GMT):
Hi guys. Is it possible (and is there any examples) for interacting with byfn network (without ca) using Java SDK?
DVasin (Mon, 20 May 2019 13:04:59 GMT):
Is is ca nessecary for accessing the network via Java SDK?
rickr (Mon, 20 May 2019 21:25:43 GMT):
No CA is strictly required for Fabric. I just connected to Fabric's BYFN load I'ts user/creds and tls/certs for the connections.
smallant (Mon, 20 May 2019 23:35:15 GMT):
hi to all,
I'm using the java sdk to connect to my network and i received a peculiar error:
May 20, 2019 @ 15:34:01.216 peer1 [33m2019-05-20 13:34:01.216 UTC [valimpl] preprocessProtoBlock -> WARN 0ed[0m Channel [mychannel]: Block [13] Transaction index [0] TxId [6adad972827e6296f14a6bcca79855ada25f2ccd0403980383155bf9dac7c95] marked as invalid by committer. Reason code [DUPLICATE_TXID]
How can this happen??
PS: I'm using the txID as a key when I store my data
sandy (Tue, 21 May 2019 03:19:36 GMT):
Hi guys...
Instead of using fabric directly using SDK, can we use hyperledger composer directly for all cases ?
nitishbhardwaj19 (Tue, 21 May 2019 05:22:15 GMT):
@rickr Hope you are doing good. Could you please let me know if we are expected to save *Enrollment enrollment* in AppUser? If so, how can we persist it in DB? Should we use blob get just save private and public keys? What is the ideal scenario?
nitishbhardwaj19 (Tue, 21 May 2019 05:22:15 GMT):
@rickr Hope you are doing good. Could you please let me know if we are expected to save *Enrollment enrollment* in AppUser? If so, how can we persist it in DB? Should we use blob and just save private and public keys? What is the ideal scenario?
darapich92 (Tue, 21 May 2019 06:53:28 GMT):
hello all, Currently i test the End2EndIT and one block contains 1 transaction. do you know how can orderer inserts many transactions to a block?
Randyshu2018 (Tue, 21 May 2019 07:00:35 GMT):
only org admin can submit transaction ?
nitishbhardwaj19 (Tue, 21 May 2019 07:03:41 GMT):
@Randyshu2018 Any user can submit the transaction as long as he is a part of the organization. For that, you would have to first register and enroll different users for the organization(using org admin).
Randyshu2018 (Tue, 21 May 2019 07:04:44 GMT):
yean,I have did it,but I got some error like this'java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: access denied: channel [mychannel] creator org [Org1MSP]
'
Randyshu2018 (Tue, 21 May 2019 07:05:30 GMT):
also the same error display in peer log '2019-05-21 06:59:51.053 UTC [protoutils] ValidateProposalMessage -> WARN 094 channel [mychannel]: MSP error: the supplied identity is not valid: x509: certificate signed by unknown authority
2019-05-21 06:59:51.054 UTC [comm.grpc.server] 1 -> INFO 095 unary call completed {"grpc.start_time": "2019-05-21T06:59:51.053Z", "grpc.service": "protos.Endorser", "grpc.method": "ProcessProposal", "grpc.peer_address": "172.20.0.1:37322", "error": "access denied: channel [mychannel] creator org [Org1MSP]", "grpc.code": "Unknown", "grpc.call_duration": "668.9µs"}'
nitishbhardwaj19 (Tue, 21 May 2019 07:06:46 GMT):
How are you managing your Enrollment certs? Do you use the same set of certs to create User object which is being generated at the time of enroll?
Randyshu2018 (Tue, 21 May 2019 07:08:04 GMT):
Using fabric-ca interface to register and enroll user and then save the enroment to the samplestore
Randyshu2018 (Tue, 21 May 2019 07:08:54 GMT):
when using user,I get user from samplestore and then setUserContext.
Randyshu2018 (Tue, 21 May 2019 07:10:54 GMT):
I think the user cert is invalid except admin .but I need some method to correct them,do you have any idea
Randyshu2018 (Tue, 21 May 2019 08:38:43 GMT):
tks for your reply,my problem has resolved.
nitishbhardwaj19 (Tue, 21 May 2019 09:12:07 GMT):
sorry, just saw your ping. Good to know that it's resolved now.
DVasin (Tue, 21 May 2019 11:36:26 GMT):
Hi, guys. I,m able to invoke chaincode using Java SDK, changes are commited to ledger, all good, except
DVasin (Tue, 21 May 2019 11:36:26 GMT):
CompletableFuture
DVasin (Tue, 21 May 2019 11:36:26 GMT):
This feature never returns and time-outs (despite transaction being commited to ledger)
DVasin (Tue, 21 May 2019 11:36:26 GMT):
I configure channels like this (i,e. adding event hub)
Peer peer = client.newPeer("peer0.org1.example.com", "grpc://localhost:7051");
// eventhub name and endpoint in fabcar network
EventHub eventHub = client.newEventHub("eventhub01", "grpc://localhost:7053");
// orderer name and endpoint in fabcar network
Orderer orderer = client.newOrderer("orderer.example.com", "grpc://localhost:7050");
// channel name in fabcar network
Channel channel = client.newChannel("mychannel");
channel.addPeer(peer);
channel.addEventHub(eventHub);
channel.addOrderer(orderer);
channel.initialize();
return channel;
DVasin (Tue, 21 May 2019 11:36:26 GMT):
What am I doing wrong, any ideas?
rickr (Tue, 21 May 2019 11:53:30 GMT):
@smallant Not sure how that is happening. That's the first case of that error code I've seen reported here. I can only _ guess _ you're sending the endorsement to the Orderer twice? May take that to the #fabric-peer-endorser-committer channel.
rickr (Tue, 21 May 2019 11:57:17 GMT):
@sandy There is no *composer* for Java. Work is in progress for Java programming model. It only I think covers transactions ( invoking chiancode ) https://github.com/hyperledger/fabric-gateway-java
rickr (Tue, 21 May 2019 12:01:32 GMT):
@nitishbhardwaj19 Yes the application needs to manage persisting it's data. The SampleStore and SampleOrg have a simple implementation of it.
rickr (Tue, 21 May 2019 12:04:47 GMT):
@darapich92 Depends on serveral factors like in the configblock there is a batch size that will trigger a block to be created once that's reached and a some timeout. For exact details ask on #fabric-orderer
rickr (Tue, 21 May 2019 12:08:02 GMT):
@DVasin not directly releated to your question but eventhubs have long been deprecated. What version of fabric/sdk are you using? Up the time 5min ? see what happens.
rickr (Tue, 21 May 2019 12:08:02 GMT):
@DVasin not directly releated to your question but eventhubs have long been deprecated. What version of fabric/sdk are you using? Up the time 5min ? see what happens. Also putting the sdk to logging trace mode shows if events are being received and after about 10 min there is a cleanup thread that kicks off and should report with a warning for any transactions that have not received a response.
smallant (Tue, 21 May 2019 12:23:17 GMT):
Thank you, I'll redirect my question to there
darapich92 (Tue, 21 May 2019 15:07:15 GMT):
@rickr thank you very much. i will the same question to the recommended group. all the best!
horse (Tue, 21 May 2019 18:11:52 GMT):
Has joined the channel.
DarionHernandez (Tue, 21 May 2019 23:35:05 GMT):
Has joined the channel.
darapich92 (Wed, 22 May 2019 02:09:25 GMT):
@rickr hi, i am sorry to ask you but i eager to know the solution to insert multi Tx in a block. Could you guide me how to configblock?
kakali (Wed, 22 May 2019 03:22:43 GMT):
can anyone help me? I need an example for connecting fabric by sdk-java
Randyshu2018 (Wed, 22 May 2019 05:19:05 GMT):
Clipboard - May 22, 2019 1:17 PM
tehsunnliu (Wed, 22 May 2019 07:06:38 GMT):
Has joined the channel.
tballast (Wed, 22 May 2019 08:44:29 GMT):
@kakali Take a look at this file: https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java
Using the resources here: https://github.com/hyperledger/fabric-sdk-java/tree/master/src/test/fixture/sdkintegration
This is a good example of what the SDK can do. There are a lot of other examples there too, but this at least covers the basics.
chill37 (Wed, 22 May 2019 10:36:48 GMT):
Invoke hangs when peer container irrelevant to endorsing is stopped.
I’m not sure if it’s a bug, something I did wrong, or just-is by design.
Thanks for looking into it!
Current Setup: BYFN Solo Network
Simulation:
- query and invoke using service discovery
- I stop peer container (docker stop peer0.org1.example.com)
- Query still works fine
- Invoke HANGS forever
My Reasoning is:
Discovered peers are only 3 (through network discovery)
But, eventing peers are 4 (when called within channel.sendTransaction())
1 event still waiting for reply to be completed
Is this the reason or am I doing something wrong?
I believe that network discovery should also refresh the peer list of channel.getPeers()
--------logs----------
Discovered Peers
2019-05-22T18:13:08.471 INFO o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 222 - Channel mychannel doing discovery with peer: Peer peer1.org1.example.com:8051 url: grpcs://peer1.org1.example.com:8051
2019-05-22T18:13:08.477 TRACE o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 309 - Channel mychannel discovered orderer MSPID: OrdererMSP, endpoint: orderer.example.com:7050
2019-05-22T18:13:08.477 TRACE o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 330 - Channel mychannel discovered peer MSPID: Org1MSP, endpoint: peer1.org1.example.com:8051
2019-05-22T18:13:08.478 TRACE o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 330 - Channel mychannel discovered peer MSPID: Org2MSP, endpoint: peer1.org2.example.com:10051
2019-05-22T18:13:08.478 TRACE o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 330 - Channel mychannel discovered peer MSPID: Org2MSP, endpoint: peer0.org2.example.com:9051
2019-05-22T18:13:08.478 DEBUG o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 346 - Channel mychannel service discovery completed: true
getEventingPeers
2019-05-22T18:13:27.373 INFO c.l.b.f.f.c.FabricClient [pool-17-thread-1] 631 - ####:peer1.org2.example.com:10051
2019-05-22T18:13:27.373 INFO c.l.b.f.f.c.FabricClient [pool-17-thread-1] 631 - ####:peer0.org1.example.com:7051
2019-05-22T18:13:27.373 INFO c.l.b.f.f.c.FabricClient [pool-17-thread-1] 631 - ####:peer0.org2.example.com:9051
2019-05-22T18:13:27.373 INFO c.l.b.f.f.c.FabricClient [pool-17-thread-1] 631 - ####:peer1.org1.example.com:8051
chill37 (Wed, 22 May 2019 10:36:48 GMT):
Invoke hangs when peer container irrelevant to endorsing is stopped.
I’m not sure if it’s a bug, something I did wrong, or just-is by design.
Thanks for looking into it!
Current Setup: BYFN Solo Network
Simulation:
- query and invoke using service discovery
- I stop peer container (docker stop peer0.org1.example.com)
- Query still works fine
- Invoke HANGS forever
My Reasoning is:
- Discovered peers are only 3 (through network discovery)
- But, eventing peers are 4 (when called within channel.sendTransaction())
- 1 event still waiting for reply to be completed
Is this the reason or am I doing something wrong?
I believe that network discovery should also refresh the peer list of channel.getPeers()
--------logs----------
Discovered Peers
2019-05-22T18:13:08.471 INFO o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 222 - Channel mychannel doing discovery with peer: Peer peer1.org1.example.com:8051 url: grpcs://peer1.org1.example.com:8051
2019-05-22T18:13:08.477 TRACE o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 309 - Channel mychannel discovered orderer MSPID: OrdererMSP, endpoint: orderer.example.com:7050
2019-05-22T18:13:08.477 TRACE o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 330 - Channel mychannel discovered peer MSPID: Org1MSP, endpoint: peer1.org1.example.com:8051
2019-05-22T18:13:08.478 TRACE o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 330 - Channel mychannel discovered peer MSPID: Org2MSP, endpoint: peer1.org2.example.com:10051
2019-05-22T18:13:08.478 TRACE o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 330 - Channel mychannel discovered peer MSPID: Org2MSP, endpoint: peer0.org2.example.com:9051
2019-05-22T18:13:08.478 DEBUG o.h.f.s.ServiceDiscovery [http-nio-8080-exec-5] 346 - Channel mychannel service discovery completed: true
getEventingPeers
2019-05-22T18:13:27.373 INFO c.l.b.f.f.c.FabricClient [pool-17-thread-1] 631 - ####:peer1.org2.example.com:10051
2019-05-22T18:13:27.373 INFO c.l.b.f.f.c.FabricClient [pool-17-thread-1] 631 - ####:peer0.org1.example.com:7051
2019-05-22T18:13:27.373 INFO c.l.b.f.f.c.FabricClient [pool-17-thread-1] 631 - ####:peer0.org2.example.com:9051
2019-05-22T18:13:27.373 INFO c.l.b.f.f.c.FabricClient [pool-17-thread-1] 631 - ####:peer1.org1.example.com:8051
chill37 (Wed, 22 May 2019 10:36:48 GMT):
Invoke hangs when peer container irrelevant to endorsing is stopped.
I’m not sure if it’s a bug, something I did wrong, or just-is by design.
Thanks for looking into it!
Current Setup: BYFN Solo Network
Simulation:
- query and invoke using service discovery
- I stop peer container (docker stop peer0.org1.example.com)
- Query still works fine
- Invoke HANGS forever
My Reasoning is:
- Discovered peers are only 3 (through network discovery)
- But, eventing peers are 4 (when called within channel.sendTransaction())
- 1 event still waiting for reply to be completed
Is this the reason or am I doing something wrong?
I believe that network discovery should also refresh the peer list of channel.getPeers()
--------code---------
(few option codes omitted)
responses = channel.sendTransactionProposalToEndorsers(request, discoveryOptions);
CompletableFuture
rickr (Wed, 22 May 2019 12:07:52 GMT):
@Randyshu2018 The most universal format would be a PEM encoded google it some https://www.programcreek.com/java-api-examples/?api=org.bouncycastle.util.io.pem.PemWriter
would probably give best results
rickr (Wed, 22 May 2019 12:27:28 GMT):
@chill37 By default the sdk will listen to all eventing peers on the channel. The sendTransaction _by default_ will wait on all eventingPeers to see the block with the transaction. You can change that and specify on that method specific peers, or no peers at all just send it to the orderer. If a peer does not report like in your case the sdk continues to try to connect and block events in the case it just a network glitch or temporary issue with the peer. Given a network is involved their can't be any guarantee a peer will report. On the future can set a timeout. Your application needs to know how it should do recovery.
rickr (Wed, 22 May 2019 12:27:28 GMT):
@chill37 By default the sdk will listen to all eventing peers on the channel. The sendTransaction _by default_ will wait on all eventingPeers to see the block with the transaction. You can change that and specify on that method specific peers, or no peers at all just send it to the orderer. If a peer does not report like in your case the sdk continues to try to reconnect to get block events in the case it just a network glitch or temporary issue with the peer. Given a network is involved their can't be any guarantee a peer will report. On the future can set a timeout. Your application needs to know how it should do recovery.
chill37 (Wed, 22 May 2019 12:31:17 GMT):
@rickr I see. So you are saying this result is by design.
In case one peer is lost for quite some time, wouldn't it be nice for sendTransaction() to have an option such as 'wait only on peers who participated on Proposal', namely the peers in proposal response? Just a thought.
chill37 (Wed, 22 May 2019 12:46:02 GMT):
anyway, thanks for making it clear! I wasn't so sure if I was doing anything wrong :joy:
rickr (Wed, 22 May 2019 12:48:25 GMT):
I think it's a situation where the sdk is caught in the middle. There is never IMO going to be a behavior that every application is going to like. You do know the peers that endorsed. You should be able to specify them on the sendTransaction
chill37 (Wed, 22 May 2019 12:51:51 GMT):
yes. now that I'm sure, I'll have to implement it. Thanks as always!
Randyshu2018 (Wed, 22 May 2019 14:17:07 GMT):
tks u , but the private key created by fabric-ca-java also doesn't work with fabric-sdk-node...the key file's length is longer than others.
nitishbhardwaj19 (Wed, 22 May 2019 18:08:41 GMT):
Hi @rickr I get an Exception when I try to reload PrivateKey instance from the privateKeyString which is generated by Enrollment object.```
``java.security.InvalidKeyException: IOException : version mismatch: (supported: 00, parsed: 01
at sun.security.pkcs.PKCS8Key.decode(PKCS8Key.java:352) ~[na:1.8.0_152]
at sun.security.pkcs.PKCS8Key.decode(PKCS8Key.java:357) ~[na:1.8.0_152]
at sun.security.ec.ECPrivateKeyImpl.
nitishbhardwaj19 (Wed, 22 May 2019 18:09:05 GMT):
Any ideas about this?
nitishbhardwaj19 (Wed, 22 May 2019 18:10:06 GMT):
`enrollment.setCert(base64Certs);
//final byte[] keyBytes = user.getPrivatekeyString().getBytes();
final byte[] privateKeyBytes = Base64.getDecoder().decode(user.getPrivatekeyString());
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes);
KeyFactory kf = KeyFactory.getInstance(user.getPrivateKeyAlgotithm());
PrivateKey privKey = kf.generatePrivate(keySpec);
enrollment.setKey(privKey);`
nitishbhardwaj19 (Wed, 22 May 2019 18:10:06 GMT):
``enrollment.setCert(base64Certs);
//final byte[] keyBytes = user.getPrivatekeyString().getBytes();
final byte[] privateKeyBytes = Base64.getDecoder().decode(user.getPrivatekeyString());
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes);
KeyFactory kf = KeyFactory.getInstance(user.getPrivateKeyAlgotithm());
PrivateKey privKey = kf.generatePrivate(keySpec);
enrollment.setKey(privKey);``
nitishbhardwaj19 (Wed, 22 May 2019 18:10:06 GMT):
``enrollment.setCert(base64Certs);
//final byte[] keyBytes = user.getPrivatekeyString().getBytes();
final byte[] privateKeyBytes = Base64.getDecoder().decode(user.getPrivatekeyString());
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes);
KeyFactory kf = KeyFactory.getInstance(user.getPrivateKeyAlgotithm());
PrivateKey privKey = kf.generatePrivate(keySpec);
enrollment.setKey(privKey);`
nitishbhardwaj19 (Wed, 22 May 2019 18:10:06 GMT):
`enrollment.setCert(base64Certs);
//final byte[] keyBytes = user.getPrivatekeyString().getBytes();
final byte[] privateKeyBytes = Base64.getDecoder().decode(user.getPrivatekeyString());
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes);
KeyFactory kf = KeyFactory.getInstance(user.getPrivateKeyAlgotithm());
PrivateKey privKey = kf.generatePrivate(keySpec);
enrollment.setKey(privKey);`
nitishbhardwaj19 (Wed, 22 May 2019 18:10:06 GMT):
Gets the Exception at PrivateKey privKey = kf.generatePrivate(keySpec);```
``enrollment.setCert(base64Certs);
//final byte[] keyBytes = user.getPrivatekeyString().getBytes();
final byte[] privateKeyBytes = Base64.getDecoder().decode(user.getPrivatekeyString());
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes);
KeyFactory kf = KeyFactory.getInstance(user.getPrivateKeyAlgotithm());
PrivateKey privKey = kf.generatePrivate(keySpec);
enrollment.setKey(privKey);`
nitishbhardwaj19 (Wed, 22 May 2019 18:17:54 GMT):
privateKeyString:```
` public static String getPEMStringFromPrivateKey(PrivateKey privateKey) throws IOException {
StringWriter pemStrWriter = new StringWriter();
JcaPEMWriter pemWriter = new JcaPEMWriter(pemStrWriter);
pemWriter.writeObject(privateKey);
pemWriter.close();
String privateKeyString = pemStrWriter.toString();
privateKeyString = privateKeyString.replaceAll("\\\r\n", "").replace("-----BEGIN EC PRIVATE KEY-----", "").replace("-----END EC PRIVATE KEY-----", "");
return privateKeyString;
}``
```
nitishbhardwaj19 (Wed, 22 May 2019 18:17:54 GMT):
I even tried this:```
`` final Reader pemReader = new StringReader(user.getPrivatekeyString());
PrivateKeyInfo pemPair = null;
try (PEMParser pemParser = new PEMParser(pemReader)) {
pemPair = (PrivateKeyInfo) pemParser.readObject();
} catch (IOException e) {
e.printStackTrace();
}
try {
PrivateKey privateKey = new JcaPEMKeyConverter().setProvider(BouncyCastleProvider.PROVIDER_NAME).getPrivateKey(pemPair);
enrollment.setKey(privateKey);
} catch (PEMException e) {
e.printStackTrace();
}`
nitishbhardwaj19 (Wed, 22 May 2019 18:57:12 GMT):
But I get *ClassCastException org.bouncycastle.openssl.PEMKeyPair cannot be cast to org.bouncycastle.asn1.pkcs.PrivateKeyInfo*. I am not doing string.replace operation anymore while saving the keys.```
```
Antimttr (Wed, 22 May 2019 19:06:43 GMT):
yeah i ran into the same thing
Antimttr (Wed, 22 May 2019 19:06:43 GMT):
@nitishbhardwaj19 yeah i ran into the same thing
Antimttr (Wed, 22 May 2019 19:06:50 GMT):
i ended up using some helper functions to get it working
Antimttr (Wed, 22 May 2019 19:08:23 GMT):
uses a deprecated function but it seems to work just fine
Antimttr (Wed, 22 May 2019 19:08:23 GMT):
uses a deprecated library but it seems to work just fine
Antimttr (Wed, 22 May 2019 19:08:27 GMT):
```
/**
* This function uses PEMWriter to extract a PEM encoded string from a private key object.
* @param privateKey The private key object which contains the private key to use to extract the PEM string.
* @return String Returns a PEM encoded string
* @throws IOException From PEMWriter
*/
public static String getPEMStringFromPrivateKey(PrivateKey privateKey) throws IOException {
StringWriter pemStrWriter = new StringWriter();
PEMWriter pemWriter = new PEMWriter(pemStrWriter);
pemWriter.writeObject(privateKey);
pemWriter.close();
return pemStrWriter.toString();
}
/**
* This method utilizes the bouncycastle OpenSSL library to parse a PEM encoded Key and converts it into a KeyPair
* object.
* @param pkcs8key String PEM encoded key string
* @return KeyPair Object contains the decoded values from the PEM key
*/
public static KeyPair keyToValue(String pkcs8key) {
Reader rdr = new StringReader(pkcs8key);
KeyPair pair = null;
try {
Object parsed = new org.bouncycastle.openssl.PEMParser(rdr).readObject();
pair = new org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter().getKeyPair((org.bouncycastle.openssl.PEMKeyPair) parsed);
} catch(Exception e) {
System.out.println("ERROR: Unable to generate enrollment: " + e.getMessage());
e.printStackTrace();
return null;
}
return pair;
}
/**
* This method utilizes the Bouncycastle OpenSSL library to extract a PrivateKey object from a PEM encoded byte
* stream.
* @param data The byte array which contains the stream.
* @return PrivateKey An object which contains the decoded private key.
* @throws IOException From Bouncycastle.
*/
public static PrivateKey getPrivateKeyFromBytes(byte[] data) throws IOException {
final Reader pemReader = new StringReader(new String(data));
final PrivateKeyInfo pemPair;
try (PEMParser pemParser = new PEMParser(pemReader)) {
pemPair = (PrivateKeyInfo) pemParser.readObject();
}
Security.addProvider(new BouncyCastleProvider());
PrivateKey privateKey = new JcaPEMKeyConverter()
.setProvider(BouncyCastleProvider.PROVIDER_NAME).getPrivateKey(pemPair);
return privateKey;
}
```
nitishbhardwaj19 (Thu, 23 May 2019 04:53:03 GMT):
@Antimttr Thanks for sharing this. But, I am getting classCastExcetion:
java.lang.ClassCastException: org.bouncycastle.openssl.PEMKeyPair cannot be cast to org.bouncycastle.asn1.pkcs.PrivateKeyInfo
nitishbhardwaj19 (Thu, 23 May 2019 05:12:04 GMT):
I got another reference, may be it will help someone```
`/**
* Reads a base64-format PEM key and returns a Java PrivateKey for it.
* @param privateKey PEM-encoded private key
*/
public static PrivateKey readPrivateKey(String privateKey) {
try (StringReader keyReader = new StringReader(privateKey);
PEMParser pemReader = new PEMParser(keyReader)) {
JcaPEMKeyConverter converter = new JcaPEMKeyConverter();
Object keyPair = pemReader.readObject();
if (keyPair instanceof PrivateKeyInfo) {
return converter.getPrivateKey((PrivateKeyInfo) keyPair);
} else {
return converter.getPrivateKey(((PEMKeyPair) keyPair).getPrivateKeyInfo());
}
} catch (IOException x) {
// Shouldn't occur, since we're only reading from strings
throw new RuntimeException(x);
}
}`
```
Subhankar 3 (Thu, 23 May 2019 07:07:55 GMT):
what is difference between channel.addPeer() and channel.joinPeer() in sdk?
kakali (Thu, 23 May 2019 08:10:31 GMT):
@tballast thanks
SatheeshNehru (Thu, 23 May 2019 10:45:48 GMT):
how to use getcreator api
it returns byte array
is there any possibility of getting sumbmitter id??
rickr (Thu, 23 May 2019 11:05:07 GMT):
@Subhankar 3 see Readme.md .. good to read it end2end :wink:
rickr (Thu, 23 May 2019 11:06:37 GMT):
@SatheeshNehru You should be getting the certificate of the person that signed the proposal
Jelle.Diet (Thu, 23 May 2019 12:27:00 GMT):
Is it possible to use the fabric java sdk with JDK 1.7?
Antimttr (Thu, 23 May 2019 14:40:24 GMT):
@rickr does the java sdk have any facilities to help adding an org to a channel? specifically can you create teh channel update difference pb/json files? Also can it perform the signature on those files? if there's any example code for these processes please let me know
rickr (Thu, 23 May 2019 14:45:07 GMT):
Updating a channel is listed in the README.md.
Antimttr (Thu, 23 May 2019 14:54:53 GMT):
right that has updating a channel configuration but specifically for the tasks needed to add an org to teh channel you have to use this command: `jq -s '.[0] * {"channel_group":{"groups":{"Application":{"groups": {"Org3MSP":.[1]}}}}}' config.json ./channel-artifacts/org3.json > modified_config.json` or something like it
Antimttr (Thu, 23 May 2019 14:55:16 GMT):
would i still need to run this command externally? or does the sdk provide facilities for performing the same action?
Antimttr (Thu, 23 May 2019 14:56:05 GMT):
seems like the jq command and the cryptotxgen commands will need to be run externally if im not mistaken?
Antimttr (Thu, 23 May 2019 14:56:05 GMT):
seems like the jq command and the configtxgen commands will need to be run externally if im not mistaken?
Antimttr (Thu, 23 May 2019 15:21:22 GMT):
So after reading https://hyperledger-fabric.readthedocs.io/en/release-1.4/channel_update_tutorial.html multiple times I have formulated a multi step proccess for creating a new org and joining it to a channel:
Antimttr (Thu, 23 May 2019 15:22:20 GMT):
1. create the new org's crypto artifacts using cryptogen from base artifact files
Antimttr (Thu, 23 May 2019 15:22:49 GMT):
2. modify and update the channel with the new crypto material generated in step 1
Antimttr (Thu, 23 May 2019 15:22:49 GMT):
2. modify and update the channel config with the new crypto material generated in step 1
Antimttr (Thu, 23 May 2019 15:23:56 GMT):
3. configure leader elections on the new org's peers and join them to the channel
Antimttr (Thu, 23 May 2019 15:24:44 GMT):
4. update the channels chaincode with the new policy which includes the new organization
Antimttr (Thu, 23 May 2019 15:24:44 GMT):
4. update the channels chaincode with the new policy which includes the new organization (this would constitute a new version of the chaincode on the channel)
Antimttr (Thu, 23 May 2019 15:25:32 GMT):
@rickr let me know if im missing anything
Antimttr (Thu, 23 May 2019 15:26:43 GMT):
seems like step one will still require the running of cryptogen which is not something the sdk deals with
Antimttr (Thu, 23 May 2019 15:27:42 GMT):
and step 2 modifying the json configuration would be something best left to the jq utility, in the example sdk code they make a very simple modification, replacing a value of an existing json key with a different value. but adding a new org is going to be a lot more modification than that
Antimttr (Thu, 23 May 2019 15:28:22 GMT):
@rickr have you ever performed all this with just the sdk only? or would you use the external tools as well?
rickr (Thu, 23 May 2019 15:49:21 GMT):
@Antimttr I have not. (honest!) The SDK does provides the means to send channel updates blocks which is needed. It admittedly keeps it simple (changing batch timeout) to keep the test and example simple. The change requires modifying json representation for changes. How the application does that is not up to the SDK. For any details on specific changes I don't feel its up to each SDK to document. Fabric documentations needs to provide and give help in appropriate rocket chat channel #fabric-questions .
Antimttr (Thu, 23 May 2019 15:52:28 GMT):
one thing i've noticed is that the doc i linked above uses command line configtxlator, where as the sdk example uses an RESTful API version of it running in a docker image. I'm curious how i could translate the commands in the doc to API calls that you use in the SDK example
Antimttr (Thu, 23 May 2019 15:52:47 GMT):
i suppose theres a document somewhere on how to use the configtxlator docker image api somewhere
Antimttr (Thu, 23 May 2019 15:52:47 GMT):
i suppose theres a document somewhere on how to use the configtxlator docker image api
Antimttr (Thu, 23 May 2019 15:55:37 GMT):
actualy the doc uses configtxgen not configtxlator
rickr (Thu, 23 May 2019 15:56:08 GMT):
I _think_ the REST APIs are limited to what's shown in the JSDK which is to get a json representations and update blocks which is shown to do the changes.
Antimttr (Thu, 23 May 2019 15:57:52 GMT):
ok i think i found the doc for the api here: https://hyperledger-fabric.readthedocs.io/en/release-1.4/commands/configtxlator.html
kn3118 (Thu, 23 May 2019 16:36:39 GMT):
Has joined the channel.
Antimttr (Thu, 23 May 2019 16:57:49 GMT):
is calling `fooChannel.getChannelConfigurationBytes()` equivilent to the following command: `peer channel fetch config config_block.pb -o orderer.example.com:7050 -c $CHANNEL_NAME --tls --cafile $ORDERER_CA` ?
Antimttr (Thu, 23 May 2019 18:53:53 GMT):
@rickr in order to join the peers of a newly added org to the channel we have to pass it the genesis block. Using peer commands you do this: `peer channel join -b mychannel.block` I was looking for some equivalent option in
Antimttr (Thu, 23 May 2019 18:53:53 GMT):
@rickr in order to join the peers of a newly added org to the channel we have to pass it the genesis block. Using peer commands you do this: `peer channel join -b mychannel.block` I was looking for some equivalent option in `channel.joinPeer()` but i couldn't find a way to specify a block to pass in. do you know if there is a way of doing this with the jsdk?
Antimttr (Thu, 23 May 2019 18:55:23 GMT):
or does this command automatically grab the genesis block on the channel as part of its regular operation?
Antimttr (Thu, 23 May 2019 18:56:55 GMT):
looking at the decompiled byte code i do see that it is grabbing the genesis block: `this.genesisBlock = this.getGenesisBlock(orderer);`
Antimttr (Thu, 23 May 2019 18:57:22 GMT):
so maybe i dont need to pass it explicitly
rickr (Thu, 23 May 2019 19:41:00 GMT):
just use the joinPeer command the sdk has
kevinkbc (Thu, 23 May 2019 19:50:42 GMT):
hey everyone, how can the sdk retry failed transactions? Is there any test that can shed some light on this @rickr ?
rickr (Thu, 23 May 2019 20:05:00 GMT):
@kevinkbc Nope, because the SDK doesn't retry failed transactionsl
Randyshu2018 (Fri, 24 May 2019 01:34:34 GMT):
Why HFCAClient.enroll() doesn't return root certificate and certificate chain?
Randyshu2018 (Fri, 24 May 2019 07:17:01 GMT):
Clipboard - May 24, 2019 3:16 PM
rickr (Fri, 24 May 2019 11:28:02 GMT):
Why do you need it?
nitishbhardwaj19 (Fri, 24 May 2019 13:09:39 GMT):
@rickr @Antimttr Thanks for your quick responses guys. You guys rock. I need your help again :)
nitishbhardwaj19 (Fri, 24 May 2019 13:11:07 GMT):
I am trying to do a query on a basic Balance-Transfer setup. My Fabric network is already up and running. I have added all the required details in connection.json and loading it in netwrokConfig.
nitishbhardwaj19 (Fri, 24 May 2019 13:12:36 GMT):
How do I connect to the channel which is preconfigured and has required config in connection.json? I have created a new instance of HFClient but it doesn't have the channel details.
nitishbhardwaj19 (Fri, 24 May 2019 13:12:59 GMT):
HFClient
nitishbhardwaj19 (Fri, 24 May 2019 13:16:00 GMT):
@rickr & @Antimttr Just went through docs again and found that there is a method, * loadChannelFromConfig(String channelName, NetworkConfig networkConfig)* I guess that should do the job. Let me give it a shot
nitishbhardwaj19 (Fri, 24 May 2019 13:16:33 GMT):
Oh, the method is in HFClient class in case someone wants to know it.
Jelle.Diet (Fri, 24 May 2019 13:17:19 GMT):
Channel newChannel = hfClient.loadChannelFromConfig("CHANNEL_NAME", networkConfig);
newChannel.initialize();
nitishbhardwaj19 (Fri, 24 May 2019 13:18:52 GMT):
Thanks @Jelle.Diet :) You guys rock.
kevinkbc (Fri, 24 May 2019 13:19:10 GMT):
So if I need a retry, I should actually send a new transaction with the same data?
kevinkbc (Fri, 24 May 2019 13:40:35 GMT):
Or there is some way to retry using chaincode?
nitishbhardwaj19 (Fri, 24 May 2019 13:51:28 GMT):
@Jelle.Diet Why does it requires to set UserContext just to load channelConfig?
nitishbhardwaj19 (Fri, 24 May 2019 13:54:05 GMT):
All I wanted is to initial HFClient first with all the configured channels and get it ready to be injected as a Bean dependency. I was planning to set the UserContext in all the subsequent requests for performing operation.
rickr (Fri, 24 May 2019 14:11:07 GMT):
There is _no magic_
You need to get enough valid endorsements and keep trying
Once enough endorsements have been obtained, send them to the Orderer.
If you don't observe via the peer eventing or querying for the transaction and fiind that the transaction is valid ... you need to start over with getting endorsements again. rinse, repeat till successfull
balamcyril (Fri, 24 May 2019 14:20:35 GMT):
Hello, i want to know how unlinkability and anonymity is provide by using Idemix Credential since CA and MSP have acces to client information?
Jelle.Diet (Fri, 24 May 2019 14:36:08 GMT):
you need to pass the peerAdmin UserContext because the channel needs a signer
nitishbhardwaj19 (Fri, 24 May 2019 14:45:03 GMT):
Yeah, that's what I am passing at he moment. But, I just confused about why it's needed as the channel is already configured and running over actual network. The config is just has it's pointers
nitishbhardwaj19 (Fri, 24 May 2019 14:45:03 GMT):
Yeah, that's what I am passing at the moment. But, I just confused about why it's needed as the channel is already configured and running over actual network. The config is just has it's pointers
nitishbhardwaj19 (Fri, 24 May 2019 14:45:03 GMT):
Yeah, that's what I am passing at the moment. But, I am just confused about why it's needed as the channel is already configured and running over actual network. The config is just has it's pointers
Jelle.Diet (Fri, 24 May 2019 14:52:37 GMT):
I looked in the code and it forcibly checks if the usercontext, throwing an exception if it's null. I'm not sure why it's 100% needed, maybe @rickr can help?
Jelle.Diet (Fri, 24 May 2019 14:52:37 GMT):
I looked in the code and it forcibly checks the usercontext, throwing an exception if it's null. I'm not sure why it's 100% needed, maybe @rickr can help?
kevinkbc (Fri, 24 May 2019 14:56:33 GMT):
I got it. The issue for me was that I am connecting with IBM cloud and I sent 100 transactions, they were divided into 5 different threads. One thread failed to connect due to network issues and all the 20 transactions that thread would send failed
kevinkbc (Fri, 24 May 2019 14:57:04 GMT):
That is the kind of problem I did not have when I was developing locally with the dockers
nitishbhardwaj19 (Fri, 24 May 2019 15:26:29 GMT):
I am just digging to the code, couldn't see any references which needs usercontext to load channel
JorgeNavarro (Mon, 27 May 2019 07:55:58 GMT):
Hello, what is the function of channel.addEventHub()? Im using java sdk.
nmutter (Mon, 27 May 2019 09:36:31 GMT):
Has joined the channel.
nmutter (Mon, 27 May 2019 09:36:34 GMT):
Hey, I want to setup Peers in different organizations. Therefore, each org will have an own client. I'm searching for instructions on how to create java-sdk-clients for this distributed setup. Like how would a channel creation work with multiple clients? Do all need to use the same serialized channel, or can they create it on their own?...? I just know samples where one client controls all the peers. Would be great if someone has experience with this :)
nmutter (Mon, 27 May 2019 09:39:41 GMT):
as far as I know EventHubs should not be used anymore. registerBlockListener is the replacement for them. but could not find documentation :)
JorgeNavarro (Mon, 27 May 2019 10:07:29 GMT):
in which sdk version should not be used?
nmutter (Mon, 27 May 2019 11:05:22 GMT):
I thought 1.4. But now I saw in the end2end test they still use it https://github.com/hyperledger/fabric-sdk-java/blob/3c1a119595c57f429dfa2f5daa615c471b8e983a/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L904 . Sorry I can not be more helpful, a colleague told me that with the eventhub but i have no document for it
JorgeNavarro (Mon, 27 May 2019 11:10:20 GMT):
@rickr help me pls
akoenig (Mon, 27 May 2019 12:02:47 GMT):
https://github.com/hyperledger/fabric-sdk-java/blob/master/docs/release_v1.1.0_notes.md#fab-6066-jsdk-channel-service-for-events
akoenig (Mon, 27 May 2019 12:02:58 GMT):
here is the link and the information about the eventhubs
akoenig (Mon, 27 May 2019 12:04:18 GMT):
and here is the "link" to the conversation with rickr :) https://chat.hyperledger.org/channel/fabric-sdk-java?msg=cRKBTR4jn7E6KD2Jk
balamcyril (Mon, 27 May 2019 13:10:13 GMT):
hello, which function is verify the userContext in fabric MSP before agree the user to make queries in the network?
balamcyril (Mon, 27 May 2019 13:23:16 GMT):
In fabric-sdk-java implementation of idemix credentia, i don't see when the user is generate a fresh credential before sending the transaction to the peer or orderer. we just see when the user credential is set in user trasaction without any other generation step
Jelle.Diet (Mon, 27 May 2019 13:27:19 GMT):
The user gets his keys and certificate when enrolling, which are then used by the HFClient to send the transaction
balamcyril (Mon, 27 May 2019 13:36:38 GMT):
yes i see this step and i understand that part. but idemix credential is provide anonymity and unlinkability for user during this authentication with the MSP. i get this answer from @mastersingh24 " this credential is actually not used to submit transactions. What actually happens is that the client generates a fresh credential from the enrollment credential and uses that to submit transactions", the i want to know when and where this step is done
Randyshu2018 (Tue, 28 May 2019 01:40:02 GMT):
considering security,I don't want to expose org admin account to peer,so how can i finishing join/install/...for peer node?
AndresMartinezMelgar.itcl (Tue, 28 May 2019 07:48:22 GMT):
Clipboard - May 28, 2019 9:48 AM
AndresMartinezMelgar.itcl (Tue, 28 May 2019 07:49:54 GMT):
Inside peers and orderer logs there arent any error, but when i put "peer chaincode list --instantiated -C channel" i keep receive "chaincode is in version 1.0"
AndresMartinezMelgar.itcl (Tue, 28 May 2019 07:51:26 GMT):
my steps are:
1º install and instantiated chaincode in version 1.0
2º install version 2.0
3º send a upgradeProposalRequest with sdk
AndresMartinezMelgar.itcl (Tue, 28 May 2019 07:52:19 GMT):
Any idea which i am doing wrong?
Jelle.Diet (Tue, 28 May 2019 08:08:48 GMT):
are you sending the transaction afterwards?
AndresMartinezMelgar.itcl (Tue, 28 May 2019 08:09:29 GMT):
yes
AndresMartinezMelgar.itcl (Tue, 28 May 2019 08:09:55 GMT):
channel.sendTransaccion()
Jelle.Diet (Tue, 28 May 2019 08:09:57 GMT):
with your succesful proposal responses?
AndresMartinezMelgar.itcl (Tue, 28 May 2019 08:10:08 GMT):
yes
Jelle.Diet (Tue, 28 May 2019 08:12:01 GMT):
Can't help then sorry, remember that upgrading can take a bit though
AndresMartinezMelgar.itcl (Tue, 28 May 2019 08:12:32 GMT):
ok, i wait a bit more
AndresMartinezMelgar.itcl (Tue, 28 May 2019 08:13:41 GMT):
ok. this take a lot of time but it works
AndresMartinezMelgar.itcl (Tue, 28 May 2019 08:14:00 GMT):
thx anyway
Jelle.Diet (Tue, 28 May 2019 08:14:18 GMT):
glad it worked at least
JorgeNavarro (Tue, 28 May 2019 08:38:34 GMT):
okay i will read it thank you
Randyshu2018 (Tue, 28 May 2019 09:03:54 GMT):
Is this a bug when requesting getHFCACertificates method with caName?
```
addCAToURL method have been invoked twice.
```
Randyshu2018 (Tue, 28 May 2019 09:03:54 GMT):
Is this a bug when requesting getHFCACertificates method with caName?
```
//addCAToURL method have been invoked twice.
String getURL(String endpoint, Map
Randyshu2018 (Tue, 28 May 2019 09:03:54 GMT):
Is this a bug when requesting getHFCACertificates method with caName?
```
//addCAToURL method has been invoked twice.
String getURL(String endpoint, Map
AndresMartinezMelgar.itcl (Tue, 28 May 2019 09:34:33 GMT):
if i have a net with 4 peer, then one of them crash down ... how can i get him in to network again?
if this peer stand up again ( it have same name, ip, ports...) why dont login in net?
I get to join again this peer to channel, but chaincodes are not present when i put peer chaincode list --installed . Must i update my channel?
I am using java sdk 1.3
nitishbhardwaj19 (Wed, 29 May 2019 06:14:40 GMT):
It is advisable to use volume mounts such that a peer can resume from the state it went off.
AndresMartinezMelgar.itcl (Wed, 29 May 2019 06:16:59 GMT):
sure, but i dont know if is posible make a volume mounts from /
nmutter (Wed, 29 May 2019 10:26:19 GMT):
push - can someone give me a hint to where to look? I have no problem setting up a network with just one client (which knows all peers and peeradmin accounts), but in reality the parties dont give me their peeradmin account. So the setup has to work distributed and I do not know how
AndresMartinezMelgar.itcl (Wed, 29 May 2019 11:08:29 GMT):
Hi i am trying to upgrade version from 1.0 to 2.0 of my chaincode, but i am receiving this proposal--> 3 are OK and 1 failed( allways fail this one)
AndresMartinezMelgar.itcl (Wed, 29 May 2019 11:08:33 GMT):
Clipboard - 29 de mayo de 2019 13:08
RodrigoMedeiros (Wed, 29 May 2019 17:17:05 GMT):
Has joined the channel.
sejalpawar (Thu, 30 May 2019 10:16:40 GMT):
I have a 3 Org network. Org1 and Org3 form a PDC. When I invoke a transaction, I get the error:
sejalpawar (Thu, 30 May 2019 10:17:07 GMT):
INFO: Invoke Status - FAILURE from peer peer0.org2.example.com
May 30, 2019 10:10:52 AM org.app.End2EndIdemix sendTransaction
INFO: Received Message: GET_STATE failed: transaction ID: 2f96831e04fc937b24955a9fd80832801663b99da259a9928cd846de2c1e6fed: private data matching public hash version is not available. Public hash version = &version.Height{BlockNum:0x3, TxNum:0x0}, Private data version = (*version.Height)(nil)
sejalpawar (Thu, 30 May 2019 10:17:07 GMT):
INFO: Invoke Status - FAILURE from peer peer0.org2.example.com
INFO: Received Message: GET_STATE failed: transaction ID: 2f96831e04fc937b24955a9fd80832801663b99da259a9928cd846de2c1e6fed: private data matching public hash version is not available. Public hash version = &version.Height{BlockNum:0x3, TxNum:0x0}, Private data version = (*version.Height)(nil)
sejalpawar (Thu, 30 May 2019 10:18:05 GMT):
How can I stop Org2 from getting the transaction request? Org2 is not an endorsing peer as per my endorsement policy in yaml file.
sejalpawar (Thu, 30 May 2019 10:18:52 GMT):
But channel.sendTransaction() issues transaction to all peers on channel irrespective of endorsement policy
bestbeforetoday (Thu, 30 May 2019 14:41:26 GMT):
@sejalpawar You can specify a collection of peers to which the proposal should be sent as a second argument to `Channel.sendTransactionProposal()`. Or if you have discovery enabled then perhaps `Channel.sendTransactionProposalToEndorsers()` might work better
sejalpawar (Thu, 30 May 2019 15:03:35 GMT):
@bestbeforetoday I was able to send the request to selected peers but now the block is not being persisted in the chain i.e. the changes made in the transaction are not being reflected
sejalpawar (Thu, 30 May 2019 15:05:54 GMT):
Endorsement Policy: identities:
user1: {"role": {"name": "peer", "mspId": "Org1MSP"}} # role member in org with mspid Org1MSP
user2: {"role": {"name": "peer", "mspId": "Org2MSP"}}
user3: {"role": {"name": "peer", "mspId": "Org3MSP"}}
policy: # the policy each MUST sign
1-of: # signed by one of these groups can be
Antimttr (Thu, 30 May 2019 15:07:51 GMT):
yeah if you want it on the chaincode you need to send it to orderers
Antimttr (Thu, 30 May 2019 15:08:00 GMT):
just like you did if you setup a channel configuration change
Antimttr (Thu, 30 May 2019 15:08:05 GMT):
send it to peers first, then orderers
sejalpawar (Thu, 30 May 2019 15:08:55 GMT):
Collection
sejalpawar (Thu, 30 May 2019 15:08:57 GMT):
CompletableFuture
sejalpawar (Thu, 30 May 2019 15:09:32 GMT):
I have
Antimttr (Thu, 30 May 2019 15:12:28 GMT):
are you checking the responses to ensure its actually working?
sejalpawar (Thu, 30 May 2019 15:13:09 GMT):
yeah they return success
Antimttr (Thu, 30 May 2019 15:13:14 GMT):
you hsould be able to count the endorsements on the invocation
sejalpawar (Thu, 30 May 2019 15:23:06 GMT):
hey solved! Had to add cf.join() instead of Thread.sleep() post sendTransaction()
sejalpawar (Thu, 30 May 2019 15:23:10 GMT):
Thank you
sejalpawar (Thu, 30 May 2019 15:23:45 GMT):
I am confused though.. why does the function getEndorsingPeers() send request to add peers on the channel?
sejalpawar (Thu, 30 May 2019 15:23:45 GMT):
Endorsement Policy: identities:
user1: {"role": {"name": "peer", "mspId": "Org1MSP"}} # role member in org with mspid Org1MSP
user2: {"role": {"name": "peer", "mspId": "Org2MSP"}}
user3: {"role": {"name": "peer", "mspId": "Org3MSP"}}
policy: # the policy each MUST sign
1-of: # signed by one of these groups can be
sejalpawar (Thu, 30 May 2019 15:23:45 GMT):
Oh, I left it for default values. I am guessing the default is true..
sejalpawar (Thu, 30 May 2019 15:23:52 GMT):
all* peers
Antimttr (Thu, 30 May 2019 15:24:11 GMT):
are all your peers set as endorsers?
Antimttr (Thu, 30 May 2019 15:24:13 GMT):
in the network-config
sejalpawar (Thu, 30 May 2019 15:24:50 GMT):
No.. Endorsement Policy: identities:
user1: {"role": {"name": "peer", "mspId": "Org1MSP"}} # role member in org with mspid Org1MSP
user2: {"role": {"name": "peer", "mspId": "Org2MSP"}}
user3: {"role": {"name": "peer", "mspId": "Org3MSP"}}
policy: # the policy each MUST sign
1-of: # signed by one of these groups can be
sejalpawar (Thu, 30 May 2019 15:25:24 GMT):
this is the endorsementPolicy.yaml
Antimttr (Thu, 30 May 2019 15:25:44 GMT):
right, but what about in your network config under channel
Antimttr (Thu, 30 May 2019 15:25:50 GMT):
thats where the roles for the peers are defined
Antimttr (Thu, 30 May 2019 15:26:08 GMT):
```
peer1.org1.example.com:
endorsingPeer: false
chaincodeQuery: true
ledgerQuery: true
eventSource: false
```
Antimttr (Thu, 30 May 2019 15:26:11 GMT):
like that
sejalpawar (Thu, 30 May 2019 15:27:30 GMT):
Oh, I left it for default values
sejalpawar (Thu, 30 May 2019 15:27:37 GMT):
I am guessing the default is true
Antimttr (Thu, 30 May 2019 15:27:56 GMT):
if thats the case then all your peers on the hcannel would be defined as endorsers
Antimttr (Thu, 30 May 2019 15:28:06 GMT):
and thats why they're all getting sent the transaction
sejalpawar (Thu, 30 May 2019 15:28:37 GMT):
got it
Antimttr (Thu, 30 May 2019 15:29:02 GMT):
im still a bit confused as to what actually references the network-config.yaml
Antimttr (Thu, 30 May 2019 15:29:22 GMT):
doesnt seem like the nodes actually reference the artifacts directory, other than for cypto assets
Antimttr (Thu, 30 May 2019 15:29:30 GMT):
but maybe i just missed it
sejalpawar (Thu, 30 May 2019 15:30:12 GMT):
Can you point me to where I can find the endorsingPeer setting? as in a sample config file
Antimttr (Thu, 30 May 2019 15:30:25 GMT):
network-config.yaml
Antimttr (Thu, 30 May 2019 15:30:28 GMT):
is where i got that from
Antimttr (Thu, 30 May 2019 15:30:38 GMT):
that one is from the balance-transfer sample
Antimttr (Thu, 30 May 2019 15:31:02 GMT):
im looking for the same file in the first-network sample and i cant locate it
sejalpawar (Thu, 30 May 2019 15:31:44 GMT):
I will try adding the line in docker-compose definition peers?
sejalpawar (Thu, 30 May 2019 15:31:44 GMT):
I will try adding the line in docker-compose definition of peers?
Antimttr (Thu, 30 May 2019 15:31:59 GMT):
```
The network connection profile provides client applications the information about the target
# blockchain network that are necessary for the applications to interact with it. These are all
# knowledge that must be acquired from out-of-band sources. This file provides such a source.
```
Antimttr (Thu, 30 May 2019 15:32:09 GMT):
so thats from the top of one of the network-config's
Antimttr (Thu, 30 May 2019 15:32:22 GMT):
i guess afaict network-config isnt actually used by the nodes at all
Antimttr (Thu, 30 May 2019 15:32:27 GMT):
and is just for your client to reference
Antimttr (Thu, 30 May 2019 15:33:29 GMT):
im guesssing, not sure about this but im guessing that you're supposed to refer to them when you join a peer to a channel and give it this command:
Antimttr (Thu, 30 May 2019 15:33:33 GMT):
```
channel.joinPeer(peer, Channel.PeerOptions.createPeerOptions()
.setPeerRoles(EnumSet.of(Peer.PeerRole.ENDORSING_PEER, Peer.PeerRole.LEDGER_QUERY,
Peer.PeerRole.CHAINCODE_QUERY, Peer.PeerRole.EVENT_SOURCE)));
```
Antimttr (Thu, 30 May 2019 15:34:00 GMT):
so then you would read that network-config.yaml and figure out which of those values to set for setPeerRoles()
Antimttr (Thu, 30 May 2019 15:34:20 GMT):
i think ill need to fix that in my implementation
sejalpawar (Thu, 30 May 2019 15:35:49 GMT):
I just commented out the endorsement file line while instantiating the chaincode.. and its absense doesnt seem to make any difference
Antimttr (Thu, 30 May 2019 15:36:49 GMT):
right because i think nothing actually refers to that file
Antimttr (Thu, 30 May 2019 15:36:57 GMT):
your app is supposed to when it gives that command above
Antimttr (Thu, 30 May 2019 15:37:05 GMT):
and THAT is when the actual roles for the peers are established
Antimttr (Thu, 30 May 2019 15:37:43 GMT):
are you joining your peers via the sdk or did you one run of those sample scripts to do it?
sejalpawar (Thu, 30 May 2019 15:37:50 GMT):
sdk
Antimttr (Thu, 30 May 2019 15:38:01 GMT):
so what does your joinPeer() call look like?
sejalpawar (Thu, 30 May 2019 15:38:47 GMT):
peer[i][j] = client.newPeer(peerName, "grpcs://localhost:"+String.valueOf(portNo), peerProperties);
mychannel.joinPeer(peer[i][j]);
Antimttr (Thu, 30 May 2019 15:39:34 GMT):
so you arent setting peer options...
Antimttr (Thu, 30 May 2019 15:39:40 GMT):
or is that what you're calling peerProperties
sejalpawar (Thu, 30 May 2019 15:40:04 GMT):
No, my peer properties is just for TLS
sejalpawar (Thu, 30 May 2019 15:40:16 GMT):
I am not explicitly setting peer roles
Antimttr (Thu, 30 May 2019 15:40:20 GMT):
right, so maybe its using some defaults then
Antimttr (Thu, 30 May 2019 15:40:28 GMT):
internal defaults to the sdk
Antimttr (Thu, 30 May 2019 15:40:59 GMT):
i went off of the end2end example
Antimttr (Thu, 30 May 2019 15:41:05 GMT):
and they explicitly set peeroptions
sejalpawar (Thu, 30 May 2019 15:42:28 GMT):
Oh okay got it
sejalpawar (Thu, 30 May 2019 15:44:08 GMT):
also, maybe we can create a jira for private data example where in an org is not part of the PDC?
Antimttr (Thu, 30 May 2019 15:47:17 GMT):
yeah i havent messed around with private data much
Antimttr (Thu, 30 May 2019 15:47:30 GMT):
not sure that ill be using it in my application
mahoney1 (Thu, 30 May 2019 15:52:13 GMT):
reminder that the Fabric Developer Community call today is at 4pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
sejalpawar (Thu, 30 May 2019 15:59:22 GMT):
@Antimttr if I send proposal requests to all peers, collect responses and send only successful responses to orderer would that work?
Antimttr (Thu, 30 May 2019 15:59:57 GMT):
yeah, i dont think sending uncessful requests to the orderers works
Antimttr (Thu, 30 May 2019 15:59:57 GMT):
yeah, i dont think sending unsuccessful requests to the orderers works
sejalpawar (Thu, 30 May 2019 16:00:27 GMT):
okay
Antimttr (Thu, 30 May 2019 16:00:39 GMT):
yeah i put all the successes into their own data structure
Antimttr (Thu, 30 May 2019 16:00:44 GMT):
and only pass those to the orderers
Antimttr (Thu, 30 May 2019 16:01:24 GMT):
though, if i get any failures that also is a breaking condition for my function
sejalpawar (Thu, 30 May 2019 16:02:30 GMT):
Hmmm... we could check for something like 2 out of 3 responses and pass it to orderer
Antimttr (Thu, 30 May 2019 16:03:04 GMT):
im not using dynamic network though
Antimttr (Thu, 30 May 2019 16:03:09 GMT):
my network will always be well defined
SatheeshNehru (Fri, 31 May 2019 12:09:06 GMT):
is there any equvalent java class for clientidentity that is defined in node
https://medium.com/@avinashvazratkar446022/attribute-based-access-control-in-hyperledger-fabric-9ed7d7bf9905
hanubc7743 (Sat, 01 Jun 2019 11:56:48 GMT):
Has joined the channel.
nitishbhardwaj19 (Sun, 02 Jun 2019 18:13:50 GMT):
@Antimttr @Jelle.Diet @rickr Has any one faced this? ```
`2019-06-02 23:19:24.466 ERROR 25442 --- [nio-8213-exec-1] o.hyperledger.fabric.sdk.OrdererClient : OrdererClient{id: 14, channel: mychannel, name: orderer.example.com, url: grpcs://localhost:7050} grpc status Code:io exception, Description UNAVAILABLE,
javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem````
I am using balance-transfer sample network as a HLF network. It's running on localhost`
nitishbhardwaj19 (Sun, 02 Jun 2019 18:13:50 GMT):
@Antimttr @Jelle.Diet @rickr Has any one faced this? ```
`2019-06-02 23:19:24.466 ERROR 25442 --- [nio-8213-exec-1] o.hyperledger.fabric.sdk.OrdererClient : OrdererClient{id: 14, channel: mychannel, name: orderer.example.com, url: grpcs://localhost:7050} grpc status Code:io exception, Description UNAVAILABLE,
javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem````
I am using balance-transfer sample network as a HLF network. It's running on localhost. By default, SSL is enabled`
nitishbhardwaj19 (Sun, 02 Jun 2019 18:13:50 GMT):
@Antimttr @Jelle.Diet @rickr Has any one faced this? ```
`2019-06-02 23:19:24.466 ERROR 25442 --- [nio-8213-exec-1] o.hyperledger.fabric.sdk.OrdererClient : OrdererClient{id: 14, channel: mychannel, name: orderer.example.com, url: grpcs://localhost:7050} grpc status Code:io exception, Description UNAVAILABLE,
javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem````
I am using balance-transfer sample network as a HLF network. It's running on localhost. SSL is enabled by default`
nitishbhardwaj19 (Sun, 02 Jun 2019 18:13:50 GMT):
@Antimttr @Jelle.Diet @rickr Has any one faced this? ```
`2019-06-02 23:19:24.466 ERROR 25442 --- [nio-8213-exec-1] o.hyperledger.fabric.sdk.OrdererClient : OrdererClient{id: 14, channel: mychannel, name: orderer.example.com, url: grpcs://localhost:7050} grpc status Code:io exception, Description UNAVAILABLE,
javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching localhost found.`
I am using balance-transfer sample network as a HLF network. It's running on localhost. SSL is enabled by default`
nitishbhardwaj19 (Mon, 03 Jun 2019 03:48:40 GMT):
Guys, any thoughts on this error? I am stuck with this. Not sure if I am missing any configuration
rickr (Mon, 03 Jun 2019 12:41:44 GMT):
@nitishbhardwaj19 You're connecting with *localhost* I'm _guessing_ that's not what servers certificate is using. Look at hostnameOverride property
rickr (Mon, 03 Jun 2019 12:46:12 GMT):
@SatheeshNehru Not 100% what that class is. But the JSDK has a User interface that has what the SDK needs to sign with.
nmutter (Mon, 03 Jun 2019 16:03:38 GMT):
@rickr can you maybe help me with this? sorry to ping you ... I guess that there are instructions or best practices somewhere (which I don't find).
rickr (Mon, 03 Jun 2019 18:40:54 GMT):
Peers/ Organizations in the *real world* ( think Ford/GM/Toyota ) would not be sharing very little. They'd have their own clients running with their own credentials with own CAs etc
rickr (Mon, 03 Jun 2019 18:40:54 GMT):
Peers/ Organizations in the *real world* ( think Ford/GM/Toyota ) would be sharing very little. They'd have their own clients running with their own credentials with own CAs etc
anand.fast (Tue, 04 Jun 2019 01:21:54 GMT):
Has joined the channel.
nmutter (Tue, 04 Jun 2019 08:21:34 GMT):
I understand. What I don't have is an example or instructions, on how these "own clients" should be implemented to create and join a channel. My first challenge was, to test if my peer is already in a channel, if not I want to join it. But the channel may not exist, so if it does not exist I will create it. I really am doing try and error and not really know where I could find the informations/examples for how to do this best.
Jelle.Diet (Tue, 04 Jun 2019 08:39:44 GMT):
How can I set the hfcaclient timeout for enrollment to a higher value? is there a property in config.properties / Config.java?
rickr (Tue, 04 Jun 2019 12:16:40 GMT):
https://github.com/hyperledger/fabric-sdk-java/blob/519cc0a44c90eb84276a8104b805f9053ca073c9/src/main/java/org/hyperledger/fabric_ca/sdk/helper/Config.java#L276-L295
tballast (Tue, 04 Jun 2019 12:29:50 GMT):
@nmutter You've used the examples that ship with the Java SDK right?
If you take a look at them, you'll see that the network that comes with it is a 2 org network. In the End2EndIT.java test the client basically loops through all of the organizations, however I believe that in the real world this wouldn't be possible. (Ie. https://github.com/hyperledger/fabric-sdk-java/blob/519cc0a44c90eb84276a8104b805f9053ca073c9/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L162)
When it runs the fabric test it actually only uses a single organization though ( https://github.com/hyperledger/fabric-sdk-java/blob/519cc0a44c90eb84276a8104b805f9053ca073c9/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L205 )
So, what I _think_ you can do, is basically have two different client applications where one of them uses the credentials for Org1 and the other for Org2 and then do all the transacting you want with the network. Does that make sense?
In a real world application (like Ford/GM), they wouldn't be sharing user credentials with one another. So each client would only have access to the credentials that belong to the respective organizations.
rickr (Tue, 04 Jun 2019 12:39:05 GMT):
@tballast @nmutter Just to add the new Lifecycle example better shows two different orgs cooperating but this is not at all realistic within a single instance of an application. https://github.com/hyperledger/fabric-sdk-java/blob/519cc0a44c90eb84276a8104b805f9053ca073c9/src/test/java/org/hyperledger/fabric/sdkintegration/End2endLifecycleIT.java
nmutter (Tue, 04 Jun 2019 13:06:50 GMT):
thanks @tballast I used the End2EndIT.java for most of my work till now. The End2endLifecycleIT does look more pormising as it basically uses two clients for two orgs, thanks @rickr . I searched such an example for 1.4, but could not find it (and still cant :) ).
rickr (Tue, 04 Jun 2019 13:11:29 GMT):
maybe out of date https://github.com/cr22rc/fabricSDKJavaMultiDomainSample
nmutter (Tue, 04 Jun 2019 14:08:25 GMT):
thanks, will have a look
nitishbhardwaj19 (Thu, 06 Jun 2019 20:08:39 GMT):
You are right @rickr I checked the cert file. Certificates were generated with the name as orderer.example.com
nitishbhardwaj19 (Thu, 06 Jun 2019 20:13:21 GMT):
@rickr I agree, but won't these clients still shares some details about the Org? Like Peers details of different Org which needs to be joined to a channel.
nitishbhardwaj19 (Thu, 06 Jun 2019 20:25:08 GMT):
@Antimttr @rickr If we create peer on the fly(without defining config in network-config.yaml), and join those peers to the channel. Will Channel object be able to figure out who all are endorsing peers at the time of TransactionProposals being sent by its own? Or will it send the proposal to all the peers who has joined the channel?
balamcyril (Fri, 07 Jun 2019 14:03:50 GMT):
hello, i want to understand want the function IdemixCredRequest(BIG sk, BIG issuerNonce, IdemixIssuerPublicKey ipk) is make. He create a zkp of what?
nitishbhardwaj19 (Mon, 10 Jun 2019 01:19:29 GMT):
@rickr @Antimttr @Jelle.Diet Thanks for all your help guys. I have integrated SDK with a HLF network. It's working as expected. I just have one doubt, how do I on-board a new Org? I know that we are suppose to have 1 HFClient per org, but what if I want to host a new instance of SDK for the org who is on-boarding the network. If I do so, how would I add peers of the org which is already a participant to the new orgs HFClient? It would be really great if someone can share their experience with adding a new Org, really appreciate guys
darapich92 (Mon, 10 Jun 2019 03:36:17 GMT):
Screenshot from 2019-06-10 12-35-46.png
nitishbhardwaj19 (Mon, 10 Jun 2019 11:26:38 GMT):
Guys, what must be input for chaincodePath of `InstallProposalRequest` ? I need to install GO_LANG chaincode via inputstream of the chaincode file which I am taking as an input in my API. I checked the code, by default SDK expects a value for chaincodePath else it throws an exception. Therefore, I am just passing a dummy value. But the installProposal fails with an```
Error: gzip: invalid header
```
nitishbhardwaj19 (Mon, 10 Jun 2019 11:26:38 GMT):
Guys, what should be expected input for chaincodePath of `InstallProposalRequest` ? I need to install GO_LANG chaincode via inputstream of the chaincode file which I am taking as an input in my API. I checked the code, by default SDK expects a value for chaincodePath else it throws an exception. Therefore, I am just passing a dummy value. But the installProposal fails with an```
Error: gzip: invalid header
```
nitishbhardwaj19 (Mon, 10 Jun 2019 11:27:40 GMT):
NOTE: I am running SDK and HLF on windows
rickr (Mon, 10 Jun 2019 11:49:10 GMT):
@nitishbhardwaj19 chaincodePath would be like your GO path in that input stream as if it were on a filesystem no difference.
rickr (Mon, 10 Jun 2019 11:50:19 GMT):
@nitishbhardwaj19 add vs join is mentioned in the README.md
nitishbhardwaj19 (Mon, 10 Jun 2019 11:52:09 GMT):
Do I need to have GO installed on my system for it?
nitishbhardwaj19 (Mon, 10 Jun 2019 11:54:10 GMT):
Thanks for replying, I understand the difference between add and join. I just wanted to know what if we are running two instances of SDK, one per org. In that case, how would we enforce that HFClient is in sync with channel information about the peers.
Javi (Mon, 10 Jun 2019 14:26:57 GMT):
Has joined the channel.
Javi (Mon, 10 Jun 2019 14:27:18 GMT):
Hi people! :grinning: I created a chaincode that saves a struct of 6 integers, and I developed a middleware in java using the fabric sdk to write data to the ledger using spring, each request takes ~2 sec to complete, is this normal? how I can reduce this time? I'm using tls on all conections, but 2 seconds is much time for a simple write of 6 values... any idea?
rickr (Mon, 10 Jun 2019 14:50:33 GMT):
Don't follow your question. Know what peers to connect to is out of bound information. You can use service discovery to help with that but even there you'll need to know at least one peer that will be doing the service discovery
Javi (Mon, 10 Jun 2019 15:00:16 GMT):
I measured time to complete in proposal and transaction, these are the results
```
Transaction proposal takes 69 ms to finish
Send transaction takes 2250 ms to complete
```
Javi (Mon, 10 Jun 2019 15:00:36 GMT):
I'm testing with a test org with only 1 peer, in my local machine....
nitishbhardwaj19 (Mon, 10 Jun 2019 15:08:38 GMT):
Right, I am sorry for not being clear. Let me re-phrase the question. I have 1 SDK instance which has singleton HFClient. I add Peers, Orderer to HFClient and create a channel and jointhese peers to the Channel. Now, the problem is, that if I am running another instance of SDK for another ORG, how will this org can refresh it's HFClient details like peers of a channel if Org1 adds another peer to the same channel. The channel at network level will definitely have the information about joined peers, but since there are 2 copies of HFClient which has a channel representation needs to be in sync as well.
rickr (Mon, 10 Jun 2019 17:38:54 GMT):
If you don't use service discovery there's no *magic*. Another organization will need _out of bounds_ inform you it running (or not) a new peer in another location. The only reason you would care is to get an endorsment from that peer's organization. Generally just having one is sufficient. Having more than one peer form another organization would give you redundancy and/or possible load sharing.
nitishbhardwaj19 (Mon, 10 Jun 2019 19:28:45 GMT):
Sure, Thanks @rickr.
yerganat (Tue, 11 Jun 2019 08:38:27 GMT):
hello @rickr
Now i interested on the fabric
The tasks from jira is can be done for every body and do not paid?)
Jelle.Diet (Tue, 11 Jun 2019 09:32:08 GMT):
What would be the best way to set channel batch timeout? Should i follow the UpdateChannelIT example, or can this be set in the connection profile for example?
rickr (Tue, 11 Jun 2019 12:25:11 GMT):
@yerganat Opensource anyone can contribute.
rickr (Tue, 11 Jun 2019 12:26:09 GMT):
@Jelle.Diet Nothing in the connection profile will address batch timeout.
smithbk (Tue, 11 Jun 2019 18:58:48 GMT):
Has left the channel.
nitishbhardwaj19 (Wed, 12 Jun 2019 08:55:07 GMT):
Has anyone tried running the sdk on windows? I am getting a weird error while I try to instantiate the chaincode. ```
``error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 \"can't load package: package C:/Go: cannot find package \"C:/Go\" in any of:\n\t/opt/go/src/C:/Go (from $GOROOT)\n\t/chaincode/input/src/C:/Go (from $GOPATH)\n\t/opt/gopath/src/C:/Go\n\`
```
nitishbhardwaj19 (Wed, 12 Jun 2019 08:55:41 GMT):
This has to be related to GO, I GOPATH is C:\GO\bin
bestbeforetoday (Wed, 12 Jun 2019 09:48:32 GMT):
I think by default send transaction will, in addition to sending the transaction to the orderer, also wait to receive commit events from all the eventing peers in the network, which can take a while. You can configure different wait options (including not waiting for commits to happen on peers) depending on your performance and consistency requirements.
nitishbhardwaj19 (Wed, 12 Jun 2019 10:26:26 GMT):
I think there is some issue with windows, I don't get any response back for install proposals for JAVA chaincode.
nitishbhardwaj19 (Wed, 12 Jun 2019 10:27:24 GMT):
I recheck, chaincode is successfully installed on peers, but yet, I am don't get any response for channel.sendInstantiationProposal(instantiateProposalRequest, channel.getPeers());
nitishbhardwaj19 (Wed, 12 Jun 2019 10:27:24 GMT):
I re-checked, chaincode is successfully installed on peers, but yet, I am don't get any response for channel.sendInstantiationProposal(instantiateProposalRequest, channel.getPeers());
nitishbhardwaj19 (Wed, 12 Jun 2019 10:28:39 GMT):
and it gets timeout in 300 seconds, which is way too long just to instantiate chaincode on a local HLF network,
nitishbhardwaj19 (Wed, 12 Jun 2019 10:28:39 GMT):
and it gets timeout in 300 seconds, which is way too long for just instantiating chaincode on a local HLF network,
nitishbhardwaj19 (Wed, 12 Jun 2019 10:29:27 GMT):
I am not sure if I am missing something. I just followed End2endIT and End2endJavaIT
rickr (Wed, 12 Jun 2019 11:49:35 GMT):
I have in the past heard starting chaincode on windows takes time. I would still try and double that.
nitishbhardwaj19 (Wed, 12 Jun 2019 12:18:12 GMT):
@rickr Thanks a lot, really appreciate your prompt response. It would be of great help!!
nitishbhardwaj19 (Wed, 12 Jun 2019 12:39:19 GMT):
I verified it again, this time it just took 15 seconds to instantiate the chaincode :) Everything worked as expected. Not sure why it wasn't working the whole day. I will get back to you in case I find something else
nitishbhardwaj19 (Wed, 12 Jun 2019 12:58:51 GMT):
May be it could be a network issue. I was connected with a dongle and now I am on a wifi. That's the only change that I see. But bottom line is, it's working as expected. :) Thanks @rickr
nitishbhardwaj19 (Wed, 12 Jun 2019 13:32:19 GMT):
@rickr I am still not sure what should be chaincodePath for installing GO chaincode. Should it be GOPATH?
rickr (Wed, 12 Jun 2019 13:44:51 GMT):
yes relative to where you package .. look at running end2endIT in a debugger you'll see how it's set there.
aatkddny (Thu, 13 Jun 2019 00:15:46 GMT):
@rickr - Are there any significant changes to the network configuration json for 1.4.1 vs 1.4 when moving to raft. If I self-generate the same network configuration as I have for a kafka setup will a channel.loadFromNetworkConfig still work or are there gotchas you can think of off the top of your head? I'm going to have to suck it and see, but figured I'd try to save some time.
TIA.
rickr (Thu, 13 Jun 2019 13:32:24 GMT):
@aatkddny I have not tested with Raft. The SDKs _should_ not care what's implementing the Orderer. IMO if it does, it would be a bug on the Fabric side.
hanubc7743 (Thu, 13 Jun 2019 15:32:12 GMT):
Hi, What is the stable version java sdk?
hanubc7743 (Thu, 13 Jun 2019 16:42:55 GMT):
Anyone can share the sample application development by using java sdk?
Charles99 (Thu, 13 Jun 2019 16:48:14 GMT):
Has joined the channel.
Randyshu2018 (Fri, 14 Jun 2019 01:07:26 GMT):
https://github.com/MindtreeLtd/balance-transfer-java
nitishbhardwaj19 (Fri, 14 Jun 2019 02:33:27 GMT):
Hi, I am curious to know when are we expected to use `foo.shutdown(boolean);` What is the recommendation to do so? Should we shut it down after each operation to save resources on sdk?
nitishbhardwaj19 (Fri, 14 Jun 2019 02:33:27 GMT):
Hi, I am curious to know when are we expected to use `channel.shutdown(boolean);` What is the recommendation to do so? Should we shut it down after each operation to save resources on sdk?
nitishbhardwaj19 (Fri, 14 Jun 2019 06:23:34 GMT):
nitishbhardwaj19 - Fri Jun 14 2019 11:53:20 GMT+0530 (India Standard Time).txt
nitishbhardwaj19 (Fri, 14 Jun 2019 06:25:14 GMT):
Hi, I am trying to integrate ServiceDiscovery. I am able to get ProposalResponses using service discovery but, the system just stuck when I call channel.sendTrancation(reponse). Would be great if anyone can share their experience with service discovery. ```
`2019-06-14 11:32:19.033 INFO 1576 --- [io-8213-exec-10] o.h.fabric.sdk.ServiceDiscovery : Channel mychannel doing discovery with peer: Peer{ id: 7, name: peer0.org1.example.com, channelName: mychannel, url: grpcs://peer0.org1.example.com:7051}
2019-06-14 11:32:24.945 INFO 1576 --- [io-8213-exec-10] c.b.f.s.c.TransactionController : Transaction proposal on channel mychannel SUCCESS with transaction id:ae4d94daf9f3bc359095012f11987daaacf4b84c0517b02720ea5ab81e42b10e
2019-06-14 11:32:25.659 INFO 1576 --- [io-8213-exec-10] c.b.f.s.c.TransactionController : invoke chaincode proposal was good
2019-06-14 11:32:32.275 WARN 1576 --- [pool-1-thread-3] o.h.fabric.sdk.PeerEventServiceClient : PeerEventServiceClient{id: 258, channel: mychannel, peerName: peer1.org1.example.com:7051, url: grpc://peer1.org1.example.com:7051} Channel mychannel connect time exceeded for peer eventing service peer1.org1.example.com:7051, timed out at 5000 ms.
2019-06-14 11:32:50.429 INFO 1576 --- [io-8213-exec-10] c.b.f.s.c.TransactionController : Successfully sent and received responses for all transaction proposals
2019-06-14 11:32:59.205 WARN 1576 --- [ault-executor-5] o.h.fabric.sdk.PeerEventServiceClient : Received error on PeerEventServiceClient{id: 270, channel: mychannel, peerName: peer1.org1.example.com:7051, url: grpc://peer1.org1.example.com:7051}, attempts 251. INTERNAL: http2 exception
2019-06-14 11:33:19.444 INFO 1576 --- [pool-3-thread-1] o.h.fabric.sdk.ServiceDiscovery : Channel mychannel doing discovery with peer: Peer{ id: 11, name: peer1.org1.example.com, channelName: mychannel, url: grpcs://peer1.org1.example.com:7056}
2019-06-14 11:33:24.610 WARN 1576 --- [ault-executor-1] o.h.fabric.sdk.PeerEventServiceClient : Received error on PeerEventServiceClient{id: 320, channel: mychannel, peerName: peer1.org1.example.com:7051, url: grpc://peer1.org1.example.com:7051}, attempts 301. INTERNAL: http2 exception
2019-06-14 11:33:50.057 WARN 1576 --- [ault-executor-1] o.h.fabric.sdk.PeerEventServiceClient : Received error on PeerEventServiceClient{id: 370, channel: mychannel, peerName: peer1.org1.example.com:7051, url: grpc://peer1.org1.example.com:7051}, attempts 351. INTERNAL: http2 exception`
```
nitishbhardwaj19 (Fri, 14 Jun 2019 06:28:09 GMT):
Steps to create channel:```
` channel = hfClient.newChannel(channelName, orderer, channelConfiguration, hfClient.getChannelConfigurationSignature(channelConfiguration, hfClient.getUserContext()));````
sdprops.put("org.hyperledger.fabric.sdk.discovery.default.protocol", "grpc:");```
channel.setServiceDiscoveryProperties(sdprops);```
channel.joinPeer(newPeer, createPeerOptions().setPeerRoles(EnumSet.of(Peer.PeerRole.SERVICE_DISCOVERY, Peer.PeerRole.ENDORSING_PEER, Peer.PeerRole.LEDGER_QUERY, Peer.PeerRole.CHAINCODE_QUERY, Peer.PeerRole.EVENT_SOURCE)));``````
```
```
```
```
```
```
nitishbhardwaj19 (Fri, 14 Jun 2019 06:28:09 GMT):
Steps to create channel:```
` channel = hfClient.newChannel(channelName, orderer, channelConfiguration, hfClient.getChannelConfigurationSignature(channelConfiguration, hfClient.getUserContext()));`
`sdprops.put("org.hyperledger.fabric.sdk.discovery.default.protocol", "grpc:");`
`channel.setServiceDiscoveryProperties(sdprops);`
`channel.joinPeer(newPeer, createPeerOptions().setPeerRoles(EnumSet.of(Peer.PeerRole.SERVICE_DISCOVERY, Peer.PeerRole.ENDORSING_PEER, Peer.PeerRole.LEDGER_QUERY, Peer.PeerRole.CHAINCODE_QUERY, Peer.PeerRole.EVENT_SOURCE)));````
`channel.sendTransactionProposalToEndorsers(request,
createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)
.setForceDiscovery(true));`
```
```
```
```
```
```
```
```
nitishbhardwaj19 (Fri, 14 Jun 2019 06:28:09 GMT):
Steps to create channel:
` channel = hfClient.newChannel(channelName, orderer, channelConfiguration, hfClient.getChannelConfigurationSignature(channelConfiguration, hfClient.getUserContext()));
sdprops.put("org.hyperledger.fabric.sdk.discovery.default.protocol", "grpc:");
channel.setServiceDiscoveryProperties(sdprops);
channel.joinPeer(newPeer, createPeerOptions().setPeerRoles(EnumSet.of(Peer.PeerRole.SERVICE_DISCOVERY, Peer.PeerRole.ENDORSING_PEER, Peer.PeerRole.LEDGER_QUERY, Peer.PeerRole.CHAINCODE_QUERY, Peer.PeerRole.EVENT_SOURCE)));
responses = channel.sendTransactionProposalToEndorsers(request,
createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)
.setForceDiscovery(true));
channel.sendTransaction(responses)
`
nitishbhardwaj19 (Fri, 14 Jun 2019 06:28:09 GMT):
Steps to create channel:
` `channel = hfClient.newChannel(channelName, orderer, channelConfiguration, hfClient.getChannelConfigurationSignature(channelConfiguration, hfClient.getUserContext()));
sdprops.put("org.hyperledger.fabric.sdk.discovery.default.protocol", "grpc:");
channel.setServiceDiscoveryProperties(sdprops);
channel.joinPeer(newPeer, createPeerOptions().setPeerRoles(EnumSet.of(Peer.PeerRole.SERVICE_DISCOVERY, Peer.PeerRole.ENDORSING_PEER, Peer.PeerRole.LEDGER_QUERY, Peer.PeerRole.CHAINCODE_QUERY, Peer.PeerRole.EVENT_SOURCE)));
responses = channel.sendTransactionProposalToEndorsers(request,
createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)
.setForceDiscovery(true));
channel.sendTransaction(responses)
``
nitishbhardwaj19 (Fri, 14 Jun 2019 06:28:09 GMT):
Steps to create channel:
`` channel = hfClient.newChannel(channelName, orderer, channelConfiguration, hfClient.getChannelConfigurationSignature(channelConfiguration, hfClient.getUserContext()));``
``sdprops.put("org.hyperledger.fabric.sdk.discovery.default.protocol", "grpc:");``
``channel.setServiceDiscoveryProperties(sdprops);``
``channel.joinPeer(newPeer, createPeerOptions().setPeerRoles(EnumSet.of(Peer.PeerRole.SERVICE_DISCOVERY, Peer.PeerRole.ENDORSING_PEER, Peer.PeerRole.LEDGER_QUERY, Peer.PeerRole.CHAINCODE_QUERY, Peer.PeerRole.EVENT_SOURCE)));
responses = channel.sendTransactionProposalToEndorsers(request,
createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)
.setForceDiscovery(true));``
``channel.sendTransaction(responses)``
`
nitishbhardwaj19 (Fri, 14 Jun 2019 06:28:09 GMT):
Steps to create channel:
` channel = hfClient.newChannel(channelName, orderer, channelConfiguration, hfClient.getChannelConfigurationSignature(channelConfiguration, hfClient.getUserContext()));`
`sdprops.put("org.hyperledger.fabric.sdk.discovery.default.protocol", "grpc:");`
`channel.setServiceDiscoveryProperties(sdprops);`
`channel.joinPeer(newPeer, createPeerOptions().setPeerRoles(EnumSet.of(Peer.PeerRole.SERVICE_DISCOVERY, Peer.PeerRole.ENDORSING_PEER, Peer.PeerRole.LEDGER_QUERY, Peer.PeerRole.CHAINCODE_QUERY, Peer.PeerRole.EVENT_SOURCE)));`
`responses = channel.sendTransactionProposalToEndorsers(request, createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)`
`.setForceDiscovery(true));`
`channel.sendTransaction(responses)`
nitishbhardwaj19 (Fri, 14 Jun 2019 06:36:08 GMT):
Have I missed something?
SatheeshNehru (Fri, 14 Jun 2019 07:08:38 GMT):
is there java api available for reenrolling identity?
Randyshu2018 (Fri, 14 Jun 2019 09:31:44 GMT):
HFCAClient.reenroll
bestbeforetoday (Fri, 14 Jun 2019 10:21:53 GMT):
`channel.initialize()` ?
nitishbhardwaj19 (Fri, 14 Jun 2019 10:22:57 GMT):
Channel is already initialized, that why I get endorsements.
nitishbhardwaj19 (Fri, 14 Jun 2019 10:27:28 GMT):
I missed that to mentioned that here, I am sorry
balamcyril (Fri, 14 Jun 2019 11:48:17 GMT):
Hello, why a iget an error when i want to get idemix credential from admin, the CA didn't return the OU value
bestbeforetoday (Fri, 14 Jun 2019 11:57:38 GMT):
Guessing that it's something to do with the peer or network configuration as I have invocations using discovery OK like so:
```channel.sendTransactionProposalToEndorsers(request,
createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)
.setForceDiscovery(true));```
bestbeforetoday (Fri, 14 Jun 2019 11:57:38 GMT):
Guessing that it's something to do with the peer or network configuration as I have invocations using discovery OK like so:
```channel.sendTransactionProposalToEndorsers(request, createDiscoveryOptions().setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM).setForceDiscovery(true));
```
nitishbhardwaj19 (Fri, 14 Jun 2019 12:00:09 GMT):
May be, I am using the same network like byfn
nitishbhardwaj19 (Fri, 14 Jun 2019 12:00:49 GMT):
I am not able to figure out the issue as I do get response for endorsements using discovery
nitishbhardwaj19 (Fri, 14 Jun 2019 12:01:28 GMT):
It's just that when I sent those responses to channel to commit, It takes forever to return the response
nitishbhardwaj19 (Fri, 14 Jun 2019 12:01:54 GMT):
The same setup works flawless if I don't use service discovery
balamcyril (Fri, 14 Jun 2019 12:39:36 GMT):
Idemix admin
Raumo0 (Fri, 14 Jun 2019 14:01:46 GMT):
Has joined the channel.
Raumo0 (Fri, 14 Jun 2019 14:24:41 GMT):
Hello, I have a problem with sending transactions, can someone help?
```
org.hyperledger.fabric.sdk.exception.TransactionException:
org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel channel1 failed with peer
nitishbhardwaj19 (Fri, 14 Jun 2019 14:55:43 GMT):
I guess you need to configure all the related certs to work with TLS enabled network when you add Orderer and peers to HFclient
Raumo0 (Fri, 14 Jun 2019 15:20:38 GMT):
All certificates? Not just a CA certificate? like this: properties.put("pemBytes", HYPERLEDGER_FABRIC_CA_PEM.getBytes());
Raumo0 (Fri, 14 Jun 2019 15:20:38 GMT):
@nitishbhardwaj19 All certificates? Not just a CA certificate? like this: `properties.put("pemBytes", HYPERLEDGER_FABRIC_CA_PEM.getBytes());`
Raumo0 (Fri, 14 Jun 2019 15:23:49 GMT):
This error occurs when I connect to the IBM Blockchain cloud. When I run locally everything works fine.
nitishbhardwaj19 (Fri, 14 Jun 2019 16:24:38 GMT):
Hi @bestbeforetoday I re-tried it again, it worked as expected. :)
nitishbhardwaj19 (Fri, 14 Jun 2019 16:25:07 GMT):
How are you adding orderers to channel to be discovered?
nitishbhardwaj19 (Fri, 14 Jun 2019 16:53:21 GMT):
Has anyone ever got this error?```
`Caused by: io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002
at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85) ~[netty-codec-http2-4.1.34.Final.jar:4.1.34.Final]`
```
nitishbhardwaj19 (Fri, 14 Jun 2019 16:59:58 GMT):
need to use grpcs protocol instead of grps to resolve this.
nitishbhardwaj19 (Fri, 14 Jun 2019 17:24:32 GMT):
It was an issue with Docker. I replicated the issue again. Restarting docker service resolved the issue.
nitishbhardwaj19 (Fri, 14 Jun 2019 17:25:22 GMT):
It was an issue with Docker. I replicated the issue again. Restarting docker service resolved the issue.
hanubc7743 (Fri, 14 Jun 2019 18:03:46 GMT):
Hi Anyone please suggest me which SDK is best for development?
Antimttr (Fri, 14 Jun 2019 18:39:56 GMT):
well depends on what language you're comfortable with
Antimttr (Fri, 14 Jun 2019 18:40:27 GMT):
i'd say objectively the Golang sdk is going to have the most features and always most up to date, since I beleive that is the primary sdk, with node and java close behind
davidkel (Fri, 14 Jun 2019 18:50:08 GMT):
@Antimttr @hanubc7743 the Go SDK has never been officially released, there are only alpha versions. The fabric documentation does say that the only 2 official sdks are node and java. This is mentioned in several places in the docs (although the docs are obviously out of date in that respect as they mention the rest sdk which doesn't exist anymore). Node has the new fabric-network api, but java will get that soon. Java on the other hand has support for IDEMIX and is the only sdk that has that, so if you need IDEMIX then you will have to use the Java SDK.
davidkel (Fri, 14 Jun 2019 18:50:08 GMT):
@Antimttr @hanubc7743 the Go SDK has never been officially released, there are only alpha versions. The fabric documentation does say that the only 2 official sdks are node and java. This is mentioned in several places in the docs (although the docs are obviously out of date in that respect as they mention the rest sdk which doesn't exist anymore). Node has the new fabric-network api, but java will get that soon. Java on the other hand has support for IDEMIX and is the only sdk that has that, so if you need IDEMIX then you will have to use the Java SDK. You then need to consider what language to write chaincode in, again there is a choice of node, java and go.
Antimttr (Fri, 14 Jun 2019 19:10:49 GMT):
interesting, thanks for the info
hanubc7743 (Fri, 14 Jun 2019 19:58:26 GMT):
@Antimttr @davidkel all SDK's supporting all features or is there any diffrence
Antimttr (Fri, 14 Jun 2019 19:59:26 GMT):
java for idemix, nodejs for fabric-network api. that's the main difference in feature set
hanubc7743 (Sun, 16 Jun 2019 17:41:49 GMT):
Hi I am getting below error
./bin/configtxgen -profile OrdererGenesis -outputBlock ./channel-artifacts/genesis.block
2019-06-16 23:07:20.775 IST [common.tools.configtxgen] main -> WARN 001 Omitting the channel ID for configtxgen for output operations is deprecated. Explicitly passing the channel ID will be required in the future, defaulting to 'testchainid'.
2019-06-16 23:07:20.775 IST [common.tools.configtxgen] main -> INFO 002 Loading configuration
2019-06-16 23:07:20.788 IST [common.tools.configtxgen.localconfig] Load -> PANI 003 Error unmarshaling config into struct: 1 error(s) decoding:
* '' has invalid keys: v1_1
2019-06-16 23:07:20.788 IST [common.tools.configtxgen] func1 -> PANI 004 Error unmarshaling config into struct: 1 error(s) decoding:
* '' has invalid keys: v1_1
panic: Error unmarshaling config into struct: 1 error(s) decoding:
* '' has invalid keys: v1_1 [recovered]
panic: Error unmarshaling config into struct: 1 error(s) decoding:
* '' has invalid keys: v1_1
goroutine 1 [running]:
github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc000121970, 0x0, 0x0, 0x0)
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:229 +0x515
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).log(0xc0000b2240, 0xc0002f9804, 0xc00009b1a0, 0x59, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0xf6
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).Panicf(0xc0000b2240, 0xc00009b1a0, 0x59, 0x0, 0x0, 0x0)
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159 +0x79
github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panic(0xc0000b2248, 0xc0002f9938, 0x1, 0x1)
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/common/flogging/zap.go:73 +0x75
main.main.func1()
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/common/tools/configtxgen/main.go:250 +0x1a9
panic(0xd4fc40, 0xc0003018e0)
/opt/go/go1.11.1.linux.amd64/src/runtime/panic.go:513 +0x1b9
github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc000121970, 0x0, 0x0, 0x0)
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:229 +0x515
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).log(0xc0000b2220, 0xc0002f9c04, 0xc00009b080, 0x59, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0xf6
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).Panicf(0xc0000b2220, 0xc00009b080, 0x59, 0x0, 0x0, 0x0)
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159 +0x79
github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panic(0xc0000b2228, 0xc0002f9d98, 0x2, 0x2)
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/common/flogging/zap.go:73 +0x75
github.com/hyperledger/fabric/common/tools/configtxgen/localconfig.Load(0x7ffeb116516d, 0xe, 0x0, 0x0, 0x0, 0x1)
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/common/tools/configtxgen/localconfig/config.go:282 +0x580
main.main()
/w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/common/tools/configtxgen/main.go:261 +0xb2f
Anyone know any solution please?
SatheeshNehru (Mon, 17 Jun 2019 07:05:54 GMT):
will reenrollment revoke older certs???
Randyshu2018 (Mon, 17 Jun 2019 07:28:31 GMT):
I'm confused with fabric-gataway.wallet, is it designed for fabtoken or simple certificate
davidkel (Mon, 17 Jun 2019 07:42:48 GMT):
It's for holding identities, not related to fabtoken
Randyshu2018 (Mon, 17 Jun 2019 07:47:07 GMT):
I want to use some traditional wallet features,for example: list wallet ,create wallet ,import wallet and list wallet identities and so on, any samples for that?
davidkel (Mon, 17 Jun 2019 08:01:39 GMT):
Have a look at the node client samples in github.com/hyperledger/fabric-samples. Also there is some useful info in the fabric tutorials for example https://hyperledger-fabric.readthedocs.io/en/release-1.4/tutorial/commercial_paper.html#application-structure
davidkel (Mon, 17 Jun 2019 08:01:39 GMT):
Have a look at the node client samples in github.com/hyperledger/fabric-samples. Also there is some useful info in the fabric tutorials for example https://hyperledger-fabric.readthedocs.io/en/release-1.4/tutorial/commercial_paper.html#application-structure
Should give you some idea of the pattern
Randyshu2018 (Mon, 17 Jun 2019 09:22:01 GMT):
thank you
Randyshu2018 (Mon, 17 Jun 2019 09:24:17 GMT):
any resource about fabric-gateway-java with TLS
rickr (Mon, 17 Jun 2019 12:32:04 GMT):
I think the response messages say's it you need to provide a channel id
hanubc7743 (Mon, 17 Jun 2019 12:43:04 GMT):
where i need to provide channel id?
Raumo0 (Mon, 17 Jun 2019 14:10:30 GMT):
Can someone tell me how to send transactions using my certificate and private key, and not generate a new one when enroll? I can create enroll along with enrollmentRequest, but for this I need to have a certificate + private key + public key. I did not understand how to get the public key.
Raumo0 (Mon, 17 Jun 2019 15:05:03 GMT):
Upd: It was necessary to set the properties of certificates on the peer, previously it was installed only on the CA.
Raumo0 (Mon, 17 Jun 2019 15:05:03 GMT):
Upd: It was necessary to set the properties of certificates on the peer and orderer, previously it was installed only on the CA.
rickr (Mon, 17 Jun 2019 16:44:57 GMT):
should not
swikar (Tue, 18 Jun 2019 08:59:24 GMT):
Has joined the channel.
swikar (Tue, 18 Jun 2019 08:59:26 GMT):
hi
swikar (Tue, 18 Jun 2019 09:00:18 GMT):
Hello I am new here. I want to use fabric-java-sdk into my project. Can I hope I will get help here if I needed? Thanks
lesleyannj (Tue, 18 Jun 2019 15:39:40 GMT):
Has joined the channel.
Antimttr (Tue, 18 Jun 2019 18:23:23 GMT):
@swikar keep hope alive!
hanubc7743 (Tue, 18 Jun 2019 19:51:48 GMT):
Hi Anybody know how to work with hyperledger fabric java sdk and ipfs?
Antimttr (Tue, 18 Jun 2019 19:53:37 GMT):
i've been working with the java sdk for what feels like most of my life
Antimttr (Tue, 18 Jun 2019 19:53:44 GMT):
but in actuality just a few months
kynguyen910 (Wed, 19 Jun 2019 08:18:17 GMT):
Has joined the channel.
kynguyen910 (Wed, 19 Jun 2019 09:11:51 GMT):
Hi I'm using fabric sdk 1.3.0 and I got warning like message below `[invoke_fabric_nw1] WARN org.hyperledger.fabric.sdk.helper.Config - Failed to load any configuration from: config.properties. Using toolkit defaults
[invoke_fabric_nw1] WARN org.hyperledger.fabric_ca.sdk.helper.Config - Failed to load any configuration from: config.properties. `
kynguyen910 (Wed, 19 Jun 2019 09:11:51 GMT):
Hi I'm using fabric sdk 1.3.0 and I got warning like message below
`[invoke_fabric_nw1] WARN org.hyperledger.fabric.sdk.helper.Config - Failed to load any configuration from: config.properties. Using toolkit defaults
[invoke_fabric_nw1] WARN org.hyperledger.fabric_ca.sdk.helper.Config - Failed to load any configuration from: config.properties. `
so I can't submit proposal request to the network.
Do you know how to fix that? thanks
kynguyen910 (Wed, 19 Jun 2019 09:11:51 GMT):
Hi I'm using fabric sdk 1.3.0 and I got warning like message below
```[invoke_fabric_nw1] WARN org.hyperledger.fabric.sdk.helper.Config - Failed to load any configuration from: config.properties. Using toolkit defaults
[invoke_fabric_nw1] WARN org.hyperledger.fabric_ca.sdk.helper.Config - Failed to load any configuration from: config.properties. ```
so I can't submit proposal request to the network.
Do you know how to fix that? thanks
rickr (Wed, 19 Jun 2019 11:51:30 GMT):
Warning it's benign _unless_ you actually had a configuration file that you expected to load. The default file has everything commented out to take the defaults https://github.com/hyperledger/fabric-sdk-java/blob/master/config.properties
rickr (Wed, 19 Jun 2019 11:51:30 GMT):
@kynguyen910 Warning it's benign _unless_ you actually had a configuration file that you expected to load. The default file has everything commented out to take the defaults https://github.com/hyperledger/fabric-sdk-java/blob/master/config.properties
bestbeforetoday (Wed, 19 Jun 2019 14:47:52 GMT):
There isn't anything different about how you use the _fabric-gateway-java_ API with TLS and non-TLS networks. And how you use TLS with _fabric-gateway-java_ is no different to how you use it with other client APIs. The differences are in the Fabric network configuration. So the connection profile needs to have appropriate certificate information, for example:
https://raw.githubusercontent.com/hyperledger/fabric-gateway-java/master/src/test/java/org/hyperledger/fabric/gateway/connection-tls.json
And appropriate tls options need to specific when using the `peer` command to create, join and update channels (e.g. `--tls true --cafile cert.pem`), and using the `peer` command for chaincode install and instantiate
karthick15v (Wed, 19 Jun 2019 15:15:09 GMT):
Hi , I am new to hyperledger-fabric and trying to use fabric java sdk 1.3.0 in my project for a while now. In this,For a n*ew channel creation process* we must have a p*re-generated channel.tx artifacts with binded channel name*(using configtxgen tool ).
karthick15v (Wed, 19 Jun 2019 15:15:09 GMT):
Hi , I am new to hyperledger-fabric and trying to use fabric java sdk 1.3.0 in my project for a while now. In this,For a *new channel creation process* we must have a p*re-generated channel.tx artifacts with binded channel name*(using configtxgen tool ).
karthick15v (Wed, 19 Jun 2019 15:15:09 GMT):
Hi , I am new to hyperledger-fabric and trying to use fabric java sdk 1.3.0 in my project for a while now. In this,For a *new channel creation process* we must have a *pre-generated channel.tx artifacts with binded channel name*(using configtxgen tool ).
karthick15v (Wed, 19 Jun 2019 15:16:25 GMT):
But for Dynamic web application, depending upon a per generated wouldn’t a bottle neck and Is there any other way to *generate a channel artifacts on runtime*
karthick15v (Wed, 19 Jun 2019 15:16:53 GMT):
https://stackoverflow.com/questions/56593577/dynamic-channel-artifactschannel-tx-in-hyperledger-fabric
SandySun2000 (Wed, 19 Jun 2019 17:44:22 GMT):
@rickr The customer is using java hyperledger fabric SDK(1.4) which is using the network config as JSON. In this JSON we need to mention the channel details(including smart contract name & peer info), but for V2.0, the channel information has been removed from the connection profile.
SandySun2000 (Wed, 19 Jun 2019 17:44:47 GMT):
@rickr Do you have any suggestion how to deal with the change?
hanubc7743 (Wed, 19 Jun 2019 17:46:28 GMT):
Hi Can we integrate oracle db instead of couch db in hyperledger fabric?
rickr (Wed, 19 Jun 2019 20:54:33 GMT):
@SandySun2000 I know of no changes to the connection profile. Can you point me to the JIRA which made those changes?
rickr (Wed, 19 Jun 2019 20:55:36 GMT):
@hanubc7743 I doubt it. but this is not the channel to discuss. Try #fabric-ledger
kynguyen910 (Thu, 20 Jun 2019 03:31:15 GMT):
Hi @rickr , thank for your answer, but I don't know why I got the error message when I submit proposal request like below
```
Caused by: org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel referpluschannel failed with peer peer1.bcass.com. Status FAILURE, details: Channel Channel{id: 1, name: referpluschannel} Sending proposal with transaction: 60dcbce1bb329c4e0168e9f81a7349d4c2b02ed1f053586b63b470efadfaf3c9 to Peer{ id: 2, name: peer1.bcass.com, channelName: referpluschannel, url: grpc://209.148.67.218:7051} failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [referpluschannel] creator org [Org1MSP], cause=null}
```
kynguyen910 (Thu, 20 Jun 2019 03:32:40 GMT):
look like I facing with issue *access denied*
rickr (Thu, 20 Jun 2019 16:05:26 GMT):
Most likely your usercontext was not set to a user that can perform the operation
balamcyril (Fri, 21 Jun 2019 15:38:17 GMT):
Hello, i'm try to send a transaction to the orderer but i have this error:
java.util.concurrent.ExecutionException: java.lang.AssertionError: Test failed1 with java.util.concurrent.CompletionException exception org.hyperledger.fabric.sdk.exception.TransactionEventException: Received invalid transaction event. Transaction ID abbf579a75f6e93c2dac8493413d817093b5c44ed81453cf3a13df359fe0cea2 status 11
Antimttr (Fri, 21 Jun 2019 15:41:23 GMT):
did you send it to the peers first?
Antimttr (Fri, 21 Jun 2019 15:41:57 GMT):
you should submit to peers first, then the result of their query is what you send to the orderer (as i understand it)
rickr (Fri, 21 Jun 2019 16:04:05 GMT):
https://github.com/hyperledger/fabric-sdk-java#transaction-sent-to-orderer-results-in-future-with-exception-validation-code-xxx-where-can-i-find-what-that-means
rickr (Fri, 21 Jun 2019 16:04:58 GMT):
More than likely your transaction read a variable that subsequently got updated
nitishbhardwaj19 (Sat, 22 Jun 2019 09:35:15 GMT):
I am running a sample network which is being shipped along with balance-transfer of fabric-samples. The containers are running in local docker environment and TLS is enabled. I am getting SSL error when I try to communicate with peer```
`Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching peer0.org2.example.com found.
at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:214) ~[na:1.8.0_202]
at sun.security.util.HostnameChecker.match(HostnameChecker.java:96) ~[na:1.8.0_202]
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:455) ~[na:1.8.0_202]
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:436) ~[na:1.8.0_202]
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:252) ~[na:1.8.0_202]
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:136) ~[na:1.8.0_202]
at io.netty.handler.ssl.OpenSslTlsv13X509ExtendedTrustManager.checkServerTrusted(OpenSslTlsv13X509ExtendedTrustManager.java:239) ~[netty-handler-4.1.34.Final.jar:4.1.34.Final]
at io.netty.handler.ssl.ReferenceCountedOpenSslClientContext$ExtendedTrustManagerVerifyCallback.verify(ReferenceCountedOpenSslClientContext.java:242) ~[netty-handler-4.1.34.Final.jar:4.1.34.Final]
at io.netty.handler.ssl.ReferenceCountedOpenSslContext$AbstractCertificateVerifier.verify(ReferenceCountedOpenSslContext.java:670) ~[netty-handler-4.1.34.Final.jar:4.1.34.Final]
... 27 common frames omitted
`
```
nitishbhardwaj19 (Sat, 22 Jun 2019 09:35:15 GMT):
I am running a sample network which is being shipped along with balance-transfer of fabric-samples. The containers are running in local docker environment and TLS is enabled. I am getting SSL error when I try to communicate with peer to install or instantiate chaincode```
`Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching peer0.org2.example.com found.
at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:214) ~[na:1.8.0_202]
at sun.security.util.HostnameChecker.match(HostnameChecker.java:96) ~[na:1.8.0_202]
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:455) ~[na:1.8.0_202]
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:436) ~[na:1.8.0_202]
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:252) ~[na:1.8.0_202]
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:136) ~[na:1.8.0_202]
at io.netty.handler.ssl.OpenSslTlsv13X509ExtendedTrustManager.checkServerTrusted(OpenSslTlsv13X509ExtendedTrustManager.java:239) ~[netty-handler-4.1.34.Final.jar:4.1.34.Final]
at io.netty.handler.ssl.ReferenceCountedOpenSslClientContext$ExtendedTrustManagerVerifyCallback.verify(ReferenceCountedOpenSslClientContext.java:242) ~[netty-handler-4.1.34.Final.jar:4.1.34.Final]
at io.netty.handler.ssl.ReferenceCountedOpenSslContext$AbstractCertificateVerifier.verify(ReferenceCountedOpenSslContext.java:670) ~[netty-handler-4.1.34.Final.jar:4.1.34.Final]
... 27 common frames omitted
`
```
nitishbhardwaj19 (Sat, 22 Jun 2019 09:36:56 GMT):
`if (this.helper.isTlsEnabled()) {
/**
* TODO: set certs for secure tls communication, this is a sample
*/
sdprops.put("org.hyperledger.fabric.sdk.discovery.default.clientCertFile", "artifacts\\channel\\crypto-config\\peerOrganizations\\org1.example.com\\users\\User1@org1.example.com\\tls\\server.crt");
sdprops.put("org.hyperledger.fabric.sdk.discovery.default.clientKeyFile", "artifacts\\channel\\crypto-config\\peerOrganizations\\org1.example.com\\users\\User1@org1.example.com\\tls\\server.key");
`
nitishbhardwaj19 (Sat, 22 Jun 2019 09:36:56 GMT):
```
if (this.helper.isTlsEnabled()) {
/**
* TODO: set certs for secure tls communication, this is a sample
*/
sdprops.put("org.hyperledger.fabric.sdk.discovery.default.clientCertFile", "artifacts\\channel\\crypto-config\\peerOrganizations\\org1.example.com\\users\\User1@org1.example.com\\tls\\server.crt");
sdprops.put("org.hyperledger.fabric.sdk.discovery.default.clientKeyFile", "artifacts\\channel\\crypto-config\\peerOrganizations\\org1.example.com\\users\\User1@org1.example.com\\tls\\server.key");
```
nitishbhardwaj19 (Sat, 22 Jun 2019 09:38:27 GMT):
Sample settings for peer in network config:```
peers:
peer0.org1.example.com:
# this URL is used to send endorsement and query requests
url: grpcs://peer0.org1.example.com:7051
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
tlsCACerts:
path: artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
```
nitishbhardwaj19 (Sat, 22 Jun 2019 09:40:57 GMT):
I have added host entries in my hosts file for peers and orderers. I am not sure what am I missing here to work with TLS enabled network. Would be great if someone can share their thoughts.
AndresMartinezMelgar.itcl (Sun, 23 Jun 2019 09:38:16 GMT):
Hi, how can i check if i instantiated successfully a peer/orderer?
nitishbhardwaj19 (Sun, 23 Jun 2019 16:50:19 GMT):
@rickr any thoughts?
nitishbhardwaj19 (Sun, 23 Jun 2019 16:51:35 GMT):
I keep on getting following error:```
2019-06-23 22:20:00.642 INFO 2064 --- [pool-5-thread-1] o.h.fabric.sdk.ServiceDiscovery : Channel mychannel doing discovery with peer: Peer{ id: 5, name: peer0.org1.example.com, channelName: mychannel, url: grpcs://peer0.org1.example.com:7051}
2019-06-23 22:20:12.053 WARN 2064 --- [ault-executor-5] o.h.fabric.sdk.PeerEventServiceClient : Received error on PeerEventServiceClient{id: 716, channel: mychannel, peerName: peer1.org1.example.com:7051, url: grpcs://peer1.org1.example.com:7051}, attempts 701. UNAVAILABLE: io exception
2019-06-23 22:20:38.528 WARN 2064 --- [ault-executor-3] o.h.fabric.sdk.PeerEventServiceClient : Received error on PeerEventServiceClient{id: 766, channel: mychannel, peerName: peer1.org1.example.com:7051, url: grpcs://peer1.org1.example.com:7051}, attempts 751. UNAVAILABLE: io exception
```
nitishbhardwaj19 (Sun, 23 Jun 2019 16:53:48 GMT):
And I don't get any response from channel when I send any successful proposals to commit. Though it gets the transaction committed in the ledger.
nitishbhardwaj19 (Sun, 23 Jun 2019 17:09:27 GMT):
Strange thing is that peer container is up and running, not sure why it throws an error of UNAVAILABLE
nitishbhardwaj19 (Sun, 23 Jun 2019 17:09:27 GMT):
@rickr , @Antimttr , @Jelle.Diet Strange thing is that peer container is up and running, not sure why it throws an error of UNAVAILABLE
balamcyril (Mon, 24 Jun 2019 11:40:00 GMT):
I don't understant why it refuse my transaction. I have create and instantiation proposal in 2 different thread which initialise respectively a for thread1 and b for thread 2 and send it to my 2 peer for endorsement. All the 2 value is succefully endors by the peer. But when i'm trying to send the transaction to the orderer, it success for the first thread and and error for the second with invalid transaction while all the peers succeful endorse the transaction
balamcyril (Mon, 24 Jun 2019 11:42:15 GMT):
Collection
rickr (Mon, 24 Jun 2019 12:20:55 GMT):
Maybe look at hostnameOverride property
rickr (Mon, 24 Jun 2019 12:29:58 GMT):
If you've written a variable in chaincode You'll need to wait for that to be sent to orderer then wait till the future is resolved before reading/modifying it again.
rickr (Mon, 24 Jun 2019 12:31:38 GMT):
Chaincode get's instantiated. I don't know what you mean by Peers and Orderers being instantiated.
balamcyril (Mon, 24 Jun 2019 12:35:45 GMT):
in my code i want to test how many initializatio transaction could be handle by the order, for that, i send several transaction to the orderer with different thread, to see if the orderer could handle all these transaction. Actulaly i'm just using 2 thread an it's not working
balamcyril (Mon, 24 Jun 2019 12:38:44 GMT):
for each thread i'm using different variable, so it not possible to have a collixion with different transaction
rickr (Mon, 24 Jun 2019 13:14:07 GMT):
I've had up to 400 threads changing and querying different values running for hours
rickr (Mon, 24 Jun 2019 13:24:24 GMT):
Also even if its the *same* variable you need to make sure any changes are committed to the peers before you try to do an endorsement using that variable again.
nitishbhardwaj19 (Mon, 24 Jun 2019 14:40:09 GMT):
@rickr Thanks for replying. I found an interesting jira ticket https://jira.hyperledger.org/browse/FAB-11834. I don't know why, but one of my peer is unreachable when I use TLS. As this Jira ticket suggests, it is expected. I am handling this at code now. Though I am still not sure about why Peer is unreachable in TLS mode. I am just using hostnames and gprcs protocols.
rickr (Mon, 24 Jun 2019 15:41:55 GMT):
Google
`openssl s_client -connect`
try to connect to the same peer with that.
Randyshu2018 (Tue, 25 Jun 2019 02:43:44 GMT):
A java question:how to deal with connection.yaml and artifacts's path after they compiled to jar file.
Randyshu2018 (Tue, 25 Jun 2019 02:45:26 GMT):
after convert to jar file ,the certificate path are always wrong.
Coada (Tue, 25 Jun 2019 10:49:33 GMT):
Has joined the channel.
Coada (Tue, 25 Jun 2019 10:49:34 GMT):
Hello! I am using the Java SDK 1.4.1 to interact with my Fabric network setup using Docker (Compose). My setup consists of 2 peers and one OSN, all part of a channel with instantiated chaincode. I am now testing what happens if one peer goes down, by stopping the docker container. I execute a function in the chaincode and get 1 valid (from the online peer) and 1 invalid (from the offline peer) proposalResponses. I send the valid response to the OSN, however *waiting on the future blocks indefinitely*. If I query the online peer, I can confirm that the transaction has gone through. Is there any way I can get the future to return?
rickr (Tue, 25 Jun 2019 11:25:56 GMT):
When dealing with networking your future should have some timeout. If it does timeout, your application can decided it's own recovery strategy. Report the error to user, Query peers for each transaction to see if it's done.
Coada (Tue, 25 Jun 2019 12:03:30 GMT):
Hello rickr, thanks for your reply. I have now added a timeout. I am also looking into adding TransactionOptions to the request, and setting the future to return when `X` peers have seen it where `X` is the size of the proposalResponses. What is the difference between `createNoEvents().setN()` and `createNofEvents().setN()`?
Coada (Tue, 25 Jun 2019 13:01:50 GMT):
Nvm I solved it. createNoEvents() is the same as _no_ events, while createNofEvents is number of events. It is clear now that I am looking at it - however perhaps some Javadoc can be added to these methods to differentiate them a bit more?
mhs22 (Wed, 26 Jun 2019 07:26:31 GMT):
Has joined the channel.
mhs22 (Wed, 26 Jun 2019 08:34:46 GMT):
Hello! I have a question. Is there a way to set database for storing user identity in java sdk?
mhs22 (Wed, 26 Jun 2019 08:36:14 GMT):
I know there are three options for storing user identity (file, database, hsm), and I developed it with nodejs sdk before.
rickr (Wed, 26 Jun 2019 12:23:38 GMT):
None in the core sdk. There is a Java programming model work in progress that I think has something like that. The SDK does does show storing credentials as properties files in the integration tests.
erictran1910 (Wed, 26 Jun 2019 16:45:34 GMT):
Has joined the channel.
erictran1910 (Wed, 26 Jun 2019 16:45:50 GMT):
hi anyone iam newbie in java sdk
erictran1910 (Wed, 26 Jun 2019 16:46:51 GMT):
is there any tutorial to do some basic stuff like create & initialize channel, join peers into channel ? https://github.com/hyperledger/fabric-sdk-java/ is too much and i dont know where to start
Antimttr (Wed, 26 Jun 2019 17:35:31 GMT):
@erictran1910 I used the end2endit suite in the java sdk, I wish there was another answer but its really the only resource that is complete. The good news is i was able to build a basically complete client application modeled after it (of course I added JWT, databases, and a jersey Restful api too)
erictran1910 (Thu, 27 Jun 2019 04:30:09 GMT):
@erictran1910 I used the end2endit suite in the java sdk, I wish there was another answer but its really the only resource that is complete.
erictran1910 (Thu, 27 Jun 2019 04:31:19 GMT):
hi @Antimttr can i pull your complete source code
erictran1910 (Thu, 27 Jun 2019 04:31:19 GMT):
hi @Antimttr can i see your complete source code for reference ?
mhs22 (Thu, 27 Jun 2019 05:04:42 GMT):
@rickr you mean, the current java sdk doesn't provide db, hsm integration feature?
MattiaBolzonella (Thu, 27 Jun 2019 09:27:00 GMT):
Has joined the channel.
MattiaBolzonella (Thu, 27 Jun 2019 09:27:06 GMT):
Hi, I've configured a fabric network, installed and istantiated chaincode. All guides that i've seen doesn't specify how to connect the SDK to a running network, can someone help me with the steps to follow in order to connect and interact with a running fabric network via SDK?
MattiaBolzonella (Thu, 27 Jun 2019 09:27:06 GMT):
Hi, I've configured a fabric network, installed and istantiated chaincode. All guides that i've seen don't specify how to connect the SDK to a running network, can someone help me with the steps to follow in order to connect and interact with a running fabric network via SDK?
tballast (Thu, 27 Jun 2019 10:23:17 GMT):
@MattiaBolzonella If you look in (this)[https://github.com/hyperledger/fabric-sdk-java/tree/master/src/test/java/org/hyperledger/fabric/sdkintegration] directory you will see a number of different tests that can be run which will al connect to a network and perform a variety of different functions. Take a look specificallt at End2EndIT.java first, and then perhaps the others.
The network that should be running when you run these tests is defined in [this](https://github.com/hyperledger/fabric-sdk-java/tree/master/src/test/fixture/sdkintegration) directory. Take a look at the fabric.sh script to see what to do.
tballast (Thu, 27 Jun 2019 10:23:17 GMT):
@MattiaBolzonella If you look in [this](https://github.com/hyperledger/fabric-sdk-java/tree/master/src/test/java/org/hyperledger/fabric/sdkintegration) directory you will see a number of different tests that can be run which will al connect to a network and perform a variety of different functions. Take a look specificallt at End2EndIT.java first, and then perhaps the others.
The network that should be running when you run these tests is defined in [this](https://github.com/hyperledger/fabric-sdk-java/tree/master/src/test/fixture/sdkintegration) directory. Take a look at the fabric.sh script to see what to do.
MattiaBolzonella (Thu, 27 Jun 2019 10:28:34 GMT):
Thank you very much, I'll get a look at the repo
mahoney1 (Thu, 27 Jun 2019 10:40:47 GMT):
reminder that the Fabric Developer Community call today is at 4pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
Patriq (Thu, 27 Jun 2019 14:05:56 GMT):
Has left the channel.
mahoney1 (Thu, 27 Jun 2019 17:04:59 GMT):
recording from today's Fabric Developer community call (0627 zip) has been posted here -> https://wiki.hyperledger.org/display/fabric/Community-Call-Recordings
yeousunn (Fri, 28 Jun 2019 02:28:53 GMT):
Hi Guys, anyone here know why we get only one orderer when querying the network like `mychannel.getOrderers()`. The network is running raft orderer service with 5 orderer node. Does it only consider the leader node?
yeousunn (Fri, 28 Jun 2019 02:53:21 GMT):
Even `mychannel.getPeers()` is giving me only 1 peer, it should be 4 in total and 2 per organization. Is there anything that I need to configure to get the correct result?
yeousunn (Fri, 28 Jun 2019 03:07:04 GMT):
Ok, This is based on number of orderers/peers I specify in the configuration file. not the actual count of nodes.
bestbeforetoday (Fri, 28 Jun 2019 08:07:44 GMT):
If you configure your client to use discovery (which requires the network to be configured in a suitable manner with anchor peers etc.), you should be able to specify a minimal set of peers in your common connection profile, and it should discover all the other nodes in the network when you call initialize() on the channel object.
yeousunn (Fri, 28 Jun 2019 08:10:59 GMT):
Thank you for the reply. I am using the first-network sample right now. Is there any specific document related to that?
bestbeforetoday (Fri, 28 Jun 2019 08:44:29 GMT):
The steps for set up of the first-network at https://hyperledger-fabric.readthedocs.io/en/release-1.4/build_network.html do mention configuring anchor peers, so things might be OK from that end. With the Java SDK, there needs to be a channel in the connection profile, and that channel needs to reference a peer that has `"discover": true` in its list of roles
yeousunn (Fri, 28 Jun 2019 08:46:30 GMT):
okay, thank you. much clear on that now. :thumbsup:
tballast (Fri, 28 Jun 2019 10:51:00 GMT):
in the HFClient.java file there are two ways to create a new channel: `Channel newChannel(String name)` OR `Channel newChannel(String name, Orderer orderer, ChannelConfiguration channelConfiguration, byte[]... channelConfigurationSignatures)`
I just want to make sure in understand correctly - if you've already got a running Fabric network with a channel and running chaincode, you can use the first, whereas the second one will call to the orderer and actually try to join this channel to the network, right?
tballast (Fri, 28 Jun 2019 10:51:00 GMT):
in the [HFClient.java](https://github.com/hyperledger/fabric-sdk-java/blob/master/src/main/java/org/hyperledger/fabric/sdk/HFClient.java#L230_ file there are two ways to create a new channel: `Channel newChannel(String name)` OR `Channel newChannel(String name, Orderer orderer, ChannelConfiguration channelConfiguration, byte[]... channelConfigurationSignatures)`
I just want to make sure in understand correctly - if you've already got a running Fabric network with a channel and running chaincode, you can use the first, whereas the second one will call to the orderer and actually try to join this channel to the network, right?
tballast (Fri, 28 Jun 2019 10:51:00 GMT):
in the [HFClient.java](https://github.com/hyperledger/fabric-sdk-java/blob/master/src/main/java/org/hyperledger/fabric/sdk/HFClient.java#L230_) file there are two ways to create a new channel: `Channel newChannel(String name)` OR `Channel newChannel(String name, Orderer orderer, ChannelConfiguration channelConfiguration, byte[]... channelConfigurationSignatures)`
I just want to make sure in understand correctly - if you've already got a running Fabric network with a channel and running chaincode, you can use the first, whereas the second one will call to the orderer and actually try to join this channel to the network, right?
balamcyril (Fri, 28 Jun 2019 11:42:24 GMT):
Error while registering the user
rickr (Fri, 28 Jun 2019 12:44:55 GMT):
No. If you had your application running and it shutsdown See README.md Take the time to follow the integration test There is one there about recreate the channel
rickr (Fri, 28 Jun 2019 12:46:09 GMT):
https://github.com/hyperledger/fabric-sdk-java/tree/e0af6681ccc829ee624f8e5d90d5a9b74724d023#end-to-end-test-scenario
JakaKrajnc (Sat, 29 Jun 2019 18:57:45 GMT):
Has joined the channel.
nitishbhardwaj19 (Sun, 30 Jun 2019 11:58:41 GMT):
Hi @rickr I am trying to retrieve channel information from `channelConfigurationBytes`. I checked UpdateChannelIT. I am not able to get where should the `CONFIGTXLATOR_LOCATION` be hosted? Do we really have any reference which can be hosted as a server for configtx. Would be great if you can share some thoughts.```
HttpPost httppost = new HttpPost(CONFIGTXLATOR_LOCATION + "/protolator/decode/common.Config");
httppost.setEntity(new ByteArrayEntity(channelConfigurationBytes));
HttpResponse response = httpclient.execute(httppost);
```
tballast (Mon, 01 Jul 2019 13:31:16 GMT):
Is there a way to pull the registered users as well as their secrets from the CA?
I have a client application that, on first boot, enroll an Admin, then register and enroll a user. I can save this user locally and then reboot the client and everything is OK. However, if I don't save the user locally, then I have no way of using this user as everytime I try to enroll it to get the secret, I get an error saying it already exists. When I call `HFCAClient.getHFCAIdentities(adminUser);` I can see the user is enrolled with the network, however the secret property is empty. Is there a way to obtain it?
aatkddny (Mon, 01 Jul 2019 22:17:53 GMT):
I'm not rick, but just as an fyi you can start it as a service locally - it comes up on 7059 as a default. Or you can use a processbuilder to run it in a shell. i'm told there's a k8s container available for it too but i haven't got round to trying that yet.
Antimttr (Mon, 01 Jul 2019 22:25:19 GMT):
@tballast what i do is enroll the user, get the provided key and encrypt it and store it in my user database, that way i have the secret if i need it
nitishbhardwaj19 (Tue, 02 Jul 2019 01:19:43 GMT):
Thanks for sharing the information. This is great. I didn't know about it. Do we have any document which covers steps to host this as a service? It would be great if you could share some points.
balamcyril (Tue, 02 Jul 2019 09:00:49 GMT):
hello, why some time i receive this error from some threads when try the registration to the CA: org.hyperledger.fabric_ca.sdk.exception.RegistrationException: Error while registering the user org.hyperledger.fabric.sdkintegration.SampleUser@131a7bd2 url: http://localhost:7054 null, Caused by: java.lang.NullPointerException.
tballast (Tue, 02 Jul 2019 09:48:28 GMT):
@Antimttr I've been doing something very similar, which works well for rebooting the client. I was just wondering about what would happen if I lost the credentials in a production environment.
Jelle.Diet (Tue, 02 Jul 2019 10:10:56 GMT):
Can private data collections always be purged afterwards (for gdpr compliance) or is there a limit on how many transactions the data can be a part of before it becomes immutable?
aatkddny (Tue, 02 Jul 2019 12:29:42 GMT):
It's in the older versions of the documentation.
https://hyperledger-fabric.readthedocs.io/en/v1.1.0-alpha/configtxlator.html
aatkddny (Tue, 02 Jul 2019 12:31:13 GMT):
Apparently - and I haven't (yet) tried it it is also here. I've taken this from the kubernetes channel, where I asked if there was a containerized version I can stick inside my cluster.
```
configtxlater is in the `us.gcr.io/provenance-io/hyperledger-fabric-tools` image ... you should be able to start and run an instance using that image ... ```
aatkddny (Tue, 02 Jul 2019 14:27:55 GMT):
anyone manage to add an org using the sdk with tls on?
i thought i had it all down pat - and i did without tls - but switching the orderers to raft has me back to square one.
org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel genesischannel failed with peer ordererpeer-orderer. Status FAILURE, details: Channel Channel{id: 1, name: genesischannel} Sending proposal with transaction: c4131e67ff70bbee1e7aec713701bfc2a8f4e4a13eca302b52d56f2c09f1e83d to Peer{ id: 5, name: ordererpeer-orderer, channelName: genesischannel, url: grpcs://localhost:30025} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:30025
aatkddny (Tue, 02 Jul 2019 14:27:55 GMT):
anyone manage to add an org using the sdk with tls on?
i thought i had it all down pat - and i did without tls - but switching the orderers to raft has me back to square one.
```org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel genesischannel failed with peer ordererpeer-orderer. Status FAILURE, details: Channel Channel{id: 1, name: genesischannel} Sending proposal with transaction: c4131e67ff70bbee1e7aec713701bfc2a8f4e4a13eca302b52d56f2c09f1e83d to Peer{ id: 5, name: ordererpeer-orderer, channelName: genesischannel, url: grpcs://localhost:30025} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:30025
```
I'm also getting these - which I'm not used to seeing
`2019-07-02 09:40:47.769 WARN 20517 --- [nio-8095-exec-1] org.hyperledger.fabric.sdk.Channel : Channel genesischannel could not load peer CA certificates from any peers.`
aatkddny (Tue, 02 Jul 2019 14:30:26 GMT):
Yes I have a hostname override. And the certs are self-signed using cryptogen.
aatkddny (Tue, 02 Jul 2019 18:48:51 GMT):
so i have a problem with the peer code.
`parseGrpcUrl` in `org.hyperledger.fabric.sdk.helper.Utils` requires `throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'");` This doesn't work so well with an ingress.
Anyone have a workaround?
aatkddny (Tue, 02 Jul 2019 18:48:51 GMT):
so i have a problem with the peer code.
`parseGrpcUrl` in `org.hyperledger.fabric.sdk.helper.Utils` requires `throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'");` This doesn't work so well with an ingress if I set the path to /{service}.
Anyone have a workaround? I believe a NodePort doesn't work with GRPCS.
aatkddny (Tue, 02 Jul 2019 18:48:51 GMT):
so i have a problem with the peer code.
`parseGrpcUrl` in `org.hyperledger.fabric.sdk.helper.Utils` requires `throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'");` This doesn't work so well with an ingress if I set the path to /{service}.
Anyone have a workaround?
yeousunn (Wed, 03 Jul 2019 00:57:41 GMT):
Hello Guys, I am following the service discovery from this link https://github.com/hyperledger/fabric-sdk-java/blob/release-1.4/src/test/java/org/hyperledger/fabric/sdkintegration/ServiceDiscoveryIT.java but I am unable to discover peers, I should get count 4 but I am getting only one. I noticed that it say I need to add entries into host file. is it necessary for all network? I am using the first-network for the test. I am using version 1.4
nitishbhardwaj19 (Wed, 03 Jul 2019 04:05:53 GMT):
Thanks for sharing this. I found this reference too https://hyperledger-fabric.readthedocs.io/en/release-1.4/commands/configtxlator.html?highlight=config
aatkddny (Wed, 03 Jul 2019 16:03:50 GMT):
Anyone manage to get this working with TLS on? Is client TLS a requirement or have I stuffed something up?
I keep getting `Endpoint grpcs://localhost:30025 with no ssl context` in my log followed by a connection refused.
aatkddny (Wed, 03 Jul 2019 16:03:50 GMT):
Anyone manage to get this working with TLS on? Is client TLS a requirement or have I stuffed something up? Trying to run with just the server stuff set.
I keep getting `Endpoint grpcs://localhost:30025 with no ssl context` in my log followed by a connection refused.
aatkddny (Wed, 03 Jul 2019 16:03:50 GMT):
Has anyone manage to get this working with TLS on inside Kubernetes?
I've been fine up until the 1.4.1 release using Kafka - well fine is relative. Kafka has presented some issues.
We need to move to raft ordering.
Raft requires TLS.
Fabric is moving to Kubernetes native (finally).
I can't find a way to talk to my peers with TLS on.
I can't use an ingress because of the problem I described above - note TODO:
```
Properties props = new Properties();
Pattern p = Pattern.compile("([^:]+)[:]//([^:]+)[:]([0-9]+)", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(url);
if (m.matches()) {
props.setProperty("protocol", m.group(1));
props.setProperty("host", m.group(2));
props.setProperty("port", m.group(3));
String protocol = props.getProperty("protocol");
if (!"grpc".equals(protocol) && !"grpcs".equals(protocol)) {
throw new RuntimeException(format("Invalid protocol expected grpc or grpcs and found %s.", protocol));
}
}
else {
throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'");
}
// TODO: allow all possible formats of the URL
```
I can't get a NodePort (which is how everything is exposed now) to work. I don't believe I can use GRPCS with NodePorts.
The last resort I have is to try to stick my code inside the K8S cluster, but that restricts me to a single cluster - which isn't realistic long term.
Anyone have a workaround?
mattremy (Wed, 03 Jul 2019 17:18:15 GMT):
A very basic question... What is the difference between creating an identity and registering and enrolling an identity? Even when an identity, it does get registered?
dan13 (Wed, 03 Jul 2019 19:09:49 GMT):
Host file entries are needed to map logical names to IP addresses when there is no name server. On a real network with DNS there would be no need to set host file entries.
dan13 (Wed, 03 Jul 2019 19:16:10 GMT):
You create the identity in CA and then enroll the identity. Enrollment returns the PK and cert needed to sign transactions as that identity. This may help: https://stackoverflow.com/questions/49917351/cas-enrollment-registration-for-hyperledger-fabric
yeousunn (Thu, 04 Jul 2019 00:56:50 GMT):
thank you for the reply, I am using fabric samples first-network which runs docker containers. I tried adding entries to hosts file. I am still not able to discover the nodes. Not sure what is missing. ancheor peer is configured by default. I am not sure what else I am missing.
yeousunn (Thu, 04 Jul 2019 00:56:50 GMT):
thank you for the reply, I am using fabric samples first-network which runs docker containers. I tried adding entries to hosts file. I am still not able to discover the nodes. The ancheor peer is configured by default. I am not sure what else I am missing.
lotty02cho (Thu, 04 Jul 2019 01:20:32 GMT):
Has joined the channel.
lotty02cho (Thu, 04 Jul 2019 01:20:36 GMT):
enroll
githubcpc (Thu, 04 Jul 2019 02:02:49 GMT):
Has fabric-sdk-java supported HLFv1.4.1? I use fabric-sdk-java release-1.4 ,but I can not connect to my HLF env.
lotty02cho (Thu, 04 Jul 2019 04:28:05 GMT):
Does anyone know or explain how to connect between fabric-sdk-java and byfn network?
githubcpc (Thu, 04 Jul 2019 06:39:01 GMT):
@lotty02cho I think you can try to run End2endIT.
mattiabolzonella1 (Thu, 04 Jul 2019 06:45:34 GMT):
Has joined the channel.
mattiabolzonella1 (Thu, 04 Jul 2019 07:29:32 GMT):
I have configured the service discovery in the docker compose, the peers can see each others but in the SDK ```
io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl onError
WARNING: [io.grpc.internal.ManagedChannelImpl-9] Failed to resolve name. status=Status{code=UNAVAILABLE, description=Unable to resolve host peer1.org1.mydomain.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: peer1.org1.mydomain.com: Name or service not known
```
The network is running using TLS, I can't figure out what i'm missing. Any help is appreciated, thanks!
mattiabolzonella1 (Thu, 04 Jul 2019 09:05:42 GMT):
It seems that the SDK cannot resolve the EXTERNAL_ENDPOINT in the docker-compose file. But in the peer debug the discovery service and gossip are working fine
mattiabolzonella1 (Thu, 04 Jul 2019 14:40:32 GMT):
Have you solved the problem? I'm struggling too
mattremy (Thu, 04 Jul 2019 19:56:57 GMT):
Is there a way that I can retrieve custom extensions from the x509Certificate generated by fabric-ca server. The extensions oid is "1.2.3.4.5.6.7.8.1". It is DER encoded Octet, but since it is custom, the usual class files cant decode it. Any pointers?
yeousunn (Fri, 05 Jul 2019 00:46:17 GMT):
no, still have the problem. only reply I get from people is to configure anchor peer and enable discovery. I have done both and followed the example. Still not able to discover other nodes.
qsmen (Fri, 05 Jul 2019 01:56:30 GMT):
applicaiton is writen in java sdk. an error "No subject alternative DNS name matching org1.example.com found" is reported when doing transaction. It is not the first time that this quesiton is asked. Please help to solve. Thank you
yeousunn (Fri, 05 Jul 2019 03:34:28 GMT):
are you sure it's the correct DNS? shouldn't it be peer0.org1.example.com or peer1.org1.example.com?
qsmen (Fri, 05 Jul 2019 06:53:39 GMT):
yes, DNS correct. the error is ""No subject alternative DNS name matching peer0.org1.example.com found".
qsmen (Fri, 05 Jul 2019 07:02:12 GMT):
for java sdk it is not easy to set proper parameters for applications. we need more documents to help us. no related posts are returned when searching in fabric-sdk-node channel with the key words "no subject alternative dns name".
qsmen (Fri, 05 Jul 2019 07:03:40 GMT):
my colleague modifys codes in almost random way, the problem is solved.
mattiabolzonella1 (Fri, 05 Jul 2019 07:07:46 GMT):
I think i resolved the problem: the application is not running on docker so the addresses returned by the discovery service are not valid and must be mapped to localhost:port. To do so i modified `/etc/hosts/` mapping all the addresses of the peer in the fabric network with 127.0.0.1
mattiabolzonella1 (Fri, 05 Jul 2019 07:07:46 GMT):
I think i resolved the problem: the application is not running on docker so the addresses returned by the discovery service are not valid and must be mapped to localhost:port. To do so i modified `/etc/hosts` mapping all the addresses of the peer in the fabric network with 127.0.0.1
mattiabolzonella1 (Fri, 05 Jul 2019 07:07:46 GMT):
I think i resolved the problem: the application is not running on docker so the addresses returned by the discovery service are not valid and must be mapped to localhost:port. To do so i modified `/etc/hosts` mapping all peers'addresses in the fabric network with 127.0.0.1
srinu_chunduru (Fri, 05 Jul 2019 08:34:08 GMT):
Has joined the channel.
srinu_chunduru (Fri, 05 Jul 2019 08:34:10 GMT):
Hi Team,
I am working on HyperLedger Fabric Java chain code.
I feel there is some issue with getStateByRange method. when i pass startKey and endKey as empty, it is not returning any data.
But it is working with empty values in GO and NodeJS.
Documentation show that both can be empty, but it's not working.
Can you please help me in this?
sandy (Fri, 05 Jul 2019 09:41:44 GMT):
Hi. Am getting this error during chaincode instantiation.. ` SimulateProposal -> ERRO 119 [mychannel][486eca5b] failed to invoke chaincode name:"lscc" , error: container exited with 1
github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:63
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:1333
chaincode registration failed
`
sandy (Fri, 05 Jul 2019 09:42:09 GMT):
Can you please help me on this?
heatherp (Fri, 05 Jul 2019 11:31:32 GMT):
Has joined the channel.
mattiabolzonella1 (Fri, 05 Jul 2019 13:42:59 GMT):
Have you solved the issue? I have the same problem with my Raft orderers, the transaction is valid thou
mattiabolzonella1 (Fri, 05 Jul 2019 13:52:45 GMT):
Not sure if it can help but i i solved in this way (I use the discovery service): ```Collection
mattiabolzonella1 (Fri, 05 Jul 2019 13:52:45 GMT):
Not sure if it can help but i i solved in this way (I use the discovery service): ```Collection
dan13 (Fri, 05 Jul 2019 23:13:08 GMT):
You have the peer your client connects to configured for service discovery? In your network config json you want to set the "discover" attribute to true for your peer. Also, Looking at org.hyperledger.fabric.sdk.Channel class and debugging into it should help you figure out what is going on.
rescalona (Sat, 06 Jul 2019 04:55:55 GMT):
Has joined the channel.
asaningmaxchain123 (Sat, 06 Jul 2019 12:02:36 GMT):
@rickr do you use the `jmeter` to test the fabric by using the java-sdk
asaningmaxchain123 (Sat, 06 Jul 2019 12:05:36 GMT):
when i use it,i meet some question, when i set the Thread Number to the 100, the `fabric-sdk-java` setup 10000 thread. it meet the following error `can't create native thread`
yeousunn (Mon, 08 Jul 2019 00:42:44 GMT):
I have all peers discovery set to true.
`- CORE_PEER_DISCOVERY_ENABLED=true`
liurain (Mon, 08 Jul 2019 02:40:36 GMT):
Has joined the channel.
liurain (Mon, 08 Jul 2019 02:40:37 GMT):
Hi, everybody
I want to endorse the contract using different peer nodes of the same channel in different threads. But a HFClient object can only create a Channel object with the same name. How should I handle this situation correctly?
Thanks
liurain (Mon, 08 Jul 2019 02:41:03 GMT):
Hi, everybody
I want to endorse the contract using different peer nodes of the same channel in different threads. But a HFClient object can only create a Channel object with the same name. How should I handle this situation correctly?
Thanks
qsmen (Mon, 08 Jul 2019 07:02:09 GMT):
not completely solved. from the description, you find the endorser by using service discovery. However, your problem is with raft order. it is a little strange.
qsmen (Mon, 08 Jul 2019 07:03:50 GMT):
@mattiabolzonella1 . I dont know if the erro "no subject alternative..." is binded to java sdk. I found no such error in nodejs sdk channel.
liurain (Mon, 08 Jul 2019 07:10:26 GMT):
You can check if the owner in the TLS certificate is the same as the node host name (container name).
qsmen (Mon, 08 Jul 2019 07:15:51 GMT):
the owner in tls ca certificate or in tls server certificate?
liurain (Mon, 08 Jul 2019 07:16:40 GMT):
tls server certificate
mattiabolzonella1 (Mon, 08 Jul 2019 07:49:11 GMT):
Do you set the external endpoint for each peer? And if you use a connection profile, did you set `discovery: true` in it for the peer to which tour sdk is connecting?
yeousunn (Mon, 08 Jul 2019 08:23:44 GMT):
I am using the default first-network sample. I have enabled discovery on all peers using the following property in docker environment `CORE_PEER_DISCOVERY_ENABLED=true` for all peers. External Endpoints are already configured in the sample.
yeousunn (Mon, 08 Jul 2019 08:23:44 GMT):
I am using the default first-network sample. I have enabled discovery on all peers using the following property in docker environment `CORE_PEER_DISCOVERY_ENABLED=true`. External Endpoints are already configured in the sample.
mattiabolzonella1 (Mon, 08 Jul 2019 08:26:38 GMT):
The strange thing is that the trasanction is successfully commited on the network
qsmen (Mon, 08 Jul 2019 08:44:58 GMT):
are you sure transaction is in peer's blockchain? or just in order's blockchain?
mattiabolzonella1 (Mon, 08 Jul 2019 09:59:57 GMT):
Yeah, from Fabric Explorer the transaction is valid and committed. Explorer is attached to an anchor peer, so it seems that the transaction is in the blockchain. There is another way to make sure if the transaction is in the peer's blockchain?
mattiabolzonella1 (Mon, 08 Jul 2019 09:59:57 GMT):
Yeah, from Fabric Explorer the transaction is valid and committed. Explorer is attached to an anchor peer, so it seems that the transaction is in the peer's blockchain. There is another way to make sure if the transaction is in the peer's blockchain?
mattiabolzonella1 (Mon, 08 Jul 2019 10:04:32 GMT):
Very strange, I'd check the docker logs of a peer to see if the discovery service is working. Set `CORE_LOGGING_PEER=DEBUG` in the peer's composer file
rjones (Mon, 08 Jul 2019 13:51:53 GMT):
Has joined the channel.
rjones (Mon, 08 Jul 2019 13:51:54 GMT):
@mastersingh24 is now an owner
rjones (Mon, 08 Jul 2019 13:51:58 GMT):
mastersingh24
rjones (Mon, 08 Jul 2019 13:52:09 GMT):
Has left the channel.
Vishal3152 (Mon, 08 Jul 2019 13:56:02 GMT):
Has joined the channel.
Vishal3152 (Mon, 08 Jul 2019 13:57:35 GMT):
Is there HSM support available in java-sdk?
nitishbhardwaj19 (Mon, 08 Jul 2019 15:12:21 GMT):
The README mentions this as a limitation
yeousunn (Tue, 09 Jul 2019 00:39:21 GMT):
I can see `registerDiscoveryService -> INFO 01c Discovery service activated`
qsmen (Tue, 09 Jul 2019 00:47:17 GMT):
you are lucky. my transaction just resides in order, not in peers
mattiabolzonella1 (Tue, 09 Jul 2019 08:23:31 GMT):
How did you figure out that the transaction resides only in orderer?
qsmen (Tue, 09 Jul 2019 08:26:56 GMT):
Lastblocknumber={36}
Commitblock-> wrote block 36
Grpc server.serve failed to complete security handshake from “10.244.1.1:58916”
qsmen (Tue, 09 Jul 2019 08:27:18 GMT):
where the ip is running cni
qsmen (Tue, 09 Jul 2019 08:29:14 GMT):
i guess order can not find peer container. Now, my colleagure solved the problem in almost random way by modifying codes related to tls
mattiabolzonella1 (Tue, 09 Jul 2019 09:57:20 GMT):
I understand. Anyway the problem with the orderer is still bothering me. I cannot send proposal response only to the first orderer and not to the other in the raft cluster, still DNS resolution problem and in the log of the first orderer i see TLS handshake failure. Each orderer's container has a dedicate internal port and the same external port 7050, and i think that the setting is correct.
mattiabolzonella1 (Tue, 09 Jul 2019 09:57:20 GMT):
I understand. Anyway the problem with the orderer is still bothering me. I can only send proposal responseto the first orderer and not to the other in the raft cluster, still DNS resolution problem and in the log of the first orderer i see TLS handshake failure. Each orderer's container has a dedicate internal port and the same external port 7050, and i think that the setting is correct.
aatkddny (Wed, 10 Jul 2019 00:13:03 GMT):
I have a small problem with the code in Channel.java at
```
public Peer addPeer(SDPeerAdditionInfo sdPeerAddition) throws InvalidArgumentException, ServiceDiscoveryException {
```
this to be exact:
```
peer = sdPeerAddition.getClient().newPeer(endpoint,
protocol + "//" + endpoint,
properties);
```
Connecting an org to a channel to install chaincode on it.
My org is `peer0-org` and it is at `localhost:30020`. It's constructing `grpcs://peer0-org:30020`
It's ultimately coming from Channel.java
```
for (SDEndorser sdEndorser : sdNetwork.getEndorsers()) {
final String sdEndorserMspid = sdEndorser.getMspid();
Peer peer = peerEndpointMap.get(sdEndorser.getEndpoint());
if (null == peer) {
if (shutdown) {
return;
}
logger.debug(format("Channel %s doing channel update found new peer mspid: %s, endpoint: %s", name, sdEndorserMspid, sdEndorser.getEndpoint()));
sdPeerAddition.addPeer(new SDPeerAdditionInfo() {
@Override
public String getMspId() {
return sdEndorserMspid;
}
@Override
public String getEndpoint() {
return sdEndorser.getEndpoint();
}
```
How should I get round this? Editing my hosts file isn't really going to scale well into a cluster.
aatkddny (Wed, 10 Jul 2019 00:13:03 GMT):
I have a small problem with the code in Channel.java at
```
public Peer addPeer(SDPeerAdditionInfo sdPeerAddition) throws InvalidArgumentException, ServiceDiscoveryException {
```
this to be exact:
```
peer = sdPeerAddition.getClient().newPeer(endpoint,
protocol + "//" + endpoint,
properties);
```
It was thrown when I tried connecting an org to a channel to install a piece of chaincode on it.
My org is inside a k8s cluster at `peer0-org` and it is accessed externally through a node port at `localhost:30020`. It's constructing `grpcs://peer0-org:30020` and failing to get to it.
It's ultimately coming from the service discovery piece inside Channel.java in `void sdUpdate(SDNetwork sdNetwork) throws InvalidArgumentException, ServiceDiscoveryException { `
```
for (SDEndorser sdEndorser : sdNetwork.getEndorsers()) {
final String sdEndorserMspid = sdEndorser.getMspid();
Peer peer = peerEndpointMap.get(sdEndorser.getEndpoint());
if (null == peer) {
if (shutdown) {
return;
}
logger.debug(format("Channel %s doing channel update found new peer mspid: %s, endpoint: %s", name, sdEndorserMspid, sdEndorser.getEndpoint()));
sdPeerAddition.addPeer(new SDPeerAdditionInfo() {
@Override
public String getMspId() {
return sdEndorserMspid;
}
@Override
public String getEndpoint() {
return sdEndorser.getEndpoint();
}
```
How should I get round this? Editing my hosts file isn't really going to scale well into a cluster.
aatkddny (Wed, 10 Jul 2019 00:13:03 GMT):
I have a small problem with the code in Channel.java at
```
public Peer addPeer(SDPeerAdditionInfo sdPeerAddition) throws InvalidArgumentException, ServiceDiscoveryException {
```
this to be exact:
```
peer = sdPeerAddition.getClient().newPeer(endpoint,
protocol + "//" + endpoint,
properties);
```
It was thrown when I tried connecting an org to a channel to install a piece of chaincode on it.
My org is inside a k8s cluster at `peer0-org` and it is accessed externally through a node port at `localhost:30020`. It's constructing `grpcs://peer0-org:30020` and failing to get to it.
It's ultimately coming from the service discovery piece inside Channel.java in `void sdUpdate(SDNetwork sdNetwork) throws InvalidArgumentException, ServiceDiscoveryException { `
```
for (SDEndorser sdEndorser : sdNetwork.getEndorsers()) {
final String sdEndorserMspid = sdEndorser.getMspid();
Peer peer = peerEndpointMap.get(sdEndorser.getEndpoint());
if (null == peer) {
if (shutdown) {
return;
}
logger.debug(format("Channel %s doing channel update found new peer mspid: %s, endpoint: %s", name, sdEndorserMspid, sdEndorser.getEndpoint()));
sdPeerAddition.addPeer(new SDPeerAdditionInfo() {
@Override
public String getMspId() {
return sdEndorserMspid;
}
@Override
public String getEndpoint() {
return sdEndorser.getEndpoint();
}
```
How should I get round this? Editing my hosts file isn't really going to scale well into a cluster and I'm loathe to point everything to the exposed host:port services.
qsmen (Wed, 10 Jul 2019 00:52:05 GMT):
maybe you can ask for help in fabric-orderer channel.
mattiabolzonella1 (Wed, 10 Jul 2019 07:07:19 GMT):
Yeah i think i'll ask there, thanks!
mattiabolzonella1 (Wed, 10 Jul 2019 09:21:07 GMT):
RaftOrderers_&_JavaSDK.txt
aatkddny (Thu, 11 Jul 2019 00:04:53 GMT):
Adding to my original message. Which is unfortunate.
Even editing the hosts file isn't enough. By time it gets to the peer that starts throwing these:
```
2019-07-10 23:54:34.126 UTC [grpc] HandleSubConnStateChange -> DEBU 4398 pickfirstBalancer: HandleSubConnStateChange: 0xc001eeef20, CONNECTING
2019-07-10 23:54:34.129 UTC [grpc] createTransport -> DEBU 4399 grpc: addrConn.createTransport failed to connect to {10.1.6.241:7051 0
SatheeshNehru (Thu, 11 Jul 2019 05:46:02 GMT):
is there any way to view chaincode inside the peer
??
Vishal3152 (Thu, 11 Jul 2019 07:39:44 GMT):
Hi group,
Vishal3152 (Thu, 11 Jul 2019 07:40:14 GMT):
I am trying to mvn install fabric-sdk-java. All test cases are failing with this error:
Vishal3152 (Thu, 11 Jul 2019 07:40:15 GMT):
[INFO] -------------------------------------------------------
[INFO] Running org.hyperledger.fabric_ca.sdk.HFCAAffiliationTest
2019-07-11 07:10:29,579 main INFO SampleStore:91 - Could not find the file "/tmp/HFCSampletest.properties"
2019-07-11 07:10:29,585 main INFO SampleStore:91 - Could not find the file "/tmp/HFCSampletest.properties"
2019-07-11 07:10:29,613 main INFO SampleStore:91 - Could not find the file "/tmp/HFCSampletest.properties"
2019-07-11 07:10:29,614 main INFO SampleStore:91 - Could not find the file "/tmp/HFCSampletest.properties"
2019-07-11 07:10:29,645 main ERROR HFCAAffiliation:274 - Error while creating affiliation neworg1 url: http://localhost:99/api/v1/affiliations null
Vishal3152 (Thu, 11 Jul 2019 07:40:43 GMT):
Nowhere in the repo I could find how this file is created.
mahoney1 (Thu, 11 Jul 2019 11:52:15 GMT):
reminder that the Fabric Developer Community call today is at 4pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
bestbeforetoday (Thu, 11 Jul 2019 15:17:57 GMT):
Not sure if I understand your requirement correctly but perhaps you could use the overload of `Channel.sendTransactionProposal()` that allows you to specify which peers the proposal should be sent to for endorsement. You could specify an appropriate set of peers for each thread
mahoney1 (Thu, 11 Jul 2019 15:41:00 GMT):
FYI - reminder that the Fabric Developer Community call is in 20mins - 4pm UTC (5pm UK, 12pm ET, 9am PT) Meeting Id: https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
aatkddny (Fri, 12 Jul 2019 14:11:31 GMT):
So I have a problem with the eventing service.
It's throwing constant errors - there's an issue with connecting to the peer to catch up on missed blocks.
```
o.h.fabric.sdk.PeerEventServiceClient : Received error on PeerEventServiceClient{id: 14, channel: org-channel, peerName: peer1-org:30022, url: grpcs://peer1-org:30022}, attempts 0. UNAVAILABLE: Channel shutdownNow invoked
```
It's doing service discovery - log follows - to build the properties inside the peer.
The call ultimately comes from `Peer#reconnectPeerEventServiceClient`
log:
```
sdk.Peer : Peer{ id: 13, name: peer1-org:30022, channelName: org-channel, url: grpcs://peer1-org:30022, mspid: OrgMSP} reconnecting. Starting block number: newest
sdk.ServiceDiscovery : Channel org-channel starting service rediscovery after 120 seconds.
sdk.ServiceDiscovery : Full network discovery force: true
sdk.ServiceDiscovery : Network discovery force: true
sdk.ServiceDiscovery : Channel org-channel doing discovery with peer: Peer{ id: 6, name: peer1-org, channelName: org-channel, url: grpcs://localhost:30022}
sdk.Peer : peer.sendDiscoveryRequstAsync Peer{ id: 6, name: peer1-org, channelName: org-channel, url: grpcs://localhost:30022}
sdk.EndorserClient : EndorserClient{id: 8, channel: org-channel, name:peer1-org, url: grpcs://localhost:30022} grpc channel isActive: true, isShutdown: false, isTerminated: false, state: READY
sdk.ServiceDiscovery : Channel org-channel service discovery MSPID OrdererMSP adding TLSCert <.cut for size.>
sdk.ServiceDiscovery : Channel org-channel service discovery MSPID OrgMSP adding TLSCert <.cut for size.>
sdk.ServiceDiscovery : Channel: org-channel peer: Peer{ id: 6, name: peer1-org, channelName: org-channel, url: grpcs://localhost:30022} discovered orderer MSPID: OrdererMSP, endpoint: raft0-orderer:7050
sdk.ServiceDiscovery : Channel org-channel no tls intermediary ca certs for mspid: OrdererMSP
sdk.ServiceDiscovery : Channel: org-channel peer: Peer{ id: 6, name: peer1-org, channelName: org-channel, url: grpcs://localhost:30022} discovered orderer MSPID: OrdererMSP, endpoint: raft1-orderer:7050
sdk.ServiceDiscovery : Channel org-channel no tls intermediary ca certs for mspid: OrdererMSP
sdk.ServiceDiscovery : Channel: org-channel peer: Peer{ id: 6, name: peer1-org, channelName: org-channel, url: grpcs://localhost:30022} discovered orderer MSPID: OrdererMSP, endpoint: raft2-orderer:7050
sdk.ServiceDiscovery : Channel org-channel no tls intermediary ca certs for mspid: OrdererMSP
sdk.ServiceDiscovery : Channel org-channel no tls intermediary ca certs for mspid: OrgMSP
sdk.ServiceDiscovery : Channel org-channel peer: Peer{ id: 6, name: peer1-org, channelName: org-channel, url: grpcs://localhost:30022} discovered peer mspid group: OrgMSP, endpoint: peer0-org:30020, mspid: OrgMSP
sdk.ServiceDiscovery : Channel org-channel no tls intermediary ca certs for mspid: OrgMSP
sdk.ServiceDiscovery : Channel org-channel peer: Peer{ id: 6, name: peer1-org, channelName: org-channel, url: grpcs://localhost:30022} discovered peer mspid group: OrgMSP, endpoint: peer1-org:30022, mspid: OrgMSP
sdk.ServiceDiscovery : Channel org-channel service discovery completed: true
sdk.ServiceDiscovery : Discover of chaincode names was empty.
sdk.Channel : Channel org-channel doing channel update for service discovery.
sdk.ServiceDiscovery : Full network rediscovery completed.
sdk.ServiceDiscovery : Channel org-channel starting service rediscovery after 120 seconds.
sdk.ServiceDiscovery : Full network discovery force: true
sdk.ServiceDiscovery : Network discovery force: true
sdk.ServiceDiscovery : Channel org-channel doing discovery with peer: Peer{ id: 6, name: peer1-org, channelName: org-channel, url: grpcs://localhost:30022}
sdk.Peer : peer.sendDiscoveryRequstAsync Peer{ id: 6, name: peer1-org, channelName: org-channel, url: grpcs://localhost:30022}
```
aatkddny (Fri, 12 Jul 2019 14:16:51 GMT):
So the problem is an ssl issue where it eventually throws `java.io.IOException: No extension found with name NetscapeCertType`
There's a handshake failure on the peer.
The properties coming in to the endpoint have two values: `pembytes` and `org.hyperledger.fabric.sdk.peer.organization_mspid`
The properties I build to talk to a peer have a few more properties in there.
These to be precise `sslProvider, negotiationType, hostnameOverride, pemBytes, clientKeyBytes, clientCertBytes`
Since I *can* talk to a peer clearly one of them is required.
aatkddny (Fri, 12 Jul 2019 14:16:51 GMT):
So the problem is an ssl issue where it eventually throws `java.io.IOException: No extension found with name NetscapeCertType`
There's a handshake failure on the peer in the logs.
The properties coming in to the endpoint have two values: `pembytes` and `org.hyperledger.fabric.sdk.peer.organization_mspid`
The properties I build to talk to a peer have a few more properties in there.
These to be precise `sslProvider, negotiationType, hostnameOverride, pemBytes, clientKeyBytes, clientCertBytes`
Since I *can* talk to a peer clearly one of them is required.
Am I missing some configuration that I need to set these somewhere before this kicks off?
SatoshiNishishita (Fri, 12 Jul 2019 16:09:34 GMT):
Has joined the channel.
SatoshiNishishita (Fri, 12 Jul 2019 16:09:37 GMT):
Hi team, please share me fabric sdk sample code. for example, connect the fabcar chaincode.
SatoshiNishishita (Fri, 12 Jul 2019 16:09:37 GMT):
Hi team, please share me fabric sdk sample code. for example, connect the fabcar chaincode.
Thank you.
iramiller (Fri, 12 Jul 2019 16:25:26 GMT):
@aatkddny -- your experience sounds familiar to me. I rolled infrastructure scripts to manage all the cluster org/channel/chaincode management tasks instead of trying to use the Java (we are actually using Kotlin) SDK. I really recommend that you put components inside of the cluster that talk to HLF and expose services which can serve as proxies to the HLF interfaces that are designed to work well with your K8s load balancers and ingress. Essentially treat the HLF Java SDK like a 'resource' in your software architecture (similar to Postgres and the like). Oh and don't be afraid to fork things and modify for your needs. It really hasn't been too bad to maintain.
aatkddny (Fri, 12 Jul 2019 16:47:04 GMT):
@iramiller My next step forward is probably to dockerize my spring boot admin software and stick it into my cluster rather than having it run standalone. Which I wish I didn't have to do...
Hopefully that'll ameliorate *some* of my networking problems. The problem is that won't fix things when I need to join peers across multiple clusters. I really don't want to have to fork the SDK - keeping my own stuff working between fabric versions is enough of a chore.
It's a real shame that java is treated as a second class citizen when compared to node.
davidkel (Fri, 12 Jul 2019 17:11:17 GMT):
You could always raise a jira and of course I'm sure that contributions are always welcome
SatoshiNishishita (Fri, 12 Jul 2019 17:15:59 GMT):
Thank you. I constructed basic-network. And deployed fabcar chaincode.
SatoshiNishishita (Fri, 12 Jul 2019 17:15:59 GMT):
Thank you. I constructed basic-network. And deployed fabcar chaincode.
my hope is connecting this chaincode with fabric-java-sdk. But there is nothing simple sample client code.
Currently I made client code (below). Please give me an advice to complete this code.
CryptoSuite cryptoSuite = CryptoSuite.Factory.getCryptoSuite();
HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(cryptoSuite);
Peer peer = client.newPeer("peer", "grpc://localhost:7051");
EventHub eventHub = client.newEventHub("ebenthub", "grpc://localhost:7053");
Orderer orderer = client.newOrderer("orderer", "grpc://localhost:7050");
Channel channel = client.newChannel("mychannel");
channel.addPeer(peer);
channel.addEventHub(eventHub);
channel.addOrderer(orderer);
channel.initialize();
iramiller (Fri, 12 Jul 2019 17:33:22 GMT):
Contributions are certainly helpful ... but when you disagree with core architecture such as how peers/chaincode are handled such that you fork and replace that (but not fully covering existing use cases) I am not sure that any useful code is going to get contributed back from that.
iramiller (Fri, 12 Jul 2019 17:34:30 GMT):
Which is why I choose to contribute helpful info or at least provide some detail on my experience and solutions here in leu of code.
SatoshiNishishita (Fri, 12 Jul 2019 17:37:43 GMT):
Hi team, please share me fabric sdk sample code. for example, connect the fabcar chaincode.
Thank you.
SatoshiNishishita (Fri, 12 Jul 2019 17:38:21 GMT):
Thank you. I constructed basic-network. And deployed fabcar chaincode.
my hope is connecting this chaincode with fabric-java-sdk. But there is nothing simple sample client code.
Currently I made client code (below). Please give me an advice to complete this code.
CryptoSuite cryptoSuite = CryptoSuite.Factory.getCryptoSuite();
HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(cryptoSuite);
Peer peer = client.newPeer("peer", "grpc://localhost:7051");
EventHub eventHub = client.newEventHub("ebenthub", "grpc://localhost:7053");
Orderer orderer = client.newOrderer("orderer", "grpc://localhost:7050");
Channel channel = client.newChannel("mychannel");
channel.addPeer(peer);
channel.addEventHub(eventHub);
channel.addOrderer(orderer);
channel.initialize();
SatoshiNishishita (Fri, 12 Jul 2019 17:39:35 GMT):
Thank you. I constructed basic-network. And deployed fabcar chaincode.
my hope is connecting this chaincode with fabric-java-sdk. But there is nothing simple sample client code.
Currently I made client code (below). Please give me an advice to complete this code.
CryptoSuite cryptoSuite = CryptoSuite.Factory.getCryptoSuite();
HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(cryptoSuite);
Peer peer = client.newPeer("peer", "grpc://localhost:7051");
EventHub eventHub = client.newEventHub("ebenthub", "grpc://localhost:7053");
Orderer orderer = client.newOrderer("orderer", "grpc://localhost:7050");
Channel channel = client.newChannel("mychannel");
channel.addPeer(peer);
channel.addEventHub(eventHub);
channel.addOrderer(orderer);
channel.initialize();
aatkddny (Fri, 12 Jul 2019 18:27:51 GMT):
your hfclient needs a user context for sure - you need a peer admin iirc.
liurain (Mon, 15 Jul 2019 01:20:45 GMT):
Your understanding is correct, thank you very much for your help.
githubcpc (Mon, 15 Jul 2019 01:37:50 GMT):
Can I use Fabric-sdk-java to create a new channel?
githubcpc (Mon, 15 Jul 2019 02:48:03 GMT):
Just like node-sdk , https://fabric-sdk-node.github.io/tutorial-channel-create.html.
new ChannelConfig --> signChannelConfig --> updateChannel
liurain (Mon, 15 Jul 2019 09:05:45 GMT):
This is no problem.
liurain (Mon, 15 Jul 2019 09:15:21 GMT):
Hi everyone, I want to use the fabric-sdk-java to get the latest configuration block of the system channel. But I found that only one private method, Channel.getConfigurationBlock(), can get this block.
Can you give me a workable way?
sandy (Mon, 15 Jul 2019 11:30:48 GMT):
How to configure ChainCodeEndorsementPolicy using ChainCodeEndorsementPolicy.fromBytes method?
sandy (Mon, 15 Jul 2019 11:32:01 GMT):
I have configured using ChainCodeEndorsementPolicy.fromBytes("AND('Org1MSP.member','Org2MSP.member')") but it doesn't seems working..
sandy (Mon, 15 Jul 2019 11:32:12 GMT):
getting error like error unmarshaling to signature policy hyperledger
sandy (Mon, 15 Jul 2019 11:32:23 GMT):
Can someone assist me on this?
Jelle.Diet (Mon, 15 Jul 2019 11:39:52 GMT):
The method seems to expect a byte array not a string, so try converting your string to bytes: ChainCodeEndorsementPolicy.fromBytes("AND('Org1MSP.member','Org2MSP.member')".getBytes(StandardCharsets.UTF_8))
sandy (Mon, 15 Jul 2019 11:46:21 GMT):
Sorry... I already used haincodeEndorsementPolicy.fromBytes("AND('Org1MSP.member','Org2MSP.member')".getBytes())
sandy (Mon, 15 Jul 2019 11:46:36 GMT):
But it is throwing error unmarshaling to signature policy hyperledger
sandy (Mon, 15 Jul 2019 12:15:09 GMT):
I have configured using ChainCodeEndorsementPolicy.fromBytes("AND('Org1MSP.member','Org2MSP.member')",getBytes()) but it doesn't seems working.. It is throwing error " error unmarshaling to signature policy hyperledger" @Jelle.Diet @rickr . Can you please help?
Jelle.Diet (Mon, 15 Jul 2019 12:23:29 GMT):
I have noticed that that way of defining policy might be outdated, to get it work I had to use the version shown here https://fabric-sdk-node.github.io/release-1.4/tutorial-private-data.html
Relax20190715 (Mon, 15 Jul 2019 12:43:10 GMT):
Has joined the channel.
ihormudryy (Mon, 15 Jul 2019 12:50:01 GMT):
Has joined the channel.
liurain (Tue, 16 Jul 2019 01:04:46 GMT):
You can refer to the example in the test case.`src/test/fixture/sample_chaincode_endorsement_policies/testCCEPPolicy.yaml`
darapich92 (Tue, 16 Jul 2019 06:02:38 GMT):
hi all, i have a question related to the verification of the signature of CA. for instance, org1 issued a certificate for Client 1 and how can another org is org2 can verify client1's certificate? could you guide me to the source code that i can learn?
sandy (Tue, 16 Jul 2019 12:16:21 GMT):
Hi.. As both the orgs are in the same channel , the root certifcates of the CA of both the orgs are present in the genesis block of the channel. Using the root CA certificate,Org2 can verify Org1's client certificate...
githubcpc (Wed, 17 Jul 2019 09:53:10 GMT):
Can I use Fabric-sdk-java to create a new channel with org1.peer and org2.peer? I hava already create a new channel with single org successfully.But I can't create with two orgs.
tballast (Wed, 17 Jul 2019 11:24:54 GMT):
When using the Java SDK, I wish to instantiate chaincode on a channel, and I have an endorsement policy that requires that it is endorsed by both Org1 and Org2.
I am running my client from the context of Org1, which will not know about the private keys of Org2. I set up my channel and attach the Org 1 peers as well as an Org2 peer, however it always fails the endorsement stage. In the logs of the docker containers I see the following:
```
2019-07-17 10:36:35.868 UTC [cauthdsl] func1 -> DEBU b8de 0xc0024b0660 gate 1563359795868828340 evaluation starts
2019-07-17 10:36:35.868 UTC [cauthdsl] func2 -> DEBU b8df 0xc0024b0660 signed by 0 principal evaluation starts (used [false])
2019-07-17 10:36:35.869 UTC [cauthdsl] func2 -> DEBU b8e0 0xc0024b0660 processing identity 0 with bytes of aa4b30
2019-07-17 10:36:35.869 UTC [cauthdsl] func2 -> DEBU b8e1 0xc0024b0660 identity 0 does not satisfy principal: This identity is not an admin
2019-07-17 10:36:35.869 UTC [cauthdsl] func2 -> DEBU b8e2 0xc0024b0660 principal evaluation fails
2019-07-17 10:36:35.869 UTC [cauthdsl] func2 -> DEBU b8e3 0xc0024b0660 signed by 1 principal evaluation starts (used [false])
2019-07-17 10:36:35.869 UTC [cauthdsl] func2 -> DEBU b8e4 0xc0024b0660 processing identity 0 with bytes of aa4b30
2019-07-17 10:36:35.869 UTC [cauthdsl] func2 -> DEBU b8e5 0xc0024b0660 identity 0 does not satisfy principal: the identity is a member of a different MSP (expected Org2MSP, got Org1MSP)
2019-07-17 10:36:35.869 UTC [cauthdsl] func2 -> DEBU b8e6 0xc0024b0660 principal evaluation fails
2019-07-17 10:36:35.869 UTC [cauthdsl] func1 -> DEBU b8e7 0xc0024b0660 gate 1563359795868828340 evaluation fails
...
2019-07-17 10:36:35.870 UTC [endorser] ProcessProposal -> ERRO b8ef [www.reportix.com][6cd4345c] simulateProposal() resulted in chaincode name:"lscc" response status 500 for txid: 6cd4345c7ecb09121adaa1e1d345eddb633397972c4e20b19c393ed9fa3649c4
```
How can I submit transactions as Org1, when endorsement is required by _both_ Org1 and Org2, without knowing the information from Org2? Am I missing something?
tballast (Wed, 17 Jul 2019 15:31:49 GMT):
I wish to upgrade chaincode via a Java client. I am using Java chaincode.
I am _also_ upgrading via the cli. If I install the java chaincode on peer0, I need to specify a path so it installs correctly. When I install the chaincode on peer1 with the client, it forces me to make the path null.
Then, when I try to use the client to construct and UpgradeProposal, it complains that the two chaincodes are inconsistent. How is it possible to do this?
dan13 (Wed, 17 Jul 2019 17:18:45 GMT):
slow
yeousunn (Thu, 18 Jul 2019 01:51:19 GMT):
Hi all, I am using discovery to find out number of nodes on the fabric network, my configuration looks like this
```
channels:
mychannel:
orderers:
- orderer.example.com
peers:
peer0.org1.example.com:
endorsingPeer: true
chaincodeQuery: true
ledgerQuery: true
eventSource: true
discover: true
```
```
peers:
peer0.org1.example.com:
url: grpcs://192.168.14.245:7051
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
grpc.http2.keepalive_time: 15
hostnameOverride: peer0.org1.example.com
tlsCACerts:
path: /home/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
```
It returnes 5 peer node when I call `getPeers()` function
```
Collection
yeousunn (Thu, 18 Jul 2019 01:51:19 GMT):
Hi all, I am using discovery to find out number of nodes on the fabric network, my configuration looks like this
```
channels:
mychannel:
orderers:
- orderer.example.com
peers:
peer0.org1.example.com:
endorsingPeer: true
chaincodeQuery: true
ledgerQuery: true
eventSource: true
discover: true
```
```
peers:
peer0.org1.example.com:
url: grpcs://192.168.14.245:7051
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
grpc.http2.keepalive_time: 15
hostnameOverride: peer0.org1.example.com
tlsCACerts:
path: /home/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
```
It returns 5 peer node when I call `getPeers()` function
```
Collection
yeousunn (Thu, 18 Jul 2019 01:51:19 GMT):
Hi all, I am using discovery to find out number of nodes on the fabric network, my configuration looks like this
```
channels:
mychannel:
orderers:
- orderer.example.com
peers:
peer0.org1.example.com:
endorsingPeer: true
chaincodeQuery: true
ledgerQuery: true
eventSource: true
discover: true
```
```
peers:
peer0.org1.example.com:
url: grpcs://192.168.14.245:7051
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
grpc.http2.keepalive_time: 15
hostnameOverride: peer0.org1.example.com
tlsCACerts:
path: /home/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
```
It returns 5 peer node instead of 4 when I call `getPeers()` function
```
Collection
chill37 (Thu, 18 Jul 2019 04:25:21 GMT):
Hi. is there any steps I'm missing in contributing this?
Just trying to get into habit of contributing so trying out a simple typo first. Not sure if this is how I should be doing it.
could anyone check it for me? It's FABJ-454
https://jira.hyperledger.org/projects/FABJ/issues/FABJ-454?filter=allopenissues
yeousunn (Thu, 18 Jul 2019 07:01:00 GMT):
Ok, I solved it by editing /etc/hosts file and adding an entry for peer
```
192.168.14.245 peer0.org1.example.com
```
davidkel (Thu, 18 Jul 2019 07:38:18 GMT):
It might be worth raising a JIRA as well about this to see if it's possible to handle better.
yeousunn (Thu, 18 Jul 2019 07:43:50 GMT):
alright, will submit to jira.
bestbeforetoday (Thu, 18 Jul 2019 08:33:56 GMT):
That looks fine as a Jira. To contribute a fix you will need to clone the Git repository and push changes back to Gerrit for review. There is some useful information in the project README.md displayed at https://github.com/hyperledger/fabric-sdk-java, and the Gerrit repository is at https://gerrit.hyperledger.org/r/admin/repos/fabric-sdk-java
bestbeforetoday (Thu, 18 Jul 2019 08:46:14 GMT):
I see you're two steps ahead of me and have already raised two (identical) CRs in Gerrit! I have merged one and -2'd the duplicate
chill37 (Thu, 18 Jul 2019 08:47:55 GMT):
@bestbeforetoday i wasnt too sure about the process. Thanks! I will abondon the other commit.
SatheeshNehru (Thu, 18 Jul 2019 13:20:21 GMT):
in fabcar example data is stored as document in couchdb
whereas in mycc[chaincode_example02] data is stored as attachment in couchdb
when does it store as document ?and when as attachment?
dan13 (Thu, 18 Jul 2019 18:53:40 GMT):
HLF 1.4.1 - running locally (ubuntu-based pc) we are seeing very slow (>>60s) times to submit a transaction proposal using idemix credentials (<1s with normal x509) -- has anyone else experienced this? Using -Djava.security.egd=file:/dev/./urandom to reduce the SecureRandom time did not make any difference. Thx!
yeousunn (Fri, 19 Jul 2019 00:47:10 GMT):
https://jira.hyperledger.org/browse/FABJ-460
yeousunn (Fri, 19 Jul 2019 07:21:35 GMT):
Hi, I have a few channels and different number of peers joined to those channels, I am querying channel and retrieving all the peers that are joined to the channel. I can get all the peers if I have that channel configuration in yaml file. But what if I don't have configuration for the channels? Right now I get null for channel that has no configuration in yaml. Is there a way to do this without adding configuration for all channels?
yeousunn (Fri, 19 Jul 2019 08:53:36 GMT):
When I am querying peers with out discovery I am getting the following result
> FabricPeer(name=peer1.org1.example.com, url=grpcs://192.168.14.245:8051, protocol=grpcs, properties={pemFile=/home/thgy/work/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/server.crt, ssl-target-name-override=peer1.org1.example.com, grpc.http2.keepalive_time=15, hostnameOverride=peer1.org1.example.com})
But when I enable discovery I get
> FabricPeer(name=peer0.org2.example.com:9051, url=grpcs://peer0.org2.example.com:9051, protocol=grpcs, properties={pemBytes=[B@635fe6c2})
In place of pemFile I am getting pemBytes when discovery is enabled. I need pemFile information.
yeousunn (Fri, 19 Jul 2019 08:53:36 GMT):
When I am querying peers with out discovery I am getting the following result
> FabricPeer(name=peer1.org1.example.com, url=grpcs://192.168.14.245:8051, protocol=grpcs, properties={pemFile=/home/work/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/server.crt, ssl-target-name-override=peer1.org1.example.com, grpc.http2.keepalive_time=15, hostnameOverride=peer1.org1.example.com})
But when I enable discovery I get
> FabricPeer(name=peer0.org2.example.com:9051, url=grpcs://peer0.org2.example.com:9051, protocol=grpcs, properties={pemBytes=[B@635fe6c2})
In place of pemFile I am getting pemBytes when discovery is enabled. I need pemFile information.
asaningmaxchain123 (Fri, 19 Jul 2019 15:36:50 GMT):
Has left the channel.
dan13 (Fri, 19 Jul 2019 15:47:47 GMT):
If you convert the byte array to string, what do you get?
yeousunn (Mon, 22 Jul 2019 02:11:37 GMT):
String value: {pemBytes=[B@6e1fe857}
dan13 (Mon, 22 Jul 2019 02:13:56 GMT):
that's just the byte array toString, which is from Object -- try String s = new String(bytes)
yeousunn (Mon, 22 Jul 2019 02:33:51 GMT):
That is "Properties" object.
yeousunn (Mon, 22 Jul 2019 02:35:14 GMT):
Clipboard - July 22, 2019 10:34 AM
yeousunn (Mon, 22 Jul 2019 02:37:46 GMT):
It's like this, When I have `discover: true` I get correct information for the anchor peer. but for other peers. the Properties field is Json value with some bytes.
yeousunn (Mon, 22 Jul 2019 02:47:21 GMT):
I think this as to do with config file. anchor peer information is taken from config file where as other peers are discovered.
yeousunn (Mon, 22 Jul 2019 02:47:21 GMT):
I think this has to do with config file. anchor peer information is taken from config file where as other peers are discovered.
yeousunn (Mon, 22 Jul 2019 03:01:36 GMT):
and this code` String p = peer.getProperties().getProperty("pemBytes");` returns `null`
yeousunn (Mon, 22 Jul 2019 05:34:49 GMT):
Is there a way to make Peer object using the names returned by `OrgInfo.getPeerNames();`?
tballast (Mon, 22 Jul 2019 11:23:40 GMT):
In the End2EndIT example there are 3 users defines. The Admin, the User, and the PeerAdmin.
What is the difference between Admin and PeerAdmin?
tballast (Mon, 22 Jul 2019 11:23:40 GMT):
In the End2EndIT example there are 3 users defined. The Admin, the User, and the PeerAdmin.
What is the difference between Admin and PeerAdmin?
Antimttr (Mon, 22 Jul 2019 14:37:23 GMT):
i beleive admin is the admin cert for the ca, where as peeradmin is the actual admin account on the channel
Antimttr (Mon, 22 Jul 2019 14:38:12 GMT):
so one is for enrolling users, the other is for signing endorsements for channel config changes and the like
tballast (Mon, 22 Jul 2019 15:00:13 GMT):
Ahh ok I see, thank you. From what I've seen that makes sense.
darapich92 (Wed, 24 Jul 2019 09:42:32 GMT):
hi all, i have a question related to register a user in Java sdk. i called ca0 to register a user by setting the affiliation "Org1.department". i failed in registration and i saw the error message in the cmd is "Failed getting affiliation 'org1.department': Failed to get affiliation: sql: no rows in result set". Could you tell me where is the sql where stored the affiliations?
yuriiuhlanov (Wed, 24 Jul 2019 16:04:21 GMT):
please refer to the documentation https://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html#registering-a-new-identity. The first thing that comes to my mind is your registrar has different affiliation than that you are setting at the new client
mahoney1 (Thu, 25 Jul 2019 14:36:11 GMT):
reminder that the Fabric Developer Community call today is at 4pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
tballast (Fri, 26 Jul 2019 07:50:59 GMT):
Is the primary purpose of the NetworkConfig class to run a non-administrative client?
I am trying to use it, however if you want to actually stand a network up (Ie. create a channel from scratch, join peers to it, etc) then it seems that this not ideal. Anyone have experience with it?
tballast (Fri, 26 Jul 2019 08:53:06 GMT):
Or rather, not necessarily non-administrative, but at the very least it seems like one is unable to create a channel from scratch with the network config alone.
mahoney1 (Fri, 26 Jul 2019 10:14:18 GMT):
@tballast you would be using the Client to create channels, nodes, join peers etc from scratch ->https://sdkjavadocs.github.io/org/hyperledger/fabric/sdk/HFClient.html whereas NetworkConfig https://sdkjavadocs.github.io/org/hyperledger/fabric/sdk/NetworkConfig.html holds details of network and channel configurations of the running network, typically loaded from an external config file (eg. json, yaml etc).
tballast (Fri, 26 Jul 2019 10:20:16 GMT):
@mahoney1 I see. Yea, that makes sense, I was just wondering because even if you're using the NetworkConfig, you still need to have a client to interact with the network. However, if you want to do something like create it from scratch you need to join the peers to it, and create an orderer, but you can't pull all of this information from the NetworkConfig, just really basic stuff like names and properties (no locations or Peer Roles, etc.)
So in that case, the actual _initialization_ (construct channel, install/instantiate chaincode) of the network is fairly separate from the _interaction_ (invoke, query, etc). I thought that perhaps the yaml file could be used as a properties file for building the network from scratch, but it doesn't look like it.
Bentipe (Fri, 26 Jul 2019 10:29:23 GMT):
Has joined the channel.
dan13 (Fri, 26 Jul 2019 15:55:57 GMT):
If you look at the IBM Blockchain Platform (IBP) 2.0, you build everything (other than the k8s cluster) through a "blockchain console" web app. I think scripting (like byfn.sh) makes more sense for blockchain-based apps rather than blockchain-as-a-service providers (IBP) but strictly my opinion. Either way you start with some description of your desired network -- and the only requirement is that it has all the info necessary to be successful -- and use some means to instantiate it.
cody588 (Tue, 30 Jul 2019 07:12:21 GMT):
Has joined the channel.
Vishal3152 (Tue, 30 Jul 2019 11:06:45 GMT):
The affiliation - org1.department doe snot exist.
Vishal3152 (Tue, 30 Jul 2019 11:07:22 GMT):
You can view or add affiliation for signing using fabric-ca-client affiliation command
sandy (Tue, 30 Jul 2019 14:30:19 GMT):
hi.. Am using putState(Key,JSON) to store document in couchdb.. Is there anyway to store unique uuid inside a document as a field?
sandy (Tue, 30 Jul 2019 14:32:05 GMT):
am trying to use uuid as a PK for the document.. Any idea?
Kupiku_2k (Thu, 01 Aug 2019 11:48:07 GMT):
Has joined the channel.
Kupiku_2k (Thu, 01 Aug 2019 11:49:17 GMT):
Hi guys, I have a problem calling to a chaincode with fabric-java-sdk
I have a network with 2 peer, 3 orderer (raft), a fabric-ca and a fabricTLS-ca
Here in my channel initialization code:
Properties properties = new Properties();
properties.put("pemBytes", configuration.getCertBytes());
properties.put("negotiationType", "TLS");
properties.put("sslProvider", "openSSL");
// initialize channel
Channel channel = client.newChannel(channelName);
// peers name and endpoint
for (HyperLedgerFabricComponent peer : configuration.getPeers()) {
channel.addPeer((client.newPeer(peer.getName(), peer.getUrl(), properties)));
}
// orderer name and endpoint
for (HyperLedgerFabricComponent orderer : configuration.getOrderers()) {
channel.addOrderer(client.newOrderer(orderer.getName(), orderer.getUrl(), properties));
}
channel.registerBlockListener(blockEventListener);
return channel.initialize();
When I run I get this error
"2019-08-01 13:07:13,436 [WARN http-nio-8084-exec-1] [org.hyperledger.fabric.sdk.Channel:initialize:1268] Channel testchannel could not load peer CA certificates from any peers.
""2019-08-01 13:07:14,521 [INFO http-nio-8084-exec-1] [org.hyperledger.fabric.sdk.Channel:initialize:1309] Channel Channel{id: 1, name: testchannel} eventThread started shutdown: false thread: null
""2019-08-01 13:08:32,720 [ERROR http-nio-8084-exec-1] [org.hyperledger.fabric.sdk.Channel:sendProposalToPeers:4469] Channel Channel{id: 1, name: testchannel} Sending proposal with transaction: ea56bbc2800b99dd642c52cbb29329e1e6049f2f1cda32c06cedcf1f8a8bd222 to Peer{ id: 2, name: peer0.test.es, channelName: testchannel, url: grpcs://172.33.13.79:7051} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
at io.netty.handler.ssl.ReferenceCountedOpenSslContext$AbstractCertificateVerifier.verify(ReferenceCountedOpenSslContext.java:629)
......
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:397)
... 27 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
... 34 more
}
I an using tls-cert.pem of the fabricTLS-ca. Is that correct? Any ideas?
Thank you
Kupiku_2k (Thu, 01 Aug 2019 11:49:17 GMT):
Hi guys, I have a problem calling to a chaincode with fabric-java-sdk
I have a network with 2 peer, 3 orderer (raft), a fabric-ca and a fabricTLS-ca
Here in my channel initialization code:
Properties properties = new Properties();
properties.put("pemBytes", configuration.getCertBytes());
properties.put("negotiationType", "TLS");
properties.put("sslProvider", "openSSL");
// initialize channel
Channel channel = client.newChannel(channelName);
// peers name and endpoint
for (HyperLedgerFabricComponent peer : configuration.getPeers()) {
channel.addPeer((client.newPeer(peer.getName(), peer.getUrl(), properties)));
}
// orderer name and endpoint
for (HyperLedgerFabricComponent orderer : configuration.getOrderers()) {
channel.addOrderer(client.newOrderer(orderer.getName(), orderer.getUrl(), properties));
}
channel.registerBlockListener(blockEventListener);
return channel.initialize();
When I run I get this error
"2019-08-01 13:07:13,436 [WARN http-nio-8084-exec-1] [org.hyperledger.fabric.sdk.Channel:initialize:1268] Channel testchannel could not load peer CA certificates from any peers.
""2019-08-01 13:07:14,521 [INFO http-nio-8084-exec-1] [org.hyperledger.fabric.sdk.Channel:initialize:1309] Channel Channel{id: 1, name: testchannel} eventThread started shutdown: false thread: null
""2019-08-01 13:08:32,720 [ERROR http-nio-8084-exec-1] [org.hyperledger.fabric.sdk.Channel:sendProposalToPeers:4469] Channel Channel{id: 1, name: testchannel} Sending proposal with transaction: ea56bbc2800b99dd642c52cbb29329e1e6049f2f1cda32c06cedcf1f8a8bd222 to Peer{ id: 2, name: peer0.test.es, channelName: testchannel, url: grpcs://172.33.13.79:7051} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
at io.netty.handler.ssl.ReferenceCountedOpenSslContext$AbstractCertificateVerifier.verify(ReferenceCountedOpenSslContext.java:629)
......
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:397)
... 27 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
... 34 more
}
I an using tls-cert.pem of the fabricTLS-ca. Is that correct? Any ideas?
PD: channel exsits, a chaincode is instantiated there and I can invoke successfully the chaincode inside a peer (using TLS)
Thank you
Kupiku_2k (Thu, 01 Aug 2019 11:49:17 GMT):
Hi guys, I have a problem calling to a chaincode with fabric-java-sdk
I have a network with 2 peer, 3 orderer (raft), a fabric-ca and a fabricTLS-ca
Here in my channel initialization code:
Properties properties = new Properties();
properties.put("pemBytes", configuration.getCertBytes());
properties.put("negotiationType", "TLS");
properties.put("sslProvider", "openSSL");
// initialize channel
Channel channel = client.newChannel(channelName);
// peers name and endpoint
for (HyperLedgerFabricComponent peer : configuration.getPeers()) {
channel.addPeer((client.newPeer(peer.getName(), peer.getUrl(), properties)));
}
// orderer name and endpoint
for (HyperLedgerFabricComponent orderer : configuration.getOrderers()) {
channel.addOrderer(client.newOrderer(orderer.getName(), orderer.getUrl(), properties));
}
channel.registerBlockListener(blockEventListener);
return channel.initialize();
When I run I get this error
"2019-08-01 13:07:13,436 [WARN http-nio-8084-exec-1] [org.hyperledger.fabric.sdk.Channel:initialize:1268] Channel testchannel could not load peer CA certificates from any peers.
""2019-08-01 13:07:14,521 [INFO http-nio-8084-exec-1] [org.hyperledger.fabric.sdk.Channel:initialize:1309] Channel Channel{id: 1, name: testchannel} eventThread started shutdown: false thread: null
""2019-08-01 13:08:32,720 [ERROR http-nio-8084-exec-1] [org.hyperledger.fabric.sdk.Channel:sendProposalToPeers:4469] Channel Channel{id: 1, name: testchannel} Sending proposal with transaction: ea56bbc2800b99dd642c52cbb29329e1e6049f2f1cda32c06cedcf1f8a8bd222 to Peer{ id: 2, name: peer0.test.es, channelName: testchannel, url: grpcs://172.33.13.79:7051} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
at io.netty.handler.ssl.ReferenceCountedOpenSslContext$AbstractCertificateVerifier.verify(ReferenceCountedOpenSslContext.java:629)
......
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:397)
... 27 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
... 34 more
}
I an using tls-cert.pem of the fabricTLS-ca. Is that correct? Any ideas?
PD: channel exists, a chaincode is instantiated there and I can invoke successfully the chaincode inside a peer (using TLS)
Thank you
bestbeforetoday (Thu, 01 Aug 2019 15:26:47 GMT):
A beta/early release of the Contracts programming model for developing Java chaincode was mentioned over in the #fabric-chaincode-dev channel. There is also an accompanying Gateway programming model for the client SDK.
A blog post with lots of description and code snippets is at http://proterra.me.uk/nx01/programming/2019/07/31/201/
Direct link to the client SDK: https://github.com/hyperledger/fabric-gateway-java
bestbeforetoday (Thu, 01 Aug 2019 15:27:34 GMT):
Feedback is welcome
jyellick (Thu, 01 Aug 2019 18:25:16 GMT):
@bestbeforetoday It seems like the Java SDK CI may be broken? https://gerrit.hyperledger.org/r/c/fabric-sdk-java/+/32638 the error I'm seeing here doesn't seem like it could be related to my change
bestbeforetoday (Thu, 01 Aug 2019 18:31:37 GMT):
The protobuf definitions got changed, which has broken the SDK build. I hope to have a fix in soon. https://gerrit.hyperledger.org/r/c/fabric-sdk-java/+/32611
jyellick (Thu, 01 Aug 2019 18:33:19 GMT):
Should I be good to rebase on that, or would you recommend I hold off?
bestbeforetoday (Thu, 01 Aug 2019 18:34:54 GMT):
I keep spotting little niggles, like missing license headers. If this build passes then I think I'll try to get this patch set in regardless so the build is passing again
huxd (Fri, 02 Aug 2019 01:29:48 GMT):
Has joined the channel.
lotty02cho (Fri, 02 Aug 2019 08:15:02 GMT):
I try to run End2endIT using IntelliJ but when I start, Run 'End2endIT.java', the error comes out like below,
```
RUNNING: End2endIT.
***** Enrolling Users *****
2019-08-02 07:54:52,362 main INFO HFCAClient:594 - CA Name: ca0, Version: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNRekNDQWVxZ0F3SUJBZ0lSQU0vdmFEdlBzeUlpQzlodm41bm5SOEF3Q2dZSUtvWkl6ajBFQXdJd2N6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpFdVpYaGhiWEJzWlM1amIyMHhIREFhQmdOVkJBTVRFMk5oCkxtOXlaekV1WlhoaGJYQnNaUzVqYjIwd0hoY05NVGd3TWpJMU1USTBNekk1V2hjTk1qZ3dNakl6TVRJME16STUKV2pCek1Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTgpVMkZ1SUVaeVlXNWphWE5qYnpFWk1CY0dBMVVFQ2hNUWIzSm5NUzVsZUdGdGNHeGxMbU52YlRFY01Cb0dBMVVFCkF4TVRZMkV1YjNKbk1TNWxlR0Z0Y0d4bExtTnZiVEJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUEKQkxxSTlkWDdkOU5HbzNndUw1RlA4b3RHc2lCak43QnpkNmRHL0NheUpEZmpOUkczNFlPOHQyOTl1NkVvRlh2egpwY2pBTUd1MFVLVHJ6TWZjeU91emNNeWpYekJkTUE0R0ExVWREd0VCL3dRRUF3SUJwakFQQmdOVkhTVUVDREFHCkJnUlZIU1VBTUE4R0ExVWRFd0VCL3dRRk1BTUJBZjh3S1FZRFZSME9CQ0lFSUxITU5NUHkwTStBZUdqNk9ob1IKaDAwZ1FUQ0VYOWp1czIwdVdVVFhkbmNjTUFvR0NDcUdTTTQ5QkFNQ0EwY0FNRVFDSUY3V2wzQTExekVOcjFDbwpxR3l1M2g0ZkN1a2t0RlZ5Ry9XUEpVeWxWWGpJQWlCOUxqcFhtOUVSZ0pNZlpzakRJekNqOU00YVF1Vk45WExrClhueDB1b0t6N2c9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==, issuerPublicKey: CgJPVQoEUm9sZQoMRW5yb2xsbWVudElEChBSZXZvY2F0aW9uSGFuZGxlEkQKIDwI9XgGar29lWsgJQ5P++7nzIIlwWWGLEJ51ykde2A1EiCqCseWTnj4fux5l9ozepRqBhlZDfRZQFOKy755TIRikhpECiBvNt5Wcruon1yTI2OEtyActT1S0GLFcfCWXRMFykliiBIgL2P8/HJvbEI5pLb0LgoTUA1JDYYS+/MKC5irpY6t25wiRAogCAVRXVLX9SAwPD64Io0XEBFzpU0AOLnlUO84CJEN/XMSINGlHg7UFotyrB8gssFv3O56azHl+2X+k0nC2fS4IJY7IkQKILXIuSKsaLPOEnzyALvLpiW5rwRrAZZGHtkGx4CDUyY3EiDTMRCTEROrAXB/ZINA+RP3FzeUgnDLxLOes+OubkOQIyJECiA0wS8aoljJ6XkaAm6viC3+OY1WhN+zlEgfckCrIeFzixIgOKoxJtgZrFma+LPjLye6/RYlejeNegmSePueBMhOctYiRAogP3UpF6MJUiwgP1WAEdcEUmA1qBzM/pnh/P4DvTClVNsSII0ME/JUvx2G/KanqXhHSdiOPO8JMvl/oT9j86NE5acMKogBCiAkGHyPPIpfZ62j37rU+vuyhyVn3GTzHxzfENb4L81d9hIg4lovQafbr+EQ8oOgJNQYJTNoxrwt03gX0KoS351tA9AaIAprAFVW8Rj/oz5qv8EgezttuHVW6CeYxhClVaUXgkv8IiCB5IQt3kHBcfaLZ0G6T07NcgX0yEcLq/SCjjIzC+OMITJECiBjX+SptFK5yiKrp6p2unJEQzicZrOl7pcjQaYCRscHxBIgNa9BFzQiJmywsmJlMcjSexW66XrrJZzTGZIGjeuiobU6RAogiyMMfc2QIHR94xmd+qIfFFeu8C0G3x/as3asLSH63YcSIEPbCHzdb/sMxS5h42sPx+bhLbJ0UzYMapdOKilxyluFQiC+JXB0Nrg+JUDkXOO30VuNa1OWTaY+uui66lvI59+s/EogS5zQNR8QLbjptQUWittI672tran5xUvtidx7QeTSjQVSIHRZz7ANrFN/racCNVLnIrCqzxKU+QGje3+AuKvFasmy, issuerRevocationPublicKey: LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUhZd0VBWUhLb1pJemowQ0FRWUZLNEVFQUNJRFlnQUU3d0JoWklYNkFHNE9ZTDRlNmlYMVJRZlNkL1VkL2pNdApjS3JZZjZzM0cyZm9QSU5PYXFyeFg4WFIrcGJDRm5ObjFla0JnaE4wZ0RKMnlOeUQ2M3lhM2l4d05jblVLbEZlCml5NlRhRHo3enBOMWVQSmxXeWhjSFJSQk1la2VMQVRvCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=
2019-08-02 07:54:52,381 main INFO SampleStore:91 - Could not find the file "/tmp/HFCSampletest.properties"
....
org.hyperledger.fabric_ca.sdk.exception.RegistrationException: Error while registering the user org.hyperledger.fabric.sdkintegration.SampleUser@3d285d7e url: http://localhost:7054 POST request to http://localhost:7054 failed request body {"id":"user1","type":"client","affiliation":"org1.department1","attrs":[]}. Response: {"result":"","errors":[{"code":0,"message":"Registration of 'user1' failed: Identity 'user1' is already registered"}
],"messages":[],"success":false}
....
Caused by: org.hyperledger.fabric_ca.sdk.exception.HTTPException: POST request to http://localhost:7054 failed request body {"id":"user1","type":"client","affiliation":"org1.department1","attrs":[]}. Response: {"result":"","errors":[{"code":0,"message":"Registration of 'user1' failed: Identity 'user1' is already registered"}
],"messages":[],"success":false}
```
Does anyone know about how to solve this issue?
lotty02cho (Fri, 02 Aug 2019 08:15:02 GMT):
I try to run End2endIT using IntelliJ but when I start, Run 'End2endIT.java', the error comes out like below,
```
RUNNING: End2endIT.
***** Enrolling Users *****
2019-08-02 07:54:52,362 main INFO HFCAClient:594 - CA Name: ca0, Version: LS0tLS1CRUdJTiBDRVJUSUZJ....
2019-08-02 07:54:52,381 main INFO SampleStore:91 - Could not find the file "/tmp/HFCSampletest.properties"
2019-08-02 07:54:52,405 main INFO SampleStore:91 - Could not find the file "/tmp/HFCSampletest.properties"
2019-08-02 07:54:53,533 main INFO HFCAClient:594 - CA Name: ca0, Version: LS0tLS1CRUdJTiBDRVJUSU.....
2019-08-02 07:54:53,535 main INFO HFCAClient:1542 - CA Version: 1.4.2
2019-08-02 07:54:53,592 main ERROR HFCAClient:1458 - POST request to http://localhost:7054 failed request body {"id":"user1","type":"client","affiliation":"org1.department1","attrs":[]}. Response: {"result":"","errors":[{"code":0,"message":"Registration of 'user1' failed: Identity 'user1' is already registered"}
],"messages":[],"success":false}
2019-08-02 07:54:53,593 main ERROR HFCAClient:405 - org.hyperledger.fabric.sdkintegration.SampleUser@3d285d7e
....
org.hyperledger.fabric_ca.sdk.exception.RegistrationException: Error while registering the user org.hyperledger.fabric.sdkintegration.SampleUser@3d285d7e url: http://localhost:7054 POST request to http://localhost:7054 failed request body {"id":"user1","type":"client","affiliation":"org1.department1","attrs":[]}. Response: {"result":"","errors":[{"code":0,"message":"Registration of 'user1' failed: Identity 'user1' is already registered"}
],"messages":[],"success":false}
....
Caused by: org.hyperledger.fabric_ca.sdk.exception.HTTPException: POST request to http://localhost:7054 failed request body {"id":"user1","type":"client","affiliation":"org1.department1","attrs":[]}. Response: {"result":"","errors":[{"code":0,"message":"Registration of 'user1' failed: Identity 'user1' is already registered"}
],"messages":[],"success":false}
```
Does anyone know about how to solve this issue?
tballast (Fri, 02 Aug 2019 08:33:11 GMT):
you're trying to run the example twice in a row is my guess. If you tear down the network and do it again you probably won't see this error. On the first run through it registers `user1`, and on the second run it's trying to do the same, but it's already been done.
Rosan (Fri, 02 Aug 2019 08:53:58 GMT):
Has joined the channel.
tballast (Fri, 02 Aug 2019 11:18:21 GMT):
Has anyone written a java client that is used to construct a network from scratch (ie. create the channel from scratch, _join_ peers, instantiate chaincode, etc.) and if so, do you have a clean way of handling whether peers need to be added or joined?
aatkddny (Fri, 02 Aug 2019 13:06:29 GMT):
Yes. - I use separate records that tracks everything. Build the yaml files to instantiate the network and construct network config from them when its running too. There's a surprisingly small amount of information you need to store. In this case I have a list of peers in each channel record.
tballast (Fri, 02 Aug 2019 13:15:12 GMT):
Ahh ok so you dynamically create the network-config file? I've tried to use it but found it somewhat useless when trying to stand the network up because you cant pull the information you need from it (at least not with the NetworkConfig class).
So then if you construct the network on one PC, then can you just give those files to someone else to run from another one where they would only need to read it and then jsut add those peers?
aatkddny (Fri, 02 Aug 2019 13:21:15 GMT):
yes. i do it from scratch with what i have in the records.
tballast (Fri, 02 Aug 2019 14:06:09 GMT):
When you say "separate records" what do you mean? like, what I have now is essentially just a properties file that has the peer information and stuff, then I read this in and just join all the peers belonging to the organization. I don't have a yaml file for this. Are you using your own custom code to build the network config, or is this something provided by the SDK? Sorry for all the questions, I've spent a fair bit of time on this though, and I need a better way to handle it.
aatkddny (Fri, 02 Aug 2019 14:10:37 GMT):
Its all custom. I generate the yaml files to create the network and a set of network descriptor records (orgs, users) inside a nosql database.
i track ca enrollments there also - it gives me a place to stash the certs after i encrypt them.
when i create a channel i add a channel record and track the peers that have joined in there (actually it's orgs because I join all the peers at the same time when i create the channel, but the idea is the same).
when i go to use the network these records are then used to build the network config that allows me to do a channel.loadfromnetworkconfig to interact with the thing.
does that help?
tballast (Fri, 02 Aug 2019 14:18:27 GMT):
:ok_hand: Awesome. That sounds like a pretty great setup. So in this case, if there are no records, will you assume that you need to setup the network from scratch, or will that always be a step in which the user must be aware that they're constructing from scratch?
aatkddny (Fri, 02 Aug 2019 14:27:39 GMT):
there's a rest endpoint - you pass in a config file with the orgs and a few other pieces and it builds the yaml files and a bash script to start the network. you run scp in and run that on a server and you are gtg.
nitishbhardwaj19 (Sun, 04 Aug 2019 13:45:14 GMT):
Hi, Hope everyone is doing good. I am trying to install & instantiate chaincode using JAVA-SDK. It does works perfectly fine for Node and JAVA chaincode, but I am getting a strange error with GO chaincode. I am not sure if I am missing something. Would be great if anyone could help.```
`Failed to generate platform-specific docker build: Error returned from build: 1 "can't load package: package github.com/example_cc: no Go files in /chaincode/input/src/github.com/example_cc``
```
nitishbhardwaj19 (Sun, 04 Aug 2019 14:19:57 GMT):
NOTE: GO chaincode gets instantiated if I use `setChaincodeSourceLocation` option to install chaincode. But It fails if I use option `setChaincodeInputStream`
nitishbhardwaj19 (Sun, 04 Aug 2019 14:19:57 GMT):
NOTE: GO chaincode gets instantiated if I use `setChaincodeSourceLocation` option to install chaincode. But It fails if I use option `setChaincodeInputStream`(Though JAVA and Node chaincode works with option)
rescalona (Mon, 05 Aug 2019 01:49:04 GMT):
Has left the channel.
aatkddny (Tue, 06 Aug 2019 00:29:43 GMT):
This works fine for me. I'll provide you a sample for comparison if it'll help.
```
InstallProposalRequest ipr = client.newInstallProposalRequest();
ipr.setChaincodeID(ccid);
ipr.setChaincodeVersion(ccid.getVersion());
Path base = pathHelper.getChaincodeInstall(ccid);
Path src = Paths.get("src");
log.info("Chaincode will be installed from {}", base.toAbsolutePath().toString());
ipr.setChaincodeInputStream(packageCCTarGzInputStream(base, src));
```
and
```
private InputStream packageCCTarGzInputStream(Path src, Path goPathPrefix) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream(500000);
TarArchiveOutputStream aos = new TarArchiveOutputStream(new GzipCompressorOutputStream(new BufferedOutputStream(bos)));
aos.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
// First look to see if there's a META-INF directory
try (Stream
aatkddny (Tue, 06 Aug 2019 00:29:43 GMT):
This works fine for me. I'll provide you a sample for comparison if it'll help. I lifted some of it from the examples, so it'll look familiar if you've been through them.
```
InstallProposalRequest ipr = client.newInstallProposalRequest();
ipr.setChaincodeID(ccid);
ipr.setChaincodeVersion(ccid.getVersion());
Path base = pathHelper.getChaincodeInstall(ccid);
Path src = Paths.get("src");
log.info("Chaincode will be installed from {}", base.toAbsolutePath().toString());
ipr.setChaincodeInputStream(packageCCTarGzInputStream(base, src));
```
and
```
private InputStream packageCCTarGzInputStream(Path src, Path goPathPrefix) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream(500000);
TarArchiveOutputStream aos = new TarArchiveOutputStream(new GzipCompressorOutputStream(new BufferedOutputStream(bos)));
aos.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
// First look to see if there's a META-INF directory
try (Stream
aatkddny (Tue, 06 Aug 2019 00:32:30 GMT):
try adding a hostname override flag in the properties too.
aatkddny (Tue, 06 Aug 2019 00:34:30 GMT):
this is a cross post from the kubernetes list. has anyone got service discovery working with k8s and the java sdk?
i thought it was a security issue brought on by my move to raft, but it fails with a plain vanilla kafka (and no tls) setup too. different errors, but at the same point in time - trying to install/instantiate chaincode.
yeousunn (Wed, 07 Aug 2019 01:13:11 GMT):
Hello guys, I am using fabric-sdk-java to query the network and find the block details. when using `channel.queryBlockchainInfo();` I get block at height 37 and when using `channel.queryBlockByNumber(current);` The current block height is 36, for both the function returned block is the same with same block hash, but block height is different. Is it by design?
mahoney1 (Wed, 07 Aug 2019 17:26:14 GMT):
reminder that the Fabric Developer Community call tomorrow (Thu) is at 4pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here -> https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
yeousunn (Thu, 08 Aug 2019 03:05:54 GMT):
Hi Guys, I am trying to instantiate chaincode using this code `channel.sendInstantiationProposal(instantiateProposalRequest, channel.getPeers());`. The code executes without error and docker container is created for the chaincode. but when I check peer's for instantiated chaincode, it is not listed on peer. I have to manually run `peer chaincode instantiate` on peer to start using the chaincode. Is there anything else I need to do to get chaincode listed on peer using the java sdk?
mahoney1 (Thu, 08 Aug 2019 10:26:54 GMT):
There is an example in [E2E](https://github.com/hyperledger/fabric-sdk-java/blob/release-1.4/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L483) - I believe after you get sufficient responses from `sendInstantiationProposal` you would need to then `sendTransaction()` as shown (Instantiating a chaincode is a full transaction operation)
mahoney1 (Thu, 08 Aug 2019 10:26:54 GMT):
There is an example in [**E2E**](https://github.com/hyperledger/fabric-sdk-java/blob/release-1.4/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L483) in fabric-sdk-java - I believe after you get sufficient responses from `sendInstantiationProposal` you would need to then `sendTransaction()` as shown (Instantiating a chaincode is a full transaction operation)
mahoney1 (Thu, 08 Aug 2019 10:26:54 GMT):
There is an example in [E2E](https://github.com/hyperledger/fabric-sdk-java/blob/release-1.4/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L483) in fabric-sdk-java - I believe after you get sufficient responses from `sendInstantiationProposal` you would need to then `sendTransaction()` as shown (Instantiating a chaincode is a full transaction operation)
aatkddny (Thu, 08 Aug 2019 17:41:57 GMT):
suspect no-one has tried this, but it's worth trying before i go down the rabbit hole.
creating a channel dynamically with raft ordering using n from m of the raft-orderers I have in hand. I have it working with m from m, but the one of the plus points of raft as i understood it was that you can use a subset for efficiency.
is just adding the n orderers (and tracking them) to the channel when I create it sufficient or are there some other hoops to jump through?
aatkddny (Thu, 08 Aug 2019 17:41:57 GMT):
suspect no-one has tried this, but it's worth trying before i go down the rabbit hole.
creating a channel dynamically with raft ordering using n from m of the raft-orderers I have in hand. I have it working with m from m, but one of the plus points of raft as i understood it was that you can use a subset for efficiency.
is just adding the n orderers (and tracking them) to the channel when I create it sufficient or are there some other hoops to jump through?
aatkddny (Thu, 08 Aug 2019 17:41:57 GMT):
suspect no-one has tried this, but it's worth asking before i go down the rabbit hole.
creating a channel dynamically with raft ordering using n from m of the raft-orderers I have in hand. I have it working with m from m, but one of the plus points of raft as i understood it was that you can use a subset for efficiency.
is just adding the n orderers (and tracking them) to the channel when I create it sufficient or are there some other hoops to jump through?
aatkddny (Thu, 08 Aug 2019 17:41:57 GMT):
suspect no-one has tried this, but it's worth asking before i go down the rabbit hole.
creating a channel dynamically with raft ordering using n from m of the raft-orderers I have in hand. I have it working with m from m, but one of the plus points of raft as i understood it was that you can use a subset for efficiency.
is just adding the n orderers (and tracking them) to the channel when I create it sufficient or are there some other hoops to jump through? The channel definition appears only to reference the original consortium - which lists all of the orderers. i'm hoping that doesn't mean i have to partition the consortiums too.
yacovm (Thu, 08 Aug 2019 21:07:59 GMT):
@aatkddny we tried it ;)
yacovm (Thu, 08 Aug 2019 21:08:56 GMT):
it is possible to create `m out of n`, or `n out of n` , but i think that creating `n out of n` and then removing them gradually is easier. To make the `m out of n` you need to pass in a special flag in the CLI
yacovm (Thu, 08 Aug 2019 21:11:14 GMT):
It is possible
yeousunn (Fri, 09 Aug 2019 00:38:57 GMT):
Thank you for the reply. I will check it out. :relaxed:
yeousunn (Fri, 09 Aug 2019 01:02:27 GMT):
it worked, thanks :ok_hand: :v:
yeousunn (Fri, 09 Aug 2019 03:00:12 GMT):
Is there a way to get all the function names written in a chaincode?
heenas06 (Fri, 09 Aug 2019 08:38:25 GMT):
Has joined the channel.
heenas06 (Fri, 09 Aug 2019 08:41:37 GMT):
Hi can this setup aviabe on git?
yeousunn (Fri, 09 Aug 2019 08:51:18 GMT):
Hi @heenas06 , which code are you referring to?
heenas06 (Fri, 09 Aug 2019 08:55:41 GMT):
Hi I am trying to setup multi-channel using raft
heenas06 (Fri, 09 Aug 2019 08:57:35 GMT):
i did raft ordering services using balance transfer-sample now i want to add new channel & new org in that ......
yeousunn (Fri, 09 Aug 2019 09:00:19 GMT):
are you trying with java-sdk?
yeousunn (Fri, 09 Aug 2019 09:02:54 GMT):
I follow the samples given here: https://github.com/hyperledger/fabric-sdk-java/tree/master/src/test/java/org/hyperledger/fabric/sdkintegration
heenas06 (Fri, 09 Aug 2019 09:03:52 GMT):
ok thank you...will refer this...
paranjan (Fri, 09 Aug 2019 09:32:43 GMT):
Has joined the channel.
aatkddny (Fri, 09 Aug 2019 14:26:05 GMT):
@yacovm I get that. I was more interested in the mechanics.
Let me try to explain why - or what - I'm asking.
My configtx has a consortium profile that I add all my members to, before defining channels for the inter party relationships.
Let's call it "All-Members-Consortium".
In there there's a section that looks like this - ignore the number of orderers, I know I need to up it for n from m.
```
Orderer:
<<: *OrdererDefaults
OrdererType: etcdraft
EtcdRaft:
Consenters:
- Host: raft0-orderer
Port: 7050
ClientTLSCert:
aatkddny (Fri, 09 Aug 2019 14:26:05 GMT):
@yacovm I get that. I was more interested in the mechanics.
Let me try to explain why - or what - I'm asking.
My configtx has a consortium profile that I add all my members to, before defining channels for the inter party relationships.
Let's call it "All-Members-Consortium".
In there there's a section that looks like this - ignore the number of orderers, I know I need to up it for n from m.
```
Orderer:
<<: *OrdererDefaults
OrdererType: etcdraft
EtcdRaft:
Consenters:
- Host: raft0-orderer
Port: 7050
ClientTLSCert:
aatkddny (Fri, 09 Aug 2019 14:26:05 GMT):
@yacovm I get that. I was more interested in the mechanics.
Let me try to explain why - or what - I'm asking.
My configtx has a consortium profile that I add all my members to, before defining channels for the inter party relationships.
Let's call it "All-Members-Consortium".
In there there's a section that looks like this - ignore the number of orderers, I know I need to up it for n from m.
```
Orderer:
<<: *OrdererDefaults
OrdererType: etcdraft
EtcdRaft:
Consenters:
- Host: raft0-orderer
Port: 7050
ClientTLSCert:
yacovm (Fri, 09 Aug 2019 14:56:32 GMT):
you're using the SDK and I have no clue how to use it, I never did
yacovm (Fri, 09 Aug 2019 14:56:55 GMT):
in general, to create a channel with a subset of orderers you just need to change the consenters array
yacovm (Fri, 09 Aug 2019 14:56:59 GMT):
that's it... nothing more
aatkddny (Fri, 09 Aug 2019 15:09:11 GMT):
The array in configtx.yaml?
aatkddny (Fri, 09 Aug 2019 15:10:21 GMT):
@yacovm - the array defined in the profile you use that comes from configtx.yaml that's encoded into the channel genesis block?
yacovm (Fri, 09 Aug 2019 15:10:40 GMT):
yeah...
aatkddny (Fri, 09 Aug 2019 15:11:42 GMT):
Which gets me back to my question - or part of it. Is there a way to override that on a per channel basis? It seems an awful design to have to have multiple profiles to use a subset of the orderers.
yacovm (Fri, 09 Aug 2019 15:15:24 GMT):
oh... but can't you just change the file without changing the profile?
yacovm (Fri, 09 Aug 2019 15:15:40 GMT):
these stuff are really designed to be scripted and automated
yacovm (Fri, 09 Aug 2019 15:16:22 GMT):
Fabric is eggs, flour, and a bowl. You make the cake yourself, and sometimes you even have instructions how to do that
aatkddny (Fri, 09 Aug 2019 15:17:21 GMT):
Which file? Configtx? You mean regenerate *that* profile as required? It's the same idea as having multiple profiles.
yacovm (Fri, 09 Aug 2019 15:17:35 GMT):
yeah configtx
aatkddny (Fri, 09 Aug 2019 15:17:41 GMT):
Ugh.
yacovm (Fri, 09 Aug 2019 15:17:53 GMT):
hey... it's either multiple profiles
yacovm (Fri, 09 Aug 2019 15:17:58 GMT):
or a single one you edit
yacovm (Fri, 09 Aug 2019 15:18:12 GMT):
any way you look at it - you need to script stuff and automate stuff
yacovm (Fri, 09 Aug 2019 15:18:27 GMT):
but - creating a channel should not be done too much in your life
yacovm (Fri, 09 Aug 2019 15:18:39 GMT):
if you end up creating channels on a daily basis - you're using Fabric wrong
yacovm (Fri, 09 Aug 2019 15:18:48 GMT):
unless you're building a fabric SaaS offering
aatkddny (Fri, 09 Aug 2019 15:20:46 GMT):
I generate it already. It's just a poor (imo) design to not allow a subset of the list you provide for the genesis block to be defined in the individual channel blocks for the same consortium.
I generate the channels when I generate a new network. I do that a lot more than you'd think in dev, which is why I spent such a lot of time to make it as close to zero touch as possible. This is a refinement to allow me to specify a subset of raft orderers, and I was looking to see if there's an accepted way to do that.
yacovm (Fri, 09 Aug 2019 15:21:36 GMT):
@jyellick ^
jyellick (Fri, 09 Aug 2019 15:24:22 GMT):
Are you saking to be able to have a set of orderers tied to a consortium? I'm a little late here, and skimmed the thread, so fear I'm missing the real question/point.
jyellick (Fri, 09 Aug 2019 15:24:22 GMT):
Are you asking to be able to have a set of orderers tied to a consortium? I'm a little late here, and skimmed the thread, so fear I'm missing the real question/point.
yacovm (Fri, 09 Aug 2019 15:25:06 GMT):
he wants to be able to specify many channels, each with different subset of orderers, without duplicating profiles
yacovm (Fri, 09 Aug 2019 15:25:13 GMT):
@aatkddny did i get you right?
aatkddny (Fri, 09 Aug 2019 15:25:35 GMT):
yes. exactly right.
yacovm (Fri, 09 Aug 2019 15:25:54 GMT):
I guess you can use the inheritance property of the YAML and use it to inherit as much information as possible
jyellick (Fri, 09 Aug 2019 15:26:40 GMT):
That would generally be my recommendation. You're generating different channel creation txes, so, you're going to need to give the tool different inputs, no way around that. But, you should be able to use basically the same profile for every one via yaml references and only change the orderers
aatkddny (Fri, 09 Aug 2019 15:26:41 GMT):
i define the consortium in a profile in configtx and list all the orderers. i ought to be able to pick a subset for this channel - or what's the point - without having to create a new consortium profile (or bogart the original)
jyellick (Fri, 09 Aug 2019 15:27:21 GMT):
I don't follow... you can pick a subset of the orderers when creating a new channel.
aatkddny (Fri, 09 Aug 2019 15:27:26 GMT):
how?
aatkddny (Fri, 09 Aug 2019 15:27:40 GMT):
that's the genesis of this. is there an override in the channel definition?
jyellick (Fri, 09 Aug 2019 15:28:13 GMT):
By default, when generating a channel creation tx, everything outside of application section is essentially ignored. This is to keep you from shooting yourself in the foot, by overriding things that are already specified in the orderer system channel. Things like your orderer addresses, block validation policy, etc.
jyellick (Fri, 09 Aug 2019 15:29:05 GMT):
However, you can use the `-baseProfile` flag when generating your channel creation tx. This will generate a channel creation tx which is _exactly_ as specified in the profile, applying any differences from the base profile.
jyellick (Fri, 09 Aug 2019 15:29:28 GMT):
This is definitely a little dangerous and error prone, so not something we typically encourage users to do. It's usually easier to generate the channel, then update it.
jyellick (Fri, 09 Aug 2019 15:30:26 GMT):
Note, to pick a subset of orderers, you'll need the consent of the ordering admin, so they'll also need to sign your channel creation tx.
jyellick (Fri, 09 Aug 2019 15:30:57 GMT):
We almost added an example of this, but decided against it https://gerrit.hyperledger.org/r/c/fabric-samples/+/30938
aatkddny (Fri, 09 Aug 2019 15:33:32 GMT):
ok so there is a way to do it. that was what i was trying to figure out.
i have to get the orderer admin to sign anything to do with the system channels, so that's the same as everything else.
What's interesting - to me at least as an aside - was that I need to get that AND all the orgs to consent to add a new member. I figured the orderer would suffice.
One final thing. Your text above implies that it's possible to remove orderers dynamically by editing the config.
Is that considered a better route than doing it as part of the channel generate with the profile?
aatkddny (Fri, 09 Aug 2019 15:33:32 GMT):
ok so there is a way to do it. that was what i was trying to figure out.
i have to get the orderer admin to sign anything to do with the system channels, so that's the same as everything else.
What's interesting - to me at least as an aside - was that I need to get that AND all the orgs to consent to add a new member to the consortium. I figured the orderer would suffice.
One final thing. Your text above implies that it's possible to remove orderers dynamically by editing the config.
Is that considered a better route than doing it as part of the channel generate with the profile?
aatkddny (Fri, 09 Aug 2019 15:33:32 GMT):
ok so there is a way to do it. that was what i was trying to figure out.
i have to get the orderer admin to sign anything to do with the system channels, so that's the same as everything else.
What's interesting - to me at least as an aside - was that I need to get that AND all the orgs to consent to add a new member to the consortium. I figured the orderer would suffice.
One final thing. Your text above implies that it's possible to remove orderers dynamically by editing the channel block.
Is that considered a better route than doing it as part of the channel generate with the profile?
jyellick (Fri, 09 Aug 2019 15:36:09 GMT):
You can modify consortium membership with only an orderer signature
jyellick (Fri, 09 Aug 2019 15:36:25 GMT):
But you cannot modify existing channel membership
jyellick (Fri, 09 Aug 2019 15:36:25 GMT):
But you cannot modify existing channel membership (only a majority of app org admins can do that)
aatkddny (Fri, 09 Aug 2019 15:36:38 GMT):
not by default. It throws a sub policy not satisfied.
aatkddny (Fri, 09 Aug 2019 15:36:57 GMT):
i had to add sigs from all the other org admins to do so.
jyellick (Fri, 09 Aug 2019 15:37:17 GMT):
There is something going wrong with your update then. Perhaps you are modifying the other org definitions as well?
jyellick (Fri, 09 Aug 2019 15:37:47 GMT):
The only time you should need a consortium member signature when modifying the orderer system channel is when you try to modify a consortium org member's org definition.
aatkddny (Fri, 09 Aug 2019 15:38:01 GMT):
added a new org. created and stood up the nodes. then tried to add to the consortium.
aatkddny (Fri, 09 Aug 2019 15:38:23 GMT):
required sigs from the other admins as well as the orderer admin.
jyellick (Fri, 09 Aug 2019 15:38:41 GMT):
All I can say is that, at least with the default set of policies, this is not the case.
aatkddny (Fri, 09 Aug 2019 15:39:06 GMT):
wrote the code to do this yesterday so it's still fresh. policies are from the configtx template - those i didn't change.
jyellick (Fri, 09 Aug 2019 15:39:36 GMT):
Look at the `mod_policy` value for the `/Channel/Consortiums/
jyellick (Fri, 09 Aug 2019 15:39:40 GMT):
What is that set to?
aatkddny (Fri, 09 Aug 2019 15:40:44 GMT):
the default. it's not overwritten.
jyellick (Fri, 09 Aug 2019 15:41:56 GMT):
https://github.com/hyperledger/fabric/blob/fbbeb01233b888b66fc5e3516beb19951ce70011/common/tools/configtxgen/encoder/encoder.go#L401
jyellick (Fri, 09 Aug 2019 15:42:19 GMT):
This is the default, which is `/Channel/Orderer/Admins`, which says only a quorum of ordering admins should have to sign off on updates.
aatkddny (Fri, 09 Aug 2019 15:43:12 GMT):
Here's my profile for the genesis block. All I did was cut the org list out.
```
Profiles:
Genesis:
<<: *ChannelDefaults
Capabilities:
<<: *ChannelCapabilities
Orderer:
<<: *OrdererDefaults
OrdererType: etcdraft
EtcdRaft:
Consenters:
- Host: raft0-orderer
Port: 7050
ClientTLSCert: raft0-orderer/tls/server.crt
ServerTLSCert: aft0-orderer/tls/server.crt
- Host: raft1-orderer
Port: 7050
ClientTLSCert: raft1-orderer/tls/server.crt
ServerTLSCert: raft1-orderer/tls/server.crt
- Host: raft2-orderer
Port: 7050
ClientTLSCert: raft2-orderer/tls/server.crt
ServerTLSCert: raft2-orderer/tls/server.crt
Addresses:
- raft0-orderer:7050
- raft1-orderer:7050
- raft2-orderer:7050
Organizations:
- *Orderer
Capabilities:
<<: *OrdererCapabilities
Application:
<<: *ApplicationDefaults
Organizations:
- <<: *
jyellick (Fri, 09 Aug 2019 15:43:16 GMT):
Adding or removing members (sub-groups) will only trigger this policy. The only way the other member policies would need to be satisfied, is if you were also modifying the definitions of those members.
aatkddny (Fri, 09 Aug 2019 15:44:22 GMT):
```
Channel: &ChannelDefaults
# Policies defines the set of policies at this level of the config tree
# For Channel policies, their canonical path is
# /Channel/
jyellick (Fri, 09 Aug 2019 15:46:43 GMT):
It's your config update that is likely the problem. Compare the versions in the read-set for your existing orgs to the versions in the write-set of those orgs. I expect you'll find they are different.
One common mistake is not re-encoding the original config through `configtxlator` if you are pulling via an SDK. Proto marshaling is non-deterministic by default so `configtxlator` takes special steps when encoding which are necessary to safely compare when computing the update.
aatkddny (Fri, 09 Aug 2019 15:47:50 GMT):
I generate the update transaction through configtxlator.
jyellick (Fri, 09 Aug 2019 15:48:46 GMT):
Yes, but the inputs, the original config, did you generate that via configtxlator's encode function?
aatkddny (Fri, 09 Aug 2019 15:49:02 GMT):
this is the same code i use for all my system channel updates.
aatkddny (Fri, 09 Aug 2019 15:49:12 GMT):
yes.
jyellick (Fri, 09 Aug 2019 15:49:47 GMT):
Then you should compare your read-set and write-set versions for those orgs.
aatkddny (Fri, 09 Aug 2019 15:50:18 GMT):
decode the block using configtxgen. edit it. pass the two to configtxgen to generate an update and do a channel update.
aatkddny (Fri, 09 Aug 2019 15:50:18 GMT):
decode the block using configtxgen. edit it. pass the two to configtxlator to generate an update and do a channel update.
jyellick (Fri, 09 Aug 2019 15:50:48 GMT):
If they match, and you are still requiring their signatures when updating the consortium definition, then this would be a bug that's worth investigating.
aatkddny (Fri, 09 Aug 2019 15:52:28 GMT):
i'm assuming i put the new org in the right place.
```"channel_group">"groups">"Consortiums">"groups">"All-Member-Consortium">"groups"```
aatkddny (Fri, 09 Aug 2019 15:52:42 GMT):
All-Member... is my consortium here
aatkddny (Fri, 09 Aug 2019 15:53:08 GMT):
It does let me create channels with this new org, so I *think* I got it right.
jyellick (Fri, 09 Aug 2019 15:54:14 GMT):
Yes, that's the right spot to put it. But, the `mod_policy` of `All-Member-Consortium` _should_ be `/Channel/Orderer/Admins`, which means you should be able to add and remove group members satisfying only that policy.
aatkddny (Fri, 09 Aug 2019 15:54:30 GMT):
Well it doesn't work. Sorry.
jyellick (Fri, 09 Aug 2019 15:56:04 GMT):
I was just trying to help :), other users are able to modify consortium membership with only an orderer signature jsut fine
jyellick (Fri, 09 Aug 2019 15:56:04 GMT):
I was just trying to help :), other users are able to modify consortium membership with only an orderer signature just fine
aatkddny (Fri, 09 Aug 2019 15:57:10 GMT):
Not sure what' different. I saw the problem in the orderer output. Would a copy of the genesis block help?
jyellick (Fri, 09 Aug 2019 15:58:16 GMT):
If you could share the artifacts from your config update flow, I expect I could get to the bottom of it.
Your original config,your modified config, and your config update.
aatkddny (Fri, 09 Aug 2019 16:00:04 GMT):
Let me regenerate them and I'll get back to you.
aatkddny (Fri, 09 Aug 2019 16:02:49 GMT):
String of channel config and update work or you need more?
jyellick (Fri, 09 Aug 2019 16:03:18 GMT):
The JSON or the protos are fine, whatever's easier for you.
aatkddny (Fri, 09 Aug 2019 16:08:00 GMT):
beforeandafter.txt
aatkddny (Fri, 09 Aug 2019 16:08:07 GMT):
Does this work?
aatkddny (Fri, 09 Aug 2019 16:08:31 GMT):
Without stepping into the SDK - which I'm not set up to do without more work - I can't get the photos.
aatkddny (Fri, 09 Aug 2019 16:08:35 GMT):
*protos
jyellick (Fri, 09 Aug 2019 16:09:12 GMT):
Let me look
jyellick (Fri, 09 Aug 2019 16:10:26 GMT):
I see 'original' and 'update', but I don't see a 'modified'. I might be able to figure it out without the modified one, let me look.
aatkddny (Fri, 09 Aug 2019 16:12:35 GMT):
modified is the piece that i patch in? wait one.
jyellick (Fri, 09 Aug 2019 16:13:49 GMT):
I'm also getting a parse error on the update json
jyellick (Fri, 09 Aug 2019 16:14:02 GMT):
Rather than pasting them all in one file, maybe just upload the 3 JSON files
aatkddny (Fri, 09 Aug 2019 16:24:14 GMT):
I autopen them - they exist only as java objects - that's what took the time.
aatkddny (Fri, 09 Aug 2019 16:24:14 GMT):
I autogen them - they exist only as java objects - that's what took the time.
aatkddny (Fri, 09 Aug 2019 16:24:44 GMT):
decode-json-channel-config.txt
aatkddny (Fri, 09 Aug 2019 16:24:45 GMT):
update-config.txt
aatkddny (Fri, 09 Aug 2019 16:24:47 GMT):
mapped-result.txt
jyellick (Fri, 09 Aug 2019 16:31:27 GMT):
Alright, so I see three JSONs, two of which are (nearly) identical, with just the sequence number be moved, the other seems to add an org
jyellick (Fri, 09 Aug 2019 16:32:00 GMT):
What I'm missing is the actual config update JSON
aatkddny (Fri, 09 Aug 2019 16:46:00 GMT):
all I do after the mapped-result is /protolator/encode/common.Config and then convert it to a byte array.
aatkddny (Fri, 09 Aug 2019 16:47:30 GMT):
wait. lmk again.
aatkddny (Fri, 09 Aug 2019 16:47:30 GMT):
wait. let me look again. there's another call to configtxlator i need to decode.
aatkddny (Fri, 09 Aug 2019 16:51:29 GMT):
update-cfgtx.txt
jyellick (Fri, 09 Aug 2019 17:02:34 GMT):
Hmmm, that looks close to right, but looks almost like it was decoded as the wrong proto type? I'd expect something that has a `read_set` and a `write_set` field in it
aatkddny (Fri, 09 Aug 2019 17:04:51 GMT):
Let me regenerate from scratch with a new install. Give me a minute to reset everything. That last is the decoded output from /configtxlator/compute/update-from-configs which I assume is what you are looking for.
aatkddny (Fri, 09 Aug 2019 17:06:15 GMT):
original-channel-config.txt
aatkddny (Fri, 09 Aug 2019 17:06:32 GMT):
channel-config-with-extra-member.txt
aatkddny (Fri, 09 Aug 2019 17:07:44 GMT):
updated-config-bytes.txt
aatkddny (Fri, 09 Aug 2019 17:10:01 GMT):
the last gets passed into the sdk as an `UpdateChannelConfiguration` which is signed by the orderer admin (and the peer admins for each of the other orgs) through a client using the orderer admin as the user. Code looks like this
```
// Sign the update configuration - orderer needs to do this. This is a special case, unlike the channels where the members sign.
UpdateChannelConfiguration updateChannelConfiguration = new UpdateChannelConfiguration(updateBytes);
byte[] osig = client.getUpdateChannelConfigurationSignature(updateChannelConfiguration, client.getUserContext());
Collection
jyellick (Fri, 09 Aug 2019 17:12:59 GMT):
`updated-config-bytes.txt` above seems to be JSON still?
jyellick (Fri, 09 Aug 2019 17:13:19 GMT):
That bin is of type `common.ConfigUpdate`, my guess is that you've decoded it as a `common.Config`
aatkddny (Fri, 09 Aug 2019 17:13:44 GMT):
I translated it for you.
aatkddny (Fri, 09 Aug 2019 17:13:44 GMT):
I translated it for you. And yes it used common.Config to do so.
aatkddny (Fri, 09 Aug 2019 17:13:55 GMT):
You want the bytes?
aatkddny (Fri, 09 Aug 2019 17:19:36 GMT):
updated-config-bytes.txt
jyellick (Fri, 09 Aug 2019 17:30:00 GMT):
I think I see your problem
jyellick (Fri, 09 Aug 2019 17:30:40 GMT):
You have an `Application` section in your orderer system channel
jyellick (Fri, 09 Aug 2019 17:30:48 GMT):
And, your consortium members are in it
jyellick (Fri, 09 Aug 2019 17:31:22 GMT):
It has a `mod_policy` of `Admins`, which, as a full path is `/Channel/Application/Admins`, which requires a majority of your consortium members to sign off.
jyellick (Fri, 09 Aug 2019 17:31:50 GMT):
Your config update is modifying the `ACLs` section of your `/Channel/Application` group.
jyellick (Fri, 09 Aug 2019 17:32:04 GMT):
This is unintentional, and a symptom of what I was guessing at earlier.
aatkddny (Fri, 09 Aug 2019 17:32:29 GMT):
I do. It's a copy of the only configtx I found that actually worked for raft...
aatkddny (Fri, 09 Aug 2019 17:32:37 GMT):
```
Application:
<<: *ApplicationDefaults
Organizations:
- <<: *BeantownLager
- <<: *Block
- <<: *Mediaocean
- <<: *Orderer
- <<: *Xtreme
Consortiums:
AllMember-Consortium:
Organizations:
- *BeantownLager
- *Block
- *Mediaocean
- *Xtreme
- *Chain
```
aatkddny (Fri, 09 Aug 2019 17:32:37 GMT):
```
Application:
<<: *ApplicationDefaults
Organizations:
- <<:
jyellick (Fri, 09 Aug 2019 17:32:57 GMT):
What you have done, is you have retrieved the original configuration as protobuf (binary), decoded it to JSON, modified it, and re-encoded it as binary. Then you have passed these two binaries to configtxlator to compute your update
jyellick (Fri, 09 Aug 2019 17:33:10 GMT):
This flow looks correct, but it's actually subtly wrong.
jyellick (Fri, 09 Aug 2019 17:34:26 GMT):
You must retrieve your original configuration as protobuf, decode it to JSON, *re-encode the original JSON to protobuf with configtxlator*, modify the JSON, and re-encode the modified JSON, and send the pair of re-encoded protos to configtxlator. _Not_ the original proto and the reencoded one.
jyellick (Fri, 09 Aug 2019 17:35:20 GMT):
This is necessary, as I mentioned before, because protobuf encoding is non-determinstic (usually), and the original proto you retrieved, was not encoded with any effort for determinism. When configtxlator encodes, it uses a special scheme for deterministically encoding protos.
jyellick (Fri, 09 Aug 2019 17:36:05 GMT):
When you computed the update with your original proto, and your re-encoded proto, the order of the ACLs were changed, because of random order map iteration. To the update computation, it looked like you had changed this field. So, it was encoded into your update erroneously.
aatkddny (Fri, 09 Aug 2019 17:40:39 GMT):
I retrieved the current channel block as binary. So this is the original here.
If I understand this correctly, I need to run it through a decode/encode pair before using it as the first file.
Then the second one is the decoded, modified, re-encoded one I have.
Yuck. That wasn't in the example I cribbed from...
Also are you saying that the Application section in the profile isn't needed at all?
aatkddny (Fri, 09 Aug 2019 17:40:39 GMT):
I retrieved the current channel block as binary. So this is the original here.
If I understand this correctly, I need to run it through a decode/encode pair before using it as the first file.
Then the second one is the decoded, modified, re-encoded one I have.
Yuck. That wasn't in the example I cribbed from...
Is it the same for all the other examples - adding anchor members, creating channels et al, or is this *special*.
Also are you saying that the Application section in the profile isn't needed at all?
aatkddny (Fri, 09 Aug 2019 17:40:39 GMT):
I retrieved the current channel block as binary. So this is the original here.
If I understand this correctly, I need to run it through a decode/encode pair before using it as the first file.
Then the second one is the decoded, modified, re-encoded one I have.
Yuck. That wasn't in the example I cribbed from...
Is it the same for all the other examples - adding anchor members, creating channels et al, or is this *special*.
Also are you saying that the Application section in the profile isn't needed at all? The intent is that *only* the orderer has visibility to the system channel to prevent data leakage.
jyellick (Fri, 09 Aug 2019 17:45:36 GMT):
Most of the examples are derived from the CLI, by nature of not being able to drill through the proto structures ends up doing the JSON re-encoding by side-effect.
jyellick (Fri, 09 Aug 2019 17:46:01 GMT):
But yes, for a correct config update, you need to do a wash cycle of the binary input through configtxlator before trying to compute the update.
jyellick (Fri, 09 Aug 2019 17:47:55 GMT):
As far as not needing the application section in your orderer system channel, yes, you should be able to do without this. However, unless there is an application section, you will not be able to connect peers to this channel. So, if your update flow involves pulling the channel config via a peer (which, the Java SDK does by default I believe), then you do need it.
I know that the Java SDK was looking into adding another API for pulling config direct from orderers to bypass this limiation (this is what the CLI does), but I'm not sure where that stands.
aatkddny (Fri, 09 Aug 2019 17:52:20 GMT):
You pull it via a client instance that uses the orderer admin as a user.
It creates a channel object then adds in orderers and peers as required.
It used to be that you needed an extra "orderer-peer" but that limitation seems to have been removed in either 1.3 or 1.4.
I'm now able to do this with a channel with no peers attached so I guess it's been fixed.
aatkddny (Fri, 09 Aug 2019 17:55:14 GMT):
Ok, I'll remove the application section in this profile template and see what that does when I re-gen this network.
If that's good I'll try adding a selective orderer section to define a subset of orderers in the channels. Which is what started this all...
Thanks for your help here.
jyellick (Fri, 09 Aug 2019 17:56:25 GMT):
Sure thing, good luck
aatkddny (Fri, 09 Aug 2019 18:41:10 GMT):
Yup. Works now with just the orderer admin. Thanks again.
cDown (Mon, 12 Aug 2019 06:48:35 GMT):
Has joined the channel.
akoenig (Mon, 12 Aug 2019 10:49:06 GMT):
Hi, I want to get the GenisisBlock from a channel. Is it correct that when I call "queryBlockByNumber(0)" I will get the genisisBlock?
bis2019 (Mon, 12 Aug 2019 16:46:25 GMT):
Has joined the channel.
medikent (Mon, 12 Aug 2019 17:56:09 GMT):
How significant are the changes to the Fabric SDK Java from 1.4.2 to 2.0.0? I imagine the upgraded service discovery, chaincode lifecycle, and the new chaincode deployment model are the main changes. Is that right?
sstone1 (Tue, 13 Aug 2019 08:17:21 GMT):
Same answer as for Node.js - the major changes are chaincode lifecycle. AFAIK, new chaincode deployment model (external builders) has no SDK impact. There’s also work that will continue to be done on top of the programming model enhancements delivered in 1.4.
Randyshu2018 (Tue, 13 Aug 2019 08:18:43 GMT):
If I don't set the request Attributes, above three attributes will be set to the default
Randyshu2018 (Tue, 13 Aug 2019 08:20:03 GMT):
but if I want set both default three attributes and customer attributes ,what should i do?
Randyshu2018 (Tue, 13 Aug 2019 09:58:24 GMT):
How to get the extension with java-sdk?
mahoney1 (Tue, 13 Aug 2019 10:04:02 GMT):
using the SDK, you can check out an example in the Fabric CA sdkintegration dir of setting custom attributes [here](https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric_ca/sdkintegration/HFCAClientIT.java#L161)
akoenig (Tue, 13 Aug 2019 10:10:48 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=ewzvo3MA2giPohAzX) has some one an idea to get the genisisblock? Unfortunately the method of the channel object is private
akoenig (Tue, 13 Aug 2019 13:24:19 GMT):
Hi I want to add a new org to a channel and then add a peer from the new org to the network. I'm updating the channel-config and it all looks fine. Then I want to join with the peer. With this I need to provide the genisis block. In this block there is not the new org (because the org is not there from scratch). Now the new peer get's an error "MSP error: channel doesn't exist". What I'm doing wrong?
aatkddny (Tue, 13 Aug 2019 18:40:10 GMT):
Anyone get round the problem with setting the pembytes in the jsonobjects for network config? it won't accept a byte[] and the examples all use the file.
Randyshu2018 (Wed, 14 Aug 2019 01:47:26 GMT):
eh...but when i set that attributes,the default one will be replaced.
aatkddny (Thu, 15 Aug 2019 11:48:48 GMT):
What does GenesisBlock mean to you here?
Usually you use a peer admin to get the latest block with a `Channel#getChannelConfigurationBytes()`. Then you'd update that, have the necessary peer admins sign it and do a `Channel#updateChannelConfiguration` There's a pretty easy to follow example in one of the SDK samples somewhere.
If you are talking about what used to be called the genesis (but now iirc is system) channel - because you want to add a new channel, say - then it's the same idea but you patch in the orderer admin as the user into the client. The latest SDK version seems to have been amended to not require what I called an orderer-peer (special peer with orderer crypto) any more.
Thanks to whoever did that, it's much much cleaner...
aatkddny (Thu, 15 Aug 2019 11:48:48 GMT):
What does GenesisBlock mean to you here?
Usually you use a peer admin to get the latest block with a `Channel#getChannelConfigurationBytes()`. Then you'd update that, have the necessary peer admins sign it and do a `Channel#updateChannelConfiguration` There's a pretty easy to follow example in one of the SDK samples somewhere.
If you are talking about what used to be called the genesis (but now iirc is system) channel - because you want to add a new channel, say - then it's the same idea but you patch in the orderer admin as the user into the client.
aatkddny (Thu, 15 Aug 2019 15:38:18 GMT):
there's a change to 2.0.0-SNAPSHOT that means I can add members to a system channel without having to define and add peers.
I love it. Thankyou...
Is it getting back ported into 1.4.x?
aatkddny (Fri, 16 Aug 2019 00:26:12 GMT):
trying to short circuit the debug process. this code used to work before it was rafted.
Test network - I have a channel `everything-channel`. Able to read and write to it just fine.
Add a new member to the consortium.
Add same member to channel.
Both work fine.
Bring up peers for the new member.
Try to start channel. Channel#initialize fails with
```org.hyperledger.fabric.sdk.Channel : getConfigBlock for channel everything-channel failed with peer peer0-chain. Status FAILURE, details: Channel Channel{id: 29, name: everything-channel} Sending proposal with transaction: 66840b139d6cb5a3f3a863965772b7279c5ddbd89d5d28055bdde5d9ae2ee0ed to Peer{ id: 35, name: peer0-chain, channelName: everything-channel, url: grpcs://localhost:30060} failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [everything-channel] creator org [ChainMSP], cause=null```
Peer has this:
`[protoutils] ValidateProposalMessage -> WARN 047 channel [everything-channel]: MSP error: channel doesn't exist`
Not sure what I did wrong, so I'm not sure where to start looking.
Anyone have this happen to them?
aatkddny (Fri, 16 Aug 2019 00:26:12 GMT):
trying to short circuit the debug process. this code used to work before it was rafted.
Test network - I have a channel `everything-channel`. Able to read and write to it just fine.
Add a new member to the consortium.
Add same member to channel.
Both work fine.
Bring up peers for the new member.
Try to start channel to install chaincode on it. So it's the add orderers and peers manually and use the peer admin dance.
Channel#initialize fails with
```org.hyperledger.fabric.sdk.Channel : getConfigBlock for channel everything-channel failed with peer peer0-chain. Status FAILURE, details: Channel Channel{id: 29, name: everything-channel} Sending proposal with transaction: 66840b139d6cb5a3f3a863965772b7279c5ddbd89d5d28055bdde5d9ae2ee0ed to Peer{ id: 35, name: peer0-chain, channelName: everything-channel, url: grpcs://localhost:30060} failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [everything-channel] creator org [ChainMSP], cause=null```
Peer has this:
`[protoutils] ValidateProposalMessage -> WARN 047 channel [everything-channel]: MSP error: channel doesn't exist`
Not sure what I did wrong, so I'm not sure where to start looking.
Anyone have this happen to them?
aatkddny (Fri, 16 Aug 2019 00:26:12 GMT):
trying to short circuit the debug process. this code used to work before it was rafted.
Test network - I have a channel `everything-channel`. Able to read and write to it just fine.
Add a new member to the consortium.
Add same member to channel.
Both work fine.
Bring up peers for the new member.
Try to start channel to install chaincode on it. So it's the add orderers and peers manually and use the peer admin dance.
Channel#initialize fails with
```org.hyperledger.fabric.sdk.Channel : getConfigBlock for channel everything-channel failed with peer peer0-chain. Status FAILURE, details: Channel Channel{id: 29, name: everything-channel} Sending proposal with transaction: 66840b139d6cb5a3f3a863965772b7279c5ddbd89d5d28055bdde5d9ae2ee0ed to Peer{ id: 35, name: peer0-chain, channelName: everything-channel, url: grpcs://localhost:30060} failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [everything-channel] creator org [ChainMSP], cause=null```
Peer has this:
`[protoutils] ValidateProposalMessage -> WARN 047 channel [everything-channel]: MSP error: channel doesn't exist`
Not sure what I did wrong, so I'm not sure where to start looking. Has the structure of the ccb changed since 1.2 and I'm poking stuff into the wrong place? Anyone have this happen to them?
aatkddny (Fri, 16 Aug 2019 00:26:12 GMT):
trying to short circuit the debug process. this code used to work before it was rafted.
Test network - I have a channel `everything-channel`. Able to read and write to it just fine.
Add a new member to the consortium.
Add same member to channel.
Both work fine.
Bring up peers for the new member.
Try to start channel to install chaincode on it. So it's the add orderers and peers manually and use the peer admin dance.
Channel#initialize fails with
```org.hyperledger.fabric.sdk.Channel : getConfigBlock for channel everything-channel failed with peer peer0-chain. Status FAILURE, details: Channel Channel{id: 29, name: everything-channel} Sending proposal with transaction: 66840b139d6cb5a3f3a863965772b7279c5ddbd89d5d28055bdde5d9ae2ee0ed to Peer{ id: 35, name: peer0-chain, channelName: everything-channel, url: grpcs://localhost:30060} failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [everything-channel] creator org [ChainMSP], cause=null```
Peer has this:
`[protoutils] ValidateProposalMessage -> WARN 047 channel [everything-channel]: MSP error: channel doesn't exist`
Not sure what I did wrong, so I'm not sure where to start looking. Channel and system channel config looks ok - or at least the new org looks just like all the others. Anyone have this happen to them?
aatkddny (Fri, 16 Aug 2019 00:26:12 GMT):
trying to short circuit the debug process. this code used to work before it was rafted.
Test network - I have a channel `everything-channel`. Able to read and write to it just fine from the other members.
Add a new member to the consortium.
Add same member to channel.
Both work fine.
Bring up peers for the new member.
Try to start channel to install chaincode on it. So it's the add orderers and peers manually and use the peer admin dance.
Channel#initialize fails with
```org.hyperledger.fabric.sdk.Channel : getConfigBlock for channel everything-channel failed with peer peer0-chain. Status FAILURE, details: Channel Channel{id: 29, name: everything-channel} Sending proposal with transaction: 66840b139d6cb5a3f3a863965772b7279c5ddbd89d5d28055bdde5d9ae2ee0ed to Peer{ id: 35, name: peer0-chain, channelName: everything-channel, url: grpcs://localhost:30060} failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [everything-channel] creator org [ChainMSP], cause=null```
Peer has this:
`[protoutils] ValidateProposalMessage -> WARN 047 channel [everything-channel]: MSP error: channel doesn't exist`
Not sure what I did wrong, so I'm not sure where to start looking. Channel and system channel config looks ok - or at least the new org looks just like all the others. Anyone have this happen to them?
aatkddny (Fri, 16 Aug 2019 00:58:17 GMT):
edit: the only thing I can think of is that the genesis channel is coming from a file and holds the original block. could that be the issue here? i would expect it to update from an orderer.
aatkddny (Fri, 16 Aug 2019 00:58:17 GMT):
addendum: the only thing I can think of is that the genesis channel is coming from a file and holds the original block. could that be the issue here? i would expect it to update from an orderer.
SatheeshNehru (Mon, 19 Aug 2019 08:09:30 GMT):
https://github.com/hyperledger/fabric-chaincode-java/blob/bd59b349ad163ed04ac0ac0029427651d1a9fcf8/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/contract/ClientIdentity.java#L91
bjcawanglu (Tue, 20 Aug 2019 02:05:01 GMT):
Has joined the channel.
tballast (Tue, 20 Aug 2019 09:25:14 GMT):
I am trying to implement service discovery, mostly following the Service discovery example in the Integration Tests, however I am not currently using TLS, and every time it tries to fetch the genesis blocks from my peers (two orgs, two peers each) it is using the grpcs protocol, and not just just grpc. I have not specified grpcs anywhere , it seems to be doing this by default. Is there a way to force it to use grpc? I am already using the `sdprops.put("org.hyperledger.fabric.sdk.discovery.default.protocol", "grpc:");` property.
Coada (Tue, 20 Aug 2019 12:08:14 GMT):
Hello! I am trying to create a Channel object to hold everything regarding a channel that has been created outside the scope of the Java application. My starting point is to call queryChannels(peer) and from the returned string(s) construct the object. However I still don't know which orderers are part of the channel, if it is initialized, etc. Perhaps this is not the way to go - how should I proceed?
bestbeforetoday (Tue, 20 Aug 2019 12:48:37 GMT):
I think if you have multiple orgs then you will need to be using TLS. As I understand it (which might not be perfectly correct!), the discovery information is passed between orgs using the gossip protocol using TLS.
ykim 1 (Tue, 20 Aug 2019 13:22:13 GMT):
Has joined the channel.
ykim 1 (Tue, 20 Aug 2019 13:22:15 GMT):
spring
tballast (Tue, 20 Aug 2019 13:35:21 GMT):
Hmm, ok gotcha. Yea, I was under the impression that it was with the gossip protocol but didn't know that it required TLS. I was able to get it to try to stop using TLS, however then I get an error along the lines of `url: grpc://peer1.org1.example.com:8051} was shutdown.`
tballast (Tue, 20 Aug 2019 16:01:33 GMT):
Is there a reason why, when communicating with a peer with TLS (querying chaincodes, for instance), the client would simply not be able to reach a specific peer?
I try to query my peers to see which chaincodes are installed, and the client is able to easily talk to the first one at `grpcs://peer0.org1.example.com:7051`, but the second peer `grpcs://peer1.org1.example.com:8051` simply isn't reached at all.
I have both of these mapped to localhost in my `/etc/hosts` file, and the only different I can see between the actual peer objects is that one has the property `"org.hyperledger.fabric.sdk.peer.organization_mspid" -> "Org1MSP"` while the other (the ont that can't be reached) doesn't. The first peer is also enabled for service discovery and the second isn't.
mattiabolzonella1 (Wed, 21 Aug 2019 07:56:41 GMT):
Hi, I've read that the API cannot query for all channels that exist but if I use several connection profiles each defining a channel, can I set the ConnectionProfile in the NetworkConfig object several time during the application execution? If so, it's a bad practice?
mahoney1 (Wed, 21 Aug 2019 10:11:29 GMT):
Depending on your use case, for queries, your applications would query using `evaluateTransaction` (example here -> https://github.com/hyperledger/fabric-gateway-java )
using the 1.4 new programming model shown (it simply picks a peer defined in the connection profile and sends the request to it, where it is evaluated) - on subject of multiple channels see here - see https://hyperledger-fabric.readthedocs.io/en/release-1.4/developapps/application.html#network-channel and in particular how an identity would connect to the gateway (and perform an evaluateTransaction)
For multiple channels see https://hyperledger-fabric.readthedocs.io/en/release-1.4/developapps/application.html#network-channel - you would have to connect to the gateway with an identity and obviously disconnect when your unit of work is done for that gateway.
mattiabolzonella1 (Wed, 21 Aug 2019 10:14:28 GMT):
Thanks for the response! I'll check the links you posted
mattiabolzonella1 (Wed, 21 Aug 2019 10:56:30 GMT):
@mahoney1 Is the gateway SDK ready for a production envirorment?
sandy (Wed, 21 Aug 2019 11:18:27 GMT):
Is there any way to user thirparty certificate authority in hyperledger fabric?
Coada (Wed, 21 Aug 2019 11:26:04 GMT):
yes it's possible. You can get more specific answers in #fabric-ca
davidkel (Wed, 21 Aug 2019 12:41:10 GMT):
@mattiabolzonella1 not yet, it's still out as a preview for now.
davidkel (Wed, 21 Aug 2019 12:41:10 GMT):
@mattiabolzonella1 not yet, it's still out as a preview for now. Hopefully an official release will come soon
rthatcher (Wed, 21 Aug 2019 15:16:18 GMT):
Has joined the channel.
JiTian0225 (Thu, 22 Aug 2019 03:14:04 GMT):
Has joined the channel.
paranjan (Thu, 22 Aug 2019 08:12:30 GMT):
I would try to first provide the msp for the non-working peer and check. A peer belongs to an org, and that membership is governed by msp. So, peer without msp seems incorrect.
mattiabolzonella1 (Thu, 22 Aug 2019 08:17:32 GMT):
I'm exploring the gateway SDK and I have a problem using a file system wallet. I'm following the example here: https://github.com/hyperledger/fabric-gateway-java#how-to-use
mattiabolzonella1 (Thu, 22 Aug 2019 08:31:57 GMT):
I'm exploring the gateway SDK and I'm following the example here: https://github.com/hyperledger/fabric-gateway-java#how-to-use
The wallet is correctly located by `Path.get("path/to/wallet")` and has the following structure;
```
wallet
|--- Admin
|--- adminCert.pem
|--- pKey_sk
```
If I try to execute the method `getAllLabels()` it returns the label "Admin" which is the folder where certificate and private key are contained.
But the method `wallet.exists("Admin")` it return false, like the isn't any label "Admin". Therefore, if I create a `Gateway.Builder` setting the `.identity(wallet,"Admin")` and try to
execute `builder.connetct()` I receive the following exception:
`java.lang.IllegalStateException: The gateway identity must be set`
mattiabolzonella1 (Thu, 22 Aug 2019 08:31:57 GMT):
I'm exploring the gateway SDK and I'm following the example here: https://github.com/hyperledger/fabric-gateway-java#how-to-use
The wallet is correctly located by `Path.get("path/to/wallet")` and has the following structure;
```
wallet
|--- Admin
|--- adminCert.pem
|--- pKey_sk
```
If I try to execute the method `getAllLabels()` it returns the label "Admin" which is the folder where certificate and private key are contained.
But the method `wallet.exists("Admin")` returns false, like the isn't any label "Admin". Therefore, if I create a `Gateway.Builder` setting the `.identity(wallet,"Admin")` and try to
execute `builder.connetct()` I receive the following exception:
`java.lang.IllegalStateException: The gateway identity must be set`
davidkel (Thu, 22 Aug 2019 09:32:54 GMT):
@mattiabolzonella1 how did you create that wallet exactly ?
VivekGani (Thu, 22 Aug 2019 09:35:25 GMT):
Has joined the channel.
mattiabolzonella1 (Thu, 22 Aug 2019 09:37:44 GMT):
I've no experience with wallets and certificate, so i'm doing obvious mistakes I apologize. Looking here: https://hyperledger-fabric.readthedocs.io/en/release-1.4/developapps/wallet.html#structure I assumed (wrongly) that a wallet is simply a folder in which are contaned various certificates. Now i think that I need some sort of tool in order to genereate wallets, am I correct?
davidkel (Thu, 22 Aug 2019 09:41:00 GMT):
You need to use the wallet api to import identities into wallets as it also generates a metadata file which is what you are missing. However it is a bug in the java implementation for getAllLabels() as it should check for the existence of the metadata file by calling the exists method itself. So would suggest raising a jira for that
mattiabolzonella1 (Thu, 22 Aug 2019 09:46:27 GMT):
The wallet API that you're referring is the class Wallet.Identity? So I need to call `createIdentity()` and the put the identity returned in the wallet using `put()`. Anyway, thanks for helping me!
davidkel (Thu, 22 Aug 2019 09:55:09 GMT):
Sounds about right :-)
mattiabolzonella1 (Thu, 22 Aug 2019 09:55:25 GMT):
Thanks!
davidkel (Thu, 22 Aug 2019 09:57:29 GMT):
```
final String basePath = "/home/dave/";
Path walletLoc = Paths.get(basePath, "wallet");
Wallet wallet = Wallet.createFileSystemWallet(walletLoc);
String certificate = new String(Files.readAllBytes(Paths.get(basePath, "cert.pem")));
String privateKey = new String(Files.readAllBytes(Paths.get(basePath, "key.pem")));
Identity id = org.hyperledger.fabric.gateway.Wallet.Identity.createIdentity("Org1MSP", new StringReader(certificate), new StringReader(privateKey));
wallet.put("dave", id);
```
davidkel (Thu, 22 Aug 2019 09:58:20 GMT):
Bit messy but hopefully you get the idea
mattiabolzonella1 (Thu, 22 Aug 2019 09:59:57 GMT):
Awesome, I've coded more or less the same thing, now i can execute `connect()`
mahoney1 (Thu, 22 Aug 2019 14:18:04 GMT):
reminder that the Fabric Developer Community call today is at 4pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
mattiabolzonella1 (Fri, 23 Aug 2019 07:51:38 GMT):
I'm looking at the source code of the gateway SDk, in particulare the `submitTransaction` method, I'm using the service discovery. As I can tell if the `TransactionProposal` fails (the chaincode returns a `TransactionResponse` with status 500) in the `Channel` class of the base SDK an Exception is thrown because the `DiscoveryOption` `inspectResult` is not set to `true` which is used if all `TransactionResponse` invalid and valid are required in the application for further inspection, like get the Response message.
Instead, a generic `GatewayRuntimeException` is returned with the default message `"Could not meet endorsement policy for chaincode ... `. So my question is: Can i get the invalid response message returned by the chaincode using the gateway SDK?
mattiabolzonella1 (Fri, 23 Aug 2019 07:51:38 GMT):
I'm looking at the source code of the gateway SDk, in particulare the `submitTransaction` method, I'm using the service discovery. As I can tell if the `TransactionProposal` fails (the chaincode returns a `ProposalResponse` with status 500) in the `Channel` class of the base SDK an Exception is thrown because the `DiscoveryOption` `inspectResult` is not set to `true` which is used if all `ProposalResponse` invalid and valid are required in the application for further inspection, like get the Response message.
Instead, a generic `GatewayRuntimeException` is returned with the default message `"Could not meet endorsement policy for chaincode ... `. So my question is: Can i get the invalid response message returned by the chaincode using the gateway SDK?
paranjan (Fri, 23 Aug 2019 08:44:07 GMT):
@mattiabolzonella1 Are you looking for this: https://gerrit.hyperledger.org/r/admin/repos/fabric-gateway-java?
mattiabolzonella1 (Fri, 23 Aug 2019 08:46:29 GMT):
I've already the source code, I cloned the repo you posted
aatkddny (Mon, 26 Aug 2019 21:39:37 GMT):
on a slow(er) connection. to save myself some google-fu anyone remember the setting to increase this timeout?
```
2019-08-26 21:36:31.006 UTC [dockercontroller] deployImage -> ERRO 166 Error building image: Post http://localhost:2375/build?t=network-peer0-mediaocean-asset-1.0-7893610ac238115938ee4220f910a7e539e2304cc3491d967d8cce6ad0192f00: Failed to generate platform-specific docker build: Failed to pull hyperledger/fabric-ccenv:latest: dial tcp: lookup auth.docker.io on 10.96.0.10:53: read udp 10.1.13.88:51688->10.96.0.10:53: i/o timeout```
aatkddny (Mon, 26 Aug 2019 21:39:37 GMT):
on a slow(er) connection. to save myself some google-fu anyone remember the setting to increase this timeout?
```
2019-08-26 21:36:31.006 UTC [dockercontroller] deployImage -> ERRO 166 Error building image: Post http://localhost:2375/build?t=network-peer0-org-asset-1.0-7893610ac238115938ee4220f910a7e539e2304cc3491d967d8cce6ad0192f00: Failed to generate platform-specific docker build: Failed to pull hyperledger/fabric-ccenv:latest: dial tcp: lookup auth.docker.io on 10.96.0.10:53: read udp 10.1.13.88:51688->10.96.0.10:53: i/o timeout```
lotty02cho (Tue, 27 Aug 2019 07:52:03 GMT):
how to start End2endIT.java?
tballast (Tue, 27 Aug 2019 11:18:04 GMT):
There is a folder called `fixture` which contains a bunch of docker stuff, and a script called `fabric.sh`. Run `fabric.sh up` and then you can run End2EndIT.java as a unit test in an IDE.
tballast (Tue, 27 Aug 2019 11:19:45 GMT):
When instantiating (java) chaincode with the SDK it is not possible to give it a path for the ChaincodeID. When doing it manually (ie. through the CLI) you must specify it. Thus, they end up with different chaincode IDs. If i install chaincode on Org1 peers with the SDK, and Org2 peers with the CLI, how can I get the program to realize these are the same?
Coada (Tue, 27 Aug 2019 14:41:14 GMT):
haha that sounds like a funny bug, although I am interested in the answer too in case we end up with this scenario
hyperlearner (Wed, 28 Aug 2019 06:42:04 GMT):
Has joined the channel.
hyperlearner (Wed, 28 Aug 2019 06:42:04 GMT):
pom.xml
hyperlearner (Wed, 28 Aug 2019 06:42:08 GMT):
pom.
lotty02cho (Wed, 28 Aug 2019 08:33:15 GMT):
how can I run End2EndIT.java in Eclipse?
tballast (Wed, 28 Aug 2019 08:34:16 GMT):
not sure, I use intelliJ, but I have it set up to run as a JUnit test. If you can do something like that it should work.
lotty02cho (Wed, 28 Aug 2019 08:45:57 GMT):
I'm using eclipse, when I click End2endIT.java and click right button, there is a Run as > Junit Test. So, I click it but it said that "No JUnit tests found."
How can you start JUnit test? Thanks for replay:)
tballast (Wed, 28 Aug 2019 08:52:14 GMT):
Again, not sure for eclipse as I've never used it, but you may have to tell it exactly where you want it to look. Like, does it as for a "Main Class" or something? In intellij there are "Run Configurations" which have all of the details required for running in what ever way you want, and the JUnit tests are all "class tests" with, for example, the End2EndIT test class specified as the class to test.
lotty02cho (Wed, 28 Aug 2019 08:57:59 GMT):
Umm.. I'm already use node-sdk, so I'm very confused. and honestly I'm not good at java. so that's why I'm asking you.
*my ultimate goal is to query data and invoke my own channel.*
Let's say I already make byfn network, using fabric-samples/first-network, I try to query and invoke someone's data in mychannel.
tballast (Wed, 28 Aug 2019 09:00:58 GMT):
I see, yea that's alright. I know that getting it to run the first time can be tricky. What I would first recommend, if you haven't already, is just figure out how to get a basic application running using Eclipse. It can be a hello world or whatever, but maybe if it uses maven and imports a package that could be useful. Then, there is an example [here](https://medium.com/@lkolisko/hyperledger-fabric-sdk-java-basics-tutorial-a67b2b898410) which I've found useful for the basics of invoking and querying.
lotty02cho (Wed, 28 Aug 2019 09:09:31 GMT):
Umm.. I already saw that blog, what about using intelliJ? Is it comfortable to run fabric-sdk-java?
tballast (Wed, 28 Aug 2019 09:11:01 GMT):
I find it to be, yes. however, it also takes a little bit of setup. i believe that all of this can be done in Eclipse without too much trouble. The settings should be similar.
tballast (Wed, 28 Aug 2019 09:25:48 GMT):
https://github.com/hyperledger/fabric-sdk-java/blob/master/docs/EclipseSetup.md
mattiabolzonella1 (Wed, 28 Aug 2019 13:44:27 GMT):
How can i decode the protobuf used to implement the transaction Envelope? I need to get all writes done in a transaction
aatkddny (Wed, 28 Aug 2019 15:48:34 GMT):
Can't you just get them from the blocks by hanging an event listener off a peer?
JanKosecki (Wed, 28 Aug 2019 16:59:02 GMT):
Has joined the channel.
JanKosecki (Wed, 28 Aug 2019 16:59:03 GMT):
Hi, why `Channel#getDiscoveredChaincodeNames` returns chaincode names only and `Channel#queryInstantiatedChaincodes()` returns more data like version?
JanKosecki (Wed, 28 Aug 2019 16:59:03 GMT):
Hi, why `Channel#getDiscoveredChaincodeNames` returns chaincode names only and `Channel#queryInstantiatedChaincodes()` returns more data like version? I'm migrating my app to use service discovery and I'm not sure which method I should use when verifying, that chaincode has been definitely instantiated
JanKosecki (Wed, 28 Aug 2019 17:03:01 GMT):
Also, I have 3 peers in the same organization for resiliency with endorsement policy requiring only one peer to approve - it works fine using `sendTransactionProposalToEndorsers` - a proposal request is made to only one of 3 peers but then what is the best approach, when the same SDK clients wants to query chaincode?
JanKosecki (Wed, 28 Aug 2019 17:03:47 GMT):
Should I simply round-robin one of the peers, check if it's available and if yes query it? Or should I query all 3 peers (but then what if 1-2 peers are down)
nmutter (Wed, 28 Aug 2019 18:26:19 GMT):
I'm running different peers and clients on multiple servers. When executing transactions after start of a client everything is ok, but after ~3-4 minutes without activity all following requests will get timeouts. Is there some hearbeat value for the clients? If I restart the client, the connection will work again for some minutes. It feels like the connection timesout, but the sdk does not notice it?
nmutter (Wed, 28 Aug 2019 18:30:54 GMT):
Maybe I need to set the properties for peers and orderers? Like https://github.com/hyperledger/fabric-sdk-java/blob/31727ee7c44aa011b5906db102d939f1371736e6/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L846
nmutter (Wed, 28 Aug 2019 18:49:46 GMT):
https://github.com/hyperledger/fabric-sdk-java/blob/master/README.md#firewalls-load-balancers-network-proxies
mattiabolzonella1 (Thu, 29 Aug 2019 06:38:53 GMT):
I have the txIds of past transactions and i would like to see what has been written in the world state in a past transaction. I can get the Envelope using `ProcessedTransaction` class but is a protobuf returned in `ByteString` and when I try to convert it to a String, no matter the charset, I get a string with gibberish character
nmutter (Thu, 29 Aug 2019 12:49:02 GMT):
Seems to have fixed the issue :)
bis2019 (Fri, 30 Aug 2019 14:47:02 GMT):
Hi everyone, I am having issue to install a chaincode with external dependencies with Java SDK. Very similar to this issue https://jira.hyperledger.org/browse/FABG-877
I tried to put the dependencies in the vendor but does with govendor but it's still not working
bis2019 (Fri, 30 Aug 2019 14:47:02 GMT):
Hi everyone, I am having issue to install a chaincode with external dependencies with Java SDK. Very similar to this issue https://jira.hyperledger.org/browse/FABG-877
I tried to put the dependencies in the vendor with govendor but it's still not working
bis2019 (Fri, 30 Aug 2019 14:48:40 GMT):
chaincode is written in go
bis2019 (Fri, 30 Aug 2019 14:50:23 GMT):
and i have this type of error with the java sdk
mych - Chain code upgrade failed to execute transaction c84bf09f814e8d54358208cfb23380b897c18e9cc405e1cffa6696223009b95a: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "../input/src/poc/go/policy.go:6:2: cannot find package "github.com/satori/go.uuid" in any of:
/opt/go/src/github.com/satori/go.uuid (from $GOROOT)
/chaincode/input/src/github.com/satori/go.uuid (from $GOPATH)
/opt/gopath/src/github.com/satori/go.uuid
"
bis2019 (Fri, 30 Aug 2019 14:50:23 GMT):
and i have this type of error with the java sdk
/code mych - Chain code upgrade failed to execute transaction c84bf09f814e8d54358208cfb23380b897c18e9cc405e1cffa6696223009b95a: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "../input/src/poc/go/policy.go:6:2: cannot find package "github.com/satori/go.uuid" in any of:
/opt/go/src/github.com/satori/go.uuid (from $GOROOT)
/chaincode/input/src/github.com/satori/go.uuid (from $GOPATH)
/opt/gopath/src/github.com/satori/go.uuid
"
bis2019 (Fri, 30 Aug 2019 14:50:23 GMT):
and i have this type of error with the java sdk
mych - Chain code upgrade failed to execute transaction c84bf09f814e8d54358208cfb23380b897c18e9cc405e1cffa6696223009b95a: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "../input/src/poc/go/policy.go:6:2: cannot find package "github.com/satori/go.uuid" in any of:
/opt/go/src/github.com/satori/go.uuid (from $GOROOT)
/chaincode/input/src/github.com/satori/go.uuid (from $GOPATH)
/opt/gopath/src/github.com/satori/go.uuid
"
bis2019 (Fri, 30 Aug 2019 14:50:23 GMT):
and i have this type of error with the java sdk
mych - Chain code upgrade failed to execute transaction c84bf09f814e8d54358208cfb23380b897c18e9cc405e1cffa6696223009b95a: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "../input/src/poc/go/policy.go:6:2: cannot find package "github.com/satori/go.uuid" in any of:
/opt/go/src/github.com/satori/go.uuid (from $GOROOT)
/chaincode/input/src/github.com/satori/go.uuid (from $GOPATH)
/opt/gopath/src/github.com/satori/go.uuid
"
bis2019 (Fri, 30 Aug 2019 14:53:02 GMT):
Did anyone managed to deploy GO chaincode with external dependecies through the Java SDK? Are there any workarounds?
aatkddny (Fri, 30 Aug 2019 17:25:36 GMT):
Have an issue that I'd like some clarification on.
```
out("sending transactionProposal to all peers with arguments: move(a,b,100)");
// Collection
aatkddny (Fri, 30 Aug 2019 17:25:36 GMT):
Have an issue that I'd like some clarification on.
```
out("sending transactionProposal to all peers with arguments: move(a,b,100)");
// Collection
Deviad (Sun, 01 Sep 2019 06:44:40 GMT):
Has joined the channel.
Deviad (Sun, 01 Sep 2019 06:44:45 GMT):
Hello
Deviad (Sun, 01 Sep 2019 06:45:31 GMT):
When I run the containers via docker-compose with the provided docker-compose.yml I get
Deviad (Sun, 01 Sep 2019 06:45:50 GMT):
```
ERROR: Duplicate mount points: [/Volumes/Data/Projects/fabric-gateway-java/src/test/fixtures/crypto-material:/etc/hyperledger/config:rw, /Volumes/Data/Projects/fabric-gateway-java/src/test/fixtures/crypto-material:/etc/hyperledger/config:rw]
```
Deviad (Sun, 01 Sep 2019 06:46:03 GMT):
The project I am using is fabric-gateway-java
paranjan (Sun, 01 Sep 2019 10:47:35 GMT):
Can you try following:
JSONObject json = new JSONObject(new String(data, UTF_8));
paranjan (Sun, 01 Sep 2019 11:28:25 GMT):
Why is the fabric library has shim in its name? What is the significance of shim?
AndresMartinezMelgar.itcl (Mon, 02 Sep 2019 08:22:16 GMT):
Hi, i am working whit v1.3. I have a channel with 2 orgs(org1 and org2) and 3 peers each one. How can i add a new peer to org1?
AndresMartinezMelgar.itcl (Mon, 02 Sep 2019 08:23:48 GMT):
i see i can do "channel.addPeer(newPeer)", but it only works when i create channel, no after that
tballast (Mon, 02 Sep 2019 09:50:27 GMT):
Typically you _join_ the channel once it's been created. You only _add_ once at the beginning. https://github.com/hyperledger/fabric-sdk-java#whats-difference-between-joining-and-adding-a-peer-to-a-channel
Coada (Tue, 03 Sep 2019 09:10:10 GMT):
do you want to add a new peer (service) or add a running peer to a channel?
Deviad (Tue, 03 Sep 2019 14:59:36 GMT):
Hello
Deviad (Tue, 03 Sep 2019 15:01:21 GMT):
Can anyone please explain me how it is possible to create a wallet and allow users who just have a password to unlock it?
Deviad (Tue, 03 Sep 2019 15:01:46 GMT):
I want to use the inmemory wallet since I plan to store this data for a single application having only a single organization.
dan13 (Tue, 03 Sep 2019 18:09:45 GMT):
This is a great question. My assumption is that the client needs to decide how to process and then make appropriate adjustments to the transaction submitted to Orderer, or fail and return error to its caller. Likewise, if query and get different responses, figure a way to a) retry (assuming can wait for network to "settle"), b) pick the response with most instances responding (voting), or c) pick the response from the peer with the greatest block height, d) something else? Would be great to have some of these impl design patterns documented by the HLF team.
SteveKIM (Wed, 04 Sep 2019 01:23:08 GMT):
Has joined the channel.
SteveKIM (Wed, 04 Sep 2019 01:23:10 GMT):
Hi, I Change source and commit, there is a Hyperledger Jobbuilder error, but I don`t have an idea, plz let me know, jira number is FABJ-474
SteveKIM (Wed, 04 Sep 2019 01:23:10 GMT):
Hi, I Change source and commit, there is a Hyperledger Jobbuilder error, but I don`t have an idea, plz let me know, jira number is FABJ-474 https://jira.hyperledger.org/projects/FABJ/issues/FABJ-474?filter=allopenissues
nitishbhardwaj19 (Wed, 04 Sep 2019 16:37:37 GMT):
Hi, do we have anything similar to this https://hyperledger-fabric.readthedocs.io/en/release-1.4/developapps/wallet.html?highlight=wallet. I know that HSM is not yet supported but do we have an interface to connect with other wallet types?
nitishbhardwaj19 (Wed, 04 Sep 2019 16:37:37 GMT):
Hi @all , do we have anything similar to this https://hyperledger-fabric.readthedocs.io/en/release-1.4/developapps/wallet.html?highlight=wallet. I know that HSM is not yet supported but do we have an interface to connect with other wallet types?
bestbeforetoday (Wed, 04 Sep 2019 19:23:42 GMT):
Right now you can't get at the actual proposal responses from the exception that gets thrown, although the message should include the proposal response messages. It seems like it would be useful to get at the actual responses though. You could raise a Jira for this as a new requirement: https://jira.hyperledger.org/projects/FGJ
bestbeforetoday (Wed, 04 Sep 2019 19:27:33 GMT):
The approach we've taken with the higher level client APIs is to just send any good proposal responses to the orderer. The orderer may reject the submit if the endorsement policy is not satisfied, and you can also listen for successful commit events from peers
bestbeforetoday (Wed, 04 Sep 2019 19:33:44 GMT):
Are you hitting this problem trying to run the _fabric-gateway-java_ integration tests? The docker-compose files are just used by the tests and aren't intended to be examples of how to stand up a Fabric environment
aatkddny (Wed, 04 Sep 2019 19:35:22 GMT):
that's what i'm doing until it stops working...
bestbeforetoday (Wed, 04 Sep 2019 19:39:37 GMT):
The builds are in a bad state for various reasons right now: actual test failures (I think caused by changes outside of the SDK but still under investigation), CI pipeline not correctly reporting the build status, and there were problems reported with the build systems recently too
bestbeforetoday (Wed, 04 Sep 2019 20:01:05 GMT):
The high level _fabric-gateway-java_ API (https://github.com/hyperledger/fabric-gateway-java) has the some wallets as the Node SDK. I'm working on simplifying the wallet implementation for the 2.0 release of both of these SDKs so that it is easier to plug in your own back-end storage mechanisms
bestbeforetoday (Wed, 04 Sep 2019 20:01:05 GMT):
The high level _fabric-gateway-java_ API (https://github.com/hyperledger/fabric-gateway-java) has the same wallets as the Node SDK. I'm working on simplifying the wallet implementation for the 2.0 release of both of these SDKs so that it is easier to plug in your own back-end storage mechanisms
nitishbhardwaj19 (Thu, 05 Sep 2019 09:05:41 GMT):
Thanks for sharing this. Do we have any roadmap/plans to integrate HSM support with Fabric-SDK as well.
rthatcher (Thu, 05 Sep 2019 14:22:52 GMT):
reminder that the Fabric Application Developer Community call today is at 4pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Community+Call
nitishbhardwaj19 (Fri, 06 Sep 2019 02:09:13 GMT):
Do we still have a limitation to use HSM with a wallet? I couldn't find any method to connect/use HSM. Just have fileSystem and inMemory type.
nitishbhardwaj19 (Fri, 06 Sep 2019 02:09:13 GMT):
@bestbeforetoday Do we still have a limitation to use HSM with a wallet? I couldn't find any method to connect/use HSM. Just have fileSystem and inMemory type.
RyanGriffiths (Fri, 06 Sep 2019 12:14:46 GMT):
Has joined the channel.
RyanGriffiths (Fri, 06 Sep 2019 12:14:48 GMT):
I'm slightly confused as to why there are multiple TransactionActionInfos per TransactionEvent and was hoping someone here might be able to help me out!
Each TransactionActionInfo - as I understand it - corresponds to a Collection
bestbeforetoday (Fri, 06 Sep 2019 12:37:32 GMT):
Somebody else might have a better, but here's one... :)
Chaincode events are attached to TransactionActionInfos. A transaction invocation may emit multiple chaincode events so there may be multiple TransactionActionInfos in a TransactionEvent
bestbeforetoday (Fri, 06 Sep 2019 12:37:32 GMT):
Somebody else might have a better answer, but here's one... :)
Chaincode events are attached to TransactionActionInfos. A transaction invocation may emit multiple chaincode events so there may be multiple TransactionActionInfos in a TransactionEvent
bestbeforetoday (Fri, 06 Sep 2019 12:40:37 GMT):
While I'd love to see HSM support using wallets in the Java SDK, I don't have any timeline for that right now, and it's not something I'm expecting to include in a first cut of the wallet refactoring I'm working on. First step would be to be able to make HSM work with the Java SDK and that's not something I personally know how to do right now. Any pointers from the community would be very welcome :)
RyanGriffiths (Fri, 06 Sep 2019 12:54:27 GMT):
Thanks, yep I was also going to look into how chaincode events behaved in this context!
Deviad (Sun, 08 Sep 2019 11:01:30 GMT):
I have got a question
Deviad (Sun, 08 Sep 2019 11:02:38 GMT):
My app has got a focus on usability and user experience. I would like to avoid the user to have to store on his computer a key which he could lose easily with a format, change of device; or a user might be willing to use multiple devices without having the hassle of having the key with him.
Deviad (Sun, 08 Sep 2019 11:03:20 GMT):
Is there any SDK to create the pem key required to enroll a user with the purpose of storing everything in a database like Mongo?
Deviad (Sun, 08 Sep 2019 11:03:43 GMT):
Is there a different approach for my use case? Is it documented somewhere?
Deviad (Sun, 08 Sep 2019 11:03:43 GMT):
Is there a different approach for my use case? Is it documented anywhere?
Deviad (Sun, 08 Sep 2019 11:48:14 GMT):
http://www.bouncycastle.org/wiki/display/JA1/BC+Version+2+APIs
Coada (Tue, 10 Sep 2019 08:19:51 GMT):
I have ended up in the deep ends of Fabric; private data collections. When performing a chaincode instantiation with Java SDK I can now also create a private data collection using a `StaticCollectionConfig`. The Fabric docs provide other datastructures for these configurations than what Java SDK accepts. In particular, I am looking for `memberOnlyRead` and `memberOnlyWrite` options. Is anyone here aware if these attributes are supported by Java SDK? I am unable to get it to work
Coada (Thu, 12 Sep 2019 13:15:50 GMT):
nobody? :cry:
heatherp (Thu, 12 Sep 2019 13:19:11 GMT):
@bestbeforetoday @andrew-coleman can you guys answer this please?
awjh (Thu, 12 Sep 2019 13:40:59 GMT):
Has joined the channel.
awjh (Thu, 12 Sep 2019 13:40:59 GMT):
If this is like the node SDK then I may be able to shed some light. The format required looks like this:
```
[
{
"name": "Org1",
"policy": {
"identities": [
{
"role": {
"name": "member",
"mspId": "Org1MSP"
}
}
],
"policy": {
"1-of": [
{
"signed-by": 0
}
]
}
},
"requiredPeerCount": 0,
"maxPeerCount": 1,
"blockToLive": 0,
"memberOnlyRead": true
}
]
```
awjh (Thu, 12 Sep 2019 13:43:09 GMT):
There is (to my knowledger) no members only write. Fabric allows any peer to write to a private collection so long as the peer whose private collection it is approves the transaction (simplified). It will approve the transaction if the endorsement policy for the chaincode is met. Therefore the write aspect of a private collection is controlled by the chaincode's endorsement policy rather than the collection config
awjh (Thu, 12 Sep 2019 13:46:22 GMT):
This allows fabric to cut down on the number of peers having to execute the chaincode to meet the endorsement policy. Imagine an endorsement policy of `OR('Org1MSP.peer', 'Org2MSP.peer')` on a chaincode which writes to the private collections of Org1 and Org2. If the peer for Org1 returns true then there is no need for fabric to wait on the response of Org2's peer as the OR condition is already true. If private collections were member only write then since Org2 did not execute the chaincode it wouldn't have updated its private collection and therefore would be out of step with Org1. (Note: this is a simplified version of fabric's processes)
awjh (Thu, 12 Sep 2019 13:46:22 GMT):
This allows fabric to cut down on the number of peers having to execute the chaincode to meet the endorsement policy. Imagine an endorsement policy of `OR('Org1MSP.peer', 'Org2MSP.peer')` on a chaincode which writes to the private collections of Org1 and Org2. If the peer for Org1 returns true then there is no need for fabric to wait on the response of Org2's peer as the OR condition is already true. If private collections were member only write then since Org2 did not execute the chaincode it wouldn't have updated its private collection and therefore would be out of step with Org1
awjh (Thu, 12 Sep 2019 13:46:22 GMT):
This allows fabric to cut down on the number of peers having to execute the chaincode to meet the endorsement policy. Imagine an endorsement policy of `OR('Org1MSP.peer', 'Org2MSP.peer')` on a chaincode which writes to the private collections of Org1 and Org2. If the peer for Org1 returns true then there is no need for fabric to wait on the response of Org2's peer as the OR condition is already true. If private collections were member only write then since Org2 did not execute the chaincode it wouldn't have updated its private collection and therefore would be out of step with Org1.
awjh (Thu, 12 Sep 2019 13:49:13 GMT):
Forgot to mention. In the example I posted above the 0 in the signed-by refers to the index of the identity in the identities that it should be signed by
Coada (Thu, 12 Sep 2019 15:47:30 GMT):
@awjh I appreciate your extensive reply. However you highlight an important point - that it only applies if it is like the node SDK, which it isn't.
The format is different (see https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/fixture/collectionProperties/testCollection.json) and there is no mention of a memberOnly property. Even if I add a memberOnlyRead property it seems to be ignored, I can query the private data as a non-member.
As for member only write, it seems to just recently have been added so I realize I probably can't set it just yet:
https://github.com/hyperledger/fabric-protos/blob/master/common/collection.proto#L61
awjh (Thu, 12 Sep 2019 15:51:39 GMT):
Okay, I unfortunately only have experience with the Node SDK :(
Cheers for the heads up on membersOnlyWrite wasn't aware of that going in, will be useful for me once implemented in the SDKs
vijay5378 (Fri, 13 Sep 2019 11:26:37 GMT):
Hi ,class Attribute in package org.hyperledger.fabric_ca.sdk is non seriallizable. Can this be made serialisable? Is there any design consideration why attributes aren't serializable? Ideally I would want to construct a user object along with attributes, serialise it and store it somewhere to access it when needed.
jdfigure (Mon, 16 Sep 2019 16:06:49 GMT):
Hi! Is there a release date planned for Java SDK version 1.4.5?
bestbeforetoday (Tue, 17 Sep 2019 15:39:27 GMT):
No target date yet that I know of. Certainly we will want 1.4.5 published by the time the a release version of _fabric-gateway-java_ is published, since it relies on some changes that went into _fabric-sdk-java_ since 1.4.4. Is there a particular fix/change that you need published?
bestbeforetoday (Tue, 17 Sep 2019 15:41:35 GMT):
You could just serialize it yourself, either using your own de/serialization scheme or using the Attribute's `toJsonObject()` method
jdfigure (Tue, 17 Sep 2019 15:53:59 GMT):
Thanks for the update - we're trying out Java Gateway and that is the reason I asked.
SteveKIM (Wed, 18 Sep 2019 00:28:40 GMT):
I modified the source, but the review is not in progress.
Checking gerrit does not change the state.
Please confirm.
https://jira.hyperledger.org/projects/FABJ/issues/FABJ-474?filter=allopenissues
SteveKIM (Wed, 18 Sep 2019 00:34:47 GMT):
Are you unable to proceed due to a build error? As I asked last time, it wasn't my source problem, but an error occurred at build time. Please check
https://gerrit.hyperledger.org/r/c/fabric-sdk-java/+/33331
vijay5378 (Wed, 18 Sep 2019 08:13:04 GMT):
I did just that. I was just wondering if there was any specific reason for not being serializable.
bestbeforetoday (Wed, 18 Sep 2019 08:29:47 GMT):
The master build is not currently passing due to an issue related to the Node chaincode container. Once that's resolved and we can see verify builds pass we can start merging changes again
SteveKIM (Thu, 19 Sep 2019 04:19:54 GMT):
thanks for your message. I can wait for the problem to be solved. Will my gerrit state change automatically when the node chaincode container problem is solved?
mahoney1 (Thu, 19 Sep 2019 15:23:15 GMT):
reminder that the Fabric Application Developer Community call today is at 4pm UTC (5pm UK, 12pm ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Meeting+Agendas%3A+Fabric+Application+Developer+Community+Call
dan13 (Thu, 19 Sep 2019 20:33:50 GMT):
why are you not using setInspectResults(true) ? If I understood the question, this worked for us
gauravgiri (Fri, 20 Sep 2019 07:20:45 GMT):
I dockerized a simple spring boot application (fabric-sdk-java) client application.
When running this docker application i get the below error for :
The docker image is build from openjdk:8-alpine

gauravgiri (Fri, 20 Sep 2019 07:20:45 GMT):
I dockerized a simple spring boot application (fabric-sdk-java) client application.
When running this docker application i get the below error for :
The docker image is build from openjdk:8-alpine
E 06:50:50 20 [dispatcherServlet].log - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: failed to load the required native library] with root cause
java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty_tcnative_linux_x86_64, netty_tcnative_linux_x86_64_fedora, netty_tcnative_x86_64, netty_tcnative]
at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:104) ~[netty-common-4.1.32.Final.jar!/:4.1.32.Final]
at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:526) ~[netty-handler-4.1.32.Final.jar!/:4.1.32.Final]
at io.netty.handler.ssl.OpenSsl.
gauravgiri (Fri, 20 Sep 2019 07:20:45 GMT):
I dockerized a simple spring boot application (fabric-sdk-java) client application.
When running this docker application i get the below error for :
The docker image is build from openjdk:8-alpine
E 06:50:50 20 [dispatcherServlet].log - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: failed to load the required native library] with root cause
java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty_tcnative_linux_x86_64, netty_tcnative_linux_x86_64_fedora, netty_tcnative_x86_64, netty_tcnative]
at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:104) ~[netty-common-4.1.32.Final.jar!/:4.1.32.Final]
at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:526) ~[netty-handler-4.1.32.Final.jar!/:4.1.32.Final]
at io.netty.handler.ssl.OpenSsl.
gauravgiri (Fri, 20 Sep 2019 07:20:45 GMT):
I dockerized a simple spring boot application (fabric-sdk-java) client application.
When running this docker application i get the below error (java.lang.UnsatisfiedLinkError: failed to load the required native library) for :
The docker image is build from openjdk:8-alpine
E 06:50:50 20 [dispatcherServlet].log - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: failed to load the required native library] with root cause
java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty_tcnative_linux_x86_64, netty_tcnative_linux_x86_64_fedora, netty_tcnative_x86_64, netty_tcnative]
at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:104) ~[netty-common-4.1.32.Final.jar!/:4.1.32.Final]
at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:526) ~[netty-handler-4.1.32.Final.jar!/:4.1.32.Final]
at io.netty.handler.ssl.OpenSsl.
Coada (Fri, 20 Sep 2019 07:38:09 GMT):
I ran into the same problem. The reason is that you are most likely using Alpine as a base for your Docker image - this is a great image because it is small, but the reason it is small is because most things have been removed from it. Netty-related native artifacts are needed for grpc communication. Replace `openjdk:8-jdk-alpine` to `openjdk:8` and you should be good to go :)
gauravgiri (Fri, 20 Sep 2019 07:39:26 GMT):
yes i used opejdk:8-alpine :) let me try
gauravgiri (Fri, 20 Sep 2019 07:39:26 GMT):
yes i used openjdk:8-alpine :) let me try
Coada (Fri, 20 Sep 2019 07:40:16 GMT):
however be aware your Docker image will explode from ~20MB to ~150MB
Coada (Fri, 20 Sep 2019 07:40:16 GMT):
however be aware your Docker image will explode from ~ 20MB to ~ 150MB
Coada (Fri, 20 Sep 2019 07:40:16 GMT):
however be aware your Docker image will explode from >20MB to >150MB
gauravgiri (Fri, 20 Sep 2019 07:40:35 GMT):
ahh ok, let me try, and check. thanks for this suggestion :)
gauravgiri (Fri, 20 Sep 2019 09:35:28 GMT):
thank you it worked :)
dtomczyk (Sat, 21 Sep 2019 11:56:36 GMT):
Has joined the channel.
Purbaja (Mon, 23 Sep 2019 11:50:30 GMT):
Has joined the channel.
jdfigure (Fri, 27 Sep 2019 15:41:13 GMT):
Basic Service Discovery question: when SD discovers a peer, and the peer requires mutual TLS, where/how does SD set the `clientCertBytes` and `clientCertKey` when communicating with the discovered peer? I'm seeing errors in our peers where it looks like SD isn't using a TLS client cert: `TLS handshake failed with error tls: client didn't provide a certificate`
yacovm (Fri, 27 Sep 2019 17:01:10 GMT):
you need to set it in the application @jdfigure
yacovm (Fri, 27 Sep 2019 17:01:22 GMT):
in the SDK configuration
jdfigure (Fri, 27 Sep 2019 18:57:46 GMT):
@yacovm `clientCertBytes` and `clientCertKey` are being set when the app connects to the anchor/discovery peer (let's call it peer-0 in this example) to do discovery. That works fine. During transaction proposal, SD will return discovered peer-1 as an endorser. The issue is peer-1 also uses mutual TLS. When `Peer.sendProposalAsync` executes and sets up `EndorserClient.getEndorserClient()` on peer-1 there is no `clientCertBytes` or `clientKeyBytes` in the Endpoint properties for peer-1. Thus, the transaction proposal fails with TLS handshake error on the peer.
jdfigure (Fri, 27 Sep 2019 18:57:46 GMT):
@yacovm `clientCertBytes` and `clientKeyBytes` are being set when the app connects to the anchor/discovery peer (let's call it peer-0 in this example) to do discovery. That works fine. During transaction proposal, SD will return discovered peer-1 as an endorser. The issue is peer-1 also uses mutual TLS. When `Peer.sendProposalAsync` executes and sets up `EndorserClient.getEndorserClient()` on peer-1 there is no `clientCertBytes` or `clientKeyBytes` in the Endpoint properties for peer-1. Thus, the transaction proposal fails with TLS handshake error on the peer.
duarte.diegod (Fri, 27 Sep 2019 20:57:28 GMT):
Has joined the channel.
duarte.diegod (Fri, 27 Sep 2019 20:58:48 GMT):
hi everyone
duarte.diegod (Fri, 27 Sep 2019 21:01:00 GMT):
I am having an issue using the SDK. I have a custom network and if I use the fabric-cli tool, I can invoke contract. However, if I try to invoke it by the SDK, I'm getting a 'Path does not chain with any of the trust anchors' error. What am I doing wrong?
jdfigure (Sat, 28 Sep 2019 20:42:55 GMT):
thanks @yacovm - I'm using the Java Gateway which wasn't setting the mutual TLS SD props I needed.
EltonSearcy (Mon, 30 Sep 2019 17:07:05 GMT):
Has joined the channel.
mattiabolzonella1 (Tue, 01 Oct 2019 08:13:14 GMT):
There are best practices for managing certificates in the SDK?
bestbeforetoday (Tue, 01 Oct 2019 14:29:18 GMT):
I've tried to capture that issue in a Jira: https://jira.hyperledger.org/browse/FGJ-49
Please add any additional information or corrections needed
bestbeforetoday (Tue, 01 Oct 2019 14:31:48 GMT):
With _fabric-sdk-java_ it is the responsibility of the application to manage identity credentials. _fabric-gateway-java_ has a *Wallet* that is used as a container for client credentials used to connect to Fabric
bestbeforetoday (Tue, 01 Oct 2019 14:33:49 GMT):
Note that I have done some refactoring of the wallet implementation for Node SDK v2.0 (_fabric-sdk-node_), and I plan to make similar changes for v2.0 of _fabric-gateway-java_. They will look very similar from an end user point of view; just the implementation is reworked
bestbeforetoday (Tue, 01 Oct 2019 14:33:49 GMT):
Note that I have done some refactoring of the wallet implementation for Node SDK v2.0 ( _fabric-sdk-node_ ), and I plan to make similar changes for v2.0 of _fabric-gateway-java_. They will look very similar from an end user point of view; just the implementation is reworked
Jelle.Diet (Wed, 02 Oct 2019 10:03:15 GMT):
Is there an example somewhere of how to use the Wallet in the fabric gateway java api?
mattiabolzonella1 (Wed, 02 Oct 2019 10:53:48 GMT):
Thanks for the response but unfortunately I do not use the gateway sdk due to limitation regarding the inspection of transaction response
Jelle.Diet (Wed, 02 Oct 2019 15:17:57 GMT):
Is there any news on when fabric-gateway-java will be released (not snapshot) ?
bestbeforetoday (Wed, 02 Oct 2019 15:18:38 GMT):
It's imminent. We're trying to publish now
Jelle.Diet (Wed, 02 Oct 2019 15:18:55 GMT):
ok great!
andrew-coleman (Wed, 02 Oct 2019 15:39:07 GMT):
Fabric Gateway Java (new programming model) is now released to Maven Central!
Add the following to your pom.xml:
andrew-coleman (Wed, 02 Oct 2019 15:39:07 GMT):
Fabric Gateway Java (new programming model) is now released to Maven Central!
Add the following to your pom.xml:
```
sstone1 (Wed, 02 Oct 2019 15:50:41 GMT):
@mattiabolzonella1 can you expand on that? what exactly are you inspecting?
Jelle.Diet (Thu, 03 Oct 2019 10:02:10 GMT):
For Fabric Gateway, is it recommended to build a new Gateway for every request or save it in the session for each user?
mahoney1 (Thu, 03 Oct 2019 10:46:26 GMT):
reminder that the Fabric Application Developer Community call today is at **3pm** UTC (4pm UK, 11am ET, 8am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Fabric+Application+Developer+Community+Call
dtomczyk (Thu, 03 Oct 2019 13:12:49 GMT):
Where can I find good example about fabric-gateway-java with service discovery ?
bestbeforetoday (Thu, 03 Oct 2019 13:16:21 GMT):
Keep the Gateway for subsequent transactions by the same user
bestbeforetoday (Thu, 03 Oct 2019 13:47:39 GMT):
From a Gateway perspective, the only thing different with discovery should be setting discovery on with `GatewayBuilder.discovery(true)`. Setting up a Fabric environment that supports discovery is a little more involved but that's nothing specific to the SDK
bestbeforetoday (Thu, 03 Oct 2019 13:49:28 GMT):
There is a connection profile that the _fabric-gateway-java_ integration tests use for testing with discovery here: https://github.com/hyperledger/fabric-gateway-java/blob/master/src/test/java/org/hyperledger/fabric/gateway/connection-discovery.json
AbhishekDudhrejia (Fri, 04 Oct 2019 05:30:58 GMT):
Has joined the channel.
mattiabolzonella1 (Fri, 04 Oct 2019 06:35:26 GMT):
@sstone1 I'm refferring to this discussion
mattiabolzonella1 (Fri, 04 Oct 2019 06:36:05 GMT):
https://chat.hyperledger.org/channel/fabric-sdk-java?msg=nfDAGTPNXQGCgueB3 this discussion
dan13 (Fri, 04 Oct 2019 13:02:42 GMT):
@mattiabolzonella1 I have not gone down this path yet, but I have the same need you do. I do see that ContractException has a payload, so perhaps the path is to make sure the chaincode error is raised as ContractException instead of GatewayRuntimeException?
silliman (Fri, 04 Oct 2019 19:30:17 GMT):
Has anybody successfully used the Fabric Java SDK running within a 32-bit JVM to connect to a TLS-enabled orderer or peer?
Jelle.Diet (Mon, 07 Oct 2019 07:12:54 GMT):
Is there a way to get en Enrollment or User (from java sdk) from the gateway Identity object?
Jelle.Diet (Mon, 07 Oct 2019 07:12:54 GMT):
Is there a way to get an Enrollment or User (from java sdk) from the gateway Identity object?
aatkddny (Mon, 07 Oct 2019 15:16:44 GMT):
anyone using the ibm version and moving from 1.0 to 2.0? i have a question about connecting.
aatkddny (Mon, 07 Oct 2019 15:16:44 GMT):
anyone using the ibm version and moved from 1.0 to 2.0? i have a question about connection profiles.
jdfigure (Mon, 07 Oct 2019 15:53:18 GMT):
I'm running into an issue setting Netty options using a network config file. In my network config json file, setting an integer Netty config via `peers.grpcOptions` like `"grpc.NettyChannelBuilderOption.maxInboundMessageSize": 123456` causes `java.lang.NoSuchMethodException: io.grpc.netty.NettyChannelBuilder.maxInboundMessageSize(java.lang.String)` . The `org.hyperledger.fabric.sdk.NetworkConfig#getJsonValue` is converting the integer to its string value. This causes `org.hyperledger.fabric.sdk.Endpoint#addNettyBuilderProps` to fail because it can't find the appropriate method. Probably need a Jira for this?
davidkel (Mon, 07 Oct 2019 16:54:02 GMT):
Have you tried raising a ticket with IBM ?
aatkddny (Mon, 07 Oct 2019 17:19:59 GMT):
have you ever tried to use their support?
Jelle.Diet (Tue, 08 Oct 2019 07:45:39 GMT):
I use the ibm blockchain cloud platform if that's what you mean
bestbeforetoday (Tue, 08 Oct 2019 13:29:57 GMT):
Yes, please raise a Jira against _fabric-sdk-java_ : https://jira.hyperledger.org/projects/FABJ
Or push up a fix if you prefer ;)
mauricio (Wed, 09 Oct 2019 02:34:07 GMT):
Has joined the channel.
icordoba (Wed, 09 Oct 2019 08:18:12 GMT):
Hello, can anybody link me to an example of how to update the anchor peers using sdk-java? (Equivalent to "Update the anchor peers" in the BYFN tutorial?
aatkddny (Wed, 09 Oct 2019 12:42:11 GMT):
have you ever added a peer to a channel? if so the process is very similar - you stick the update payload in something like this:
```
public Map
aatkddny (Wed, 09 Oct 2019 12:42:11 GMT):
have you ever added a peer to a channel? if so the process is very similar - you stick the update payload in rather like this, instead of shoving it in `"channel_group">"groups">"Application">"groups"`:
```
public Map
dan13 (Thu, 10 Oct 2019 15:28:15 GMT):
@sstone1 any update on above question from @mattiabolzonella1 : "Can i get the invalid response message returned by the chaincode using the gateway SDK?"
bestbeforetoday (Thu, 10 Oct 2019 15:39:01 GMT):
@dan13 On the previous thread you linked I suggested raising a Jira to capture this as a requirement. I don't see any sign of that having happened so I'll raise one now
dan13 (Thu, 10 Oct 2019 15:54:41 GMT):
Ah, thanks -- must've missed that. Much appreciated!
bestbeforetoday (Thu, 10 Oct 2019 15:56:46 GMT):
Here is the Jira I have raised: https://jira.hyperledger.org/browse/FGJ-57
Feel free to comment if I've missed any information. I can't say how soon this is likely to get to the top of my todo list
aatkddny (Fri, 11 Oct 2019 01:21:31 GMT):
The intent with the gateway seems to be to make it a per user connection - which means having a lot more of them cached than the HFClient approach (where it's thread safe and you can swap users as soon as you submit the Tx). Is the Contract you get from the gateway still thread safe or do you need to do a gateway#getnetwork#get contract every time you want to run a Tx in a multithreaded environment? We have some system users that could potentially be running Txs concurrently.
Also a suggestion for the Builder. I have a bunch of user ids that already implement User.
I could extract the msp and the cert and pk from their Enrollment, so having a builder#identity method allowing me to pass them in would be quite nice. Or better - support passing in a User directly. so I don't have to roll my own Wallet (all our ids are encrypted and stored in a DB - our security team would have conniptions if I said we were storing user identities on the filesystem).
aatkddny (Fri, 11 Oct 2019 01:21:31 GMT):
The intent with the gateway seems to be to make it a per user connection - which means having a lot more of them cached than the HFClient approach (where it's thread safe and you can swap users as soon as you submit the Tx). Is the Contract you get from the gateway still thread safe or do you need to do a gateway#getnetwork#get contract every time you want to run a Tx in a multithreaded environment? We have some system users that could potentially be running Txs concurrently.
Also a suggestion for the Builder. I have a bunch of user ids that already implement User.
I could extract the msp and the cert and pk from their Enrollment, so having a builder#identity method allowing me to pass them in would be quite nice. Or better - support passing in a User directly. Then I don't have to roll my own Wallet (all our ids are encrypted and stored in a DB - our security team would have conniptions if I said we were storing user identities on the filesystem).
vtech (Fri, 11 Oct 2019 07:39:19 GMT):
hsm
Jelle.Diet (Fri, 11 Oct 2019 07:44:18 GMT):
It is possible to create an identity from an Enrollment if that's what you mean, like so : Identity identity = Wallet.Identity.createIdentity("Org1MSP", enrollment.getCert(), enrollment.getKey());
aatkddny (Fri, 11 Oct 2019 12:13:38 GMT):
That's fairly obvious.
But unless you want to stick the then created identities into a wallet on your file system (or in memory) you still need to have a way to pass them into Gateway#Builder#Identity - all the methods there seem to require a wallet.
In this case accepting the User as an alternative would - imnsho - help with integrating identities that have followed the User pattern. Or if the desire is to pretend none of that ever happened, just accepting an Identity without requiring the wallet, requiring that the implementing code build it would perform the same function. Either works.
It's not a ton of code to write something that'll act as a wallet against a DB of User objects, but then you (one) are at the mercy of keeping up with whatever the next shiny thing is.
aatkddny (Fri, 11 Oct 2019 12:13:38 GMT):
That's fairly obvious.
But unless you want to stick the then created identities into a wallet on your file system (or in memory) you still need to have a way to pass them into Gateway#Builder#Identity - all the methods there seem to require a wallet. Creating an in memory one just for this is a hack imo.
In this case accepting the User as an alternative would - imnsho - help with integrating identities that have followed the User pattern. Or if the desire is to pretend none of that ever happened, just accepting an Identity without requiring the wallet, requiring that the implementing code build it would perform the same function. Either works.
It's not a ton of code to write something that'll act as a wallet against a DB of User objects, but then you (one) are at the mercy of keeping up with whatever the next shiny thing is.
bestbeforetoday (Fri, 11 Oct 2019 13:20:30 GMT):
@aatkddny The design is that a gateway represents a single users connection. It might be possible for us optimise the internals so low-level resources are shared between Gateway instances but this does not happen today and is not something I expect to happen near-term.
bestbeforetoday (Fri, 11 Oct 2019 13:20:39 GMT):
You should be able to safely call `create/submit/evaluateTransaction()` concurrently so no need to keep calling `Gateway.getNetwork().getContract()`
bestbeforetoday (Fri, 11 Oct 2019 13:22:26 GMT):
I am planning on refactoring the wallet implementation for 2.0 in-line with the refactoring I've already done in _master_ branch of the Node SDK. Right now the objective is just equivalence with the way wallets and identities are used today. So your options would be to use an in-memory wallet and populate the content with externally stored identity information, or to write a `WalletStore` implementation that acts as an adapter to wherever your identity information is held. The refactor of wallets makes this much easier and more robust that before but does mean you have to deal with the identity persistent format, which might not be ideal for you
bestbeforetoday (Fri, 11 Oct 2019 13:23:46 GMT):
Being able to just supply an identity yourself without using a wallet sounds like a reasonable feature request. Could you raise a _Story_ to capture this in Jira? https://jira.hyperledger.org/projects/FGJ
aatkddny (Fri, 11 Oct 2019 13:27:25 GMT):
It appears - since I was trying it this am and have trace enabled - that the gateway is just a wrapper around the NetworkConfig/HFClient stuff I'm using anyway rather than something completely new. Until I have time to figure out where the ClassCast error I'm getting is coming from with the config I generate (somewhere in the certs) I'll leave it alone.
I already wrote an implementation that does pretty what you said above to wrap my user service with an in memory wallet. It's not exactly rocket science, but the maintenance when something else new and shiny comes along is my concern.
I'll add a jira. Thx.
aatkddny (Fri, 11 Oct 2019 13:41:30 GMT):
Also ``The design is that a gateway represents a single users connection. It might be possible for us optimise the internals so low-level resources are shared between Gateway instances but this does not happen today and is not something I expect to happen near-term.``
I'm talking about a single user identity - created for system processes - that may be running concurrently in multiple threads. So in this case (probably) the Network instance needs to be able to support multithreading, unless it creates a new HFClient under the covers for every Contract (which won't scale well).
The HFClient (sort of) will multithread in that once you send the Tx, you can reuse it so you don't need to serialize for very long. Something that properly serializes this access internally would be helpful here.
aatkddny (Fri, 11 Oct 2019 13:41:30 GMT):
Also ``The design is that a gateway represents a single users connection. It might be possible for us optimise the internals so low-level resources are shared between Gateway instances but this does not happen today and is not something I expect to happen near-term.``
I'm talking about a single user identity - created for system processes - that may be running concurrently in multiple threads. So in this case (probably) the Network instance needs to be able to support multithreading, unless it creates a new HFClient under the covers for every Contract (which may not scale well because creating one of those seems to take a while longer than I'd like).
The HFClient (sort of) will multithread in that once you send the Tx, you can reuse it so you don't need to serialize for very long. Something that properly serializes this access internally would be helpful here.
aatkddny (Fri, 11 Oct 2019 13:57:12 GMT):
@bestbeforetoday one final thing...
My class cast issue above is the same thing I had to put a fix into my own code for.
This comment covers it:
```* There's an issue with the way client certificates are passed. The JSON Object writers won't allow you to put a byte[] in as a value. This means the client certificate bytes need to be translated from the string representations and injected into the properties objects before you can use them.
```
Before I go digging into the code, do you remember how you are getting round this with the inputstream?
aatkddny (Fri, 11 Oct 2019 13:57:12 GMT):
@bestbeforetoday one final thing...
My class cast issue above is the same thing I had to put a fix into my own code for.
This comment covers it:
```* There's an issue with the way client certificates are passed. The JSON Object writers won't allow you to put a byte[] in as a value. This means the client certificate bytes need to be translated from the string representations and injected into the properties objects before you can use them. The SDK does this for PEM string, but not for these.
```
Before I go digging into the code, do you remember how you are getting round this with the inputstream?
aatkddny (Fri, 11 Oct 2019 13:57:12 GMT):
@bestbeforetoday one final thing...
My class cast issue above is the same thing I had to put a fix into my own code for (FABJ-468).
This comment covers it:
```* There's an issue with the way client certificates are passed. The JSON Object writers won't allow you to put a byte[] in as a value. This means the client certificate bytes need to be translated from the string representations and injected into the properties objects before you can use them. The SDK does this for PEM string, but not for these.
```
Before I go digging into the code, do you remember how you are getting round this with the inputstream?
aatkddny (Fri, 11 Oct 2019 18:25:15 GMT):
Addendums: You aren't. You have the same issue.
If anyone else has this network config issue but wants to use the Gateway this'll fix you up. I was looking for a way in for a while before I remembered to use reflection...
```
GatewayImpl.Builder builder = (Builder) Gateway.createBuilder().identity(wallet, "id");
Field ccpField = builder.getClass().getDeclaredField("ccp");
ccpField.setAccessible(true);
ccpField.set(builder, myNetworkConfig);
```
aatkddny (Fri, 11 Oct 2019 18:25:15 GMT):
Addendums: You aren't. You have the same issue.
If anyone else has this network config issue but wants to use the Gateway this'll fix you up. I was looking for a way in for a while before I remembered to use reflection...
```
GatewayImpl.Builder builder = (Builder) Gateway.createBuilder().identity(wallet, "id");
Field ccpField = builder.getClass().getDeclaredField("ccp");
ccpField.setAccessible(true);
ccpField.set(builder, myNetworkConfig);
```
aatkddny (Fri, 11 Oct 2019 18:25:15 GMT):
Addendum: You aren't. You have the same issue with the certs.
If anyone else has this network config issue but wants to use the Gateway this'll fix you up. I was looking for a way in for a while before I remembered to use reflection...
```
GatewayImpl.Builder builder = (Builder) Gateway.createBuilder().identity(wallet, "id");
Field ccpField = builder.getClass().getDeclaredField("ccp");
ccpField.setAccessible(true);
ccpField.set(builder, myNetworkConfig);
...
do the connect and follow the example
```
aatkddny (Fri, 11 Oct 2019 18:25:15 GMT):
Addendum: You aren't. You have the same issue with the certs.
If anyone else has this network config issue but wants to use the Gateway with a NetworkConfig in hand this'll fix you up. I was looking for a way in for a while before I remembered to use reflection...
```
GatewayImpl.Builder builder = (Builder) Gateway.createBuilder().identity(wallet, "id");
Field ccpField = builder.getClass().getDeclaredField("ccp");
ccpField.setAccessible(true);
ccpField.set(builder, myNetworkConfig);
...
do the connect and follow the example
```
dan13 (Fri, 11 Oct 2019 18:27:18 GMT):
Can you clarify the multithreading issue(s) with fabric-sdk-java HFClient? Under what conditions or how used you see threads conflicting?
aatkddny (Fri, 11 Oct 2019 18:41:54 GMT):
This might be a bit involved. I'll try not to make it too tl;dr
Consider a single-threaded application where you have a single HFClient - hfc - and two Users - U1 and U2
You are already connected to the channel.
To run a Tx you can stick U1 in hfc and off you go.
You can then stick U2 in hfc and the same applies. You are free to run a Tx.
Now same actors but multithreaded.
U1 in thread1, U2 in thread2.
If they are concurrent you can collide - swapping U2 for U1 while U1 is halfway through a Tx isn't going to do what you think it should do.
So you would think you'd serialize the client for the entire Tx.
Well not exactly. It turns out that you don't need to do it for the entire Tx. Just up until it ships it off. You DO need to serialize under these conditions though to avoid collisions. I'd need to dig back into the code - or the find the conversation with Rick on here about this some time ago - to find the exact spot. It's around one of the GRPC proto calls.
So drifting back to my question here which is only tangentially related.
I have a gateway for U1. Which gets a network. Which gets a contract.
If am running multithreaded and U1 could in theory run transactions in more than one thread at the same time, what's the serialization strategy for reuse? Do I need to get a network in each thread, or a contract in each thread or can it be synchronized in the gateway code itself?
aatkddny (Fri, 11 Oct 2019 18:41:54 GMT):
@dan13 This might be a bit involved. I'll try not to make it too tl;dr
Consider a single-threaded application where you have a single HFClient - hfc - and two Users - U1 and U2
You are already connected to the channel.
To run a Tx you can stick U1 in hfc and off you go.
You can then stick U2 in hfc and the same applies. You are free to run a Tx.
Now same actors but multithreaded.
U1 in thread1, U2 in thread2.
If they are concurrent you can collide - swapping U2 for U1 while U1 is halfway through a Tx isn't going to do what you think it should do.
So you would think you'd serialize the client for the entire Tx.
Well not exactly. It turns out that you don't need to do it for the entire Tx. Just up until it ships it off. You DO need to serialize under these conditions though to avoid collisions. I'd need to dig back into the code - or the find the conversation with Rick on here about this some time ago - to find the exact spot. It's around one of the GRPC proto calls.
So drifting back to my question here which is only tangentially related.
I have a gateway for U1. Which gets a network. Which gets a contract.
If am running multithreaded and U1 could in theory run transactions in more than one thread at the same time, what's the serialization strategy for reuse? Do I need to get a network in each thread, or a contract in each thread or can it be synchronized in the gateway code itself?
dan13 (Fri, 11 Oct 2019 19:13:20 GMT):
Thank you -- that was very cogently and concisely stated. I *hope* the answer to your last question is Contract (at worst). With respect to hfc, in my current situation I maintain an hfc instance per user (these are system-type users and only a few, all connected at service startup), so I'm never setting/switching the user. Seems like I avoided the multithread-user-switch issue, unless there are other problems with reusing hfc without user switch? I'll search for your previous conversation here! Thanks!
dan13 (Fri, 11 Oct 2019 19:13:20 GMT):
@aatkddny Thank you -- that was very cogently and concisely stated. I *hope* the answer to your last question is Contract (at worst). With respect to hfc, in my current situation I maintain an hfc instance per user (these are system-type users and only a few, all connected at service startup), so I'm never setting/switching the user. Seems like I avoided the multithread-user-switch issue, unless there are other problems with reusing hfc without user switch? I'll search for your previous conversation here! Thanks!
karthikspb (Mon, 14 Oct 2019 06:32:17 GMT):
Has joined the channel.
karthikspb (Mon, 14 Oct 2019 06:40:49 GMT):
Java chaincode cannot be deployed and instantiated through fabric sdk java
Jelle.Diet (Mon, 14 Oct 2019 07:53:01 GMT):
In my application I set the User on the TransactionProposalRequest itself, not switching the HFC User. Does this also avoidthe multithread issue?
HofmT (Mon, 14 Oct 2019 15:20:28 GMT):
Hi community,
I'm also facing an issue when instantiating java chaincode through the fabric java SDK. I'm able to install the chaincode but I keep failing at instantiating it via the java SDK. When sending the installProposalRequest it always returns "Undefined contract method called". I have definitely no typo in the name. On top of that, I'm even able to instantiate it via the 'peer chaincode instantiate' command. It's just the SDK that is causing troubles.
I thought it might be related to the fact that I'm using the annotation chaincode style which you can also find in the FabCar sample chaincode here: https://github.com/hyperledger/fabric-samples/tree/release-1.4/fabcar/java
Other than that I'm using container version 1.4.3 and SDK version release 1.4
I appreciate your help. Please let me know if you need any further information. Thanks!
diego_ (Mon, 14 Oct 2019 17:08:27 GMT):
Has joined the channel.
bestbeforetoday (Tue, 15 Oct 2019 08:29:08 GMT):
You can use a single Contract instance to send multiple transactions concurrently. It is thread-safe. A new client is not created every time
bestbeforetoday (Tue, 15 Oct 2019 08:33:02 GMT):
I replied in another thread but... you can use a single Contract instance to invoke multiple transactions concurrently. The concurrency issue you might face is at the blockchain level if multiple in-flight transactions have overlapping read/write sets (i.e. they manipulate the same data keys). This will result in a failure but is nothing to do with the thread safety of the client API
aatkddny (Tue, 15 Oct 2019 13:08:32 GMT):
Has anyone got the Contract#addContractListener(
bestbeforetoday (Tue, 15 Oct 2019 13:34:02 GMT):
The scenario tests exercise the contract listeners in a real Fabric environment, and I've used it myself for demo purposes too, so it does work. The one thing to check is that you have peers marked with the _eventSource_ role as it's only those peers that the (low-level) SDK will connect to for receiving events.
aatkddny (Tue, 15 Oct 2019 13:40:48 GMT):
I can see the peers throwing block events.
`Sending block event 'Channel everything-channel eventqueue got block event with block number: 32 for channel: everything-channel, from Peer{`
As I said I can trace the thing into the Listeners class where it ends up in here:
`Consumer
bestbeforetoday (Tue, 15 Oct 2019 13:46:17 GMT):
In case it helps, from my demo code:
``` // Listen for block events.
network.addBlockListener(this::acceptBlockEvent);
// Listen for contract events.
contract.addContractListener(this::acceptContractEvent);
```
``` private void acceptBlockEvent(BlockEvent event) {
long blockNumber = event.getBlockNumber();
System.out.println("Received block number " + blockNumber);
}
private void acceptContractEvent(ContractEvent event) {
String message = String.format("Received contract event named %s with %s",
event.getName(),
getPayloadString(event.getPayload()));
System.out.println(message);
}
private String getPayloadString(Optional
bestbeforetoday (Tue, 15 Oct 2019 13:47:35 GMT):
And the connection profile contains:
``` "channels": {
"mychannel": {
"orderers": [
"orderer.example.com"
],
"peers": {
"peer0.org1.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"ledgerQuery": true,
"eventSource": true
}
}
}
},
```
bestbeforetoday (Tue, 15 Oct 2019 13:50:59 GMT):
Also, if you are receiving the block event OK, are you definitely emitting an event from the chaincode? From my (Node.js) demo chaincode:
``` async createCar(ctx, carNumber, make, model, color, owner) {
ctx.stub.setEvent('createCar', Buffer.from(carNumber));
console.info('============= END : Create Car ===========');
}
```
bestbeforetoday (Tue, 15 Oct 2019 13:50:59 GMT):
Also, if you are receiving the block event OK, are you definitely emitting an event from the chaincode? From my (Node.js) demo chaincode:
``` async createCar(ctx, carNumber, make, model, color, owner) {
ctx.stub.setEvent('createCar', Buffer.from(carNumber));
}
```
aatkddny (Tue, 15 Oct 2019 13:58:28 GMT):
I'm not getting the block either.
aatkddny (Tue, 15 Oct 2019 13:58:28 GMT):
I'm not getting the block either. Code is trivial -
```
Gateway gateway = cache.gateway(org, user);
Network network = gateway.getNetwork(channel);
Consumer
aatkddny (Tue, 15 Oct 2019 14:00:56 GMT):
Cache is a cache of GatewayImpls by id.
bestbeforetoday (Tue, 15 Oct 2019 14:58:08 GMT):
One side note... if you are creating a new checkpoint file every time and not re-connecting to the file used previously, the checkpointing is really doing nothing for you so you should just add a block listener without checkpointer
aatkddny (Tue, 15 Oct 2019 14:59:51 GMT):
This was a test to see if checkpointing replayed what I missed.
bestbeforetoday (Tue, 15 Oct 2019 14:59:52 GMT):
If the peer is committing blocks but you are not receiving block events at your client, check the peer has the _eventSource_ role. You could try something like:
```network.getChannel().getPeers(EnumSet.of(Peer.PeerRole.EVENT_SOURCE))
```
aatkddny (Tue, 15 Oct 2019 15:01:57 GMT):
I'm getting the blocks now. I'm not too bright - chaincode that doesn't throw events doesn't get called - :(
I was hoping to use the checkpoint to replay everything that was missed for *this* listener. That would remove a ton of code in my app, and this was a test to see if it did just that.
aatkddny (Tue, 15 Oct 2019 15:01:57 GMT):
I'm getting the blocks now. I'm not too bright - chaincode that doesn't throw events doesn't get the eventing functions called - :(
I was hoping to use the checkpoint as a crutch to replay everything that was missed for *this* listener. That would remove a ton of code in my app, and this was a test to see if it did just that.
aatkddny (Tue, 15 Oct 2019 15:01:57 GMT):
I'm getting the blocks now. I'm not too bright - chaincode that doesn't throw events doesn't get the eventing functions called - :(
I was hoping to use the checkpoint as a crutch to replay everything that was missed for *this* listener. That would remove a ton of code in my app, and this was a test to see if it did just that. I could then rely on my stuff to be eventually consistent regardless of state, which would have been a rather nice bonus for me.
bestbeforetoday (Tue, 15 Oct 2019 15:06:36 GMT):
That is exactly what checkpointing is designed to do. You just need to make sure a given listener is using the same checkpointer. So if you are using a file to store checkpoint information (file checkpointer), your listener needs to connect to the same file every time it is started up. Something like:
```Checkpointer checkpointer = DefaultCheckpointers.file(Paths.get("contractcheckpoint.json");
contract.addContractListener(checkpointer, this::acceptContractEvent);
```
bestbeforetoday (Tue, 15 Oct 2019 15:06:36 GMT):
That is exactly what checkpointing is designed to do. You just need to make sure a given listener is using the same checkpointer. So if you are using a file to store checkpoint information (file checkpointer), your listener needs to connect to the same file every time it is started up. Something like:
```Checkpointer checkpointer = DefaultCheckpointers.file(Paths.get("contractcheckpoint.json"));
contract.addContractListener(checkpointer, this::acceptContractEvent);
```
bestbeforetoday (Tue, 15 Oct 2019 15:07:41 GMT):
The very first time that listener is added, the checkpoint file will not exist and so the listener will start listening from the current point in time
bestbeforetoday (Tue, 15 Oct 2019 15:08:04 GMT):
As soon as any block events are received, they will be recorded in the checkpoint file
bestbeforetoday (Tue, 15 Oct 2019 15:08:33 GMT):
If you take your client off-line and restart it again later, re-attaching to the same checkpoint file, the listener will start receiving events from where it left off
aatkddny (Tue, 15 Oct 2019 15:08:37 GMT):
Then wouldn't I expect to get all the blocks for this listener if the checkpointer is new. Because right now I'm not getting anything until I do an update.
I understand I need the same one - and I have a different thing than a file in mind for it. As I said this was a test.
aatkddny (Tue, 15 Oct 2019 15:08:37 GMT):
Then wouldn't I expect to get all the blocks - from block 0 - for this listener if the checkpointer is new. Because right now I'm not getting anything until I do an update.
I understand I need the same one - and I have a different thing than a file in mind for it. As I said this was a test.
aatkddny (Tue, 15 Oct 2019 15:08:37 GMT):
Then wouldn't I expect to get all the blocks - from block 0 - for this listener if the checkpointer is new. Because right now I'm not getting anything until I do an update.
I understand I need the same checkpointer to actually use this - and I have a different thing than a file in mind for it. As I said this was a test.
bestbeforetoday (Tue, 15 Oct 2019 15:10:24 GMT):
If you just want to play from block 0 then you could attach a listener as `contract.addContractListener(0, this::acceptContractEvent)`
aatkddny (Tue, 15 Oct 2019 15:12:35 GMT):
I don't. I want to have a real ongoing checkpointed set of blocks for trailing aggregations.
But when I attach a listener - any listener - to a channel I want it to start from 0 if this is a new checkpointer.
So it streams everything from 0->current once and once only to allow me to recreate and maintain the state at any point for any purpose.
aatkddny (Tue, 15 Oct 2019 15:12:35 GMT):
I don't. I want to have a real ongoing checkpointed set of blocks for trailing aggregations.
But when I attach a listener - any listener - to a channel I want it to start from 0 if this is a new checkpointer.
So it streams everything from 0->current once and once only *and keeps going* to allow me to recreate and maintain the state at any point for any purpose.
bestbeforetoday (Tue, 15 Oct 2019 15:14:47 GMT):
You should be able to do that with something like this:
``` Checkpointer checkpointer = DefaultCheckpointers.file(Paths.get("contractcheckpoint.json");
if (checkpointer.getBlockNumber() == Checkpointer.UNSET_BLOCK_NUMBER) {
checkpointer.setBlockNumber(0);
}
contract.addContractListener(checkpointer, this::acceptContractEvent);
```
bestbeforetoday (Tue, 15 Oct 2019 15:14:47 GMT):
You should be able to do that with something like this:
``` Checkpointer checkpointer = DefaultCheckpointers.file(Paths.get("contractcheckpoint.json"));
if (checkpointer.getBlockNumber() == Checkpointer.UNSET_BLOCK_NUMBER) {
checkpointer.setBlockNumber(0);
}
contract.addContractListener(checkpointer, this::acceptContractEvent);
```
aatkddny (Tue, 15 Oct 2019 15:15:26 GMT):
So unset_block is latest and 0 is from start. Got it. Thx.
aatkddny (Tue, 15 Oct 2019 15:15:59 GMT):
Appreciate the help.
bestbeforetoday (Tue, 15 Oct 2019 15:16:05 GMT):
You're welcome! :)
bestbeforetoday (Tue, 15 Oct 2019 15:18:29 GMT):
You got it, the `UNSET_BLOCK_NUMBER` means this checkpointer has not yet seen any blocks. And the behaviour for checkpoint listening when no previous blocks have been seen is to start at the current block
biligunb (Wed, 16 Oct 2019 03:11:33 GMT):
Has joined the channel.
biligunb (Wed, 16 Oct 2019 03:11:35 GMT):
1 simple question
Which one is faster?
1. Java SDK
2. Node SDK
gunso (Wed, 16 Oct 2019 10:10:57 GMT):
Has joined the channel.
gunso (Wed, 16 Oct 2019 10:16:36 GMT):
Hi, we think using fabric-gateway-java instead of fabric-sdk-java for our client in production environment. Is fabric-gateway-java stable?
bestbeforetoday (Wed, 16 Oct 2019 13:05:29 GMT):
Yes, it is at release version 1.4 now. The API will stay stable in the 1.4 branch
aatkddny (Wed, 16 Oct 2019 15:26:20 GMT):
Yeah - we see that fairly often in eventing - if the event dispatches another Tx that read assets in the original Tx.
Function of the design, but it's a shame - or at least our devs think it's a shame - you can't flag that you don't care about reads in the RW TxSet somehow. :D
aatkddny (Wed, 16 Oct 2019 15:26:20 GMT):
Yeah - we see that fairly often in eventing - if the event dispatches another Tx that read assets in the original Tx.
Function of the design, but it's a shame - or at least our devs think it's a shame - you (one) can't flag that you don't care about reads in the RW TxSet somehow. :D
gunso (Thu, 17 Oct 2019 00:40:26 GMT):
Got it. Thank you!
mahoney1 (Thu, 17 Oct 2019 09:04:40 GMT):
reminder that the Fabric Application Developer Community call today is at 3pm UTC (4pm UK, 11am ET, 8am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Fabric+Application+Developer+Community+Call
gunso (Thu, 17 Oct 2019 09:16:08 GMT):
Hello again, sorry for a lot of questions. Is it possible to execute chaincode extending ChaincodeBase (not implementing ContractInterface) from fabric-java-gateway's API? I can find sample code using ContractInterface but not ChaincodeBase..
aatkddny (Thu, 17 Oct 2019 13:52:19 GMT):
It's org.hyperledger.fabric.sdktest.ProposalWaitTime to fix query timeouts, right?
I should remember this by now...
aatkddny (Thu, 17 Oct 2019 13:52:19 GMT):
It's `org.hyperledger.fabric.sdktest.ProposalWaitTime` to fix query timeouts, right?
I should remember this by now...
dan13 (Thu, 17 Oct 2019 14:49:43 GMT):
It was previously stated here that "the high level [gateway] is built on top of the low level. so you can use the low level SDK to call a high level smart contract (assuming you know what args to pass in), and the high level [gateway] SDK to call a low level smart contract (Invoke will just get called)". I have no personally tested this yet.
gunso (Fri, 18 Oct 2019 00:12:28 GMT):
Got it. Thank you for reply!
SamYuan1990 (Fri, 18 Oct 2019 07:27:11 GMT):
Has joined the channel.
SamYuan1990 (Fri, 18 Oct 2019 07:30:09 GMT):
Hi Guys, I am try with IdeMix feature with BYFN and I am confusing now. I am going to verify the IdeMix via golang cid interface in my chaincode. And I am create my user as idemixUser.setIdemixEnrollment(ca.idemixEnroll(idemixUser.getEnrollment(), mspID));
in End2endIdemixIT.java , however, my peer node reports error msg as MSP error: could not decode the PEM structure, and my client reports exception as description=access denied
SamYuan1990 (Fri, 18 Oct 2019 07:31:52 GMT):
can anyone help correct me about may I able to use a user with enrollment by (ca.idemixEnroll) directly to send transaction to fabric network? if not, what else should I do for make it working.
bestbeforetoday (Fri, 18 Oct 2019 12:06:56 GMT):
The integration tests for _fabric-gateway-java_ use both a Contract-based and a plain chaincode implementation to test against. You get hold of a plain chaincode by calling `network.getContract(chaincodeId)`. If you only have a single (default) smart contract in a chaincode container then you do the same to interact with a Contract. If you have multiple (namespaced) smart contracts in a chaincode container then you get hold of them using `network.getContract(chaincodeId, contractName)`. Other than that you use them identically from the client side.
gunso (Sat, 19 Oct 2019 12:49:26 GMT):
So, the test is done. Got it. Thanks!
justformorefun (Mon, 21 Oct 2019 06:29:29 GMT):
Has joined the channel.
justformorefun (Mon, 21 Oct 2019 06:29:30 GMT):
hi, guys. I came across error when I create channel using java sdk. The detailed error is following:org.hyperledger.fabric.sdk.exception.TransactionException: Channel mychannel, send transaction failed on orderer OrdererClient{id: 4, channel: mychannel, name: orderer.example.com, url: grpc://localhost:7050}. Reason: Channel mychannel orderer orderer.example.com status returned failure code 400 (BAD_REQUEST) during orderer next
at org.hyperledger.fabric.sdk.OrdererClient.sendTransaction(OrdererClient.java:236)
at org.hyperledger.fabric.sdk.Orderer.sendTransaction(Orderer.java:161)
at org.hyperledger.fabric.sdk.Channel.sendUpdateChannel(Channel.java:531)
at org.hyperledger.fabric.sdk.Channel.
justformorefun (Mon, 21 Oct 2019 06:37:41 GMT):
Another question: how to run single integration test case in fabric-java-sdk's repo? any commands available there? I look for mvn failsafe:integration-test -DskipITs=false, but it is for all integration test. Now I wanna to only run End2endIdemixIT.java integration test. Any replies will be thankful.
aatkddny (Mon, 21 Oct 2019 13:46:43 GMT):
Anyone use the Gateway code with IBP2?
There seems to be a mismatch between the provided connection profile and the code in Identity#createIdentity.
Specifically parser.readObject() is returning null.
Yeah yeah - write my own implementation. I know...
medikent (Tue, 22 Oct 2019 04:41:10 GMT):
Are you able to invoke a chaincode method through the Java SDK?
medikent (Tue, 22 Oct 2019 04:42:17 GMT):
Did you find a solution to this? I haven't tried this myself yet.
medikent (Tue, 22 Oct 2019 04:44:23 GMT):
Have you written something that acts as a wallet against a DB of user objects? I am doing just that now and am looking for a good example.
medikent (Tue, 22 Oct 2019 04:46:50 GMT):
Do you know of a simple example that uses Spring Boot of an app that creates Fabric users and connects to Fabric with those newly created users?
medikent (Tue, 22 Oct 2019 04:52:02 GMT):
What are some possible causes for getting a gRPC *access denied* failure when getting the ConfigBlock?
I am using a newly generated fabric identity to invoke a chaincode function on a channel. Do I need to create a user with access to a given channel?
Below is my stack trace:
```
org.hyperledger.fabric.sdk.exception.ProposalException:
org.hyperledger.fabric.sdk.exception.TransactionException:
org.hyperledger.fabric.sdk.exception.ProposalException:
getConfigBlock for channel alexchannel failed with peer alex.example.org.
Status FAILURE, details: Channel Channel{id: 4, name: alexchannel}
Sending proposal with transaction: c88ec73a833a8a8e026e4f03090e058c44b9efec15873470ddd9e8dc2e22cdcc
to Peer{ id: 1, name: alex.example.org, channelName: alexchannel, url: grpc://alex.example.org:8051}
failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [alexchannel] creator org [AlexMSP], cause=null}
```
justformorefun (Tue, 22 Oct 2019 06:39:35 GMT):
hi, everyone. should client side still use the private key in keystore directory for signing tx when trying idemix feature?
justformorefun (Tue, 22 Oct 2019 06:40:33 GMT):
yes but no idemix feature available
justformorefun (Tue, 22 Oct 2019 06:41:21 GMT):
@medikent
mattiabolzonella1 (Tue, 22 Oct 2019 08:58:07 GMT):
Hi, where couchDb indexes need to be placed inside the chaincode maven project?
medikent (Tue, 22 Oct 2019 14:43:42 GMT):
That's great. I am currently struggling to do invocation with the Java SDK. Do you know of a good example I could look at?
medikent (Tue, 22 Oct 2019 14:44:12 GMT):
Also, what functionality does Idemix give you?
justformorefun (Tue, 22 Oct 2019 15:30:42 GMT):
you can try https://github.com/IBM/blockchain-application-using-fabric-java-sdk
justformorefun (Tue, 22 Oct 2019 15:31:02 GMT):
but it does not support idemix
justformorefun (Tue, 22 Oct 2019 15:31:10 GMT):
good luch
justformorefun (Tue, 22 Oct 2019 15:31:15 GMT):
good luck
justformorefun (Tue, 22 Oct 2019 15:35:55 GMT):
hi, anyone here who know how to generate IssuerPublicKey ,IssuerRevocationPublicKey for org3.example.com and org4.example.com, these two org are idemix msp.
Bavaji (Tue, 22 Oct 2019 16:27:14 GMT):
Has joined the channel.
alecjones (Tue, 22 Oct 2019 18:58:32 GMT):
Has joined the channel.
alecjones (Tue, 22 Oct 2019 19:01:49 GMT):
Hello guys. I was trying to run the fabric java SDK from this repository (https://github.com/hyperledger/fabric-samples) but I get SSL error. Please check the attached error logs
alecjones (Tue, 22 Oct 2019 19:02:27 GMT):
logs.txt
nitishbhardwaj19 (Wed, 23 Oct 2019 07:31:52 GMT):
Hi @rickr, @bestbeforetoday I am trying to create a docker image for my java-sdk app. The app works great end-to-end when I tested in intellij. But, as soon I ran it as a docker container, I get a weird grpc connect exceptions when I try to join peers. Logs:
nitishbhardwaj19 (Wed, 23 Oct 2019 07:31:52 GMT):
Hi @rickr, @bestbeforetoday I am trying to create a docker image for my java-sdk app. The app works great end-to-end when I tested in intellij. But, as soon I ran it as a docker container, I get a weird grpc connect exceptions when I try to join peers. Logs:```
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: peer1.org1.example.com/172.18.0.12:7056
``` ```
I am able to enroll Users with CA and create a new channel
```
nitishbhardwaj19 (Wed, 23 Oct 2019 07:31:52 GMT):
Hi @rickr, @bestbeforetoday I am trying to create a docker image for my java-sdk app. The app works great end-to-end when I tested in intellij. But, as soon I ran it as a docker container, I get a weird grpc connect exceptions when I try to join peers. Base image for docker container is: openjdk:8. Logs:```
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: peer1.org1.example.com/172.18.0.12:7056
``` ```
I am able to enroll Users with CA and create a new channel
```
nitishbhardwaj19 (Wed, 23 Oct 2019 07:33:19 GMT):
logs.txt
alecjones (Wed, 23 Oct 2019 09:44:30 GMT):
```asd```
alecjones (Wed, 23 Oct 2019 09:46:10 GMT):
Hello guys. I get an error when invoking chaincode from this tutorial - https://github.com/IBM/blockchain-application-using-fabric-java-sdk.
```Oct 23, 2019 4:57:45 PM org.example.util.Util deleteDirectory
INFO: Deleting - admin.ser
Oct 23, 2019 4:57:45 PM org.example.util.Util deleteDirectory
INFO: Deleting - org1
Oct 23, 2019 4:57:45 PM org.example.util.Util deleteDirectory
INFO: Deleting - users
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.
Oct 23, 2019 4:57:47 PM org.example.client.CAClient enrollAdminUser
INFO: CA -http://localhost:7054 Enrolled Admin.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/D:/WORKSPACE/SKIOS/blockchain-tutorial/blockchain-application-using-fabric-java-sdk-master/network_resources/blockchain-client.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Oct 23, 2019 4:57:49 PM org.example.client.ChannelClient sendTransactionProposal
INFO: Sending transaction proposal on channel mychannel
org.hyperledger.fabric.sdk.exception.InvalidArgumentException: Proposal response is invalid.
at org.hyperledger.fabric.sdk.ProposalResponse.getChaincodeActionResponsePayload(ProposalResponse.java:272)
at org.example.client.ChannelClient.sendTransactionProposal(ChannelClient.java:121)
at org.example.chaincode.invocation.InvokeChaincode.main(InvokeChaincode.java:88)```
bestbeforetoday (Wed, 23 Oct 2019 12:56:09 GMT):
My guess would be that there is a networking issue with your docker containers. You could check whether your client container is on the same Docker virtual network as the peer and, if so, whether that is the correct IP address and port for the peer on the virtual network. If they are not connected to the same virtual network then check that all the correct port forwarding is in place to allow connections between your client container and the peer container via your host machines network layer. A simple approach to troubleshoot might be to connect to a shell terminal within the container and use the command-line to check network routing and connectivity
Sai_S 1 (Wed, 23 Oct 2019 14:51:11 GMT):
Has joined the channel.
medikent (Wed, 23 Oct 2019 20:40:01 GMT):
Any ideas why I would be getting an *access denied* gRPC error when trying to connect to a peer on my network through fabric-gateway-java?
medikent (Wed, 23 Oct 2019 20:41:40 GMT):
My error says "MSP error: channel doesn't exist"
medikent (Wed, 23 Oct 2019 20:41:46 GMT):
Yet the channel name is correct
nitishbhardwaj19 (Thu, 24 Oct 2019 04:16:10 GMT):
@bestbeforetoday Thanks for the suggestion. You are right. There was an issue with port mapping of that peer. I was mapping it with a different port which was being exposed other than 7051. Thanks for the suggestion.
nitishbhardwaj19 (Thu, 24 Oct 2019 04:16:10 GMT):
@bestbeforetoday Thanks for the suggestion. You are right. There was an issue with port mapping of that peer. I was mapping it with a different port which was being exposed other than 7051. Thank you so much for your input. You saved a day.
aatkddny (Thu, 24 Oct 2019 12:04:59 GMT):
This may be out of scope, and I think I already know the answer but figured I'd ask if anyone else had tried it yet.
If we switch to the Gateway/Network/Contract pattern, can the constructs be serialized so they can be shared across sessions in multiple containers.
I suspect the answer is no.
And if that is the case, is there a recommended approach for scaling out - sticky sessions, multiple local copies inside each container, something else?
I was going to go the multiple local copy route unless there's a good reason not to.
medikent (Thu, 24 Oct 2019 20:06:57 GMT):
Does anyone here have a working example of user enrollment and registration along with a working Fabric network setup I can use as a reference?
HofmT (Fri, 25 Oct 2019 07:52:59 GMT):
Unfortunately no, still getting the same error...
tschulshuh (Fri, 25 Oct 2019 14:22:51 GMT):
Has joined the channel.
tschulshuh (Fri, 25 Oct 2019 14:22:51 GMT):
Hello there, can someone tell me if it is possible to implement a private data collection by using java chaincode? i unterstand how private data is supposed to work on the network and sdk side, but cant figure out how i have to structure the java chaincode. Thanks
bestbeforetoday (Fri, 25 Oct 2019 15:18:26 GMT):
@HofmT I have a theory what the issue might be...
bestbeforetoday (Fri, 25 Oct 2019 15:20:35 GMT):
For some reason RocketChat isn't letting me reply to your thread right now so here goes... Any instantiate proposal sent by the Java SDK will include `init` as a function name to invoke during instantiate. My guess is that your contract implementation doesn't have an `init()` function and so the instantiate is failing. You could try implementing a no-op `init()` function in your contract to see if this allows you to instantiate using the Java SDK. If this does help, please let me know and perhaps we can make some changes to help this situation
bestbeforetoday (Fri, 25 Oct 2019 15:22:21 GMT):
If you need help with the chaincode / contract implementation, you might be better posting in the #fabric-chaincode-dev channel
bestbeforetoday (Fri, 25 Oct 2019 15:22:21 GMT):
If you need help with the chaincode / contract implementation, you might be better posting in the #fabric-java-chaincode channel
javier-ochoa (Sun, 27 Oct 2019 06:42:02 GMT):
Has joined the channel.
huxd (Mon, 28 Oct 2019 06:54:02 GMT):
does fabric-gateway-java SDK support idemix identity now? or does it intend to do that?
HofmT (Mon, 28 Oct 2019 09:21:23 GMT):
@bestbeforetoday Thank you, this did indeed fix the issue!
I added the following code snippet into my contract:
`@Transaction()
public void init(final Context ctx) {}
`
I just want to point out that it is important to include the parameter _Context ctx_ although it is not used. When I tested it without it, my Chaincode container crashed.
HofmT (Mon, 28 Oct 2019 09:21:23 GMT):
@bestbeforetoday Thank you, this did indeed fix the issue!
I added the following code snippet into my contract:
```java @Transaction()
public void init(final Context ctx) {}
```
I just want to point out that it is important to include the parameter _Context ctx_ although it is not used. When I tested it without it, my Chaincode container crashed.
HofmT (Mon, 28 Oct 2019 09:21:23 GMT):
@bestbeforetoday Thank you, this did indeed fix the issue!
I added the following code snippet into my contract:
``` @Transaction()
public void init(final Context ctx) {}
```
I just want to point out that it is important to include the parameter _Context ctx_ although it is not used. When I tested it without it, my Chaincode container crashed.
Bolzo 1 (Mon, 28 Oct 2019 09:24:04 GMT):
Has joined the channel.
ikar (Wed, 30 Oct 2019 09:10:41 GMT):
Has joined the channel.
ikar (Wed, 30 Oct 2019 09:11:31 GMT):
Hey there!
I got to the project that is based on BYFN sample, but limited to one organisation only. In my app when I call following code:
```
private Contract getContract(Gateway gw) {
return gw.getNetwork("mychannel").getContract("realchain");
}
```
following error is produced:
2019-10-30 09:34:51.433 INFO 23108 --- [nio-8080-exec-3] org.hyperledger.fabric.gateway.Gateway : Unable to load channel configuration from connection profile:
org.hyperledger.fabric.sdk.exception.NetworkConfigurationException: Channel configuration has no channels defined.
at org.hyperledger.fabric.sdk.NetworkConfig.loadChannel(NetworkConfig.java:519) ~[fabric-sdk-java-1.4.5-20190620.151745-1.jar:na]
at org.hyperledger.fabric.sdk.HFClient.loadChannelFromConfig(HFClient.java:161) ~[fabric-sdk-java-1.4.5-20190620.151745-1.jar:na]
at org.hyperledger.fabric.gateway.impl.GatewayImpl.getNetwork(GatewayImpl.java:258) ~[fabric-gateway-java-1.4.0-20191002.055106-31.jar:na]
...
...the app recovers somehow itself, but I suspect this error to slow down the whole interaction with the ledger.
Also I'd love to keep my logs clean from exceptions if possible ;)
Anyone encountered and resolved the same error?
ikar (Wed, 30 Oct 2019 09:11:31 GMT):
Hey there!
I got to the project that is based on BYFN sample, but limited to one organisation only. In my app when I call following code:
```
private Contract getContract(Gateway gw) {
return gw.getNetwork("mychannel").getContract("realchain");
}
```
following error is produced:
```
2019-10-30 09:34:51.433 INFO 23108 --- [nio-8080-exec-3] org.hyperledger.fabric.gateway.Gateway : Unable to load channel configuration from connection profile:
org.hyperledger.fabric.sdk.exception.NetworkConfigurationException: Channel configuration has no channels defined.
at org.hyperledger.fabric.sdk.NetworkConfig.loadChannel(NetworkConfig.java:519) ~[fabric-sdk-java-1.4.5-20190620.151745-1.jar:na]
at org.hyperledger.fabric.sdk.HFClient.loadChannelFromConfig(HFClient.java:161) ~[fabric-sdk-java-1.4.5-20190620.151745-1.jar:na]
at org.hyperledger.fabric.gateway.impl.GatewayImpl.getNetwork(GatewayImpl.java:258) ~[fabric-gateway-java-1.4.0-20191002.055106-31.jar:na]
...
```
...the app recovers somehow itself, but I suspect this error to slow down the whole interaction with the ledger.
Also I'd love to keep my logs clean from exceptions if possible ;)
Anyone encountered and resolved the same error?
ikar (Wed, 30 Oct 2019 09:12:18 GMT):
SO question: https://stackoverflow.com/questions/58621526/hyperledger-fabric-channel-configuration-has-no-channels-defined
bestbeforetoday (Wed, 30 Oct 2019 09:47:35 GMT):
I've replied on Stack Overflow but to save people linking off there...
> That is normal behaviour. If the connection profile does not contain a channel definition then the client uses peer definitions (current for your client identities organisation only) and assumes the channel exists for those peers. It should not impact performance at all.
>
> You have the option of adding a channel definition to the connection profile, which will avoid this log message occurring, but we wanted to avoid this being necessary.
>
> I agree that the exception appearing in the log gives the false impression that a real error has occurred and I have removed that in the current development code.
Bolzo 1 (Wed, 30 Oct 2019 10:01:08 GMT):
Hi, i want to connect my application, which use the java SDK with a connection profile and discovery service, to a remote fabric blockchain. I was wondering if i need a DNS or mapping the logical address (peer.org1.example.com) to the ip of the machine hosting the peer.. My application needs to run outside a docker container, and with this restriction also the discovery service is affected, right? This because i have no map every new address of peers and orderers which may be added to a channel
bestbeforetoday (Wed, 30 Oct 2019 10:12:10 GMT):
The peer URLs are the physical addresses so they need to be resolvable in DNS by the client. You are correct that when using discovery, the address configured in the peer will be supplied to client during network discovery and so also needs to be resolvable in DNS at the client
bestbeforetoday (Wed, 30 Oct 2019 10:13:12 GMT):
For testing purposes you could add entries to the client's local hosts file
ikar (Wed, 30 Oct 2019 10:46:42 GMT):
thanks @bestbeforetoday !
> You have the option of adding a channel definition to the connection profile
I believe I do =) But I have no idea where. Is this the (java-sdk) app part or the fabric network part?
ikar (Wed, 30 Oct 2019 10:55:12 GMT):
currently trying to modify `cpp-template.yaml` inside `first-network` dir of the fabric network. is this the correct path at least?
Bolzo 1 (Wed, 30 Oct 2019 11:03:01 GMT):
I understand, thanks for the reply
ikar (Wed, 30 Oct 2019 12:20:43 GMT):
Okay, this was it! The error is gone and the performance is the same. Thanks again!
aatkddny (Wed, 30 Oct 2019 12:51:47 GMT):
Anyone use service discovery with the latest connection profile setup and know how to turn it on off the top of their head?
I thought it was as simple as setting `"serviceDiscovery":true` in the set of json values in `channels>channel>peers>peer` but it seems to not be accepting that any more.
Of the two different profile examples I have, one doesn't use the channels json at all and the other doesn't use SD so I'm not sure what changed. The peer role isn't getting set on any of the peers and it's throwing this `throw new ServiceDiscoveryException("The channel is not configured with any peers with the 'discover' role");`
The peer *is* set to turn on SD (`discovery.enabled:true`).
If anyone remembers off the top of their head it'll save me a bundle of time with the debugger.
aatkddny (Wed, 30 Oct 2019 12:51:47 GMT):
Anyone use service discovery with the latest connection profile setup and know how to turn it on off the top of their head?
I thought it was as simple as setting `"serviceDiscovery":true` in the set of json values in a NetworkConfig in `channels>channel>peers>peer` but it seems to not be accepting that any more.
Of the two different profile examples I have, one doesn't use the channels json at all and the other doesn't use SD so I'm not sure what changed. The peer role isn't getting set on any of the peers and it's throwing this `throw new ServiceDiscoveryException("The channel is not configured with any peers with the 'discover' role");`
The peer *is* set to turn on SD (`discovery.enabled:true`).
If anyone remembers off the top of their head it'll save me a bundle of time with the debugger.
aatkddny (Wed, 30 Oct 2019 13:04:02 GMT):
Responding to my own post - poor form, but hopefully it'll save someone else the same.
The role name has been remapped from `serviceDiscovery` to `discover` inside the `NetworkConfig` class at `roleNameRemapHash`. Not sure why.
bestbeforetoday (Wed, 30 Oct 2019 15:15:07 GMT):
I'm not sure why that remapping was done either, but it does seem to be consistent with the Node SDK behaviour at least.
If you have a `channels` section in your connection profile then to use discovery you will need to have at least one peer in there with the `discover` role. If you omit the `channels` section (using the Gateway API) then it will be assumed that all peers have all roles so discovery should work if enabled when connecting the Gateway
aatkddny (Wed, 30 Oct 2019 15:17:38 GMT):
we have channels in the network config. it's converting from a fully expressed network.
i do have peers set for discovery - rememberer you need the core.yaml switches set too or it isn't happy.
problem now is the external orderer address thing i posted about in the orderer chat group. i'll look at reconfiguring that and rebuilding my network after lunch.
aatkddny (Wed, 30 Oct 2019 15:17:38 GMT):
we have channels in the network config. it's converting from a fully expressed network.
i do have peers set for discovery - rememberer you need the core.yaml switches set too or it isn't happy.
problem now is the external orderer address thing i posted about in the fabric-orderer chat group. i'll look at reconfiguring that and rebuilding my network after lunch.
bestbeforetoday (Wed, 30 Oct 2019 15:19:47 GMT):
We were thinking of removing the notion of roles for peers in 2.0 since this is really just a client-side concept and any peers obtained through discovery just get all the roles so is less useful in the discovery scenario. It seems to cause more problems that it solves
aatkddny (Wed, 30 Oct 2019 15:24:10 GMT):
well i can't say that i ever ran into a problem where i needed more non-endorsing peers to try to get throughput...
aatkddny (Wed, 30 Oct 2019 17:59:58 GMT):
This one's new. Never saw it panic before...
```
2019-10-30 13:53:20.971 ERROR 59582 --- [ault-executor-4] io.grpc.internal.ManagedChannelImpl : [Channel<161>: (peer0-mediaocean:30020)] Uncaught exception in the SynchronizationContext. Panic!
java.lang.IllegalStateException: The transport factory is closed.
at com.google.common.base.Preconditions.checkState(Preconditions.java:510) ~[guava-26.0-android.jar:na]
at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.newClientTransport(NettyChannelBuilder.java:567) ~[grpc-netty-1.23.0.jar:1.23.0]
at io.grpc.internal.CallCredentialsApplyingTransportFactory.newClientTransport(CallCredentialsApplyingTransportFactory.java:49) ~[grpc-core-1.23.0.jar:1.23.0]
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:246) ~[grpc-core-1.23.0.jar:1.23.0]
at io.grpc.internal.InternalSubchannel.access$400(InternalSubchannel.java:65) ~[grpc-core-1.23.0.jar:1.23.0]
at io.grpc.internal.InternalSubchannel$2.run(InternalSubchannel.java:196) ~[grpc-core-1.23.0.jar:1.23.0]
at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:95) [grpc-api-1.23.0.jar:1.23.0]
at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:127) [grpc-api-1.23.0.jar:1.23.0]
at io.grpc.internal.ManagedChannelImpl$NameResolverListener.onResult(ManagedChannelImpl.java:1365) [grpc-core-1.23.0.jar:1.23.0]
at io.grpc.internal.DnsNameResolver$Resolve.resolveInternal(DnsNameResolver.java:311) [grpc-core-1.23.0.jar:1.23.0]
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:213) [grpc-core-1.23.0.jar:1.23.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_162]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_162]
```
aatkddny (Wed, 30 Oct 2019 17:59:58 GMT):
This one's new. Never saw it panic before...
```
2019-10-30 13:53:20.971 ERROR 59582 --- [ault-executor-4] io.grpc.internal.ManagedChannelImpl : [Channel<161>: (peer0-someorg:30020)] Uncaught exception in the SynchronizationContext. Panic!
java.lang.IllegalStateException: The transport factory is closed.
at com.google.common.base.Preconditions.checkState(Preconditions.java:510) ~[guava-26.0-android.jar:na]
at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.newClientTransport(NettyChannelBuilder.java:567) ~[grpc-netty-1.23.0.jar:1.23.0]
at io.grpc.internal.CallCredentialsApplyingTransportFactory.newClientTransport(CallCredentialsApplyingTransportFactory.java:49) ~[grpc-core-1.23.0.jar:1.23.0]
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:246) ~[grpc-core-1.23.0.jar:1.23.0]
at io.grpc.internal.InternalSubchannel.access$400(InternalSubchannel.java:65) ~[grpc-core-1.23.0.jar:1.23.0]
at io.grpc.internal.InternalSubchannel$2.run(InternalSubchannel.java:196) ~[grpc-core-1.23.0.jar:1.23.0]
at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:95) [grpc-api-1.23.0.jar:1.23.0]
at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:127) [grpc-api-1.23.0.jar:1.23.0]
at io.grpc.internal.ManagedChannelImpl$NameResolverListener.onResult(ManagedChannelImpl.java:1365) [grpc-core-1.23.0.jar:1.23.0]
at io.grpc.internal.DnsNameResolver$Resolve.resolveInternal(DnsNameResolver.java:311) [grpc-core-1.23.0.jar:1.23.0]
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:213) [grpc-core-1.23.0.jar:1.23.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_162]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_162]
```
aatkddny (Wed, 30 Oct 2019 19:31:55 GMT):
was it intentional that if you put a non-discovery enabled peer in the list it adds it to the channel twice when doing sd?
aatkddny (Wed, 30 Oct 2019 19:31:55 GMT):
was it intentional that if you put a non-discovery enabled peer in the configuration list it adds it to the channel twice when doing sd?
bestbeforetoday (Wed, 30 Oct 2019 19:42:29 GMT):
No, that sounds like a bug, although it _might_ be down to the client not being able to reliably distinguish between a discovered peer and one defined in the connection profile. It would be worth raising a Jira with an example of the peer entry from the connection profile and the duplicate added with discovery
aatkddny (Wed, 30 Oct 2019 19:59:57 GMT):
I'll do it tomorrow. Need to figure out what else is missing first.
It's also interesting that the names also are required to exactly match the ones generated by SD - including the port - rather than it working off something a little less ephemeral (url I'm looking at you here).
aatkddny (Wed, 30 Oct 2019 19:59:57 GMT):
I'll do it tomorrow. Need to figure out what else is missing first.
It's also interesting that the names are required to exactly match the ones generated by SD - including the port - rather than it working off something a little less ephemeral (url I'm looking at you here
aatkddny (Wed, 30 Oct 2019 19:59:57 GMT):
I'll do it tomorrow. Need to figure out what else is missing first.
It's also interesting that the names are required to exactly match the ones generated by SD - including the port - rather than it working off something a little less ephemeral (url I'm looking at you here)
aatkddny (Wed, 30 Oct 2019 19:59:57 GMT):
I'll do it tomorrow. Need to figure out what else is missing first.
It's also interesting that the names one constructs appear to be required to exactly match the ones generated by SD - they include the exposed port - rather than it working off something a little less ephemeral (url I'm looking at you here).
yacovm (Wed, 30 Oct 2019 20:18:33 GMT):
> i do have peers set for discovery - rememberer you need the core.yaml switches set too or it isn't happy.
what switches? discovery is turned on by default in the peers...
aatkddny (Wed, 30 Oct 2019 22:12:15 GMT):
it is, but when it doesn't work for you you turn it off until you have time to go back to it, and then have to remember to turn it back on again.
yacovm (Wed, 30 Oct 2019 22:20:31 GMT):
why do you turn it off in the peer @aatkddny ?
yacovm (Wed, 30 Oct 2019 22:20:37 GMT):
it doesn't consume resources...
aatkddny (Wed, 30 Oct 2019 22:30:56 GMT):
because when i was trying to build myself a raft in kubernetes setup that works with the java sdk i was having terrible terrible trouble with certificates. i got past that and then service discovery was failing - and still is when i go to submit a transaction using the gateway. my network was built from my configuration and i have some code that dynamically builds it. so i didn't need it. still really don't for my setup.
my problem came to a head when trying to connect to another vendor's network, one that has now changed all their configuration so it only uses service discovery. i need to be able to switch between our setup (non production) and the self same vendor setup (production) and don't want to support two code bases.
so now i' m back looking at what i overlooked while i was shoehorning raft in, so i can go natively with the gateway and sd for everything. i'm working through figuring out what's different between sd and a self-built config (using the 1.0 style configuration) and trying to see where everything gets set.
aatkddny (Wed, 30 Oct 2019 22:30:56 GMT):
because when i was trying to build myself a raft in kubernetes setup that works with the java sdk i was having terrible terrible trouble with certificates. i got past that and then service discovery was failing - and still is when i go to submit a transaction using the gateway. my network was built from my configuration and i have some code that dynamically builds it. so i didn't need it. still really don't for my setup.
my problem came to a head when trying to connect to another vendor's network, one that has now changed all their configuration so it only uses service discovery. i need to be able to switch between our setup (non production) and the self same vendor setup (production) and don't want to support two code bases.
so now i' m back looking at what i overlooked while i was shoehorning raft in, so i can go natively with the gateway and sd for everything. i'm working through figuring out what's different between sd and a self-built config (using the 1.0 style configuration) and trying to see where everything gets set. i'm nearly there - it looks like there are two places where the orderer endpoints are set and they must be coming from two different sources because they have different names (corresponding to my internal service for one and the external endpoint for the other). Hence my question about the config yaml and the orderers.
aatkddny (Thu, 31 Oct 2019 01:12:11 GMT):
has the encoding for the genesis channel changed between 1.4.1 and 1.4.3?
joining a peer - which has worked hithertofore - now throws this `org.hyperledger.fabric.sdk.exception.ProposalException: Join peer to channel everything-channel failed. Status FAILURE, details: initializing channelconfig failed: could not create channel Orderer sub-group config: failed to deserialize values: Unexpected key Endpoints`
aatkddny (Thu, 31 Oct 2019 01:12:11 GMT):
has the encoding for the genesis block changed between 1.4.1 and 1.4.3?
joining a peer - which has worked hithertofore - now throws this `org.hyperledger.fabric.sdk.exception.ProposalException: Join peer to channel everything-channel failed. Status FAILURE, details: initializing channelconfig failed: could not create channel Orderer sub-group config: failed to deserialize values: Unexpected key Endpoints`
nitishbhardwaj19 (Thu, 31 Oct 2019 05:49:38 GMT):
Hi @rickr @bestbeforetoday Thanks for sharing thoughts on HSM integration. I am just curious to know to know more about it. I assume that things would work as expected with HSM if we create a custom cryptoSuite which can connect to HSM. But, I found that we are referring to User's enrollment down the stream when we have to sign a transaction. ```
IdentityFactory.getSigningIdentity(cryptoPrimitives, user);
``` If that's the case, I am still not clear how we can plugin HSM support. Is there a way to play around with it? I know that's it's not supported fully, but it would be great if you can point to some pointers for just an idea of the concept.
yacovm (Thu, 31 Oct 2019 07:26:07 GMT):
you need to enable capabilities of 1.4.2
aatkddny (Thu, 31 Oct 2019 11:24:41 GMT):
In addition to V_1_4_2/3? I pulled that section from the fabric-samples.
yacovm (Thu, 31 Oct 2019 11:25:05 GMT):
i think it's 1.4.2 capability
aatkddny (Thu, 31 Oct 2019 11:25:47 GMT):
So 1_4_2 doesn't add to 1_3? Then why would someone leave them off in the only sample we have for this.
yacovm (Thu, 31 Oct 2019 11:26:01 GMT):
what do you mean doesn't add to?
yacovm (Thu, 31 Oct 2019 11:26:07 GMT):
if you want to use the new per org endpoints
aatkddny (Thu, 31 Oct 2019 11:26:11 GMT):
Inherit from.
yacovm (Thu, 31 Oct 2019 11:26:12 GMT):
you need to have 1.4.2 capability
yacovm (Thu, 31 Oct 2019 11:26:30 GMT):
how can it inherit from 1.3 ?
yacovm (Thu, 31 Oct 2019 11:26:33 GMT):
it extends it
aatkddny (Thu, 31 Oct 2019 11:28:15 GMT):
Extends, Inherits, whatever. I expect if 1_4_2 is on all the stuff for 1_3 is valid too.
This is the config - from fabric-sample - for 1.4.3 with the comments stripped
```
Capabilities:
Channel: &ChannelCapabilities
V1_4_3: true
V1_3: false
V1_1: false
Orderer: &OrdererCapabilities
V1_4_2: true
V1_1: false
Application: &ApplicationCapabilities
V1_4_2: true
V1_3: false
V1_2: false
V1_1: false
```
aatkddny (Thu, 31 Oct 2019 11:29:02 GMT):
If you are saying I also need to have v1_3 set true why isn't it in as a default.
yacovm (Thu, 31 Oct 2019 11:29:09 GMT):
no no
yacovm (Thu, 31 Oct 2019 11:29:12 GMT):
what you have now is good
yacovm (Thu, 31 Oct 2019 11:29:26 GMT):
version `y` has everything `x` has if `y>x`
aatkddny (Thu, 31 Oct 2019 11:29:37 GMT):
which is what i expect.
yacovm (Thu, 31 Oct 2019 11:29:48 GMT):
and it gives you that error? :/
aatkddny (Thu, 31 Oct 2019 11:29:54 GMT):
except - drifting back to the original point - i get that error
aatkddny (Thu, 31 Oct 2019 11:30:09 GMT):
and i didn't until moving to 1.4.3
yacovm (Thu, 31 Oct 2019 11:30:18 GMT):
oh so it is resolved in 1.4.3?
aatkddny (Thu, 31 Oct 2019 11:30:28 GMT):
nope. it STARTED in 1.4.3.
yacovm (Thu, 31 Oct 2019 11:30:39 GMT):
oh, this is bad
aatkddny (Thu, 31 Oct 2019 11:30:42 GMT):
1.4.1 was just fine. As was all versions 1.4.x
aatkddny (Thu, 31 Oct 2019 11:30:42 GMT):
1.4.1 was just fine. As was all versions 1.2.x - 1.4.x
yacovm (Thu, 31 Oct 2019 11:30:57 GMT):
I don't know what to say though... @jyellick what can you make of this? :O
yacovm (Thu, 31 Oct 2019 11:31:08 GMT):
Sorry Danny, config is not my area :/
aatkddny (Thu, 31 Oct 2019 13:54:57 GMT):
UGH - ignore the whole thing above. We template the install scripts so changing versions should be as simple as changing a property. And it is, for everything except fabric-tools. Going from 1.4.1 to 1.4.3 works better when it also is the correct version.
Now back to my original problem that caused all this - where the orderer names aren't being discovered as i expect for some types of transaction.
aatkddny (Thu, 31 Oct 2019 13:54:57 GMT):
UGH - ignore the whole thing above. We template the install scripts so changing versions should be as simple as changing a property. And it is, for everything except fabric-tools. Going from 1.4.1 to 1.4.3 works better when it also is the correct version.
Now I can get back to the original problem that caused all this - where the orderer names aren't being discovered as i expect for some types of transaction.
yacovm (Thu, 31 Oct 2019 13:55:44 GMT):
what do you mean aren't being discovered?
yacovm (Thu, 31 Oct 2019 13:55:49 GMT):
not being returned by SD ?
aatkddny (Thu, 31 Oct 2019 14:01:57 GMT):
I'm inside kubernetes - apart from my client, which isn't. So I need the external names for the orderers (localhost:nodeport). I'm getting the internal ones (raft{N}-orderer:7050). I've tried - and am trying - changing my configtx generation code to put in the external name, but it seems that every time I try to change one of the Address blocks to the external address the rafts then fail to talk to one another.
I was sidetracked by the need to go to 1.4.3, so need to go try setting these more thoroughly and checking the errors better. It was late last night when I was doing this.
Raumo0 (Thu, 31 Oct 2019 17:05:55 GMT):
org.hyperledger.fabric.sdk.Channel
org.hyperledger.fabric.sdk.ChaincodeID
org.hyperledger.fabric.sdk.HFClient
org.hyperledger.fabric.sdk.QueryByChaincodeRequest
I use these libraries, but I don’t understand how can I specify the name of the contract? I can set the channel name, chaincode name, method name, but not the contract name. How should I do it? Earlier, when I had 1 contract everything worked, and when I made several contracts in 1 chaincode, I can’t start it.
AllanHansen (Fri, 01 Nov 2019 00:36:01 GMT):
Has joined the channel.
Ryan--Yang (Fri, 01 Nov 2019 07:00:01 GMT):
Has joined the channel.
bestbeforetoday (Fri, 01 Nov 2019 12:14:23 GMT):
What errors are you getting? I wonder if you are seeing the issue that the Java SDK always sends `init` as an initialization function name when instantiating chaincode and, if you have multiple smart contracts within one chaincode, you may not have an `init` function defined for a default (non-namespaced) smart contract. If so, you could try implementing a dummy `init` function in a default (non-namespaced) smart contract
bestbeforetoday (Fri, 01 Nov 2019 12:15:17 GMT):
Once you have things up and running, the easiest way to invoke smart contract transactions is to use the _fabric-gateway-java_ API: https://github.com/hyperledger/fabric-gateway-java
bestbeforetoday (Fri, 01 Nov 2019 12:15:49 GMT):
Once you have things up and running, the easiest way to invoke smart contract transactions is to use the fabric-gateway-java API: https://github.com/hyperledger/fabric-gateway-java
bestbeforetoday (Fri, 01 Nov 2019 12:19:14 GMT):
If you want to use the low-level API then you specify a transaction name scoped by the smart contract namespace, e.g.: `my-smart-contract-namespace:transactionName'
bestbeforetoday (Fri, 01 Nov 2019 12:19:14 GMT):
If you want to use the low-level API then you specify a transaction name scoped by the smart contract namespace, e.g.: `my-smart-contract-namespace:transactionName`
Raumo0 (Fri, 01 Nov 2019 13:11:24 GMT):
@bestbeforetoday This one works for me: "
Paradox-AT (Mon, 04 Nov 2019 13:30:48 GMT):
Has joined the channel.
Paradox-AT (Mon, 04 Nov 2019 13:30:49 GMT):
Hey Guys ,
I am trying to do a transaction from sdk. I am able to query the data back form the legder but while trying to do a transaction it throws an error and says:
```
2019-11-04 18:43:57.144 WARN 13032 --- [ault-executor-9] o.h.fabric.sdk.PeerEventServiceClient : Received error on PeerEventServiceClient{id: 1737, channel: test, peerName: peer0.tms.transplace.com:9051, url: grpcs://peer0.tms.transplace.com:9051}, attempts 451. UNAVAILABLE: Unable to resolve host peer0.tms.transplace.com
2019-11-04 18:43:57.144 WARN 13032 --- [ault-executor-8] o.h.fabric.sdk.PeerEventServiceClient : Received error on PeerEventServiceClient{id: 1738, channel: test, peerName: peer0.carrier.transplace.com:11051, url: grpcs://peer0.carrier.transplace.com:11051}, attempts 451. UNAVAILABLE: Unable to resolve host peer0.carrier.transplace.com
2019-11-04 18:43:57.147 WARN 13032 --- [ault-executor-8] o.h.fabric.sdk.PeerEventServiceClient : Received error on PeerEventServiceClient{id: 1739, channel: test, peerName: peer0.shipper.transplace.com:7051, url: grpcs://peer0.shipper.transplace.com:7051}, attempts 451. UNAVAILABLE: Unable to resolve host peer0.shipper.transplace.com
2019-11-04 18:44:17.351 WARN 13032 --- [ault-executor-5] o.h.fabric.sdk.PeerEventServiceClient : Received error on PeerEventServiceClient{id: 1889, channel: test, peerName: peer0.carrier.transplace.com, url: grpcs://localhost:11051}, attempts 401. UNAVAILABLE: io exception
```
Paradox-AT (Mon, 04 Nov 2019 13:31:04 GMT):
Any clues?
aatkddny (Mon, 04 Nov 2019 14:50:37 GMT):
where is your network running? on a local machine or a server in your data center? the ports don't look like nodeport mappings so i'm guessing it's not kubernetes. and are you using service discovery?
yang.xiao (Tue, 05 Nov 2019 08:18:02 GMT):
Has joined the channel.
Paradox-AT (Tue, 05 Nov 2019 08:34:28 GMT):
Local machine
Paradox-AT (Tue, 05 Nov 2019 08:37:07 GMT):
If I am trying to do a transaction from the node itself it works
Paradox-AT (Tue, 05 Nov 2019 09:53:31 GMT):
So I regenerated the certificates I am no longer getting this error
Paradox-AT (Tue, 05 Nov 2019 09:53:31 GMT):
So I regenerated the certificates I am no longer getting the above error instead of that now I am getting this error:
Paradox-AT (Tue, 05 Nov 2019 09:54:21 GMT):
```
org.hyperledger.fabric.sdk.exception.ServiceDiscoveryException: The channel is not configured with any peers with the 'discover' role
at org.hyperledger.fabric.sdk.Channel.sendTransactionProposalToEndorsers(Channel.java:3955) ~[fabric-sdk-java-1.4.5.jar:na]
at org.hyperledger.fabric.gateway.impl.TransactionImpl.sendTransactionProposal(TransactionImpl.java:155) ~[fabric-gateway-java-1.4.0.jar:na]
at org.hyperledger.fabric.gateway.impl.TransactionImpl.submit(TransactionImpl.java:91) ~[fabric-gateway-java-1.4.0.jar:na]
at org.hyperledger.fabric.gateway.impl.ContractImpl.submitTransaction(ContractImpl.java:50) ~[fabric-gateway-java-1.4.0.jar:na]
```
Bolzo 1 (Tue, 05 Nov 2019 11:30:28 GMT):
HIi, there are somewhere some examples on how send multiple transaction in parallel?
aatkddny (Tue, 05 Nov 2019 12:34:04 GMT):
Using the java client? Or the fabric-gateway?
Former - Setting up multiple HFClients will do it (if you want simple but possibly marginally less efficient).
Latter - I'm not 100% convinced Contract is thread safe - since the HFClient is in the Gateway - so I'd go multiple Gateways. Caveat - I didn't write it and I haven't stepped through it, so it may well be completely thread safe and I'm just being over-cautious.
Or you could self-synchronize, but I'm betting you don't want to do that.
Bolzo 1 (Tue, 05 Nov 2019 13:03:26 GMT):
I'm using java-sdk not the gateway, my goal is to send multiple transaction proposal to multiple endorsers and collect their response
bestbeforetoday (Tue, 05 Nov 2019 13:03:53 GMT):
You _should_ be able to submit multiple transactions in parallel using a single Contract instance using a multi-threaded client and the _fabric-gateway-java_ API. I have certainly done this but personally only with simple scenarios, like driving client load on a specific smart contract transaction. If anything doesn't work correctly invoking multiple transactions in parallel then please do raise a bug with as much information as you can gather to help identify the issue
aatkddny (Tue, 05 Nov 2019 13:07:14 GMT):
So look at the code in the sample to submit a tx and stick it in a thread so you can do it multiple times.
Bolzo 1 (Tue, 05 Nov 2019 13:09:38 GMT):
My approach at the moment consists in a executor service which submits multiple callables. The callable calls the sdk to send a transaction proposal. I was wondering if my approach can be improved
aatkddny (Tue, 05 Nov 2019 13:10:56 GMT):
tp to each endorser separately then you collect? or multiple discrete transactions?
Bolzo 1 (Tue, 05 Nov 2019 13:11:37 GMT):
multiple discrete transaction
aatkddny (Tue, 05 Nov 2019 13:12:27 GMT):
you have an pool of cached hfclients?
aatkddny (Tue, 05 Nov 2019 13:12:49 GMT):
one per thread in the executor service?
Bolzo 1 (Tue, 05 Nov 2019 13:13:03 GMT):
No, i have a single HFclient and i set the user context at evety call
aatkddny (Tue, 05 Nov 2019 13:13:13 GMT):
then you aren't thread safe.
Bolzo 1 (Tue, 05 Nov 2019 13:13:37 GMT):
Oh, so i must have multiple HFClients?
aatkddny (Tue, 05 Nov 2019 13:13:50 GMT):
unless it's been rewritten since we did this, yes.
aatkddny (Tue, 05 Nov 2019 13:14:34 GMT):
you can swap in another user after you dispatch the tx, but there's a window when you can collide. So a pool is simpler and safer.
Bolzo 1 (Tue, 05 Nov 2019 13:15:13 GMT):
Can you point me to some example code?
aatkddny (Tue, 05 Nov 2019 13:15:22 GMT):
if you want really shitty performance you could inline them and get an hfclient and connect every time, but that'll get old fast.
Bolzo 1 (Tue, 05 Nov 2019 13:16:40 GMT):
At the moment it takes 1 minute and a half to do 250 tx
Bolzo 1 (Tue, 05 Nov 2019 13:17:04 GMT):
So yes I need to improve the performance
aatkddny (Tue, 05 Nov 2019 13:17:36 GMT):
you can also saturate netty - in our case it was at about 25tx/s on 200 or so threads - so be warned about that too.
Bolzo 1 (Tue, 05 Nov 2019 13:20:44 GMT):
So the idea is to have a separate HFClient per thread (or per call), am I right?
Purbaja (Wed, 06 Nov 2019 12:39:34 GMT):
Hi Guys,
In a tls enabled hyperledger fabric network, while running a invoke command from java sdk getting below error:
_streaming call completed grpc.service=protos.Deliver grpc.method=Deliver grpc.peer_address=52.168.9.112:61141 error="context finished before block retrieved: context canceled" grpc.code=Unknown_
Purbaja (Wed, 06 Nov 2019 12:39:34 GMT):
Hi Guys,
In a tls enabled hyperledger fabric network, while running a invoke command from java sdk getting below error:
_streaming call completed grpc.service=protos.Deliver grpc.method=Deliver grpc.peer_address=x.x.x.x:61141 error="context finished before block retrieved: context canceled" grpc.code=Unknown_
Purbaja (Fri, 08 Nov 2019 11:02:10 GMT):
While invoking transaction from java-sdk (using service discovery), getting below error:
org.hyperledger.fabric.sdk.exception.ProposalException: org.hyperledger.fabric.sdk.exception.ServiceDiscoveryException: *Could not meet endorsement policy for chaincode ccXX*
at org.hyperledger.fabric.sdk.Channel.sendTransactionProposalToEndorsers(Channel.java:3879)
aatkddny (Fri, 08 Nov 2019 14:02:02 GMT):
@bestbeforetoday Was the swallowing of error responses from chaincode when validation fails using SD intentional?
Instead of our error responses now all we get is a `ServiceDiscoveryException("Could not meet endorsement policy for chaincode XXX")`
We found that in Channel.java
```
public Collection
aatkddny (Fri, 08 Nov 2019 14:28:18 GMT):
Anyone using the `ContractImpl` in fabric-gateway with Private Data?
How do you set the transient map to pass in non persisted information?
aatkddny (Fri, 08 Nov 2019 14:28:18 GMT):
Anyone using the `ContractImpl` in fabric-gateway with Private Data?
How do you set the transient map to pass in non persisted information? Did you extend it to implement `setTransient` or did we miss something.
bestbeforetoday (Fri, 08 Nov 2019 15:47:19 GMT):
No, not intentional. Improving this behaviour is captured in https://jira.hyperledger.org/projects/FGJ/issues/FGJ-57
aatkddny (Fri, 08 Nov 2019 15:51:51 GMT):
Thx. We'll Proxy `sendTransactionProposal` until it gets adopted and hits the mainline code then.
aatkddny (Fri, 08 Nov 2019 15:51:51 GMT):
Thx. Looked but didn't see the jira.
We'll Proxy `sendTransactionProposal` until it gets adopted and hits the mainline code then.
dan13 (Sun, 10 Nov 2019 02:46:32 GMT):
You want to lock an HFClient to each thread for the duration of the transaction via pool, or, if you have a limited set of users you could create instances for each, store them, and re-use the appropriate one across threads.
aatkddny (Sun, 10 Nov 2019 18:59:31 GMT):
He's already using an executor service. Unless he has a HFClient per thread in that service (or a bigger pool - which is wasteful) he's likely to bottleneck on them.
Bolzo 1 (Mon, 11 Nov 2019 15:49:06 GMT):
Yeah I have a HFClient per thread.. Each HFClient has the same information. The idea is that i want to split a series of transactions sent by a user into parallel transactions using multithreading.
Bolzo 1 (Mon, 11 Nov 2019 15:49:06 GMT):
Yeah I have a HFClient per thread.. Each HFClient has the same information. The idea is that I want to split a series of transactions sent by a user into parallel transactions using multithreading.
Bolzo 1 (Thu, 14 Nov 2019 08:01:36 GMT):
Java gateway: the only options for a wallet are in memory and file System, right? What is the best approach if I want load user certs from a DB? Should I create a memory wallet and load the information from the database? Or I Should create a FileSystem wallet?
Bolzo 1 (Thu, 14 Nov 2019 08:01:36 GMT):
Java gateway: the only options for a wallet are in memory and file system, right? What is the best approach if I want load user certs from a DB? Should I create a memory wallet and load the information from the database? Or I Should create a FileSystem wallet?
Bolzo 1 (Thu, 14 Nov 2019 08:01:36 GMT):
Java gateway: the only options for a wallet are in memory and file system, right? What is the best approach if I want to load user certs from a DB? Should I create a memory wallet and load the information from the database? Or I Should create a FileSystem wallet?
Bolzo 1 (Thu, 14 Nov 2019 08:29:12 GMT):
By any chance, do you have some example code?
bestbeforetoday (Thu, 14 Nov 2019 10:14:01 GMT):
If you are storing your credentials in a database then probably the best approach is for your client application at startup to pull the required credentials from the database and stick them in an in-memory wallet. The file system wallet is useful just if you want a simple out-of-the box storage mechanism for your credentials.
Bolzo 1 (Thu, 14 Nov 2019 10:17:43 GMT):
Perfect, thanks!
Bolzo 1 (Thu, 14 Nov 2019 15:51:31 GMT):
a
Bolzo 1 (Thu, 14 Nov 2019 15:56:31 GMT):
I'm trying to send async transaction with the gateway sdk but i receive `Channel has been shutdown`. Here's any example code: ``Gateway.Builder builder = Gateway.createBuilder()
.discovery(true)
.identity(wallet, user.getName())
.networkConfig([OATH TO CONNECTION PROFILE]);
try(Gateway gateway = builder.connect()) {
Network channel = gateway.getNetwork(CHANNEL_NAME);
Contract someChaincode = channel.getContract(CHAINCODE_NAME);
int coresNumber = (Runtime.getRuntime().availableProcessors());
ExecutorService executor = Executors.newFixedThreadPool(coresNumber);
Map
Bolzo 1 (Thu, 14 Nov 2019 15:56:31 GMT):
I'm trying to send async transaction with the gateway sdk but i receive `Channel has been shutdown`. Here's any example code: ```Gateway.Builder builder = Gateway.createBuilder()
.discovery(true)
.identity(wallet, user.getName())
.networkConfig([OATH TO CONNECTION PROFILE]);
try(Gateway gateway = builder.connect()) {
Network channel = gateway.getNetwork(CHANNEL_NAME);
Contract someChaincode = channel.getContract(CHAINCODE_NAME);
int coresNumber = (Runtime.getRuntime().availableProcessors());
ExecutorService executor = Executors.newFixedThreadPool(coresNumber);
Map
Bolzo 1 (Thu, 14 Nov 2019 15:56:31 GMT):
I'm trying to send async transaction with the gateway sdk but i receive `Channel has been shutdown`. Here's an example code: ```Gateway.Builder builder = Gateway.createBuilder()
.discovery(true)
.identity(wallet, user.getName())
.networkConfig([OATH TO CONNECTION PROFILE]);
try(Gateway gateway = builder.connect()) {
Network channel = gateway.getNetwork(CHANNEL_NAME);
Contract someChaincode = channel.getContract(CHAINCODE_NAME);
int coresNumber = (Runtime.getRuntime().availableProcessors());
ExecutorService executor = Executors.newFixedThreadPool(coresNumber);
Map
Bolzo 1 (Thu, 14 Nov 2019 15:56:31 GMT):
I'm trying to send async transaction with the gateway sdk but i receive `Channel has been shutdown`. Here's an example code: ```Gateway.Builder builder = Gateway.createBuilder()
.discovery(true)
.identity(wallet, user.getName())
.networkConfig([OATH TO CONNECTION PROFILE]);
try(Gateway gateway = builder.connect()) {
Network channel = gateway.getNetwork(CHANNEL_NAME);
Contract someChaincode = channel.getContract(CHAINCODE_NAME);
int coresNumber = (Runtime.getRuntime().availableProcessors());
ExecutorService executor = Executors.newFixedThreadPool(coresNumber);
Map
Bolzo 1 (Thu, 14 Nov 2019 15:56:31 GMT):
I'm trying to send async transaction with the gateway sdk but i receive `Channel has been shutdown`. Here's an example code: ```Gateway.Builder builder = Gateway.createBuilder()
.discovery(true)
.identity(wallet, user.getName())
.networkConfig([OATH TO CONNECTION PROFILE]);
try(Gateway gateway = builder.connect()) {
Network channel = gateway.getNetwork(CHANNEL_NAME);
Contract someChaincode = channel.getContract(CHAINCODE_NAME);
int coresNumber = (Runtime.getRuntime().availableProcessors());
ExecutorService executor = Executors.newFixedThreadPool(coresNumber);
Map
Bolzo 1 (Thu, 14 Nov 2019 15:56:31 GMT):
I'm trying to send async transaction with the gateway sdk but i receive `Channel has been shutdown`. Here's an example code: ```Gateway.Builder builder = Gateway.createBuilder()
.discovery(true)
.identity(wallet, user.getName())
.networkConfig([OATH TO CONNECTION PROFILE]);
try(Gateway gateway = builder.connect()) {
Network channel = gateway.getNetwork(CHANNEL_NAME);
Contract someChaincode = channel.getContract(CHAINCODE_NAME);
int coresNumber = (Runtime.getRuntime().availableProcessors());
ExecutorService executor = Executors.newFixedThreadPool(coresNumber);
for(String elemt : elements) {
CompletableFuture
Bolzo 1 (Thu, 14 Nov 2019 15:56:31 GMT):
I'm trying to send async transaction with the gateway sdk but i receive `Channel has been shutdown`. Here's an example code: ```Gateway.Builder builder = Gateway.createBuilder()
.discovery(true)
.identity(wallet, user.getName())
.networkConfig([OATH TO CONNECTION PROFILE]);
try(Gateway gateway = builder.connect()) {
Network channel = gateway.getNetwork(CHANNEL_NAME);
Contract someChaincode = channel.getContract(CHAINCODE_NAME);
int coresNumber = (Runtime.getRuntime().availableProcessors());
ExecutorService executor = Executors.newFixedThreadPool(coresNumber);
for(String elemt : elements) {
CompletableFuture
Bolzo 1 (Thu, 14 Nov 2019 15:56:31 GMT):
I'm trying to send async transaction with the gateway sdk but i receive `Channel has been shutdown`. Here's an example code: ```Gateway.Builder builder = Gateway.createBuilder()
.discovery(true)
.identity(wallet, user.getName())
.networkConfig([OATH TO CONNECTION PROFILE]);
try(Gateway gateway = builder.connect()) {
Network channel = gateway.getNetwork(CHANNEL_NAME);
Contract someChaincode = channel.getContract(CHAINCODE_NAME);
int coresNumber = (Runtime.getRuntime().availableProcessors());
ExecutorService executor = Executors.newFixedThreadPool(coresNumber);
for(String elemt : elements) {
CompletableFuture
Bolzo 1 (Thu, 14 Nov 2019 15:56:31 GMT):
I'm trying to send async transaction with the gateway sdk but i receive `Channel has been shutdown`. Here's an example code: ```Gateway.Builder builder = Gateway.createBuilder()
.discovery(true)
.identity(wallet, user.getName())
.networkConfig([OATH TO CONNECTION PROFILE]);
try(Gateway gateway = builder.connect()) {
Network channel = gateway.getNetwork(CHANNEL_NAME);
Contract someChaincode = channel.getContract(CHAINCODE_NAME);
int coresNumber = (Runtime.getRuntime().availableProcessors());
ExecutorService executor = Executors.newFixedThreadPool(coresNumber);
for(String elemt : elements) {
CompletableFuture
Bolzo 1 (Thu, 14 Nov 2019 16:22:42 GMT):
My question on stackoverflow about this more detailed: https://stackoverflow.com/questions/58861348/hyperledger-fabric-async-parallel-transaction-using-java-gateway-sdk
Bolzo 1 (Thu, 14 Nov 2019 16:22:42 GMT):
More detailed question on stackoverflow about this: https://stackoverflow.com/questions/58861348/hyperledger-fabric-async-parallel-transaction-using-java-gateway-sdk
JackMGit (Fri, 15 Nov 2019 13:00:13 GMT):
Has joined the channel.
Deepakbyrappa (Sun, 17 Nov 2019 04:38:07 GMT):
Has joined the channel.
nitishbhardwaj19 (Mon, 18 Nov 2019 05:43:57 GMT):
Hi @bestbeforetoday I am trying to improve performance of my application. I am using java-sdk apis to interact with network and not any wallets for now. I noticed that it takes 2.2 secs to get conformation for a transaction when I send it to channel.```
channel.sendTransaction(responses, getTransactionOptions(channel))
.exceptionally(this::processExceptionForTxnEvent)
.whenCompleteAsync((event, throwable)-> { processTransactionEvent(deferredResult, event, throwable);});
``` ```
I just added whenComplete Async and it reduced it to miliseconds, yet, the overall invoke operation time remains the same i.e. 2.2 secs(noticed it through postman). Is there a better way to reduce overall operation time such that clients doesn't have to wait until the block is generated? What's the recommended approach for this? Should I focus on events? If so, how do I notify clients when I get an event for block generation?
```
nitishbhardwaj19 (Mon, 18 Nov 2019 05:43:57 GMT):
Hi @bestbeforetoday I am trying to improve performance of my application. I am using java-sdk apis to interact with network and not any wallets for now. I noticed that it takes 2.2 secs to get confirmation for a transaction when I send it to channel.```
channel.sendTransaction(responses, getTransactionOptions(channel))
.exceptionally(this::processExceptionForTxnEvent)
.whenCompleteAsync((event, throwable)-> { processTransactionEvent(deferredResult, event, throwable);});
```
I just added *whenComplete *Async and it reduced it to *miliseconds*(thread is not blocked), yet, the overall invoke operation time remains the same i.e. 2.2 secs(noticed it through postman). Is there a better* way to reduce overall operation time such that clients doesn't have to wait until the block is generated?* What's the recommended approach for this? Should I focus on events? If so, how do I notify clients when I get an event for block generation?
nitishbhardwaj19 (Mon, 18 Nov 2019 05:43:57 GMT):
Hi @bestbeforetoday I am trying to improve performance of my application. I am using java-sdk apis to interact with network and not any wallets for now. I noticed that it takes 2.2 secs to get confirmation for a transaction when I send it to channel.```
channel.sendTransaction(responses, getTransactionOptions(channel))
.exceptionally(this::processExceptionForTxnEvent)
.whenCompleteAsync((event, throwable)-> { processTransactionEvent(deferredResult, event, throwable);});
```
I just added *whenComplete *Async and it reduced it to *miliseconds*(thread is not blocked), yet, the overall invoke operation time remains the same i.e. 2.2 secs(noticed it through postman, block generation time is 2 secs in orderer settings). Is there a better* way to reduce overall operation time such that clients doesn't have to wait until the block is generated?* What's the recommended approach for this? Should I focus on events? If so, how do I notify clients when I get an event for block generation?
ShrutiHK (Mon, 18 Nov 2019 09:10:50 GMT):
Has joined the channel.
ShrutiHK (Mon, 18 Nov 2019 09:14:10 GMT):
Hi, I am trying to work with fabric java sdk in a TLS enabled network. I keep getting the TLS Handshake failed error. I am using the fabric-sdk-java dependency version 1.4.3.
ShrutiHK (Mon, 18 Nov 2019 09:15:18 GMT):
In a non-tls enabled network, my code works perfectly. I would really appreciate if someone can share a working example of TLS enabled java-sdk sample.
SatheeshNehru (Tue, 19 Nov 2019 12:59:50 GMT):
when I generate enrollemnt using java fabric CAclient I get cert and key and copy to msp
Is there any option to generate cert in msp Structure using fabricCAClient
bestbeforetoday (Tue, 19 Nov 2019 14:54:28 GMT):
I have replied to your question on StackOverflow
Bolzo 1 (Tue, 19 Nov 2019 14:58:43 GMT):
I've just check... I completely missed the try-with-resources! Now all makes sense, thanks!
bestbeforetoday (Tue, 19 Nov 2019 15:05:30 GMT):
I guess that your client will be waiting until successful transaction commit events are received from peers. This is often what you want so that any subsequent transactions or queries are seeing the world state after your transaction have been applied. But for you to see the commit events the transaction must have been included in a block that is committed on the peers, which can take a little time. Under light load the round-trip time may look artificially slow as the orderer waits for more transactions for a short period of time before committing the block (likely including only your one transaction). As concurrent load increases you will start to see multiple transactions included in each block and so the average round-trip time effectively decreases as blocks are either filling up before the wait time, or your transactions are being ordered part-way through the wait time triggered by preceding transactions.
bestbeforetoday (Tue, 19 Nov 2019 15:07:09 GMT):
Alternatively... if you don't need to wait for the world state to include state changes resulting from your transaction -- perhaps you are just firing in a batch of transaction invocations that don't rely on each others' state changes -- you can not wait for the transaction commit events and see higher throughput
Chem (Wed, 20 Nov 2019 06:10:43 GMT):
Has joined the channel.
Chem (Wed, 20 Nov 2019 06:10:45 GMT):
Hi, When I deal with fabric-sdk-java , when testing End2endIT.java file, the channel creation is not working.
Channel newChannel = client.newChannel(name, anOrderer, channelConfiguration, client.getChannelConfigurationSignature(channelConfiguration, peerAdmin));
The above function call wait for a long time. Please help
Bolzo 1 (Wed, 20 Nov 2019 11:03:27 GMT):
With the gateway sdk How can I get the transaction id after a `submitTransaction`?
sudijovski (Wed, 20 Nov 2019 11:53:12 GMT):
Has joined the channel.
Purbaja (Wed, 20 Nov 2019 13:07:05 GMT):
Hi @bestbeforetoday , when using channel.sendTransaction(prResponses).whenCompleteAsync((event, throwable)-> {...}); I am not getting the event back and therefore not able to understand whether the transaction is getting committed or not. Please suggest how to confirm that.
Bolzo 1 (Wed, 20 Nov 2019 15:34:32 GMT):
I want to improve the performance of my module which use the java-sdk (not gateway). Currently the function `sendTransactionProposalToEndorsers` takes about 300 ms (`forceDiscovery` and `inspectResult` set to `true` and `endorsementSelector set to ENDORMENT_SELECTION_RANDOM`). What are the factors that affect this function? What are the best practices to use in order to optimize the performance?
bestbeforetoday (Wed, 20 Nov 2019 15:51:55 GMT):
From memory there is some default waiting behaviour that means the Future won't complete until commit events have been received. To tailor this behaviour you might want to use `sendTransaction(Collection
bestbeforetoday (Wed, 20 Nov 2019 15:52:47 GMT):
Or use the higher level _fabric-gateway-java_ API where you can select from a few different default commit handling strategies or roll your own
AkilaVasanthakumar (Thu, 21 Nov 2019 05:36:15 GMT):
Hi, how to implement fabcar usecase in springboot project
Coada (Thu, 21 Nov 2019 08:28:48 GMT):
You could start by trying out this IBM example https://github.com/IBM/blockchain-application-using-fabric-java-sdk
AkilaVasanthakumar (Thu, 21 Nov 2019 09:02:41 GMT):
yes, i tried its working fine ...i want to work with tls enabled network .
Chem (Thu, 21 Nov 2019 10:00:13 GMT):
channel.png
AkilaVasanthakumar (Thu, 21 Nov 2019 10:30:41 GMT):
Can able to implement fabcar usecase with springboot project ..But its querying with this error message
AkilaVasanthakumar (Thu, 21 Nov 2019 10:30:41 GMT):
Can able to implement fabcar usecase with springboot project ..But its querying with this message..Do you have any idea about this
AkilaVasanthakumar (Thu, 21 Nov 2019 10:32:20 GMT):
Screenshot from 2019-11-21 16-01-25.png
AkilaVasanthakumar (Thu, 21 Nov 2019 10:40:21 GMT):
oie_211137213Q8y87L0.png
AkilaVasanthakumar (Thu, 21 Nov 2019 10:41:27 GMT):
oie_JMz6gA0jT8LW.png
AkilaVasanthakumar (Thu, 21 Nov 2019 10:44:33 GMT):
oie_ZlN30ECOvLGe.png
KyoungsunPark (Thu, 21 Nov 2019 13:45:01 GMT):
Has joined the channel.
KyoungsunPark (Thu, 21 Nov 2019 13:45:05 GMT):
https://chat.hyperledger.org/channel/general?msg=5rbcefYjbS6hL4QXG
bestbeforetoday (Thu, 21 Nov 2019 14:03:05 GMT):
_fabric-sdk-java_ is a low level API while _fabric-gateway-java_ is a higher level (read: more usable) API that is built on top of _fabric-sdk-java_. The 1.4.x release of _fabric-gateway-java_ is stable, and my recommendation would be to use that wherever practical, only using the low level API for specific tasks that are not available in the high level API
bestbeforetoday (Thu, 21 Nov 2019 14:03:05 GMT):
_fabric-sdk-java_ is a low level API while _fabric-gateway-java_ is a higher level (read: more usable) API that is built on top of _fabric-sdk-java_. The 1.4.x release of _fabric-gateway-java_ is stable, and my recommendation would be to use that wherever practical; only using the low level API for specific tasks that are not available in the high level API
giuzero (Thu, 21 Nov 2019 17:12:05 GMT):
Has joined the channel.
giuzero (Thu, 21 Nov 2019 17:12:06 GMT):
Hi all, I'm tryng to run a java cli on a x86 arch. I'm having problems with netty_tcnative_linux_x86_32, we rebuilt nettyx86_32bit but we still have problems running sdk functions like network discovery etc... (enroll and registration are ok). Has someone managed to run a Hyperledger Client on x86_32bit?
KyoungsunPark (Fri, 22 Nov 2019 02:49:19 GMT):
Thank you for your explanation and recommendation. :)
medikent (Fri, 22 Nov 2019 19:03:06 GMT):
Is there something like a fabric-gateway-go?
yacovm (Fri, 22 Nov 2019 19:32:38 GMT):
why do you need it @medikent ?
nitishbhardwaj19 (Fri, 22 Nov 2019 19:35:04 GMT):
@bestbeforetoday Thanks for the detail information. This really helps.
nitishbhardwaj19 (Fri, 22 Nov 2019 19:41:43 GMT):
Hi @bestbeforetoday I was just going through balance-transfer sample which is implemented using node-sdk. I noticed that for each operations, transaction invoke etc, they close the channel. I am not sure whether this is required in java-sdk for resource cleanup. Would be great if you can share your thoughts.
SatheeshNehru (Sun, 24 Nov 2019 03:53:17 GMT):
Is there any sdk to replace configtxgen configtxlator and docker operation?will be glad if sample code is shared? #fabric-sdk-java #fabric-sdk-java
bestbeforetoday (Mon, 25 Nov 2019 11:24:30 GMT):
Connecting to the channel and then closing the connection again for every transaction invocation will result in very poor performance. Ideally you want to be staying connected while you perform a series of transaction invocations and just close connections when your client application completes.
icordoba (Tue, 26 Nov 2019 16:24:41 GMT):
Hi, I have my Smart Contract working throwg peer node and through Java SDS for query transaction, but when I try to execute a write transaciton I get this exception. (I had this working but I have changed something in the code):
icordoba (Tue, 26 Nov 2019 16:24:42 GMT):
17:22:05.988 [main] DEBUG org.hyperledger.fabric.sdk.transaction.ProtoUtils - ChannelHeader: type: ENDORSER_TRANSACTION, version: 1, Txid: 78e36586768f32cc6ed1ed685e4ec45a85eec56a0eed15240cf031c53325086b, channelId: mrrc, epoch 0, clientTLSCertificate digest:
17:22:05.989 [main] ERROR org.hyperledger.fabric.sdk.Channel - java.lang.NullPointerException
org.hyperledger.fabric.sdk.exception.ProposalException: java.lang.NullPointerException
at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:4366)
at org.hyperledger.fabric.sdk.Channel.sendTransactionProposal(Channel.java:4244)
at mt.gov.ha.rent.javasdk.client.ChannelClient.sendTransactionProposal(ChannelClient.java:119)
at mt.gov.ha.rent.javasdk.invocation.InvokeChaincode.main(InvokeChaincode.java:166)
Caused by: java.lang.NullPointerException: null
at org.hyperledger.fabric.sdk.transaction.ProposalBuilder.createChaincodeInvocationSpec(ProposalBuilder.java:182)
at org.hyperledger.fabric.sdk.transaction.ProposalBuilder.createFabricProposal(ProposalBuilder.java:134)
at org.hyperledger.fabric.sdk.transaction.ProposalBuilder.build(ProposalBuilder.java:114)
at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:4360)
... 3 common frames omitted
org.hyperledger.fabric.sdk.exception.ProposalException: java.lang.NullPointerException
at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:4366)
at org.hyperledger.fabric.sdk.Channel.sendTransactionProposal(Channel.java:4244)
at mt.gov.ha.rent.javasdk.client.ChannelClient.sendTransactionProposal(ChannelClient.java:119)
at mt.gov.ha.rent.javasdk.invocation.InvokeChaincode.main(InvokeChaincode.java:166)
Caused by: java.lang.NullPointerException
at org.hyperledger.fabric.sdk.transaction.ProposalBuilder.createChaincodeInvocationSpec(ProposalBuilder.java:182)
at org.hyperledger.fabric.sdk.transaction.ProposalBuilder.createFabricProposal(ProposalBuilder.java:134)
at org.hyperledger.fabric.sdk.transaction.ProposalBuilder.build(ProposalBuilder.java:114)
at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:4360)
... 3 more
icordoba (Tue, 26 Nov 2019 16:24:49 GMT):
Any idea what I¡m missing? thanks
sandy (Wed, 27 Nov 2019 11:52:25 GMT):
Hi.. Am getting this error while creating channel. Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: d0bf306e3efcb6243a5ad09b94dccaca19dfc7254ed63a90daa92f446daf3e79 to Peer{ id: 4, name: peer0.org2.example.com, channelName: mychannel, url: grpc://localhost:9053, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Network closed for unknown reason, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:4525)
at org.hyperledger.fabric.sdk.Channel.getConfigBlock(Channel.java:952)
at org.hyperledger.fabric.sdk.Channel.getConfigBlock(Channel.java:918)
at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:2045)
at org.hyperledger.fabric.sdk.Channel.loadCACertificates(Channel.java:1882)
at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:1267)
at org.hyperledger.fabric.gateway.impl.NetworkImpl.initializeChannel(NetworkImpl.java:59)
at org.hyperledger.fabric.gateway.impl.NetworkImpl.
sandy (Wed, 27 Nov 2019 11:52:37 GMT):
can anyone help on this?
sandy (Wed, 27 Nov 2019 11:53:24 GMT):
Its working for me when i use fabric sdk directly but not working with fabric gateway...
sandy (Wed, 27 Nov 2019 20:17:07 GMT):
got it fixed.. Thank you
Purbaja (Mon, 02 Dec 2019 05:40:42 GMT):
Hi guys, using fabric-sdk-java I want to continuously listen to a chaincode event. How that can be achieved ?
Randyshu2018 (Tue, 03 Dec 2019 08:09:49 GMT):
Clipboard - December 3, 2019 4:09 PM
Randyshu2018 (Tue, 03 Dec 2019 08:11:58 GMT):
Anyone know why my proposalResponses's payload are different ? (I send proposal to two peers and the response payload are different)
knagware9 (Tue, 03 Dec 2019 08:15:16 GMT):
may be one of the peer's state database is compromised
Randyshu2018 (Tue, 03 Dec 2019 08:16:21 GMT):
so I should check couchdb first?
knagware9 (Tue, 03 Dec 2019 08:16:52 GMT):
you can check if something is modified there
Randyshu2018 (Tue, 03 Dec 2019 08:17:27 GMT):
they are same
knagware9 (Tue, 03 Dec 2019 08:18:25 GMT):
ok...then can you please share actual error you getting
Randyshu2018 (Tue, 03 Dec 2019 08:20:48 GMT):
16:19:13.842 [main] DEBUG org.hyperledger.fabric.sdk.SDKUtils - Consistency set: 0 bytes size: 765 bytes: 0a20360a2409892d0011198f4ff1a4ddc889da9655a6ef363306757d1c4f3428eba612d8050afe0412e3040a0665737461746512d8041a390a34007569647e69640072616e6479310032313939393163372d653334342d343235342d623835632d643138333463333436663438001a01001a9a040a2432313939393163372d653334342d343235342d623835632d6431383334633334366634381af1037b22656e637279707465644b6579223a2242454d306649674f597a6b704c334a51713670346a7156723343794d5a514c365377733056434b473056447971552b4a64527339797339724867686776666a772b4c6b306453794c437941385c6e42705a6e54625a6b627162784d514473446e396146384d41493042626378566573446e3458454c4a4b754f554f49683257412b597735536a314c493d5c6e222c2263727970746f4669656c6473223a5b2270686f6e65225d2c2264617461223a227b5c227569645c223a5c2272616e6479315c222c5c2270686f6e655c223a5c226f5146764748526b745a79364839516a6d466f3469413d3d5c5c6e5c222c5c226e616d655c223a5c2272616e6479315c222c5c2269645c223a5c2232313939393163372d653334342d343235342d623835632d6431383334633334366634385c227d222c22646967657374223a22787156576c694638623832445346362b336e68314a7842396d76707853464376485137615775553764306f3d5c6e222c227369676e6174757265223a224d4559434951436963756f51584d704b414843535038762b582b68444e3667383037502f5576366b51674330314476543377496841503578526953524e4d4c77595447586f684441444c67415c6e4d6b4a41466d584845746f5a567a2b4f465043645c6e227d12160a046c736363120e0a0c0a06657374617465120208051a4508c8011a4032336234313164313139633462383161666530366636353336356337636330666631373130333834646238626465396161373833303331616535653539373135220e12066573746174651a0476312e33 [Peer{ id: 3, name: peer0.master.ejubc.com, channelName: qiushichannel, url: grpcs://localhost:7051, mspid: MasterMSP}],
Consistency set: 1 bytes size: 402 bytes: 0a20360a2409892d0011198f4ff1a4ddc889da9655a6ef363306757d1c4f3428eba612ed020a930212f8010a0665737461746512ed011a0f0a0a007569647e69640000001a01001ad9010a2432313939393163372d653334342d343235342d623835632d6431383334633334366634381ab0017b226964223a22222c22756964223a22222c22656e637279707465644b6579223a2242454d306649674f597a6b704c334a51713670346a7156723343794d5a514c365377733056434b473056447971552b4a64527339797339724867686776666a772b4c6b306453794c437941385c6e42705a6e54625a6b627162784d514473446e396146384d41493042626378566573446e3458454c4a4b754f554f49683257412b597735536a314c493d5c6e227d12160a046c736363120e0a0c0a06657374617465120208051a4508c8011a4032336234313164313139633462383161666530366636353336356337636330666631373130333834646238626465396161373833303331616535653539373135220e12066573746174651a0476312e33 [Peer{ id: 4, name: peer0.merchant.ejubc.com, channelName: qiushichannel, url: grpcs://localhost:9051, mspid: MerchantMSP}]
knagware9 (Tue, 03 Dec 2019 08:23:30 GMT):
here how you saying the proposal responses are different ? Did you getting error during chaincode invoke
knagware9 (Tue, 03 Dec 2019 08:24:01 GMT):
Please ask this in #fabric & #fabric-questions
Randyshu2018 (Tue, 03 Dec 2019 08:25:15 GMT):
both responsecode are valid : 16:19:13.827 [main] DEBUG org.hyperledger.fabric.gateway.impl.TransactionImpl - validatePeerResponses: valid response from peer grpcs://localhost:7051
16:19:13.828 [main] DEBUG org.hyperledger.fabric.gateway.impl.TransactionImpl - validatePeerResponses: valid response from peer grpcs://localhost:9051
Randyshu2018 (Tue, 03 Dec 2019 08:26:52 GMT):
the endorse process is success but failed with Consistency check
knagware9 (Tue, 03 Dec 2019 08:28:46 GMT):
If a transaction has been endorsed correctly, the peer will attempt to apply it to the ledger. To do this, a peer must perform a ledger consistency check to verify that the current state of the ledger is compatible with the state of the ledger when the proposed update was generated.
Randyshu2018 (Tue, 03 Dec 2019 08:37:08 GMT):
upgrade chaincode and everything goes well ...
Randyshu2018 (Tue, 03 Dec 2019 08:37:55 GMT):
maybe the local chaincode image is mismatch from new chaincode version ?
Randyshu2018 (Tue, 03 Dec 2019 08:38:34 GMT):
or chaincode did some undetermined operation
knagware9 (Tue, 03 Dec 2019 09:32:45 GMT):
ok great
bestbeforetoday (Tue, 03 Dec 2019 10:12:25 GMT):
Are you looking for this:
- https://sdkjavadocs.github.io/org/hyperledger/fabric/sdk/Channel.html#registerChaincodeEventListener-java.util.regex.Pattern-java.util.regex.Pattern-org.hyperledger.fabric.sdk.ChaincodeEventListener-
bestbeforetoday (Tue, 03 Dec 2019 10:12:25 GMT):
Are you looking for this:
https://sdkjavadocs.github.io/org/hyperledger/fabric/sdk/Channel.html#registerChaincodeEventListener-java.util.regex.Pattern-java.util.regex.Pattern-org.hyperledger.fabric.sdk.ChaincodeEventListener-
Or with the higher-level API there are lots of flavours of `Contract.addContractListener()` which are similar but avoid duplication and provide events in order:
https://fabric-gateway-java.github.io/org/hyperledger/fabric/gateway/Contract.html
icordoba (Tue, 03 Dec 2019 22:54:40 GMT):
Hello, did you solve this? I also need to get all entries but passing "","" returns empty Iterator.
sandy (Wed, 04 Dec 2019 03:43:11 GMT):
Am getting this error while creating channel.. error authorizing update: error validating ReadSet: existing config does not contain element for [Group] /Channel/Application/Org1MSP but was in the read set
Can anyone help me on this?
Purbaja (Wed, 04 Dec 2019 08:13:01 GMT):
@bestbeforetoday thanks for sharing this. But as u said, with the fabric-sdk option I am receiving every event twice. Any way to avoid this?
bestbeforetoday (Wed, 04 Dec 2019 09:39:16 GMT):
Two obvious options spring to mind:
1. Write your own code to ignore duplicate events.
2. Use the high level _fabric-gateway-java_ API, which includes this deduplication logic so you don't have to write it yourself.
bestbeforetoday (Wed, 04 Dec 2019 09:43:16 GMT):
The reason you get duplicate (and out of order) events is because the event listener listens to all eventing peers on the channel. A different approach -- although I'm not sure I would recommend it -- could be to create a new Channel object based on the "real" Channel object, and populate it with only a single eventing peer object. Listeners attached to this new Channel object will only be receiving one copy of each event because it only has one eventing peer. The downside is that, if that one peer disconnects for any reason, you aren't getting any events.
ranjan008 (Wed, 04 Dec 2019 10:49:11 GMT):
how did you solve it ?
ranjan008 (Wed, 04 Dec 2019 10:54:51 GMT):
Hi I am getting below error when I am trying to join a new peer onto the existing channel.
ranjan008 (Wed, 04 Dec 2019 10:54:54 GMT):
Join peer to channel comchannel failed. Status FAILURE, details: Channel Channel{id: 6, name: comchannel} Sending proposal with transaction: 6c4b0ee01be64e211134cc789771c783dd338aa56fc12f4e99fba31880f7f194 to Peer{ id: 39, name: peer2.dmcc.com, channelName: comchannel, url: grpc://localhost:5051} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Network closed for unknown reason, cause=null
sandy (Wed, 04 Dec 2019 11:23:09 GMT):
Hi Ranjan.. The port number 5051 could be wrong. For my case i have misconfigured the port number.. Can you check once?
sandy (Wed, 04 Dec 2019 11:28:58 GMT):
If the configured port number is right then just check the peer logs.
sandy (Wed, 04 Dec 2019 11:34:49 GMT):
@ranjan008
ranjan008 (Wed, 04 Dec 2019 11:39:30 GMT):
have checked the peer logs there are no calls going to the peer for joining the channel.
ranjan008 (Wed, 04 Dec 2019 12:45:21 GMT):
also do I need to update channel capabilities to join peer onto the channel?
icordoba (Wed, 04 Dec 2019 13:56:19 GMT):
Hi... I am trying to get all entries in the ledger (Fabric 1.4.4, using Java Chaincode):
QueryResultsIterator
Qeven (Thu, 05 Dec 2019 07:09:09 GMT):
Has joined the channel.
icordoba (Thu, 05 Dec 2019 14:24:58 GMT):
Hi, anybody has an example of code to subscribe to events for the transaction that the client has just submitted? I mean... I want my client to do a putState() and be able to wait until that transaction is finished and distributed, but only to that transaction (not other transactions that may occur in at the same time).
bestbeforetoday (Thu, 05 Dec 2019 15:06:40 GMT):
Using the _fabric-gateway-java_ API, you get this behaviour (by default for your organization peers) out-of-the-box. You can select from several alternative commit handling strategies, or write your own implementation if the defaults do not suit you:
- https://fabric-gateway-java.github.io/org/hyperledger/fabric/gateway/Gateway.Builder.html#commitHandler-org.hyperledger.fabric.gateway.spi.CommitHandlerFactory-
If you do need custom behaviour, there is a sample implementation in the "See Also" links on this page:
- https://fabric-gateway-java.github.io/org/hyperledger/fabric/gateway/spi/CommitHandler.html
As mentioned on that page, you can easily listen for transaction commit events from specific peers using `Network.addCommitListener()`:
- https://fabric-gateway-java.github.io/org/hyperledger/fabric/gateway/Network.html#addCommitListener-org.hyperledger.fabric.gateway.spi.CommitListener-java.util.Collection-java.lang.String-
icordoba (Thu, 05 Dec 2019 15:24:44 GMT):
Thanks @bestbeforetoday Do I need to add any SetEvent() method in chaincode right after the putState() or it is not needed? (Just putState will do?)
bestbeforetoday (Thu, 05 Dec 2019 15:29:44 GMT):
SetEvent() is just for emitting chaincode (which the client API calls Contract) events, which you might use to send out additional information related to a transaction only when it is committed. The transaction commit events happen automatically when each peers commits the transaction. You don't have to write any code for this to happen
icordoba (Thu, 05 Dec 2019 15:39:56 GMT):
Great. Thanks @bestbeforetoday . If you can link here to some example of using addCommitListener() method in the client code that will help a lot. (I don't know how to get the Network or Gateway objects. I just have FabricClient and ChannelClient objects in my code, no Network or Gateway)
bestbeforetoday (Thu, 05 Dec 2019 15:43:45 GMT):
Are you sure you're using the Java SDK? Those object types don't look familiar to me. There is a usage example of the _fabric-gateway-java_ API in the overview page for the API documentation:
- https://fabric-gateway-java.github.io/
bestbeforetoday (Thu, 05 Dec 2019 15:44:16 GMT):
You probably won't need to add your own commit listeners as there are several default commit handling options available
icordoba (Thu, 05 Dec 2019 15:45:43 GMT):
I'm sorry, I pasted my own library classes (coded months ago). I'll check them to figure out. Again, thanks a lot.
bestbeforetoday (Thu, 05 Dec 2019 15:45:57 GMT):
If you do then there is an example of usage mentioned in my first reply in this thread, but for reference:
- https://github.com/hyperledger/fabric-gateway-java/blob/master/src/test/java/org/hyperledger/fabric/gateway/sample/SampleCommitHandler.java
icordoba (Thu, 05 Dec 2019 15:56:35 GMT):
@bestbeforetoday Sorry again. I use org.hyperledger.fabric.sdk.HFClient class to create a transaction proposal which then I use org.hyperledger.fabric.sdk.Channel to send the transaction to the channel. sorry I don't find Network or Gateway objects from there. Any directions? Thanks
bestbeforetoday (Thu, 05 Dec 2019 16:01:56 GMT):
When calling `sendTransaction` to send the proposal responses to the orderer, you can pass options, which include configuring nOfEvents:
- https://sdkjavadocs.github.io/org/hyperledger/fabric/sdk/Channel.html#sendTransaction-java.util.Collection-org.hyperledger.fabric.sdk.Channel.TransactionOptions-
This can make it wait for a certain number of commit events before the Future completes
icordoba (Thu, 05 Dec 2019 16:03:11 GMT):
OK, this means I don't need to use listener approach right? Just wait for that Completable future?
bestbeforetoday (Thu, 05 Dec 2019 16:03:53 GMT):
Alternatively you can roll your own by specifying `nofNoEvents` to have the send unblock immediately and then attach a block listener to listen for commit events that you care about using `Channel.registerBlockListener()`:
- https://sdkjavadocs.github.io/org/hyperledger/fabric/sdk/Channel.html#registerBlockListener-org.hyperledger.fabric.sdk.BlockListener-
icordoba (Thu, 05 Dec 2019 16:04:26 GMT):
The "certain number of commit events" works for me I guess. I'll try that.
bestbeforetoday (Thu, 05 Dec 2019 16:05:31 GMT):
Yes, if all you care about is receiving commit events from certain peers (or a certain number of events), you can use the nOfEvents mechanism. Just take care that it doesn't deal with peers not being available or disconnecting. The high level API does deal with these cases
icordoba (Thu, 05 Dec 2019 16:05:48 GMT):
ok cool. thanks
Purbaja (Fri, 06 Dec 2019 08:01:12 GMT):
Hi @bestbeforetoday thanks for ur suggestion. i switched to fabric-gateway. I tried to build dynamic gateway object . so set discover true as:
builder.identity(wallet, userName).networkConfig(connectionProfile).discovery(true);
But getting below error while submitting transaction
org.hyperledger.fabric.sdk.exception.ServiceDiscoveryException: The channel is not configured with any peers with the 'discover' role
at org.hyperledger.fabric.gateway.impl.TransactionImpl.submit(TransactionImpl.java:118)
at org.hyperledger.fabric.gateway.impl.ContractImpl.submitTransaction(ContractImpl.java:50)
Purbaja (Fri, 06 Dec 2019 09:26:40 GMT):
Hi @bestbeforetoday , thanks for ur suggestion. I have switched to fabric-gateway. Is there any example of contractListener?
Purbaja (Fri, 06 Dec 2019 10:22:48 GMT):
@bestbeforetoday , I checked ur previous post and tried below:
Consumer
Purbaja (Fri, 06 Dec 2019 10:22:48 GMT):
@bestbeforetoday , I checked ur previous post and tried below:
Consumer
roberto.cangiamila (Fri, 06 Dec 2019 10:43:46 GMT):
Has joined the channel.
roberto.cangiamila (Fri, 06 Dec 2019 10:43:47 GMT):
Hi all .. i needs to ask you a question about chaincode event lister registration .. is there a way to pass an offset in registerChaincodeEventListener Channel class call?
roberto.cangiamila (Fri, 06 Dec 2019 10:46:15 GMT):
i have to initialize chaincode event retrieve from a specific point ..
Purbaja (Mon, 09 Dec 2019 09:19:39 GMT):
Is there any observable present in fabric-gateway-java for contractEventListener?
Purbaja (Mon, 09 Dec 2019 09:19:39 GMT):
Is there any observable present in fabric-gateway-java for contractEventListener? otherwise only the first event is coming to the listener. Then onward no event is coming.
Purbaja (Mon, 09 Dec 2019 09:33:04 GMT):
listener
Purbaja (Tue, 10 Dec 2019 11:15:06 GMT):
Hi @bestbeforetoday , there was some issue in my code. Now the gateway contractListener is running and events are coming. But the listener is getting stopped after some time. Is there any default timeout set in the gateway?
shrivastava.amit (Wed, 11 Dec 2019 09:54:35 GMT):
Has joined the channel.
bestbeforetoday (Wed, 11 Dec 2019 09:57:58 GMT):
@Purbaja There should not be any timeout and your listener should continue receiving events either until it is disconnected or your client application is shut down. One thing you could try is... when you listener appears to stop receiving events, grab the result of calling `toString()` on the associated Network object, and post that in a Jira mentioning that your listener is not receiving events: https://jira.hyperledger.org/projects/FGJ
billd100 (Wed, 11 Dec 2019 14:55:29 GMT):
Has joined the channel.
Purbaja (Thu, 12 Dec 2019 12:58:14 GMT):
Hi @bestbeforetoday , i tried capturing the associated object, but i am not getting the actual point when the listener is getting stopped
Purbaja (Thu, 12 Dec 2019 13:20:24 GMT):
I have a question.. for a chaincodeEvent if the associated chaincode is deployed/installed in two peers, then will both the peers get the event through contractListener? Or only one peer will get the event at a time?
bestbeforetoday (Thu, 12 Dec 2019 13:54:28 GMT):
The contract listener will only get the chaincode event once
AkilaVasanthakumar (Fri, 13 Dec 2019 08:48:32 GMT):
Fabric-ca using java-gateway-sdk
Requirement:
My requirement is to do the register, enroll operations in fabric-ca using java-gateway-sdk.
What I have tried:
Started the fabric-ca server in a vm(say vm1). Tried to access the fabric-ca server from another vm(say vm2). I can able to enroll the admin, register and enroll the user using api. I also got the result in server after register and enroll processes as:
POST /api/v1/enroll 201 0 "OK" (admin enrollment)
POST /api/v1/cainfo 200 0 "OK"
POST /api/v1/register 201 0 "OK" (user registration)
signed certificate with serial number 75758730054339427289657557776062433601010825862
POST /api/v1/enroll 201 0 "OK" (user enrollment)
So We can assume that, vm1 can receive the enroll and register request from vm2.
Now the problem is, the generated certificates after the enrollment of the user has got stored in the wallet in the vm2 itself(that is, from where I done the api request for register and enrollment). Actually, I need that certificates to get stored in vm1(where the fabric-ca server is running). Can anyone guide me on this? Please reply asap.
Paradox-AT (Mon, 16 Dec 2019 11:20:14 GMT):
You will get the certificate where the client is running. In your case the client is running on VM2 so it got stored there
Paradox-AT (Mon, 16 Dec 2019 11:20:50 GMT):
If you need it in VM1 run your client and server on the same machine
Paradox-AT (Mon, 16 Dec 2019 11:23:07 GMT):
Hey Guys, How do I add attributes to the certificates? I am doing something like this:
``` registrationRequest.addAttribute(new Attribute("permission", "P1,P2"));
```
But while looking at the certificate there is no attribute
Paradox-AT (Mon, 16 Dec 2019 11:23:07 GMT):
Hey Guys, How do I add attributes to the certificates? I am doing something like this:
``` registrationRequest.addAttribute(new Attribute("permission", "P1,P2"));
```
But while looking at the certificate there is no attribute
Can anyone help?
Paradox-AT (Mon, 16 Dec 2019 11:23:07 GMT):
Hey Guys, How do I add attributes to the certificates? I am doing something like this:
``` registrationRequest.addAttribute(new Attribute("permission", "P1,P2"));
```
But while looking at the certificate there is no attribute
Please help
Paradox-AT (Mon, 16 Dec 2019 11:58:59 GMT):
You will get the certificate where the client is running. In your case the client is running on VM2 so it got stored there
If you need it in VM1 run your client and server on the same machine
AkilaVasanthakumar (Mon, 16 Dec 2019 12:27:04 GMT):
We have tried to set up a native fabric-ca server in a TLS enabled environment. After the successful setup of ca, we have enrolled/registed users in CA, brought up the network with 1-Org,1-Orderer,2-Peer(All setup natively and TLS enabled).
We have developed a java based webapplication using Java SDK to connect to the above mentioned setup. However while trying to invoke/query the chaincodes, SDK throws the below error:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.2.1.RELEASE)
2019-12-16 17:21:42.850 INFO 32154 --- [ main] o.e.demoFabcar.DemoFabcarApplication : Starting DemoFabcarApplication with PID 32154 (/home/akila/Documents/Fabric-java-sdk-webApp/demo-Fabcar/src/main/resources/demo-Fabcar-0.0.1-SNAPSHOT.jar started by akila in /home/akila/Documents/Fabric-java-sdk-webApp/demo-Fabcar/src/main/resources)
2019-12-16 17:21:42.853 INFO 32154 --- [ main] o.e.demoFabcar.DemoFabcarApplication : No active profile set, falling back to default profiles: default
2019-12-16 17:21:43.903 INFO 32154 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-12-16 17:21:43.914 INFO 32154 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-12-16 17:21:43.915 INFO 32154 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.27]
2019-12-16 17:21:43.972 INFO 32154 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-12-16 17:21:43.972 INFO 32154 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1073 ms
2019-12-16 17:21:44.128 INFO 32154 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-12-16 17:21:44.332 INFO 32154 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-12-16 17:21:44.335 INFO 32154 --- [ main] o.e.demoFabcar.DemoFabcarApplication : Started DemoFabcarApplication in 1.854 seconds (JVM running for 2.284)
2019-12-16 17:21:48.707 INFO 32154 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-12-16 17:21:48.707 INFO 32154 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2019-12-16 17:21:48.711 INFO 32154 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 4 ms
2019-12-16 17:21:49.033 WARN 32154 --- [nio-8080-exec-1] o.hyperledger.fabric.sdk.helper.Config : Failed to load any configuration from: config.properties. Using toolkit defaults
gateway log msg :::org.hyperledger.fabric.gateway.impl.GatewayImpl@37faf39b
2019-12-16 17:21:50.934 ERROR 32154 --- [nio-8080-exec-1] org.hyperledger.fabric.sdk.Channel : Channel Channel{id: 1, name: composerchannelrest} Sending proposal with transaction: 42b80b210bddd8219ea095bd8894572435f9d9f32354651b54b045c12f75ef1a to Peer{ id: 3, name: peer0.org0, channelName: composerchannelrest, url: grpcs://104.215.67.23:7051, mspid: Org0MSP} failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [composerchannelrest] creator org [Org0MSP], cause=null}
Any help regarding this is greatly appreciated.
sandy (Mon, 16 Dec 2019 14:53:37 GMT):
Hi.. If I tend to use DefaultCommitHandlers in fabric gateway, how do I listen and do my own handling during commitEvents ?
sandy (Mon, 16 Dec 2019 14:55:48 GMT):
@bestbeforetoday
bestbeforetoday (Tue, 17 Dec 2019 09:51:54 GMT):
What kind of handling are you looking to do?
- If you want to take some action after the transaction has been committed on peers then just do it after the transaction submit returns.
- If you want to implement your own rules for when a transaction is considered committed from the default handlers, you can implement your own commit handler. See https://hyperledger.github.io/fabric-gateway-java/release-1.4/org/hyperledger/fabric/gateway/spi/CommitHandlerFactory.html
- Another option is to have your transactions explicitly emit events to let you know that certain things have happened. These events can include additional information. For example, a _createCar_ transaction function could emit a _carCreated_ event including the unique identifier of the newly created car. Your client can listen for these events using `Contract.addContractListener()`: https://hyperledger.github.io/fabric-gateway-java/release-1.4/org/hyperledger/fabric/gateway/Contract.html#addContractListener-java.util.function.Consumer-
ranjan008 (Tue, 17 Dec 2019 10:38:13 GMT):
I am using below policy, I want an endorsement from 1 peer from both the organization, however in this case it is taking the endorsement from 2 peers of the same organization and the transaction goes through, Is this format right for an AND situation or need any change?
ranjan008 (Tue, 17 Dec 2019 10:38:17 GMT):
identities:
user1: {"role": {"name": "member", "mspId": "ABCMSP"}}
user2: {"role": {"name": "member", "mspId": "XYZMSP"}}
policy:
2-of:
- 1-of:
- signed-by: "user1"
- 1-of:
- signed-by: "user2"
SatheeshNehru (Tue, 17 Dec 2019 12:38:56 GMT):
how to get instance of Systemchannel??
is it possible add org to consortium(i.e updating system channel configuration) via fabric java sdk?
SatheeshNehru (Tue, 17 Dec 2019 12:40:26 GMT):
#fabric-questions #fabric-java-chaincode #fabric-orderer #fabric-orderer-dev #fabric-sdk-java
Purbaja (Wed, 18 Dec 2019 05:39:46 GMT):
While using fabric-gateway services with service discovery on , I am getting below exception.What could be possible root cause for this ?
org.hyperledger.fabric.gateway.GatewayRuntimeException: org.hyperledger.fabric.sdk.exception.ServiceDiscoveryException: java.util.concurrent.TimeoutException
at org.hyperledger.fabric.gateway.impl.TransactionImpl.submit(TransactionImpl.java:118) ~[fabric-gateway-java-1.4.0.jar!/:na]
at org.hyperledger.fabric.gateway.impl.ContractImpl.submitTransaction(ContractImpl.java:50) ~[fabric-gateway-java-1.4.0.jar!/:na]
Purbaja (Wed, 18 Dec 2019 09:34:34 GMT):
In fabric-gateway-java the contract.submitTransaction() is returning only the contract response. SO, if we need the transaction hash, how to get that?
bestbeforetoday (Wed, 18 Dec 2019 09:40:45 GMT):
I would guess it timed out waiting for a service discovery response
bestbeforetoday (Wed, 18 Dec 2019 09:48:36 GMT):
Do you mean the block hash? One or more transactions get committed together in a block once they have been pushed out to committing peers by the orderer. You can add a block listener to the Network object and examine the data hash and previous block hash for each block event that arrives
Purbaja (Wed, 18 Dec 2019 09:55:58 GMT):
I need the individual transaction id
Purbaja (Wed, 18 Dec 2019 09:59:14 GMT):
like we used to get in the fabric-sdk through ProposalResponse.getTransactionID()
bestbeforetoday (Wed, 18 Dec 2019 10:46:41 GMT):
Unfortunately, as you point out, the transaction ID is not surfaced by the low level SDK until after proposal responses are received, so the high level SDK does not know in advance of the `Transaction.submit()` call what the transaction ID will be. In the Node SDK we expose this with `Transaction.getTransactionID()` because this can be generated in advance of sending the transaction proposals. In practice, this typically only gets used I to wait for commit events from that transaction, which isn't necessary because the high level SDK takes care of that for you. And if you want more control of how commit events are handled you can write your own commit handler, which gets given the transaction ID
bestbeforetoday (Wed, 18 Dec 2019 10:46:41 GMT):
Unfortunately, as you point out, the transaction ID is not surfaced by the low level SDK until after proposal responses are received, so the high level SDK does not know in advance of the `Transaction.submit()` call what the transaction ID will be. In the Node SDK we expose this with `Transaction.getTransactionID()` because this can be generated in advance of sending the transaction proposals. In practice, this typically only gets used to wait for commit events from that transaction, which isn't necessary because the high level SDK takes care of that for you. And if you want more control of how commit events are handled you can write your own commit handler, which gets given the transaction ID
bestbeforetoday (Wed, 18 Dec 2019 10:49:42 GMT):
Have you got a different use case from listening to commit events that means you need the transaction ID? If so, please could you raise a Jira describing this requirement:
- https://jira.hyperledger.org/projects/FGJ
We might be able to change the implementation so that you can get the transaction ID similar to how this is done in the Node SDK.
ShobhitSrivastava (Thu, 19 Dec 2019 07:06:44 GMT):
Hey!! did you figure this out. I am stuck in it.
ShrutiHK (Thu, 19 Dec 2019 08:27:07 GMT):
Hi All,
ShrutiHK (Thu, 19 Dec 2019 08:27:13 GMT):
I am setting up a TLS enabled network on separate VMs, and testing a fabric-java-sdk based client application with this network
The network has 1 Orderer, 1 Org with 2 peers, and a Fabric - CA
I am able to register and enroll users from my client application on Fabric CA
But invoke and query fail with the error - access denied for the creator Org
I am using fabric-gateway-sdk for java
Can you please advice, how can I fix the issue?
ShrutiHK (Thu, 19 Dec 2019 08:45:12 GMT):
We are stuck in resolving the issue since a long time. The setup works in dockerized setup on a single VM, but not on separate VMs
ShrutiHK (Thu, 19 Dec 2019 08:46:31 GMT):
Any help is appreciated.
ShrutiHK (Thu, 19 Dec 2019 08:47:23 GMT):
Has anyone worked on a similar setup?
bestbeforetoday (Fri, 20 Dec 2019 11:06:42 GMT):
Some of the test code works with certificate attributes and might help as an example: https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric_ca/sdkintegration/HFCAClientIT.java#L161
bestbeforetoday (Fri, 20 Dec 2019 11:11:08 GMT):
It's not obvious to me what the issue is but, particularly if it does work with local docker containers, I would check all the certificates are correctly generated and configured. TLS certificates will need to correctly reflect the external host names of the nodes in the network
ShobhitSrivastava (Fri, 20 Dec 2019 12:05:31 GMT):
please check the certificate content which we received after registering via fabric-ca. We need to have signedpem. Debug the fabric sdk and check the certificate content when you are enrolling the user. I can help post christmas if you need any code snippet. Thanks
Purbaja (Fri, 20 Dec 2019 12:34:26 GMT):
Does fabric-gateway supports key externalization? i mean without using fabric-ca if we use our own CA where keys are externalized can we create wallet in fabric-gateway?
bestbeforetoday (Fri, 20 Dec 2019 14:14:16 GMT):
Wallets just hold X.509 certificates and private keys. The wallet doesn't care how the credentials are obtained. To allow connection to the network they will need to be recognised as valid network credentials, which probably means signed by whatever CA is configured for your network.
manivannant (Sat, 21 Dec 2019 08:11:55 GMT):
Has joined the channel.
ShrutiHK (Mon, 23 Dec 2019 08:34:41 GMT):
Thanks for your reply, will connect with you again post Christmas. It would be great if you can share some code snippet for the same. Till then, I will check what you have suggested.
ShrutiHK (Mon, 23 Dec 2019 08:36:02 GMT):
I have checked this, everything seems correctly configured. May be will share some logs with you.
ShrutiHK (Tue, 24 Dec 2019 07:08:32 GMT):
I am unable to query the chaincodes on my Org0 peers using the Fabric-CA generated certificates
ShrutiHK (Tue, 24 Dec 2019 07:09:19 GMT):
But if I replace the certificate content with the content from Admin@org0-cert.pem, it works
ShrutiHK (Tue, 24 Dec 2019 07:09:42 GMT):
I have added the Fabric CA VM to my network later
ShrutiHK (Tue, 24 Dec 2019 07:10:01 GMT):
What can be the issue with the certificates generated by Fabric CA?
rahulsingh79 (Wed, 25 Dec 2019 06:37:41 GMT):
Has joined the channel.
konda.kalyan (Thu, 26 Dec 2019 06:01:47 GMT):
Has joined the channel.
Paradox-AT (Sun, 29 Dec 2019 08:59:10 GMT):
Hey I was able to figure things out
Paradox-AT (Sun, 29 Dec 2019 09:00:09 GMT):
I had to pass default policies as true while issuing the certificate
Paradox-AT (Sun, 29 Dec 2019 09:00:28 GMT):
What is your problem @ShobhitSrivastava ?
HectorRen (Tue, 31 Dec 2019 16:17:24 GMT):
Has joined the channel.
ShobhitSrivastava (Thu, 02 Jan 2020 07:09:23 GMT):
Hi @Paradox-AT . I was doing as below " RegistrationRequest rr = new RegistrationRequest(user.getName(), "org1.department1");
rr.addAttribute(new Attribute("email", "shobhit@test"));"
ShobhitSrivastava (Thu, 02 Jan 2020 07:10:05 GMT):
and in chaincode I was fetching the "email", but could not get this
kelvinzhong (Thu, 02 Jan 2020 07:46:20 GMT):
@bestbeforetoday hi I wonder if I can override the grpcs properties while doing the service discovery. since I use a nignx to proxy the network, the service discovery could not work properly and I need to override the grpc properties, but seems the java sdk did not provide a interface to do that
dwusiq (Mon, 06 Jan 2020 07:18:19 GMT):
Has joined the channel.
dwusiq (Mon, 06 Jan 2020 07:18:20 GMT):
WARN PeerEventServiceClient(:) - Received error on PeerEventServiceClient{id: 21, channel: mychannel, peerName: peer1.org2.example.com:10051, url: grpcs://peer1.org2.example.com:10051}, attempts 1. UNAVAILABLE: Unable to resolve host peer1.org2.example.com
dwusiq (Mon, 06 Jan 2020 07:20:41 GMT):
i use fabric-gateway-java, but throw exception:
WARN PeerEventServiceClient(:) - Received error on PeerEventServiceClient{id: 21, channel: mychannel, peerName: peer1.org2.example.com:10051, url: grpcs://peer1.org2.example.com:10051}, attempts 1. UNAVAILABLE: Unable to resolve host peer1.org2.example.com
how can I fix the issue?
bestbeforetoday (Tue, 07 Jan 2020 11:58:51 GMT):
I am guessing that your peer is running in a Docker container on your local machine. If so, you have two options:
1. Add entries for your containers to your hosts file so they resolve to localhost, for example:
```127.0.0.1 peer1.org2.example.com
```
2. Set the environment variable `org.hyperledger.fabric.sdk.service_discovery.as_localhost` to `true` to indicate that discovered nodes should resolve as localhost
Flyyellow (Thu, 09 Jan 2020 01:05:16 GMT):
Has joined the channel.
ShobhitSrivastava (Fri, 10 Jan 2020 09:52:46 GMT):
*asdasd_asdsadasd_*
yeousunn (Mon, 13 Jan 2020 05:45:46 GMT):
Hi Guys,
I have a QueryAll function in which I need to pass range of keys and it should returns all the state within the range. It is working fine. But I find it weird in some cases.
I have key values as : 101, 102, 103....
When I pass ["101","103"]
It returns 101, 102 as expected.
and when I pass ["1","2"]
It returns all the values 101,102,103
is it expected behavior?
yeousunn (Mon, 13 Jan 2020 05:45:46 GMT):
Hi Guys,
I have a QueryAll function in which I need to pass range of keys and it should returns all the state within the range. It is working fine. But I find it weird in some cases.
I have key values as : 101, 102, 103....
When I pass ["101","103"]
It returns 101, 102 as expected.
and when I pass ["1","2"]
It returns all the values 101,102,103
is it expected behavior?
I am calling `ctx.getStub().getStateByRange(key1, key2);`
yeousunn (Mon, 13 Jan 2020 05:45:46 GMT):
Hi Guys,
I have a queryAll function in which I need to pass range of keys and it should returns all the state within the range. It is working fine. But I find it weird in some cases.
I have key values as : 101, 102, 103....
When I pass ["101","103"]
It returns 101, 102 as expected.
and when I pass ["1","2"]
It returns all the values 101,102,103
is it expected behavior?
I am calling `ctx.getStub().getStateByRange(key1, key2);`
medikent (Mon, 13 Jan 2020 18:42:19 GMT):
@ShrutiHK You may have a mismatch between your CA identities and your generated crypto material on the network. If you created CA Identities and then wiped and recreated your crypto-config directory without clearing out your CA Identities then using your existing CA identities would give you access denied errors.
bestbeforetoday (Tue, 14 Jan 2020 10:13:58 GMT):
I would suggest asking this question on #fabric-chaincode-dev
PauloQuerido (Fri, 17 Jan 2020 16:01:58 GMT):
Has joined the channel.
PauloQuerido (Fri, 17 Jan 2020 16:01:59 GMT):
Hi, I'm new to Hyperledger Fabric and in my first time trying to run the Fabcar example in Java i get the following error: "Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1"
Anyone knows how to fix this issue? I can run the code in javascript but not in java
bestbeforetoday (Fri, 17 Jan 2020 16:48:34 GMT):
Sounds like something went wrong with the install/instantiate/start of the chaincode. Perhaps the logs on the peer will give you some clues. If the peer is in a Docker container then you should be able to use `docker logs` to view them. Also look at stopped chaincode Docker containers, which might be left over if the chaincode container failed to start cleanly
Paradox-AT (Mon, 20 Jan 2020 10:58:56 GMT):
rr.addAttribute(new Attribute("email", "shobhit@test",true));"
Paradox-AT (Mon, 20 Jan 2020 10:58:56 GMT):
Try this: rr.addAttribute(new Attribute("email", "shobhit@test",true));"
Paradox-AT (Mon, 20 Jan 2020 10:58:56 GMT):
Try this:``` rr.addAttribute(new Attribute("email", "shobhit@test",true));"```
JanKosecki (Mon, 20 Jan 2020 11:37:35 GMT):
Hi guys, I'm running java service that uses Fabric SDK ServiceDiscovery and I'm seeing quite often an errors `Failed to discover peer endpoint information XXX for chaincode YYY` - the discovery runs every 120 seconds, but this errors doesn't always happen, however it definitely causes lots of noise in the logs. I don't want to change log level to ERROR as it could hide other more useful warn messages
JanKosecki (Mon, 20 Jan 2020 11:37:35 GMT):
Hi guys, I'm running java service that uses Fabric SDK ServiceDiscovery and I'm seeing quite often errors like `Failed to discover peer endpoint information XXX for chaincode YYY` - the discovery runs every 120 seconds, but this errors doesn't always happen, however it definitely causes lots of noise in the logs. I don't want to change log level to ERROR as it could hide other more useful warn messages
JanKosecki (Mon, 20 Jan 2020 11:37:35 GMT):
Hi guys, I'm running java service that uses Fabric SDK ServiceDiscovery and I'm seeing quite often errors like `Failed to discover peer endpoint information XXX for chaincode YYY` - the discovery runs every 120 seconds and this error doesn't happen all the time, however it definitely causes lots of noise in the logs of my service. I don't want to change log level to ERROR as it could hide other more useful warn messages
Purbaja (Mon, 20 Jan 2020 11:40:28 GMT):
From my fabric-java-sdk i want to register a new user using fabric-ca-client. Is there any example present?
bestbeforetoday (Tue, 21 Jan 2020 09:43:53 GMT):
By coincidence, somebody recently reported an issue using the Node SDK that sounded like it might have been caused by failure to obtain service discovery information: https://chat.hyperledger.org/channel/fabric-sdk-node?msg=7ekkDPb4Ccnq6Ttce
I am not aware of a bug in service discovery that might be causing this but that doesn't mean there isn't one. I'll try to find somebody from the server end to take a look
Purbaja (Tue, 21 Jan 2020 13:21:08 GMT):
While registering a new user through fabric-ca I am getting Affiliation validation exception.
org.hyperledger.fabric_ca.sdk.exception.HTTPException: POST request to https://XXX:7054 failed request body {"id":"User3","type":"client","affiliation":"org1","attrs":[]}. Response: {"result":"","errors":[{"code":0,"message":"Registration of 'User3' failed in affiliation validation: Failed getting affiliation 'org1': : scode: 404, code: 63, msg: Failed to get Affiliation: sql: no rows in result set"}
],"messages":[],"success":false}
at org.hyperledger.fabric_ca.sdk.HFCAClient.getResult(HFCAClient.java:1456)
at org.hyperledger.fabric_ca.sdk.HFCAClient.post(HFCAClient.java:1374)
at org.hyperledger.fabric_ca.sdk.HFCAClient.httpPost(HFCAClient.java:1348)
at org.hyperledger.fabric_ca.sdk.HFCAClient.register(HFCAClient.java:395)
medikent (Wed, 22 Jan 2020 00:41:45 GMT):
After connecting to a Fabric network with `Gateway` is there a need to also add a contract listener with ` addContractListener(Consumer)` to know for sure when the transaction is complete?
dineshthemacho1 (Wed, 22 Jan 2020 06:05:06 GMT):
Has joined the channel.
bestbeforetoday (Wed, 22 Jan 2020 09:46:33 GMT):
Absolutely not! `Contract.submitTransaction()` (and `Contract.createTransaction().submit()`) but use whatever commit handling strategy you have configured at the Gateway to wait for the transaction to be committed on peers before returning. The implementation uses `Network.addCommitHandler()` to listen for commit events (and disconnections) from relevant peers. `Contract.addContractListener()` is for listening to contract (chaincode) events emitted by transaction implementation code, so might be used to coordinate business processes or logic. For example, a transaction function that creates an order might emit an event that is received by some client code, which in turn kicks off some business process to fulfil the order
bestbeforetoday (Wed, 22 Jan 2020 09:47:24 GMT):
Do have a look at the different commit handling strategies to make sure you're using one appropriate to your situation. If none of them do exactly what you want then you can write your own custom implementation
medikent (Wed, 22 Jan 2020 18:15:46 GMT):
I suspected as much when I saw the `DefaultCommitHandlers` enum. Thank you for clarifying the behavior and purpose of `Contract.addContractListener()`.
bestbeforetoday (Thu, 23 Jan 2020 09:39:57 GMT):
You're welcome. I realise the Javadoc doesn't give any description of the context in which you might want to use each of the listener types. I figured the main Fabric docs are the place to cover these concepts since they are common to all client (and smart contract) SDKs. Now I'm wondering if the Javadoc should at least contain some context on usage. Or at the very least, the doc for `submit()` should make it clear that it will use the commit handler to determine how it will wait for commit events before returning. What do you think?
bestbeforetoday (Thu, 23 Jan 2020 09:47:17 GMT):
I've raised this Jira for the submit Javadoc anyway: https://jira.hyperledger.org/browse/FGJ-73
Tatse (Thu, 23 Jan 2020 14:49:08 GMT):
Has joined the channel.
icordoba (Fri, 24 Jan 2020 19:12:54 GMT):
My chaincode running on Kubernetes has some problem and the docker instances seem to be dying frequently. After this, a new instance is started but it takes some time so first request is always lost. I am getting this error (I use Fabric Java SDK):
icordoba (Fri, 24 Jan 2020 19:12:58 GMT):
2020-01-24 16:00:58.705 ERROR 1 --- [nio-8080-exec-6] org.hyperledger.fabric.sdk.Channel : Channel Channel{id: 1, name: mrrc} sending proposal with transaction 23df885c323a56a2fab469de59f4744305690cad1151d202227b4b0ad416be51 to Peer{ id: 2, name: blockchain-hapeer1, channelName: mrrc, url: grpcs://blockchain-hapeer1:7051} failed because of timeout(1000 milliseconds) expiration
icordoba (Fri, 24 Jan 2020 19:13:07 GMT):
Until I figure out why Java chaincode Pods are respawning, how can I increase that proposal wait timeout?
I have read online that value is org.hyperledger.fabric.sdk.proposal.wait.time but how and where should I pass it to the Fabric Java SDK classes?
icordoba (Fri, 24 Jan 2020 19:16:52 GMT):
Let me ask another quesiton: I have a simple Hyperledger Fabric network with just 2 peers using Kubernetes. Peer 1 is having load issues and it periodically is respawning, which is a problem as it won't be restarted until a request is received. This first request returns timeout as it needs some time to start (I am using java chaincode) I have seen that peer2 gets no request or transaction from the orderer. How should I configure the orderer to balance transactions between both peers?
icordoba (Fri, 24 Jan 2020 19:16:56 GMT):
I also want to balance the queries to the chaincode. I am using fabric Java SDK. What is the recommended approach to distribute the queries to both peers and not just to the first one? Currently, peer 2 is completely unused by Orderer or Java SDK client.
nitishbhardwaj19 (Sun, 26 Jan 2020 08:34:15 GMT):
Have you tried enabling service discovery? It will automatically choose any available peer based on the load and availability .
nitishbhardwaj19 (Sun, 26 Jan 2020 08:37:26 GMT):
What kind of operation you are trying to perform? Is it any administration task or a simple chaincode invoke? You need to use **Admin Cert** for performing the administrative tasks like installing, instantiating chaincode
nitishbhardwaj19 (Sun, 26 Jan 2020 08:42:50 GMT):
@bestbeforetoday Thanks for your active support. Your inputs are always helpful. I am just trying to switch from fabric-sdk-java to gateway-java. I went through the API docs, looks pretty interesting and simple to use. What I couldn't find is that do we have support to perform administrative activities using Gateway? I.e. creation of channel, installation/instantiation of chaincode, join or add peers with Gateways? Or Gateways are just for invoke and query? Would be great if you can share some details about it. Thanks.
davidkel (Sun, 26 Jan 2020 09:14:11 GMT):
The gateway implemention doesn't include any operational/administrative capabilities.
nitishbhardwaj19 (Sun, 26 Jan 2020 09:14:52 GMT):
Thanks for the confirmation @davidkel
nitishbhardwaj19 (Tue, 28 Jan 2020 08:13:11 GMT):
Does anyone knows if we have capability to sign transactions offline with fabric-sdk-java? We do this feature with fabric-sdk-node, I hope we must have it for java too.
Has anyone tried it with java? Where can I get some references?
FYI - @bestbeforetoday
nitishbhardwaj19 (Tue, 28 Jan 2020 08:13:11 GMT):
Does anyone knows if we have capability to sign transactions offline with fabric-sdk-java? We do this feature with fabric-sdk-node, I hope we must have it for java too.
Has anyone tried it with java? Where can I get some references?
Nodesdk's reference to sign transactions offline: https://hyperledger.github.io/fabric-sdk-node/release-1.4/tutorial-sign-transaction-offline.html
FYI - @bestbeforetoday
lzaouche (Tue, 28 Jan 2020 09:18:06 GMT):
Has joined the channel.
bestbeforetoday (Tue, 28 Jan 2020 09:35:32 GMT):
If using the _fabric-gateway_ API, you can simply select the round robin query handler when connecting your Gateway. If using the low level _fabric-sdk-java_ API then you can specify the peers a proposal should be sent to in the call to `Channel.queryByChaincode()`
medikent (Tue, 28 Jan 2020 14:28:07 GMT):
I agree. I'll send you a PR.
medikent (Tue, 28 Jan 2020 14:29:59 GMT):
@nitishbhardwaj19 what is your use case for performing administrative activities through the SDK?
medikent (Tue, 28 Jan 2020 14:30:18 GMT):
Haven't heard of that. It would be cool to implement though. If it doesn't exist we should add it.
bestbeforetoday (Tue, 28 Jan 2020 16:59:47 GMT):
I don't have a very authoritative answer for you but this may help. I think the signing of proposals is all handled by the `byte[] sign(PrivateKey key, byte[] plainText)` method on the CryptoSuite set on the HFClient. Perhaps you could configure your client with your own CryptoSuite implementation with your own signing implementation. That would hook you into the `Channel.sendTransactionProposal()` flow, but it doesn't give you a mechanism to sign transaction proposals completely independently and then submit the previously signed proposals directly
nitishbhardwaj19 (Tue, 28 Jan 2020 17:02:52 GMT):
Thanks @bestbeforetoday I guess this is good enough :)
nitishbhardwaj19 (Tue, 28 Jan 2020 17:13:56 GMT):
I wanted this because I wanted to use Azure-key vault to store user's certificates and use it to sign the transaction. It provides it's own implementation to sign a message. Just wanted to know if we can leverage that and plugin with the overall flow.
nitishbhardwaj19 (Wed, 29 Jan 2020 04:53:16 GMT):
@medikent to create channel, join peers to channel, install and instantiate chaicode
bestbeforetoday (Wed, 29 Jan 2020 09:42:10 GMT):
The (current) direction for Fabric as a whole seems to focus on command-line tools for administrative tasks rather than having these capabilities implemented in all of the different language SDKs. I don't know whether that may change in the future but for now there isn't a plan to extend the Gateway API with admin capabilities
nitishbhardwaj19 (Wed, 29 Jan 2020 09:44:31 GMT):
Good to know, thanks for information.
nitishbhardwaj19 (Wed, 29 Jan 2020 09:44:31 GMT):
Good to know, thanks for the information.
medikent (Wed, 29 Jan 2020 15:51:11 GMT):
we should do this
medikent (Wed, 29 Jan 2020 15:52:33 GMT):
For automation purposes it would be cool to be able to use the SDKs to perform these capabilities.
icordoba (Wed, 29 Jan 2020 20:16:05 GMT):
Thanks @nitishbhardwaj19 I have checked the documentation at https://hyperledger-fabric.readthedocs.io/en/release-1.4/discovery-overview.html but I don't get to understand how to get it to work. I have added CORE_PEER_GOSSIP_EXTERNALENDPOINT to the peer configuration yaml but I can't figure out how to continue... Anybody can send a tutorial on using Fabric SDK Java with discovery service?
nitishbhardwaj19 (Thu, 30 Jan 2020 03:50:10 GMT):
There are few simple steps that is needed in order to use service discovery.
1) Enable _peerRoles.add(SERVICE_DISCOVERY)_ on peers while you join a peer on to the channel using sdk
2) Use service discovery while you send transaction to channel: channel
.sendTransactionProposalToEndorsers(
request,
createDiscoveryOptions()
.setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)
.setForceDiscovery(true)
);
nitishbhardwaj19 (Thu, 30 Jan 2020 03:50:10 GMT):
There are few simple steps that is needed in order to use service discovery.
1) Enable _peerRoles.add(SERVICE_DISCOVERY)_ on peers while you join a peer on to the channel using sdk
2) Use service discovery while you send transaction to channel:
`channel
.sendTransactionProposalToEndorsers(
request,
createDiscoveryOptions()
.setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)
.setForceDiscovery(true)
);`
nitishbhardwaj19 (Thu, 30 Jan 2020 03:50:10 GMT):
There are few simple steps that is needed in order to use service discovery.
1) Enable _peerRoles.add(SERVICE_DISCOVERY)_ on peers while you join a peer on to the channel using sdk
2) Use service discovery while you send transaction to channel:
` channel
.sendTransactionProposalToEndorsers(
request,
createDiscoveryOptions()
.setEndorsementSelector(ServiceDiscovery.EndorsementSelector.ENDORSEMENT_SELECTION_RANDOM)
.setForceDiscovery(true)
); `
nitishbhardwaj19 (Thu, 30 Jan 2020 03:52:20 GMT):
Or if you are using connection.json ffor boot up the sdk, please specify serviceDiscovery role in peers section. Let me know if you still have doubts, would be happy to help
nitishbhardwaj19 (Thu, 30 Jan 2020 03:58:57 GMT):
@medikent Yes, SDK already has capability to support these operations. It works flawless. :)
nitishbhardwaj19 (Thu, 30 Jan 2020 04:02:52 GMT):
@medikent I think we can still do this but we have to override default _CryptoSuite_ implementation to deal with certificates and sign/verify. By overriding sign and verify we can connect to key-vault and get the transaction signed from there. Just need to make sure that we use our custom _CryptoSuite_ in transaction context other than the default one.
icordoba (Thu, 30 Jan 2020 09:58:46 GMT):
Thanks @nitishbhardwaj19 . Regarding point 1, I had joined the peers to the channel using CLI. Do I need to execute any peer channel commandto enable that service discovery in the channel? So far I have added CORE_PEER_GOSSIP_EXTERNALENDPOINT and restarted the peer.
icordoba (Thu, 30 Jan 2020 10:03:44 GMT):
About point do, I don't see the sendTransactionProposalToENdorsers in() my code. I use Fabric Java SDK. For example, to perform a query I create a QueryByChaincodeRequest object and pass it to the Channel object using channel.queryByChaincode(request);
Antimttr (Thu, 30 Jan 2020 16:00:53 GMT):
Are their any migration guides yet for java sdk from v1.4 to v2.0?
bestbeforetoday (Fri, 31 Jan 2020 09:22:58 GMT):
Not that I am aware of, but the transition should be pretty seamless. The only significant changes in the low-level API are the addition of lifecycle support for administrative tasks. For the high-level API, there is a change to the Wallet API but the pattern of usage is very similar to the previous iteration. This is a good starting point for the wallet API: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Wallets.html
Antimttr (Fri, 31 Jan 2020 14:16:26 GMT):
i dont use the wallet
nitishbhardwaj19 (Mon, 03 Feb 2020 04:47:44 GMT):
Query always needs to be execute on a specific peer. If we aren't not specifying a peer then that information would be taken up from the channel object and query would be performed on all the peers of that channel. (that's what I have observed till now through java-sdk code)
nitishbhardwaj19 (Mon, 03 Feb 2020 04:48:17 GMT):
_sendTransactionProposalToENdorsers _ would be used when you try to invoke anything on the chaincode
Antimttr (Thu, 06 Feb 2020 04:10:31 GMT):
does the java sdk have the same support for event listening that the node.js sdk does?
bestbeforetoday (Thu, 06 Feb 2020 09:32:58 GMT):
Functionally similar but the APIs are (currently) slightly different. You can add block listeners to the `Network` and contract (chaincode) event listeners to the `Contract`. All of these can be real-time, event replay or checkpointed:
- https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Network.html
- https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Contract.html
dan13 (Thu, 06 Feb 2020 19:07:35 GMT):
Use of a custom CheckPointer to avoid duplicate chaincode-emitted event processing (multiple peers receiving same event "concurrently") would be the HLF-architecture-consistent approach?
ownspies (Thu, 06 Feb 2020 19:30:37 GMT):
Has joined the channel.
ownspies (Thu, 06 Feb 2020 19:30:37 GMT):
I just did a search here but didn't find any answers. I have a Java service that talks to HLF (with Mutual TLS auth enabled). I pre-create the user in the Org CA and when the app starts it enrolls the user and receives the certificates just fine. The service can also talk to the peers just fine. When talking to the orderers, however, I receive an SSL error. I've tracked down that the service is using the TLS cert from the Org CA to do mutual TLS auth, however the orderer is expecting the certs for mutual TLS auth to be signed by the TLS CA, not the org CA. Is there a way to specify a custom key / cert pair to the Java Gateway Builder SDK for mutual TLS auth?
bestbeforetoday (Fri, 07 Feb 2020 09:18:17 GMT):
Event listening with the Gateway API you will only get each event once and in order. Checkpointing is useful if you want to resume event processing across client application invocations, so use cases might include things like:
- Resume event processing after client application crash
- Batch processing of events only at certain times of day
dan13 (Fri, 07 Feb 2020 14:13:58 GMT):
Thanks -- that approach assume there is only one listener instance for each event, right? I inadverently said "peer" instead of "client" above -- sorry for the confusion.
bestbeforetoday (Fri, 07 Feb 2020 18:05:22 GMT):
Checkpointing wasn't really designed to coordinate across multiple client application instances. Certainly the supplied file checkpointer won't work for this because it gets an exclusive lock on the file and then uses in-memory state to avoid constantly re-reading the file
bestbeforetoday (Fri, 07 Feb 2020 18:08:34 GMT):
You might be able to implement your own checkpointer to achieve the result you want. It might be worth looking at some kind of external coordination like a shared message queue or database
Bolzo 1 (Mon, 10 Feb 2020 11:21:11 GMT):
Hi, Im my chaincode I throw a ChaincodeException which wrap another exception. I'm working with the low level SDK and i was wondering if it is possible to get the wrapped exeception when I'm inspecting the ProposalResponse. Example: in my chaincode i have `throw new ChaincodeException("error message", new IOException("specific error")` is there a way in the SDK to access the message of the `IOException`?
bestbeforetoday (Tue, 11 Feb 2020 09:58:28 GMT):
The error from the peer is sent back in a message field as part of the proposal response. This is just a string. So at the client end the ChaincodeException and wrapped exception don't exist. You are just getting the exception message text.
Javi (Tue, 11 Feb 2020 15:12:48 GMT):
Hi all! I'm using the Java SDK for my application, but I'm getting service discovery errors.... Any one know what happens? `Failed to discover peer endpoint information peer0.org1.example.com:7051 for chaincode`XXXXX`
Javi (Tue, 11 Feb 2020 15:13:31 GMT):
in the app, that is deployed inside a k8s cluster I'm using the `org.hyperledger.fabric.sdk.service_discovery.as_localhost``envvar as `false`
Javi (Tue, 11 Feb 2020 15:14:28 GMT):
any help would be appreciated...
aatkddny (Tue, 11 Feb 2020 22:32:26 GMT):
Having a problem with load testing (or more accurately a bootstrap process).
Getting intermittent errors that look like this:
```
org.hyperledger.fabric.sdk.ServiceDiscovery (ServiceDiscovery.java:604) -
Service discovery error on peer Peer{ id: 767, name:
aatkddny (Tue, 11 Feb 2020 22:32:26 GMT):
Having a problem with load testing (or more accurately a bootstrap process).
Getting intermittent errors that look like this:
```
org.hyperledger.fabric.sdk.ServiceDiscovery (ServiceDiscovery.java:604) -
Service discovery error on peer Peer{ id: 767, name:
aatkddny (Tue, 11 Feb 2020 22:32:26 GMT):
Having a problem with load testing (or more accurately a bootstrap process).
Getting intermittent errors that look like this:
```
org.hyperledger.fabric.sdk.ServiceDiscovery (ServiceDiscovery.java:604) -
Service discovery error on peer Peer{ id: 767, name:
Bolzo 1 (Wed, 12 Feb 2020 07:38:38 GMT):
I understand, thanks!
icordoba (Wed, 12 Feb 2020 11:53:36 GMT):
Hello again @nitishbhardwaj19 I am still trying to have Discovery working. I have added CORE_PEER_GOSSIP_EXTERNALENDPOINT env in my peer node and restart it but I get this when I try to execute a transaction from Java SDK client: "The channel is not configured with any peers with the 'discover' role" any idea what I am missing in the node configuration? Thanks a lot
icordoba (Wed, 12 Feb 2020 12:04:18 GMT):
It seems that I need to enable the discover flat when I join a channel from a peer, how can I do this? I used the "peer join" shell command to do that, so it is already joined.
dwusiq (Thu, 13 Feb 2020 08:45:59 GMT):
i use HFClient to install chaincode, but return is fail:
Channel Channel{id: 23, name: } Sending proposal with transaction: 4132669342bc366506b89495c248dbd418c73a0692c40a507f36273b616396f9 to Peer{ id: 13, name: peer1.org2.example.com:10051, channelName: mychannel, url: grpcs://peer1.org2.example.com:10051, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [] creator org [Org1MSP], cause=null};error installing chaincode code mychannel_di_c:c(chaincode /var/hyperledger/production/chaincodes/mychannel_di_c.c exists);failed to execute transaction 4132669342bc366506b89495c248dbd418c73a0692c40a507f36273b616396f9: error sending: txid: 4132669342bc366506b89495c248dbd418c73a0692c40a507f36273b616396f9() exists;error installing chaincode code mychannel_di_c:c(chaincode /var/hyperledger/production/chaincodes/mychannel_di_c.c exists);Channel Channel{id: 23, name: } Sending proposal with transaction: 4132669342bc366506b89495c248dbd418c73a0692c40a507f36273b616396f9 to Peer{ id: 9, name: peer0.org2.example.com:9051, channelName: mychannel, url: grpcs://peer0.org2.example.com:9051, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [] creator org [Org1MSP], cause=null};failed to execute transaction 4132669342bc366506b89495c248dbd418c73a0692c40a507f36273b616396f9: error sending: txid: 4132669342bc366506b89495c248dbd418c73a0692c40a507f36273b616396f9() exists;
dwusiq (Thu, 13 Feb 2020 08:52:43 GMT):
I tried it your way, it worked.
dwusiq (Thu, 13 Feb 2020 08:53:18 GMT):
thanks,I tried it your way, it worked.
kmadala (Thu, 13 Feb 2020 16:09:44 GMT):
Hi, can someone please direct me a documentation link for Mutual TLS on Fabric JAVA SDK?
kmadala (Thu, 13 Feb 2020 16:10:18 GMT):
link provided in this Jira is not working. Jira URL : https://jira.hyperledger.org/browse/FABJ-513
dan13 (Fri, 14 Feb 2020 01:28:53 GMT):
also looking for same -- that link pointed to a node SDK doc anyway, which wouldn't answer the question for java
bestbeforetoday (Fri, 14 Feb 2020 14:00:11 GMT):
There is just about nothing in the way of docs for the low-level Java SDK, so this is not a great answer, but this code frmo the integration tests might help: https://github.com/hyperledger/fabric-sdk-java/blob/f97741e2bd76c7733f7f81078b4de5d42a37cf9a/src/test/java/org/hyperledger/fabric/sdkintegration/ServiceDiscoveryIT.java#L99
bestbeforetoday (Fri, 14 Feb 2020 14:01:48 GMT):
So it is setting properties on the channel that look like they define the client TLS certificate and key used by discovery for mutual auth
Antimttr (Fri, 14 Feb 2020 21:51:11 GMT):
Does the java sdk at any point directly read the network-config.yaml file?
Antimttr (Fri, 14 Feb 2020 21:51:45 GMT):
I thought not but this comment gives me a reason to question that assumption: ```
# Any properties with an "x-" prefix will be treated as application-specific, exactly like how naming
# in HTTP headers or swagger properties work. The SDK will simply ignore these fields and leave
# them for the applications to process. This is a mechanism for different components of an application
# to exchange information that are not part of the standard schema described below. In particular,
# the "x-type" property with the "hlfv1" value example below is used by Hyperledger Composer to
# determine the type of Fabric networks (v0.6 vs. v1.0) it needs to work with.
```
davidkel (Fri, 14 Feb 2020 22:20:25 GMT):
network-config.yaml is an example of a connection profile. The java-sdk will only parse a connection profile if you choose to use the apis that parse a connection profile to create your channel and peer objects. You can create the channel and peer objects yourself in your code.
Antimttr (Fri, 14 Feb 2020 22:21:33 GMT):
hmm i dont think i chose those apis? but im not really sure which api's you're referring to so I cant be sure
Antimttr (Fri, 14 Feb 2020 22:22:21 GMT):
are you talking about like that gateway thingy?
Antimttr (Fri, 14 Feb 2020 22:22:25 GMT):
i know i dont use that
davidkel (Fri, 14 Feb 2020 22:24:48 GMT):
The fabric-gateway-java probably mandates the use of a connection profile (don't know if it supports what you can do in the node sdk). However the fabric-sdk-java allows you to either use a connection profile or to create channel/peer/orderer objects programatically
Antimttr (Fri, 14 Feb 2020 22:25:30 GMT):
yes, and thats what i do
Antimttr (Fri, 14 Feb 2020 22:25:55 GMT):
the channels and chaincode are all installed using sdk calls
Antimttr (Fri, 14 Feb 2020 22:26:06 GMT):
ok thanks for clarifying!
dan13 (Sat, 15 Feb 2020 21:57:18 GMT):
@bestbeforetoday thanks for the response. So, we can do something like
```Network network = gateway.getNetwork(channelName);
Properties sdprops = new Properties();
//set mutual TLS props per https://github.com/hyperledger/fabric-sdk-java/blob/f97741e2bd76c7733f7f81078b4de5d42a37cf9a/src/test/java/org/hyperledger/fabric/sdkintegration/ServiceDiscoveryIT.java#L99
network.getChannel().setServiceDiscoveryProperties(sdprops```
?
ShobhitSrivastava (Mon, 17 Feb 2020 10:39:43 GMT):
Hi All, I am facing issue in working with 2.0 version of fabirc-sdk-java. I am making use of basic-network from fabric-sample. I am able to initialize the channel, install the chaincode, approve the chaincode, but once I execute any smart contract, it is saying my chaincode is not defined on channel. Let me know. I am using 2.0 enabled channel capabilities.
ShobhitSrivastava (Mon, 17 Feb 2020 10:41:42 GMT):
@bestbeforetoday ..adding
ArvsIndrarys (Mon, 17 Feb 2020 14:49:39 GMT):
Has left the channel.
Purbaja (Tue, 18 Feb 2020 13:52:15 GMT):
Hi All, while trying to create channel from fabric-sdk client we are getting below exception :
config update for existing channel did not pass initial checks: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Writers' sub-policies to be satisfied: permission denied
Any suggestion?
dan13 (Tue, 18 Feb 2020 21:57:05 GMT):
Anyone seen this: the same peer is being added the the Java Gateway SDK ServiceDiscovery list multiple times because a duplicate entry (proof below) is added under a new ID every time a new event is received from the peer (this is simple local network, single peer, HF 1.4). I have a vague recollection that it was reported before but I cannot find (if it was)
```2020-02-16 15:30:43.106 INFO 36285 --- [ool-11-thread-1] o.h.fabric.sdk.ServiceDiscovery : Channel myChannel doing discovery with peer: Peer{ id: 3, name: peer0.myorg.com:7051, channelName: myChannel, url: grpcs://peer0.myorg.com:7051, mspid: myorgmsp}
2020-02-16 15:32:11.436 INFO 36285 --- [ool-13-thread-1] o.h.fabric.sdk.ServiceDiscovery : Channel myChannel doing discovery with peer: Peer{ id: 9, name: peer0.myorg.com:7051, channelName: myChannel, url: grpcs://peer0.myorg.com:7051, mspid: myorgmsp}```
janipartanen (Thu, 20 Feb 2020 11:50:32 GMT):
Has joined the channel.
lzaouche (Thu, 20 Feb 2020 16:22:59 GMT):
Hello, does somebody know if transactionActionInfo.getChaincodeInputArgs(0) returns the name of the function called in the chaincode?
Antimttr (Thu, 20 Feb 2020 19:24:10 GMT):
anyone know what happened to @rickr ? he was the best!
Antimttr (Thu, 20 Feb 2020 22:09:12 GMT):
When you setup an orderer object in the sdk you need to specify a few properties and pass them into the orderer constructor. I was wondering for the properties `clientCertFile` and `clientKeyFile` why in the end2endit test does it use a user's (Admin@example.com) tls cert and key instead of the orderers tls and key?
Antimttr (Thu, 20 Feb 2020 22:12:05 GMT):
there's also the `pemFile` property which is set to the orderer's tls-msp server.crt file. when i attempt to create the channel and send the envelope to the orderer i get `Caused by: java.security.cert.CertificateException: No name matching orderer1.example.com found` Now i checked the certificate specified by the pemFile ```
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
7b:50:4f:7b:54:65:dd:31:65:65:d6:bd:01:5e:ab:75:13:a0:92:cd
Signature Algorithm: ecdsa-with-SHA256
Issuer: C=US, ST=California, O=example.com, CN=ica.example.com
Validity
Not Before: Feb 10 19:24:00 2020 GMT
Not After : Feb 9 19:29:00 2021 GMT
Subject: C=US, ST=North Carolina, O=Hyperledger, OU=orderer, CN=orderer1
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:00:f0:52:19:1b:49:b0:0d:8f:ee:7a:45:54:de:
4b:8d:b7:21:55:00:4d:f4:11:87:94:fb:26:d3:16:
14:58:06:ae:ac:72:65:1f:16:41:c1:82:27:96:61:
38:44:22:a9:51:f4:99:7e:3c:66:27:37:48:4b:d5:
d7:6f:5f:91:ba
ASN1 OID: prime256v1
NIST CURVE: P-256
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature, Key Encipherment, Key Agreement
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
FC:E8:DB:FD:90:14:68:7F:2D:FE:33:3C:BF:50:32:3B:DA:72:C8:51
X509v3 Authority Key Identifier:
keyid:34:DF:CB:67:C3:E3:55:6A:3E:36:C7:8B:F9:8C:AB:B8:3D:DA:0E:E8
X509v3 Subject Alternative Name:
IP Address:3.X.72.X
1.2.3.4.5.6.7.8.1:
{"attrs":{"hf.Affiliation":"","hf.EnrollmentID":"orderer1","hf.Type":"orderer"}}
Signature Algorithm: ecdsa-with-SHA256
30:44:02:20:72:3c:3b:d5:89:ba:36:76:3b:ab:17:0b:62:c8:
76:cc:45:5c:da:47:5c:fc:23:e6:de:d5:04:de:23:4d:db:fd:
02:20:4a:58:1e:d0:96:1c:bf:6a:a5:c8:f0:41:dd:78:f9:42:
f8:48:65:3b:3f:65:5d:5e:ef:d1:92:56:b1:30:ae:ce
```
Antimttr (Thu, 20 Feb 2020 22:12:24 GMT):
and as you can see, the CN is orderer1 O is example.com
Antimttr (Thu, 20 Feb 2020 22:12:28 GMT):
so everything looks in order
Antimttr (Thu, 20 Feb 2020 22:13:00 GMT):
surely the clientCertFile and clientKeyFile don't need to have orderer1.example.com in them?
Antimttr (Thu, 20 Feb 2020 22:22:18 GMT):
in the orderer logs i get this: `2020-02-20 21:38:18.383 UTC [core.comm] ServerHandshake -> ERRO 034 TLS handshake failed with error remote error: tls: internal error server=Orderer remoteaddress=`
Antimttr (Thu, 20 Feb 2020 22:27:22 GMT):
ls
bestbeforetoday (Fri, 21 Feb 2020 15:00:26 GMT):
I changed a bit of _fabric-gateway-java_ behaviour quite a while back in response to some reports raised here about not being able to get at the proposal responses if submit of a transaction failed. I think these changes have only recently been published but are not available in both 1.4 and 2.0 releases. Any ContractException thrown from Transaction.submit() should now have all the proposal responses attached. You can get at them with ContractException.getProposalResponses()
bestbeforetoday (Fri, 21 Feb 2020 15:00:26 GMT):
I changed a bit of _fabric-gateway-java_ behaviour quite a while back in response to some reports raised here about not being able to get at the proposal responses if submit of a transaction failed. I think these changes have only recently been published but are now available in both 1.4 and 2.0 releases. Any ContractException thrown from Transaction.submit() should now have all the proposal responses attached. You can get at them with ContractException.getProposalResponses()
ownspies (Fri, 21 Feb 2020 21:03:57 GMT):
@Antimttr the CN needs to be `orderer1.example.com`, or you need `DNS:orderer1.example.com` in the `X509v3 Subject Alternative Name:` attributes
ownspies (Fri, 21 Feb 2020 21:04:52 GMT):
Also, the only `O=example.com` I see is for the issuer, not for the subject, those are two totally different things
ownspies (Fri, 21 Feb 2020 21:05:20 GMT):
one last note, the `"hf.EnrollmentID":"orderer1"` typically needs to contain the full hostname for HLF nodes, so `"hf.EnrollmentID":"orderer1.example.com"`
ownspies (Fri, 21 Feb 2020 21:08:35 GMT):
Here is my key:
ownspies (Fri, 21 Feb 2020 21:08:35 GMT):
Here is my certificate:
ownspies (Fri, 21 Feb 2020 21:08:38 GMT):
```[ justin.spies@ownum.io / example ] 16:06 $ openssl x509 -noout -text -in ordererOrganizations/sit.example.net/orderers/orderer-01.sit.example.net/msp/signcerts/cert.pem
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
41:78:ed:8e:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:5a:24:82:4b:21
Signature Algorithm: ecdsa-with-SHA256
Issuer: C=US, ST=Ohio, L=Cleveland, O=MyOrg, OU=HLF Signer, CN=ca.sit.example.net
Validity
Not Before: Feb 20 18:01:00 2020 GMT
Not After : Feb 19 18:06:00 2021 GMT
Subject: C=US, ST=Ohio, L=Cleveland, O=MyOrg, OU=orderer, CN=orderer-01.sit.example.net
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:3a:67:
04:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:9e:27:
6a:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:5c:d6:
c1:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:74:7e:
d4:da:ef:73:35
ASN1 OID: prime256v1
NIST CURVE: P-256
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
A8:D8:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:F7:F4:63:AC
X509v3 Authority Key Identifier:
keyid:2A:D0:09:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:C2:37:AC:43
X509v3 Subject Alternative Name:
DNS:localhost, DNS:orderer-01.sit.example.net, DNS:orderer-01, DNS:orderer-01.sit
1.2.3.4.5.6.7.8.1:
{"attrs":{"hf.Affiliation":"","hf.EnrollmentID":"orderer-01.sit.example.net","hf.Type":"orderer"}}
Signature Algorithm: ecdsa-with-SHA256
30:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:78:b7:30:af:
99:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:20:a9:91:e6:
02:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:59:fb:22:7b:
b4:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:40:b9```
Antimttr (Fri, 21 Feb 2020 21:09:58 GMT):
thanks! i suspected that it had to do with the CN, but i got pulled off the project today so I havent had a chance to go back and regenerate all the crypto material
Antimttr (Fri, 21 Feb 2020 21:10:21 GMT):
I generated the material using the Fabric-ca operations guide
Antimttr (Fri, 21 Feb 2020 21:10:57 GMT):
and they dont put the full orderer name in the register/enroll fabric-ca-client commands
Antimttr (Fri, 21 Feb 2020 21:11:00 GMT):
just the first part
Antimttr (Fri, 21 Feb 2020 21:11:19 GMT):
but then i compared my cert with the ones in balance-transfer sample and saw that it was the full hostname with domain
ownspies (Fri, 21 Feb 2020 21:12:03 GMT):
I've spent about four months getting it all working, have bounced between standalone CAs, AWS Private CA + HLF Hierarchy, Vault CA for TLS, and straight openSSL... Have a crazy menagerie of scripts now as a result... My way of saying "I feel you're pain"
ShrutiHK (Mon, 24 Feb 2020 04:57:00 GMT):
Hi,
We are working with java-sdk but while invoking chaincodes, sometimes we get the error - GatewayException: 'Failed to discover peer endpoint '.
What can be done to avoid this error?
ShrutiHK (Mon, 24 Feb 2020 04:57:22 GMT):
Any pointers on this are appreciated. Thanks in advance.
ShrutiHK (Mon, 24 Feb 2020 05:28:45 GMT):
Kindly let me know in case someone has encountered this error
nitishbhardwaj19 (Tue, 25 Feb 2020 07:59:03 GMT):
Hi,
Could anyone share few details about the default CryptoSuite which is being used in Java-sdk.
`public byte[] sign(PrivateKey key, byte[] data)
`
This method is being override in CryptoPrimitives which is being used to sign the transaction. I am not sure about:
1) If the *byte data is actually the transaction data byte or if it's the bytes of the hash of the tx data*.
2) *What's the default hash algorithm being used to compute tx hash.*
Would be great if someone can share their thoughts on this.
nitishbhardwaj19 (Tue, 25 Feb 2020 07:59:03 GMT):
Hi,
Could anyone share few details about the default CryptoSuite which is being used in Java-sdk.
_public byte[] sign(PrivateKey key, byte[] data) _
This method is being override in CryptoPrimitives which is being used to sign the transaction. I am not sure about:
1) If the *byte data is actually the transaction data byte or if it's the bytes of the hash of the tx data*.
2) *What's the default hash algorithm being used to compute tx hash.*
Would be great if someone can share their thoughts on this.
FYI - @bestbeforetoday
nitishbhardwaj19 (Wed, 26 Feb 2020 07:14:17 GMT):
The default Algo to compute the hash is SHA2
ascatox (Wed, 26 Feb 2020 13:16:32 GMT):
Hi All! I'm trying to use the Fabric Gateway
ascatox (Wed, 26 Feb 2020 13:16:42 GMT):
using the documentation
ascatox (Wed, 26 Feb 2020 13:17:04 GMT):
but I need an example of `connection.json`
ascatox (Wed, 26 Feb 2020 13:17:28 GMT):
Someone has an example to share with me! Thanks in advance!
dan13 (Wed, 26 Feb 2020 13:48:37 GMT):
https://github.com/hyperledger/fabric-gateway-java/blob/master/src/test/java/org/hyperledger/fabric/gateway/connection.json
ascatox (Wed, 26 Feb 2020 13:48:51 GMT):
Thanks
Antimttr (Wed, 26 Feb 2020 18:55:24 GMT):
hey @ownspies , so finally had a chance to revist this issue today.
Antimttr (Wed, 26 Feb 2020 18:55:52 GMT):
I went ahead and deleted all the erroneous crypto material and the fabric-ca-server databases for the servers
ownspies (Wed, 26 Feb 2020 18:55:54 GMT):
how did it work out?
Antimttr (Wed, 26 Feb 2020 18:56:01 GMT):
well i got the CN corrected
Antimttr (Wed, 26 Feb 2020 18:56:15 GMT):
but the certificates the fa-ca-server is issueing still has the O=Hyperledger
Antimttr (Wed, 26 Feb 2020 18:56:21 GMT):
instead of org1.example.com
ownspies (Wed, 26 Feb 2020 18:56:28 GMT):
ugh, my wife would kill me... should have said "I feel YOUR pain" .... not "you're pain"
Antimttr (Wed, 26 Feb 2020 18:56:41 GMT):
also the locales im setting aren't taking when i enroll
Antimttr (Wed, 26 Feb 2020 18:56:54 GMT):
i checked the root ca certificate
Antimttr (Wed, 26 Feb 2020 18:56:59 GMT):
and its all correct their
Antimttr (Wed, 26 Feb 2020 18:57:15 GMT):
i changed the CSR config section in the fabric-ca-server.yaml file
Antimttr (Wed, 26 Feb 2020 18:57:25 GMT):
to match what i want the O and locales to be
Antimttr (Wed, 26 Feb 2020 18:57:31 GMT):
but it doesnt seem to be pulling it from their
Antimttr (Wed, 26 Feb 2020 18:57:31 GMT):
but it doesnt seem to be pulling it from there
ownspies (Wed, 26 Feb 2020 18:58:12 GMT):
so are you changing the fabric-ca-server-config.yaml file ?
ownspies (Wed, 26 Feb 2020 18:58:15 GMT):
this section:
ownspies (Wed, 26 Feb 2020 18:58:18 GMT):
```###########################################################################
csr:
cn: fabric-ca-server
keyrequest:
algo: ecdsa
size: 256
names:
- C: US
ST: "North Carolina"
L:
O: Hyperledger
OU: Fabric
hosts:
- 3346f9929deb
- localhost
ca:
expiry: 131400h
pathlength: 1
###########################################################################```
Antimttr (Wed, 26 Feb 2020 18:58:25 GMT):
yeah let me paste mine
Antimttr (Wed, 26 Feb 2020 18:58:42 GMT):
```csr:
cn: fabric-ca-server
keyrequest:
algo: ecdsa
size: 256
names:
- C: US
ST: California
L: "San Diego"
O: org1.example.com
OU: Fabric
hosts:
- c7597f94f1bd
- localhost
ca:
expiry: 131400h
pathlength: 1```
ownspies (Wed, 26 Feb 2020 18:58:48 GMT):
how are you launching the CA? Are those values getting overridden with ENV VARS ?
Antimttr (Wed, 26 Feb 2020 18:59:16 GMT):
docker-compose.yaml section: ``` ica.org1.example.com:
container_name: ica.org1.example.com
image: hyperledger/fabric-ca
command: sh -c 'fabric-ca-server start -d -b ca-org1-admin:ca-org1-adminpw --port 7153 --cfg.identities.allowremove'
environment:
- FABRIC_CA_SERVER_HOME=/etc/hyperledger/fabric-ca
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_CA_NAME=ica.org1.example.com
- FABRIC_CA_SERVER_CSR_CN=ica.org1.example.com
- FABRIC_CA_SERVER_CSR_HOSTS=0.0.0.0,3.14.72.136
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca/ca/ica.org1.example.com.key.pem
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca/ca/ica.org1.example.com.crt.pem
- FABRIC_CA_SERVER_DEBUG=true
volumes:
- ./ca/:/etc/hyperledger/fabric-ca
- ./channel/crypto-config/peerOrganizations/org1.example.com/ca:/etc/hyperledger/fabric-ca/ca
ports:
- 7153:7153```
Antimttr (Wed, 26 Feb 2020 18:59:16 GMT):
docker-compose.yaml section: ``` ica.org1.example.com:
container_name: ica.org1.example.com
image: hyperledger/fabric-ca
command: sh -c 'fabric-ca-server start -d -b ca-org1-admin:ca-org1-adminpw --port 7153 --cfg.identities.allowremove'
environment:
- FABRIC_CA_SERVER_HOME=/etc/hyperledger/fabric-ca
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_CA_NAME=ica.org1.example.com
- FABRIC_CA_SERVER_CSR_CN=ica.org1.example.com
- FABRIC_CA_SERVER_CSR_HOSTS=0.0.0.0,3.1x.7x.136
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca/ca/ica.org1.example.com.key.pem
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca/ca/ica.org1.example.com.crt.pem
- FABRIC_CA_SERVER_DEBUG=true
volumes:
- ./ca/:/etc/hyperledger/fabric-ca
- ./channel/crypto-config/peerOrganizations/org1.example.com/ca:/etc/hyperledger/fabric-ca/ca
ports:
- 7153:7153```
ownspies (Wed, 26 Feb 2020 18:59:19 GMT):
not sure that is a valid O value
ownspies (Wed, 26 Feb 2020 19:00:03 GMT):
and your custom file ... is located at `FABRIC_CA_SERVER_HOME=/etc/hyperledger/fabric-ca/fabric-ca-server-config.yaml`?
Antimttr (Wed, 26 Feb 2020 19:00:19 GMT):
right that's the volume im assigning for it
ownspies (Wed, 26 Feb 2020 19:02:08 GMT):
what command do you use to register a new entity ?
Antimttr (Wed, 26 Feb 2020 19:10:01 GMT):
sec i got my boss here
Antimttr (Wed, 26 Feb 2020 19:57:08 GMT):
ok trying to reconstruct the registration command, i have it scripted
Antimttr (Wed, 26 Feb 2020 19:57:15 GMT):
but its pretty straight forward
Antimttr (Wed, 26 Feb 2020 19:57:26 GMT):
right out of the fabric-ca-server ops guide
Antimttr (Wed, 26 Feb 2020 19:59:03 GMT):
so heres an example of the registration command for my org1's first peer: fabric-ca-client register -d --id.name peer1.org1.example.com --id.secret peer1PW --id.type peer -u https://0.0.0.0:7054
Antimttr (Wed, 26 Feb 2020 19:59:03 GMT):
so heres an example of the registration command for my org1's first peer: `fabric-ca-client register -d --id.name peer1.org1.example.com --id.secret peer1PW --id.type peer -u https://0.0.0.0:7054`
ownspies (Wed, 26 Feb 2020 19:59:32 GMT):
and you run that from inside the fabric CA container ?
Antimttr (Wed, 26 Feb 2020 19:59:54 GMT):
no i run that from host command line using fabric-ca-client
Antimttr (Wed, 26 Feb 2020 20:00:11 GMT):
but it connects to my fabric-ca-server container
ownspies (Wed, 26 Feb 2020 20:00:13 GMT):
ok
Antimttr (Wed, 26 Feb 2020 20:00:23 GMT):
the 0.0.0.0 is replaced with the proper socket
Antimttr (Wed, 26 Feb 2020 20:00:48 GMT):
could it be the fabric-ca-client config?
Antimttr (Wed, 26 Feb 2020 20:01:05 GMT):
i noticed it creates a new yaml file for the client each time i run it
ownspies (Wed, 26 Feb 2020 20:01:15 GMT):
well, the first two things I would check are a) fabric-ca-server isn't loading the config file you thought it was loading and so is missing the options you set or b) there are other ENV variables overriding the config file
Antimttr (Wed, 26 Feb 2020 20:01:37 GMT):
its actually created the server.yaml file
ownspies (Wed, 26 Feb 2020 20:02:00 GMT):
it should load the config file from the FABRIC_CA_SERVER_HOME
Antimttr (Wed, 26 Feb 2020 20:02:02 GMT):
if i remove it from the fabric-ca-server working directory it will create it from new, then i just edit the existing one and restart the container
Antimttr (Wed, 26 Feb 2020 20:02:13 GMT):
right, exactly,
Antimttr (Wed, 26 Feb 2020 20:02:33 GMT):
i have it mapped to a volume: ./ca/:/etc/hyperledger/fabric-ca
ownspies (Wed, 26 Feb 2020 20:02:51 GMT):
I would enable `FABRIC_LOGGING_SPEC=debug` and restart the CA to confirm it is loading the correct config file
ownspies (Wed, 26 Feb 2020 20:03:00 GMT):
do that env var inside the docker container
Antimttr (Wed, 26 Feb 2020 20:03:02 GMT):
already have that set
Antimttr (Wed, 26 Feb 2020 20:03:14 GMT):
i have the full log in my buffer
Antimttr (Wed, 26 Feb 2020 20:03:21 GMT):
lets see if i can find where it loads the config
ownspies (Wed, 26 Feb 2020 20:03:34 GMT):
you have both the one I sent and `FABRIC_CA_SERVER_DEBUG` from your docker-compose ?
Antimttr (Wed, 26 Feb 2020 20:03:41 GMT):
```2020/02/26 17:33:44 [DEBUG] Home directory: /etc/hyperledger/fabric-ca
2020/02/26 17:33:44 [INFO] Configuration file location: /etc/hyperledger/fabric-ca/fabric-ca-server-config.yaml
2020/02/26 17:33:44 [INFO] Starting server in home directory: /etc/hyperledger/fabric-ca
```
Antimttr (Wed, 26 Feb 2020 20:04:02 GMT):
oh i see
Antimttr (Wed, 26 Feb 2020 20:04:08 GMT):
ok they're different
Antimttr (Wed, 26 Feb 2020 20:04:10 GMT):
let me try that
ownspies (Wed, 26 Feb 2020 20:05:09 GMT):
They may do the same thing; IIRC FABRIC_LOGGING_SPEC is the go forward and all others are deprecated
ownspies (Wed, 26 Feb 2020 20:05:54 GMT):
so after you start the CA if you `cat /etc/hyperledger/fabric-ca/fabric-ca-server-config.yaml` does it include your changes? Also, I thought the CA output all the options it used, but I may be thinking of something else ....
ownspies (Wed, 26 Feb 2020 20:06:06 GMT):
if it does output the options then I would compare those against what I set
Antimttr (Wed, 26 Feb 2020 20:06:30 GMT):
it does print some stuff, but let me try it with the new flag, i didnt see like OU, O, CN stuff previously
ownspies (Wed, 26 Feb 2020 20:06:43 GMT):
I admit to having a hard time here (chat) troubleshooting - there are very often hints to the real problem scattered in the log output, and just grabbing the last few lines is misleading
Antimttr (Wed, 26 Feb 2020 20:08:36 GMT):
ok heres the whole log since restarting
Antimttr (Wed, 26 Feb 2020 20:09:02 GMT):
Antimttr - Wed Feb 26 2020 12:08:50 GMT-0800 (Pacific Standard Time).txt
Antimttr (Wed, 26 Feb 2020 20:11:41 GMT):
i dont see anything in their about loading csr section
ownspies (Wed, 26 Feb 2020 20:11:46 GMT):
question for you
ownspies (Wed, 26 Feb 2020 20:11:55 GMT):
earlier in the chat you said `i changed the CSR config section in the fabric-ca-server.yaml file`
Antimttr (Wed, 26 Feb 2020 20:11:57 GMT):
also the comments above the csr section say they're only used in generated the rootca cert
ownspies (Wed, 26 Feb 2020 20:12:04 GMT):
was that just short hand ?
ownspies (Wed, 26 Feb 2020 20:12:21 GMT):
because the config file should be called `fabric-ca-server-config.yaml` and not `fabric-ca-server.yaml`
Antimttr (Wed, 26 Feb 2020 20:12:40 GMT):
oh you're right, that is what its called
Antimttr (Wed, 26 Feb 2020 20:13:32 GMT):
```# Certificate Signing Request (CSR) section.
# This controls the creation of the root CA certificate.```
Antimttr (Wed, 26 Feb 2020 20:13:42 GMT):
see but im supplying the root certificate not creating it
Antimttr (Wed, 26 Feb 2020 20:13:55 GMT):
and the ca cert im supplying has all the correct data
ownspies (Wed, 26 Feb 2020 20:14:17 GMT):
is this a root CA or an intermediate CA ?
Antimttr (Wed, 26 Feb 2020 20:14:52 GMT):
well i mean its an openssl root but it is the highest fabric-ca-server in the chain
Antimttr (Wed, 26 Feb 2020 20:15:28 GMT):
there is no fabric-ca-server above it but theirs an openssl certificate that i call the root which is what signed the ica's cert
Antimttr (Wed, 26 Feb 2020 20:15:48 GMT):
following this guide: https://medium.com/ibm-garage/using-3rd-party-root-cas-in-hyperledger-fabric-3cafa91d1260
ownspies (Wed, 26 Feb 2020 20:15:52 GMT):
ok, so you have openssl root cert and use that to sign the cert for the HFL CA ?
Antimttr (Wed, 26 Feb 2020 20:16:01 GMT):
yes
ownspies (Wed, 26 Feb 2020 20:16:54 GMT):
and the HLF CA has the wrong O / OU ?
Antimttr (Wed, 26 Feb 2020 20:17:13 GMT):
the cert im using for it looks correct to me, ill paste it here
ownspies (Wed, 26 Feb 2020 20:18:04 GMT):
so the cert issued _by_ the HLF CA has the wrong O / OU, right?
ownspies (Wed, 26 Feb 2020 20:18:18 GMT):
meaning like the orderer cert or the peer cert, or the admin cert?
Antimttr (Wed, 26 Feb 2020 20:18:27 GMT):
right
Antimttr (Wed, 26 Feb 2020 20:18:33 GMT):
so heres my ica's cert:
Antimttr (Wed, 26 Feb 2020 20:18:42 GMT):
```Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4096 (0x1000)
Signature Algorithm: ecdsa-with-SHA256
Issuer: C=US, ST=California, L=San Diego, O=org1.example.com, CN=rca.org1.example.com
Validity
Not Before: Feb 3 18:31:26 2020 GMT
Not After : Feb 1 18:31:26 2025 GMT
Subject: C=US, ST=California, O=org1.example.com, CN=ica.org1.example.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:91:e8:89:a5:01:42:d7:67:0b:79:a1:06:7b:b7:
aa:d2:27:cd:a7:51:51:ec:a7:94:4e:97:92:f8:41:
e6:dc:3e:aa:0c:8d:4e:30:99:4b:cf:c9:12:f4:2a:
11:7c:84:27:ba:29:08:26:be:69:c3:fe:d8:a8:b0:
11:ee:b0:a3:30
ASN1 OID: prime256v1
NIST CURVE: P-256
X509v3 extensions:
X509v3 Subject Key Identifier:
D1:88:51:B1:C4:CA:33:5F:77:2D:85:E7:09:87:60:05:B4:11:B3:5C
X509v3 Authority Key Identifier:
keyid:1E:29:BC:69:70:B8:A8:E8:CB:2F:95:E2:78:21:2C:5B:78:92:33:45
X509v3 Basic Constraints: critical
CA:TRUE, pathlen:0
X509v3 Key Usage: critical
Digital Signature, Certificate Sign, CRL Sign
Signature Algorithm: ecdsa-with-SHA256
30:44:02:20:29:49:5d:12:9a:0e:b3:b8:47:c9:78:dc:e5:26:
00:0b:7d:a2:95:ef:70:2d:56:89:a4:3e:ab:c1:4c:1e:a8:bd:
02:20:19:d7:dc:56:c6:f9:48:05:f6:0b:93:17:28:46:96:e1:
af:78:0b:ac:c5:48:4c:86:dd:51:d6:e3:a0:77:a5:3d
```
ownspies (Wed, 26 Feb 2020 20:19:24 GMT):
yeah, ok, that cert looks fine and yes, it's the peer cert that has the wrong O
Antimttr (Wed, 26 Feb 2020 20:19:31 GMT):
right
Antimttr (Wed, 26 Feb 2020 20:19:45 GMT):
so the cert that ca generates has O=Hyperledger
Antimttr (Wed, 26 Feb 2020 20:19:53 GMT):
which is like the default from the config.yaml
ownspies (Wed, 26 Feb 2020 20:19:58 GMT):
yeah, ok
ownspies (Wed, 26 Feb 2020 20:20:42 GMT):
so I use this command, which is effectively the same you're using
ownspies (Wed, 26 Feb 2020 20:20:47 GMT):
``````
ownspies (Wed, 26 Feb 2020 20:20:47 GMT):
```fabric-ca-client register -d \
-u ${PROTO}://$CA_ADMIN:$CA_PASSWORD@$SERVICE_DNS \
-M "${ORG_PATH}/msp" \
--id.name peer-0${PEERID}.${ORGID}.${DOMAIN_SUFFIX} \
--id.secret ${ORGID}-peer-0${PEERID}_pw \
--id.type peer
```
ownspies (Wed, 26 Feb 2020 20:21:34 GMT):
let me check my CA
Antimttr (Wed, 26 Feb 2020 20:21:58 GMT):
yeah that looks the same as what im doing
ownspies (Wed, 26 Feb 2020 20:23:15 GMT):
yes, and I have this in my config, which does work:
```###########################################################################
csr:
cn:
names:
- C: "US"
ST: "MyState"
L: "MyCity"
O: "MyOrg"
OU: "HLF Org Signer - SIT Environment"
hosts:
- localhost
# K8S Service
- ca-core-sit-hlf-ca.hlf-sit.svc.cluster.local
ca:
expiry: 131400h
pathlength: 2
#############################################################################
```
Antimttr (Wed, 26 Feb 2020 20:23:22 GMT):
so i mentioned that fabric-ca-client makes a fabric-ca-client-config.yaml each time i do an enroll in the enrolling entities working dir
Antimttr (Wed, 26 Feb 2020 20:23:35 GMT):
and it seems to have all the same options as the server version
Antimttr (Wed, 26 Feb 2020 20:23:39 GMT):
but of course its all set to default
ownspies (Wed, 26 Feb 2020 20:23:44 GMT):
yeah, it's similar
ownspies (Wed, 26 Feb 2020 20:23:57 GMT):
you can override the CA and stuff on the CLI
Antimttr (Wed, 26 Feb 2020 20:24:17 GMT):
im wondering if i should configure that and specify the configured yaml when i issue a fabric-ca-client command
Antimttr (Wed, 26 Feb 2020 20:24:34 GMT):
because its just using the defaults everytime somehow overriding what ive setup on my server-config.yaml
ownspies (Wed, 26 Feb 2020 20:24:40 GMT):
I've never configured the CA client file but you can try
ownspies (Wed, 26 Feb 2020 20:24:48 GMT):
for some reason the server just isn't reading your config file properly
ownspies (Wed, 26 Feb 2020 20:24:59 GMT):
is your host OS linux or Windows ?
Antimttr (Wed, 26 Feb 2020 20:25:02 GMT):
hmm but you issue these commands in the fabric-ca-server container?
Antimttr (Wed, 26 Feb 2020 20:25:08 GMT):
that seems to be a difference
Antimttr (Wed, 26 Feb 2020 20:25:18 GMT):
my host os is centos
Antimttr (Wed, 26 Feb 2020 20:26:30 GMT):
im going to give that a shot, generate a fabric-ca-client-config.yaml and use that when issue the register and enroll commands
Antimttr (Wed, 26 Feb 2020 20:29:52 GMT):
i guess what i'd like to do is just specify this stuff in environment
Antimttr (Wed, 26 Feb 2020 20:30:24 GMT):
let me see if the docs has the env variables for the CSR config settings
ownspies (Wed, 26 Feb 2020 20:34:43 GMT):
the CSR stuff as ENV is a small PITA because it's an array, not a straight string
Antimttr (Wed, 26 Feb 2020 20:34:50 GMT):
yeah
Antimttr (Wed, 26 Feb 2020 20:35:05 GMT):
im only seeing 2: FABRIC_CA_SERVER_CSR_CN and FABRIC_CA_SERVER_CSR_HOSTS
ownspies (Wed, 26 Feb 2020 20:35:11 GMT):
I found mixed docs on how to do the array, some said comma separated some said space
ownspies (Wed, 26 Feb 2020 20:35:17 GMT):
well, try that then
Antimttr (Wed, 26 Feb 2020 20:35:50 GMT):
ok so ill try setting: FABRIC_CA_SERVER_CSR_O
Antimttr (Wed, 26 Feb 2020 20:40:06 GMT):
actually i think ill do
Antimttr (Wed, 26 Feb 2020 20:40:16 GMT):
FABRIC_CA_SERVER_CSR_NAMES_O
Antimttr (Wed, 26 Feb 2020 20:40:31 GMT):
to have it match the structure
ownspies (Wed, 26 Feb 2020 20:40:48 GMT):
that makes sense
Antimttr (Wed, 26 Feb 2020 20:52:03 GMT):
ok regenerated everything time to look at my cert
ownspies (Wed, 26 Feb 2020 20:52:41 GMT):
:fingers_crossed:
Antimttr (Wed, 26 Feb 2020 20:53:46 GMT):
no change
Antimttr (Wed, 26 Feb 2020 20:54:00 GMT):
O=Hyperledger
Antimttr (Wed, 26 Feb 2020 20:55:27 GMT):
let me look at my server logs now
Antimttr (Wed, 26 Feb 2020 20:57:05 GMT):
```2020/02/26 20:51:50 [DEBUG] Received request for /enroll
2020/02/26 20:51:50 [DEBUG] ca.Config: &{Version:1.4.4-latest Cfg:{Identities:{PasswordAttempts:10 AllowRemove:true} Affiliations:{AllowRemove:false}} CA:{Name:ica.org1.example.com Keyfile:/etc/hyperledger/fabric-ca/ca/ica.org1.example.com.key.pem Certfile:/etc/hyperledger/fabric-ca/ca/ica.org1.example.com.crt.pem Chainfile:/etc/hyperledger/fabric-ca/ca/chain.org1.example.com.crt.pem} Signing:0xc0001f73e0 CSR:{CN:ica.org1.example.com Names:[{C:US ST:California L:San Diego O:org1.example.com OU:Fabric SerialNumber:}] Hosts:[0.0.0.0 3.x.7x.136] KeyRequest:0xc0001fc260 CA:0xc0001fc2e0 SerialNumber:} Registry:{MaxEnrollments:-1 Identities:[{ Name:**** Pass:**** Type:client Affiliation: MaxEnrollments:0 Attrs:map[hf.AffiliationMgr:1 hf.GenCRL:1 hf.IntermediateCA:1 hf.Registrar.Attributes:* hf.Registrar.DelegateRoles:* hf.Registrar.Roles:* hf.Revoker:1] }]} Affiliations:map[org1:[department1 department2] org2:[department1]] LDAP:{ Enabled:false URL:ldap://****:****@
Antimttr (Wed, 26 Feb 2020 20:57:13 GMT):
thats from the server log
Antimttr (Wed, 26 Feb 2020 20:57:23 GMT):
and you can see its got the correct stuff in csr
Antimttr (Wed, 26 Feb 2020 20:57:45 GMT):
`Signing:0xc0001f73e0 CSR:{CN:ica.org1.example.com Names:[{C:US ST:California L:San Diego O:org1.example.com OU:Fabric SerialNumber:}] Hosts:[0.0.0.0 3.x.7x.136] `
Antimttr (Wed, 26 Feb 2020 20:58:05 GMT):
and thats reflected in the generated cert, the issuer O is correct
Antimttr (Wed, 26 Feb 2020 20:58:09 GMT):
just not the subject O
ownspies (Wed, 26 Feb 2020 20:59:59 GMT):
so ... that is the cert for your ICA
Antimttr (Wed, 26 Feb 2020 21:00:10 GMT):
yeah
ownspies (Wed, 26 Feb 2020 21:00:18 GMT):
that has no bearing on the cert for the peer when you run the register command
Antimttr (Wed, 26 Feb 2020 21:00:28 GMT):
apparently not
Antimttr (Wed, 26 Feb 2020 21:01:44 GMT):
but it does show that the ca-server is atleast using the correct values
Antimttr (Wed, 26 Feb 2020 21:01:59 GMT):
how to get the correct values into the enrolled certificate is the question
ownspies (Wed, 26 Feb 2020 21:02:32 GMT):
uggh, sorry, let me test something locally
ownspies (Wed, 26 Feb 2020 21:05:17 GMT):
Mine say that too .... when I enroll
Antimttr (Wed, 26 Feb 2020 21:05:34 GMT):
says what? O=Hyperledger ?
ownspies (Wed, 26 Feb 2020 21:05:42 GMT):
`Subject: C = US, ST = North Carolina, O = Hyperledger, OU = client, CN = admin`
Antimttr (Wed, 26 Feb 2020 21:05:50 GMT):
ahh
ownspies (Wed, 26 Feb 2020 21:06:08 GMT):
testing something else ...
Antimttr (Wed, 26 Feb 2020 21:06:35 GMT):
well i havent tested out anything since i changed the CN
Antimttr (Wed, 26 Feb 2020 21:06:42 GMT):
maybe that's all it needs
ownspies (Wed, 26 Feb 2020 21:08:02 GMT):
`Subject: C = US, ST = California, L = San Diego, O = Testing, OU = client, CN = Justin`
ownspies (Wed, 26 Feb 2020 21:08:43 GMT):
yes in the fabric-ca-client-config.yaml (or using the corresponding env vars) set
ownspies (Wed, 26 Feb 2020 21:09:50 GMT):
so
ownspies (Wed, 26 Feb 2020 21:10:02 GMT):
`FABRIC_CA_CLIENT_CSR_NAMES_O=...`
ownspies (Wed, 26 Feb 2020 21:10:17 GMT):
and so on
Antimttr (Wed, 26 Feb 2020 21:11:01 GMT):
oh shoot i was using FABRIC_CA_SERVER not _CLIENT :disappointed_relieved:
Antimttr (Wed, 26 Feb 2020 21:13:09 GMT):
ok got to reset all this again and ill give it another go!
ownspies (Wed, 26 Feb 2020 21:15:10 GMT):
shouldn't have to reset
ownspies (Wed, 26 Feb 2020 21:15:22 GMT):
just set the env vars and register a new user
Antimttr (Wed, 26 Feb 2020 21:20:16 GMT):
still no
Antimttr (Wed, 26 Feb 2020 21:20:27 GMT):
-.-
Antimttr (Wed, 26 Feb 2020 21:20:43 GMT):
im going to review some settings, this is so strange, you're able to get it working
Antimttr (Wed, 26 Feb 2020 21:21:26 GMT):
ah shite i had a space after the NAMES_O
Antimttr (Wed, 26 Feb 2020 21:21:31 GMT):
might make a idfference
Antimttr (Wed, 26 Feb 2020 21:25:24 GMT):
bah nope still the same
Antimttr (Wed, 26 Feb 2020 21:30:29 GMT):
ok im going to try it with a custom fabric-ca-client-config.yaml
Antimttr (Wed, 26 Feb 2020 21:34:22 GMT):
@ownspies did you set that env just when you enrolled or when you registered too?
Antimttr (Wed, 26 Feb 2020 22:08:18 GMT):
aha!
Antimttr (Wed, 26 Feb 2020 22:08:38 GMT):
i got it, used --csr.names in the arguments to fabric-ca-client
Antimttr (Wed, 26 Feb 2020 22:19:28 GMT):
thanks ownspies!
ownspies (Thu, 27 Feb 2020 13:12:11 GMT):
awesome! Sorry, I got off the bus and went straight to church
ownspies (Thu, 27 Feb 2020 13:12:11 GMT):
awesome! Sorry or not responding sooner, I got off the bus and went straight to church, yada yada yada
lzaouche (Thu, 27 Feb 2020 14:44:00 GMT):
Hello, is it possible to get the name of the peer who executed a transaction? envelopeInfo.getCreator().getName() for example?
yacovm (Thu, 27 Feb 2020 15:10:08 GMT):
it's in the endorsement
yacovm (Thu, 27 Feb 2020 15:10:13 GMT):
the certificate of the peer is there
lzaouche (Thu, 27 Feb 2020 15:29:07 GMT):
I can't see anything about the transaction creator here https://javadoc.io/doc/org.hyperledger.fabric-sdk-java/fabric-sdk-java/latest/org/hyperledger/fabric/sdk/BlockInfo.EndorserInfo.html
Antimttr (Thu, 27 Feb 2020 19:59:06 GMT):
@ownspies quick update. got everything back up and running with the corrected certs now but now im running into some sort of chaining issue: `Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target` going to try the tlsca's chain certificate instead of its main cert
ownspies (Thu, 27 Feb 2020 20:24:09 GMT):
where do you get that ?
ownspies (Thu, 27 Feb 2020 20:24:27 GMT):
should have replied here - what is returning that error?
Antimttr (Thu, 27 Feb 2020 20:34:29 GMT):
the java sdk
Antimttr (Thu, 27 Feb 2020 20:34:40 GMT):
when im attempting to send a transaction to the orderer
ownspies (Thu, 27 Feb 2020 20:34:59 GMT):
Ohhh we just went through that....
Antimttr (Thu, 27 Feb 2020 20:35:01 GMT):
org.hyperledger.fabric.sdk.OrdererClient.sendTransaction(OrdererClient.java:236)
Antimttr (Thu, 27 Feb 2020 20:35:07 GMT):
right but different error message
ownspies (Thu, 27 Feb 2020 20:35:12 GMT):
Ahh yes, the TLS CA files have to be included in the network config JSON file
Antimttr (Thu, 27 Feb 2020 20:35:14 GMT):
still a tls error though
Antimttr (Thu, 27 Feb 2020 20:35:25 GMT):
yes they are
ownspies (Thu, 27 Feb 2020 20:35:27 GMT):
yeah, sorry, I mean my team just went through that same problem
Antimttr (Thu, 27 Feb 2020 20:35:47 GMT):
but my tlsca is chained
ownspies (Thu, 27 Feb 2020 20:35:49 GMT):
is your TLS CA comprised of more than one parent, meaning is it Root -> Intermediate -> Peer Cert
Antimttr (Thu, 27 Feb 2020 20:35:56 GMT):
im wodnering if i need to supply the chain cert
ownspies (Thu, 27 Feb 2020 20:36:04 GMT):
yes you need to include the chain cert in the JSON
Antimttr (Thu, 27 Feb 2020 20:36:04 GMT):
yes
ownspies (Thu, 27 Feb 2020 20:36:17 GMT):
not the TLS cert for the server, just the chain
Antimttr (Thu, 27 Feb 2020 20:36:24 GMT):
does it use a different key name or still
Antimttr (Thu, 27 Feb 2020 20:36:26 GMT):
tlsCACerts
ownspies (Thu, 27 Feb 2020 20:37:07 GMT):
``` "orderers": {
"orderer-01.dev.example.net:7050": {
"url": "grpcs://orderer-01.dev.example.net:7050",
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\nMIICmzCCxxxxxxxxxxxxxxxxUrk=\n-----END CERTIFICATE-----\n"
}
},
```
ownspies (Thu, 27 Feb 2020 20:37:29 GMT):
you have to do that for each orderer and each peer
Antimttr (Thu, 27 Feb 2020 20:38:16 GMT):
i diff'd the cert thats in `crypto-config/ordererOrganizations/example.com/tlsca/tls.example.com.crt.pem` and the one in the orderer directory : `crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/tls-msp/tlscacerts/cert.pem`
Antimttr (Thu, 27 Feb 2020 20:38:21 GMT):
and they are completely different certs
Antimttr (Thu, 27 Feb 2020 20:38:29 GMT):
which i was confused by because i thought they would be the same
Antimttr (Thu, 27 Feb 2020 20:38:31 GMT):
but i guess not
ownspies (Thu, 27 Feb 2020 20:38:51 GMT):
tls-msp - is that standard?
ownspies (Thu, 27 Feb 2020 20:38:56 GMT):
I've never seen that dir
Antimttr (Thu, 27 Feb 2020 20:39:07 GMT):
thats what they used in the fabric-ca-server ops guide
Antimttr (Thu, 27 Feb 2020 20:39:16 GMT):
which is what i used to build the msp
ownspies (Thu, 27 Feb 2020 20:39:20 GMT):
hmm, didn't RTFM that one
ownspies (Thu, 27 Feb 2020 20:39:39 GMT):
I use the cert from tlsca
Antimttr (Thu, 27 Feb 2020 20:39:42 GMT):
are they different in your setup to?
ownspies (Thu, 27 Feb 2020 20:39:56 GMT):
no, I have a simplified TLS setup
ownspies (Thu, 27 Feb 2020 20:39:57 GMT):
just
ownspies (Thu, 27 Feb 2020 20:40:10 GMT):
root -> intermediate -> tls parent ->
ownspies (Thu, 27 Feb 2020 20:40:10 GMT):
root -> intermediate -> tls parent ->
ownspies (Thu, 27 Feb 2020 20:41:13 GMT):
the certs have to be in a specific order too...
ownspies (Thu, 27 Feb 2020 20:41:18 GMT):
when they are chained
Antimttr (Thu, 27 Feb 2020 20:41:24 GMT):
yes according to the ops guide
Antimttr (Thu, 27 Feb 2020 20:41:36 GMT):
actually according to the medium article i used
Antimttr (Thu, 27 Feb 2020 20:41:57 GMT):
i first cat the intermediate signing cert, then the rca cert
Antimttr (Thu, 27 Feb 2020 20:42:06 GMT):
so child, parent
ownspies (Thu, 27 Feb 2020 20:42:18 GMT):
do you just have two certs above the server TLS cert ?
Antimttr (Thu, 27 Feb 2020 20:42:33 GMT):
well just one cert
Antimttr (Thu, 27 Feb 2020 20:42:37 GMT):
the root cert
ownspies (Thu, 27 Feb 2020 20:42:43 GMT):
and it signs all the TLS certs ?
ownspies (Thu, 27 Feb 2020 20:42:45 GMT):
so its
Antimttr (Thu, 27 Feb 2020 20:42:48 GMT):
then the tls fabric-server's cert
ownspies (Thu, 27 Feb 2020 20:43:06 GMT):
root ->
ownspies (Thu, 27 Feb 2020 20:43:06 GMT):
root ->
Antimttr (Thu, 27 Feb 2020 20:43:33 GMT):
rca.example.com -> tls.example.com -> orderer1.example.com
ownspies (Thu, 27 Feb 2020 20:44:05 GMT):
ok, so your TLS chain file should include (in this order) tls.example.com+rca.example.com
Antimttr (Thu, 27 Feb 2020 20:44:16 GMT):
ok
Antimttr (Thu, 27 Feb 2020 20:45:06 GMT):
i have that certificate already in my example.com/tlsca dir
Antimttr (Thu, 27 Feb 2020 20:45:29 GMT):
ill set that as the tlscacert in the network-config.yaml
Antimttr (Thu, 27 Feb 2020 20:45:31 GMT):
and try again
Antimttr (Thu, 27 Feb 2020 20:48:21 GMT):
hmm now i got `javax.net.ssl.SSLHandshakeException: error:0b000074:X.509 certificate routines:OPENSSL_internal:KEY_VALUES_MISMATCH`
Antimttr (Thu, 27 Feb 2020 20:49:30 GMT):
im wondering if in the docker environment if ORDERER_GENERAL_TLS_ROOTCAS needs to also contain this chain cert
Antimttr (Thu, 27 Feb 2020 20:49:48 GMT):
right now its pointing to the tlscacert in the orderer directory
Antimttr (Thu, 27 Feb 2020 21:43:06 GMT):
ok so set the orderers docker yaml config to point ORDERER_GENERAL_TLS_ROOTCAS to the chain cert as well, but didnt make any difference
ownspies (Fri, 28 Feb 2020 14:22:59 GMT):
So it's hard to help without combing through all the config files, but what I had to do with issues like this is I would retrieve the cert from the orderer using `openssl s_client -connect google.com:443` (obviously use the correct host/port) and I would save the cert locally
ownspies (Fri, 28 Feb 2020 14:23:21 GMT):
Then I would use the local TLS certs to verify the certificate
ownspies (Fri, 28 Feb 2020 14:23:49 GMT):
since you have chained certs, create a new directory and put each certificate into a separate file in that directory
ownspies (Fri, 28 Feb 2020 14:24:01 GMT):
and put the downloaded orderer cert into the directory above that
ownspies (Fri, 28 Feb 2020 14:24:52 GMT):
and run `openssl verify -CAfile chain/root.pem o.pem`
ownspies (Fri, 28 Feb 2020 14:24:52 GMT):
run `openssl verify -CAfile chain.pem orderer.pem`
ownspies (Fri, 28 Feb 2020 14:27:26 GMT):
e.g. I ran this locally:"
ownspies (Fri, 28 Feb 2020 14:27:26 GMT):
e.g. I ran this locally:
ownspies (Fri, 28 Feb 2020 14:28:10 GMT):
```openssl verify -CAfile tlsca/tls.sit.example.net-chain.pem orderers/orderer-01.sit.example.net/tls/orderer-01.sit.example.net-cert.pem
orderers/orderer-01.sit.champgrid.net/tls/orderer-01.sit.champgrid.net-cert.pem: OK
```
ownspies (Fri, 28 Feb 2020 14:28:10 GMT):
```openssl verify -CAfile tlsca/tls.sit.example.net-chain.pem orderers/orderer-01.sit.example.net/tls/orderer-01.sit.example.net-cert.pem
orderers/orderer-01.sit.example.net/tls/orderer-01.sit.example.net-cert.pem: OK
```
ownspies (Fri, 28 Feb 2020 14:28:59 GMT):
doing this tells you exactly which cert chain to use with your orderers
Antimttr (Fri, 28 Feb 2020 15:36:47 GMT):
oh
Antimttr (Fri, 28 Feb 2020 15:36:49 GMT):
very nice!
Antimttr (Fri, 28 Feb 2020 15:36:54 GMT):
ok im going to try that, thanks
Antimttr (Fri, 28 Feb 2020 15:42:06 GMT):
```CONNECTED(00000003)
depth=0 C = US, ST = California, L = San Diego, O = example.com, OU = orderer, CN = orderer1.example.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 C = US, ST = California, L = San Diego, O = example.com, OU = orderer, CN = orderer1.example.com
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
0 s:/C=US/ST=California/L=San Diego/O=example.com/OU=orderer/CN=orderer1.example.com
i:/C=US/ST=California/O=example.com/CN=ica.example.com
---
Server certificate
-----BEGIN CERTIFICATE-----
MIICzTCCAnOgAwIBAgIUXm8IUylYLWRsSW6Y3SCSOZPrdBIwCgYIKoZIzj0EAwIw
UjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFDASBgNVBAoMC2V4
YW1wbGUuY29tMRgwFgYDVQQDDA9pY2EuZXhhbXBsZS5jb20wHhcNMjAwMjI2MjI0
NjAwWhcNMjEwMjI1MjI1MTAwWjB9MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2Fs
aWZvcm5pYTESMBAGA1UEBxMJU2FuIERpZWdvMRQwEgYDVQQKEwtleGFtcGxlLmNv
bTEQMA4GA1UECxMHb3JkZXJlcjEdMBsGA1UEAxMUb3JkZXJlcjEuZXhhbXBsZS5j
b20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQtoKENXIVwb5+6KKQ2sr2Ql48T
8qfpa4uEX2ZDrR5gF4c5LkRMssGTyjU8kjuv6A3xiO3t2amkH/UQgZ9qbOiWo4H7
MIH4MA4GA1UdDwEB/wQEAwIDqDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUH
AwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUHPqrAVWiSmJ/NAaaHrSlHp6ElXsw
HwYDVR0jBBgwFoAUNN/LZ8PjVWo+NseL+YyruD3aDugwDwYDVR0RBAgwBocEAw5I
iDBoBggqAwQFBgcIAQRceyJhdHRycyI6eyJoZi5BZmZpbGlhdGlvbiI6IiIsImhm
LkVucm9sbG1lbnRJRCI6Im9yZGVyZXIxLmV4YW1wbGUuY29tIiwiaGYuVHlwZSI6
Im9yZGVyZXIifX0wCgYIKoZIzj0EAwIDSAAwRQIhAKHm1YpffdrUUGku8FXYDjgL
v8NYzttIdIqrRcjY/kDhAiBgW/H/trfaZ35dAzfh66ZfqEn6Gs1Y6GAF2f9WtOdk
aA==
-----END CERTIFICATE-----
subject=/C=US/ST=California/L=San Diego/O=example.com/OU=orderer/CN=orderer1.example.com
issuer=/C=US/ST=California/O=example.com/CN=ica.example.com
---
No client certificate CA names sent
Client Certificate Types: RSA sign, ECDSA sign
Requested Signature Algorithms: RSA+SHA256:ECDSA+SHA256:RSA+SHA384:ECDSA+SHA384:RSA+SHA512:ECDSA+SHA512:RSA+SHA1:ECDSA+SHA1
Shared Requested Signature Algorithms: RSA+SHA256:ECDSA+SHA256:RSA+SHA384:ECDSA+SHA384:RSA+SHA512:ECDSA+SHA512:RSA+SHA1:ECDSA+SHA1
Peer signing digest: SHA512
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 1036 bytes and written 427 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-ECDSA-AES256-GCM-SHA384
Server public key is 256 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-ECDSA-AES256-GCM-SHA384
Session-ID:
Session-ID-ctx:
Master-Key: 9AE1E724773D020D43D8CD7CF9CE67EB3D570E0FAE322462BD65BFFE6B6A927992BDCD5DB9DDC7F57BABB059CA3233F7
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
Start Time: 1582904463
Timeout : 300 (sec)
Verify return code: 21 (unable to verify the first certificate)
---
```
ownspies (Fri, 28 Feb 2020 15:42:45 GMT):
yup, save that `---BEGIN CERTIFI...` to the `---END CERT...`
Antimttr (Fri, 28 Feb 2020 15:43:22 GMT):
ok saved that
Antimttr (Fri, 28 Feb 2020 15:43:43 GMT):
now ill verify
ownspies (Fri, 28 Feb 2020 15:43:47 GMT):
yup
Antimttr (Fri, 28 Feb 2020 15:44:51 GMT):
```$ openssl verify -CAfile chain.example.com.crt.pem ~/tmp/orderer.pem
/home/m____/tmp/orderer.pem: OK
```
Antimttr (Fri, 28 Feb 2020 15:44:58 GMT):
so that works
Antimttr (Fri, 28 Feb 2020 15:45:14 GMT):
i think they're the same cert if im not mistaken
Antimttr (Fri, 28 Feb 2020 15:45:17 GMT):
let me diff them
ownspies (Fri, 28 Feb 2020 15:45:29 GMT):
yeah, you don't want to verify the cert with itself
ownspies (Fri, 28 Feb 2020 15:45:33 GMT):
you want to verify the cert chain
Antimttr (Fri, 28 Feb 2020 15:45:35 GMT):
oh no they're not
Antimttr (Fri, 28 Feb 2020 15:46:26 GMT):
hmm ok well
Antimttr (Fri, 28 Feb 2020 15:46:46 GMT):
those warnings at the begining of the first openssl command were interesting
Antimttr (Fri, 28 Feb 2020 15:47:00 GMT):
but maybe they occur just because they're not signed by a real root authority
Antimttr (Fri, 28 Feb 2020 15:47:05 GMT):
so it cant verify them that way
Antimttr (Fri, 28 Feb 2020 15:48:30 GMT):
ok so i found what cert its giving me, its the orderer.example.com/tls-msp/signcerts/cert.pem
Antimttr (Fri, 28 Feb 2020 15:48:39 GMT):
which i beleive is correct
ownspies (Fri, 28 Feb 2020 15:49:34 GMT):
ohhh so you're using the CA to register then enroll a user
ownspies (Fri, 28 Feb 2020 15:49:43 GMT):
and using that users certs for TLS
ownspies (Fri, 28 Feb 2020 15:49:46 GMT):
got it
Antimttr (Fri, 28 Feb 2020 15:49:53 GMT):
i have two fabric-ca-server's per org
Antimttr (Fri, 28 Feb 2020 15:49:58 GMT):
one is the regular one, and one is the tls
Antimttr (Fri, 28 Feb 2020 15:50:07 GMT):
they both come from independent rootcas
Antimttr (Fri, 28 Feb 2020 15:51:14 GMT):
that openssl command is handy though, i love stuff like that
ownspies (Fri, 28 Feb 2020 15:51:19 GMT):
yeah, ok, so you should have the chain files inside `tls-msp/cacerts` and `tls-msp/intermediatecerts`
Antimttr (Fri, 28 Feb 2020 15:51:24 GMT):
i had no idea you could extract the cert like that
ownspies (Fri, 28 Feb 2020 15:51:39 GMT):
yeah, I've learned a LOT about openssl commands
Antimttr (Fri, 28 Feb 2020 15:51:44 GMT):
oh and intermediatecerts?
Antimttr (Fri, 28 Feb 2020 15:51:51 GMT):
i think my intermediatecerts is empty
ownspies (Fri, 28 Feb 2020 15:51:56 GMT):
you'll join all the files from those two directories
ownspies (Fri, 28 Feb 2020 15:52:34 GMT):
and that will be your chain file
Antimttr (Fri, 28 Feb 2020 15:52:37 GMT):
nm its not empty
Antimttr (Fri, 28 Feb 2020 15:52:42 GMT):
let me see if its my chain file though
Antimttr (Fri, 28 Feb 2020 15:53:06 GMT):
it is not a chain file
Antimttr (Fri, 28 Feb 2020 15:53:15 GMT):
but neither is it the same as whats in tlscacerts
ownspies (Fri, 28 Feb 2020 15:53:44 GMT):
well the file in signercerts is signed by the file in cacerts + intermediatecerts
Antimttr (Fri, 28 Feb 2020 15:54:04 GMT):
i see
ownspies (Fri, 28 Feb 2020 15:54:11 GMT):
you could validate that statement using the openssl verify command to verify the file in signercerts
Antimttr (Fri, 28 Feb 2020 15:54:14 GMT):
let me examine the cert in intermediate
ownspies (Fri, 28 Feb 2020 15:54:19 GMT):
it works a little different when you have multiple files
ownspies (Fri, 28 Feb 2020 15:54:34 GMT):
but ... basically all your TLS material you need is in that tls-msp path
Antimttr (Fri, 28 Feb 2020 15:55:12 GMT):
```$ openssl verify -CAfile tlscacerts/tls-3-14-72-136-7151.pem signcerts/cert.pem
signcerts/cert.pem: C = US, ST = California, L = San Diego, O = example.com, OU = orderer, CN = orderer1.example.com
error 20 at 0 depth lookup:unable to get local issuer certificate
```
Antimttr (Fri, 28 Feb 2020 15:55:12 GMT):
```$ openssl verify -CAfile tlscacerts/tls-3-x-72-x6-7151.pem signcerts/cert.pem
signcerts/cert.pem: C = US, ST = California, L = San Diego, O = example.com, OU = orderer, CN = orderer1.example.com
error 20 at 0 depth lookup:unable to get local issuer certificate
```
ownspies (Fri, 28 Feb 2020 15:55:56 GMT):
right - the tlsca didn't sign the signcert file
Antimttr (Fri, 28 Feb 2020 15:56:35 GMT):
should it have?
ownspies (Fri, 28 Feb 2020 15:56:46 GMT):
no
ownspies (Fri, 28 Feb 2020 15:57:01 GMT):
the files in cacerts/ and intermediatecerts/ signed that file
Antimttr (Fri, 28 Feb 2020 15:57:11 GMT):
same response if i verify the signcert with the tlscaintermediate cert
Antimttr (Fri, 28 Feb 2020 15:57:35 GMT):
i dont have any files in cacerts
Antimttr (Fri, 28 Feb 2020 15:57:38 GMT):
in the tls-msp anyways
Antimttr (Fri, 28 Feb 2020 15:57:41 GMT):
only tlscacerts
ownspies (Fri, 28 Feb 2020 15:57:49 GMT):
oh
Antimttr (Fri, 28 Feb 2020 15:58:09 GMT):
i noticed that when i enrolled tls server
ownspies (Fri, 28 Feb 2020 15:58:17 GMT):
what I output from `openssl x509 -noout -text -in signcerts/cert.pem` then ?
Antimttr (Fri, 28 Feb 2020 15:58:24 GMT):
only the tls directories in the msp it produced had anythign in them
Antimttr (Fri, 28 Feb 2020 15:58:57 GMT):
```Certificate:
Data:
Version: 3 (0x2)
Serial Number:
5e:6f:08:53:29:58:2d:64:6c:49:6e:98:dd:20:92:39:93:eb:74:12
Signature Algorithm: ecdsa-with-SHA256
Issuer: C=US, ST=California, O=example.com, CN=ica.example.com
Validity
Not Before: Feb 26 22:46:00 2020 GMT
Not After : Feb 25 22:51:00 2021 GMT
Subject: C=US, ST=California, L=San Diego, O=example.com, OU=orderer, CN=orderer1.example.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:2d:a0:a1:0d:5c:85:70:6f:9f:ba:28:a4:36:b2:
bd:90:97:8f:13:f2:a7:e9:6b:8b:84:5f:66:43:ad:
1e:60:17:87:39:2e:44:4c:b2:c1:93:ca:35:3c:92:
3b:af:e8:0d:f1:88:ed:ed:d9:a9:a4:1f:f5:10:81:
9f:6a:6c:e8:96
ASN1 OID: prime256v1
NIST CURVE: P-256
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature, Key Encipherment, Key Agreement
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
1C:FA:AB:01:55:A2:4A:62:7F:34:06:9A:1E:B4:A5:1E:9E:84:95:7B
X509v3 Authority Key Identifier:
keyid:34:DF:CB:67:C3:E3:55:6A:3E:36:C7:8B:F9:8C:AB:B8:3D:DA:0E:E8
X509v3 Subject Alternative Name:
IP Address:3.x.72.x
1.2.3.4.5.6.7.8.1:
{"attrs":{"hf.Affiliation":"","hf.EnrollmentID":"orderer1.example.com","hf.Type":"orderer"}}
Signature Algorithm: ecdsa-with-SHA256
30:45:02:21:00:a1:e6:d5:8a:5f:7d:da:d4:50:69:2e:f0:55:
d8:0e:38:0b:bf:c3:58:ce:db:48:74:8a:ab:45:c8:d8:fe:40:
e1:02:20:60:5b:f1:ff:b6:b7:da:67:7e:5d:03:37:e1:eb:a6:
5f:a8:49:fa:1a:cd:58:e8:60:05:d9:ff:56:b4:e7:64:68
```
Antimttr (Fri, 28 Feb 2020 15:59:43 GMT):
and thats the same cert that i got when i downloaded the cert via openssl
ownspies (Fri, 28 Feb 2020 15:59:48 GMT):
if you do the same for the file in tlsintermediatecerts/ what do you get ?
Antimttr (Fri, 28 Feb 2020 16:00:42 GMT):
```Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4096 (0x1000)
Signature Algorithm: ecdsa-with-SHA256
Issuer: C=US, ST=California, L=San Diego, O=example.com, CN=rca.example.com
Validity
Not Before: Feb 3 18:32:13 2020 GMT
Not After : Feb 1 18:32:13 2025 GMT
Subject: C=US, ST=California, O=example.com, CN=ica.example.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:2f:ea:c0:33:d9:44:64:9c:7f:70:0e:55:24:b2:
03:3c:d3:ea:51:1a:0d:53:42:8a:ec:e2:1c:00:e1:
e0:7a:ad:05:b7:0f:74:bb:f0:72:b6:08:76:c7:eb:
8d:69:a0:d5:c4:ba:fa:5b:8d:7f:fe:2a:46:44:50:
6e:83:2b:2b:05
ASN1 OID: prime256v1
NIST CURVE: P-256
X509v3 extensions:
X509v3 Subject Key Identifier:
34:DF:CB:67:C3:E3:55:6A:3E:36:C7:8B:F9:8C:AB:B8:3D:DA:0E:E8
X509v3 Authority Key Identifier:
keyid:93:A8:FC:F3:51:C7:A1:5D:16:88:DB:D5:FF:B9:ED:57:D9:34:8E:4F
X509v3 Basic Constraints: critical
CA:TRUE, pathlen:0
X509v3 Key Usage: critical
Digital Signature, Certificate Sign, CRL Sign
Signature Algorithm: ecdsa-with-SHA256
30:45:02:20:7a:b2:08:38:24:00:85:67:d2:94:a1:ff:48:1d:
5c:24:88:5c:e8:de:82:7a:e3:9f:12:6c:0a:54:82:76:e9:84:
02:21:00:cc:2f:12:08:9b:0c:9d:98:ba:69:bd:25:e6:57:64:
b2:36:03:2e:f3:1a:a8:70:a8:66:91:52:2b:ab:62:02:39
```
ownspies (Fri, 28 Feb 2020 16:00:56 GMT):
ok, wasn't expecting that
Antimttr (Fri, 28 Feb 2020 16:01:29 GMT):
does that look off to you?
ownspies (Fri, 28 Feb 2020 16:06:14 GMT):
you could try
ownspies (Fri, 28 Feb 2020 16:06:48 GMT):
```openssl verify -CAfile tlscacerts/
ownspies (Fri, 28 Feb 2020 16:06:48 GMT):
```openssl verify -CAfile tlscacerts/
ownspies (Fri, 28 Feb 2020 16:07:36 GMT):
basically though the files in tlscacerts and tlsintermediatecerts are your chain - assemble those into a single file in the correct sequence and use that for your Java app
Antimttr (Fri, 28 Feb 2020 16:07:44 GMT):
`signcerts/cert.pem: OK`
ownspies (Fri, 28 Feb 2020 16:08:12 GMT):
have to jump off for a bit, but that is your chain
Antimttr (Fri, 28 Feb 2020 16:08:22 GMT):
so i just need to make it into a chain file
Antimttr (Fri, 28 Feb 2020 16:08:29 GMT):
and use that in the tlsCACerts in my network-config
Antimttr (Fri, 28 Feb 2020 16:08:34 GMT):
if i understasnd correctly
Antimttr (Fri, 28 Feb 2020 16:17:18 GMT):
ok so here's the issue, the two of those files chained together is equal to the chainfile i already have, and that file does verify the signcerts/cert.pem
Antimttr (Fri, 28 Feb 2020 16:20:24 GMT):
the error message seems to imply some sort of mismatch with the cert key file
Antimttr (Fri, 28 Feb 2020 16:20:36 GMT):
`OPENSSL_internal:KEY_VALUES_MISMATCH`
Antimttr (Fri, 28 Feb 2020 16:20:59 GMT):
https://knowledge.digicert.com/solution/SO7302.html
ownspies (Fri, 28 Feb 2020 16:24:42 GMT):
so do this
ownspies (Fri, 28 Feb 2020 16:24:48 GMT):
?
Antimttr (Fri, 28 Feb 2020 16:25:05 GMT):
you know theres two other files that the sdk requires to do this transaction
Antimttr (Fri, 28 Feb 2020 16:25:13 GMT):
the clientcertfile and the clientkey file
Antimttr (Fri, 28 Feb 2020 16:25:25 GMT):
im wondering if those are off
ownspies (Fri, 28 Feb 2020 16:25:32 GMT):
https://www.ssl247.com/kb/ssl-certificates/troubleshooting/certificate-matches-private-key
Antimttr (Fri, 28 Feb 2020 16:25:38 GMT):
right now i have the clientcertfile pointing to its tlscacert
Antimttr (Fri, 28 Feb 2020 16:25:44 GMT):
which wouldnt correspond to the key file
Antimttr (Fri, 28 Feb 2020 16:25:57 GMT):
so ii tried changing it to the signcert in the Admin@example.com/tsl-msp
Antimttr (Fri, 28 Feb 2020 16:26:02 GMT):
testing now
ownspies (Fri, 28 Feb 2020 16:26:24 GMT):
compare the signcert/cert.pem with your private key in keyfiles/
Antimttr (Fri, 28 Feb 2020 16:26:37 GMT):
oh
Antimttr (Fri, 28 Feb 2020 16:26:41 GMT):
i think that did it
Antimttr (Fri, 28 Feb 2020 16:26:45 GMT):
im getting past tls handshaking now
ownspies (Fri, 28 Feb 2020 16:27:03 GMT):
nice
Antimttr (Fri, 28 Feb 2020 16:27:37 GMT):
``` [channel: mychannel] Rejecting broadcast of config message from 184.X.179.X:34092 because of error: config update for existing channel did not pass initial checks: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Writers' sub-policies to be satisfied: permission denied
2020-02-28 16:26:19.548 UTC [comm.grpc.server] 1 -> INFO 02e streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=184.X.179.X:34092 grpc.peer_subject="CN=admin-orderer,OU=admin,O=example.com,L=San Diego,ST=California,C=US" grpc.code=OK grpc.call_duration=940.511µs
```
Antimttr (Fri, 28 Feb 2020 16:28:51 GMT):
hmm wondering why my admin isnt a writer
Antimttr (Fri, 28 Feb 2020 16:29:05 GMT):
maybe i should be using the msp cert not the tls-msp cert..
Antimttr (Fri, 28 Feb 2020 16:32:29 GMT):
hmm nope didnt make a difference
Antimttr (Fri, 28 Feb 2020 16:33:06 GMT):
let me double check my genesis block config
Antimttr (Fri, 28 Feb 2020 16:35:40 GMT):
hmm nothing in their about identities
Antimttr (Fri, 28 Feb 2020 16:38:21 GMT):
hmm maybe im attempting something stupid
Antimttr (Fri, 28 Feb 2020 16:39:24 GMT):
im trying to create a new channel
Antimttr (Fri, 28 Feb 2020 16:39:44 GMT):
but i've already created a genesis block by hand outside of the sdk
Antimttr (Fri, 28 Feb 2020 16:41:44 GMT):
but thats exactly how they do it in balance-transfer
Antimttr (Fri, 28 Feb 2020 16:41:50 GMT):
and this same process works their no probllem
Antimttr (Fri, 28 Feb 2020 16:43:30 GMT):
oh shoot, they have the admin keys encoded into their first block
Antimttr (Fri, 28 Feb 2020 16:43:34 GMT):
i dont have that
Antimttr (Fri, 28 Feb 2020 16:44:21 GMT):
no nm thats their network-config not their configtx.yaml
Antimttr (Fri, 28 Feb 2020 20:45:44 GMT):
yay i finally got it!
Antimttr (Fri, 28 Feb 2020 20:45:57 GMT):
had to copy updated admin certs into my org msp's
Antimttr (Fri, 28 Feb 2020 20:46:40 GMT):
and then regenerate the channel.tx and genesis.block
ownspies (Mon, 02 Mar 2020 13:38:23 GMT):
nice!
lionelronaldo (Tue, 03 Mar 2020 09:26:48 GMT):
Has joined the channel.
Antimttr (Tue, 03 Mar 2020 19:31:57 GMT):
@ownspies any chance you're about today?
ownspies (Tue, 03 Mar 2020 20:10:18 GMT):
Hey @Antimttr what's up?
Antimttr (Tue, 03 Mar 2020 20:12:23 GMT):
hey ownspies, so I'm attempting to resolve some of the crypto issues im having. When you generate your crypto do you specify the peers internal ip addresses via the SAN or via the CSR values?
Antimttr (Tue, 03 Mar 2020 20:12:55 GMT):
my peers are trying to gossip to one another but they cant resolve the hostnames: ` UTC [gossip.discovery] func1 -> WARN 37f Could not connect to Endpoint: peer1.org2.example.com:7021, InternalEndpoint: peer1.org2.example.com:7021, PKI-ID:
Antimttr (Tue, 03 Mar 2020 20:12:55 GMT):
my peers are trying to gossip to one another but they cant resolve the hostnames: `UTC [gossip.discovery] func1 -> WARN 37f Could not connect to Endpoint: peer1.org2.example.com:7021, InternalEndpoint: peer1.org2.example.com:7021, PKI-ID:
ownspies (Tue, 03 Mar 2020 20:13:00 GMT):
both I believe
ownspies (Tue, 03 Mar 2020 20:13:02 GMT):
let me check
ownspies (Tue, 03 Mar 2020 20:13:12 GMT):
this is the TLS for a peer, or the signer cert for a peer?
Antimttr (Tue, 03 Mar 2020 20:13:23 GMT):
both i suppose
Antimttr (Tue, 03 Mar 2020 20:13:57 GMT):
i mean i specified the public ip address of the peer in the CSR
Antimttr (Tue, 03 Mar 2020 20:14:07 GMT):
but it seems like its not using that data to try and gossip with the peer
Antimttr (Tue, 03 Mar 2020 20:14:52 GMT):
theres so much going on in the peer logs, hard to know whats normal and what needs to be addressed
Antimttr (Tue, 03 Mar 2020 20:15:53 GMT):
also seems like the peers are grabbing these ips that the host box is bound to but they're for internal use only, like in the 172.x.x.x network and it makes it so i have no idea which peer is on which ip address
ownspies (Tue, 03 Mar 2020 20:16:03 GMT):
I use the defaults for signer
ownspies (Tue, 03 Mar 2020 20:16:09 GMT):
```fabric-ca-client register -d \
-u ${PROTO}://$CA_ADMIN:$CA_PASSWORD@$SERVICE_DNS \
-M "${ORG_PATH}/msp" \
--id.name peer-0${PEERID}.${ORGID}.${DOMAIN_SUFFIX} \
--id.secret ${ORGID}-peer-0${PEERID}_pw \
--id.type peer```
ownspies (Tue, 03 Mar 2020 20:16:09 GMT):
```fabric-ca-client register -d \
-u ${PROTO}://$CA_ADMIN:$CA_PASSWORD@$SERVICE_DNS \
-M "${ORG_PATH}/msp" \
--id.name peer-0${PEERID}.${ORGID}.${DOMAIN_SUFFIX} \
--id.secret XXXXX \
--id.type peer```
Antimttr (Tue, 03 Mar 2020 20:16:15 GMT):
im thinking about just specifying a binding ip address
Antimttr (Tue, 03 Mar 2020 20:16:38 GMT):
so you dont use the -m flag at all
Antimttr (Tue, 03 Mar 2020 20:16:54 GMT):
in your SAN in the certificate do you have the hostname of the box used to run fabric-ca-client?
Antimttr (Tue, 03 Mar 2020 20:17:07 GMT):
i checked and thats what's in my SAN for all my generated certificates
ownspies (Tue, 03 Mar 2020 20:17:18 GMT):
for the TLS cert, I'm setting the SAN and the CN to the same
Antimttr (Tue, 03 Mar 2020 20:17:48 GMT):
and you're dealing with dns hostnames that actually resolve i take it?
Antimttr (Tue, 03 Mar 2020 20:17:52 GMT):
im still dealing with example.com
ownspies (Tue, 03 Mar 2020 20:17:57 GMT):
``` X509v3 extensions:
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Subject Key Identifier:
9F:95:50:7C:20:DB:DD:67:97:E8:CD:5C:FD:71:54:69:29:15:A3:EC
X509v3 Authority Key Identifier:
keyid:4D:1C:22:6C:33:83:3E:92:D3:D2:C1:F3:93:65:C6:CC:C2:68:E7:33
Authority Information Access:
CA Issuers - URI:https://vault.sit.example.net/v1/tls/ca
X509v3 Subject Alternative Name:
DNS:peer-01.core.sit.example.net
X509v3 CRL Distribution Points:
Full Name:
URI:https://vault.sit.example.net/v1/tls/crl
```
ownspies (Tue, 03 Mar 2020 20:18:16 GMT):
``` Subject: C=US, ST=Ohio, L=Cleveland, O=CHAMPtitles, OU=IT Operations, CN=peer-01.core.sit.example.net
```
ownspies (Tue, 03 Mar 2020 20:18:16 GMT):
``` Subject: C=US, ST=Ohio, L=Cleveland, O=MyOrg, OU=IT Operations, CN=peer-01.core.sit.example.net
```
Antimttr (Tue, 03 Mar 2020 20:18:48 GMT):
and so what address does your gossip try and go through?
Antimttr (Tue, 03 Mar 2020 20:18:55 GMT):
does it resolve that hostname?
ownspies (Tue, 03 Mar 2020 20:18:59 GMT):
peer-01.core.sit.example.net
ownspies (Tue, 03 Mar 2020 20:19:02 GMT):
which is a load balancer
ownspies (Tue, 03 Mar 2020 20:19:14 GMT):
using TCP not HTTP/HTTPS/GPC load balancing
ownspies (Tue, 03 Mar 2020 20:19:41 GMT):
So it is LB -> K8S Service (KubeProxy) -> K8S POD
Antimttr (Tue, 03 Mar 2020 20:19:43 GMT):
so you have that hostname mapped to an ip address in the box hosting the docker containers?
Antimttr (Tue, 03 Mar 2020 20:19:46 GMT):
oh you're doing k8
ownspies (Tue, 03 Mar 2020 20:19:52 GMT):
yeah and use DNS to resolve
ownspies (Tue, 03 Mar 2020 20:20:05 GMT):
so DNS points to LB, it is updated automatically using external-dns for K8S
ownspies (Tue, 03 Mar 2020 20:20:27 GMT):
the advertised gossip address is that hostname, peer-01.sit.example.net
ownspies (Tue, 03 Mar 2020 20:20:27 GMT):
the advertised gossip address is that hostname, peer-01.sit.example.net:7051
ownspies (Tue, 03 Mar 2020 20:20:43 GMT):
Port Number may be wrong, going from mem
Antimttr (Tue, 03 Mar 2020 20:20:52 GMT):
interesting
Antimttr (Tue, 03 Mar 2020 20:21:01 GMT):
i wonder if theres some way to specify hostnames in the docker container
Antimttr (Tue, 03 Mar 2020 20:21:06 GMT):
i guess a hosts file
ownspies (Tue, 03 Mar 2020 20:21:12 GMT):
K8S automatically registers the nodes / target ports with the LB
ownspies (Tue, 03 Mar 2020 20:21:24 GMT):
you can use something, just a sec
ownspies (Tue, 03 Mar 2020 20:22:00 GMT):
https://docs.docker.com/compose/compose-file/#extra_hosts
ownspies (Tue, 03 Mar 2020 20:22:14 GMT):
you also can use the `link` option to specify a host alias
ownspies (Tue, 03 Mar 2020 20:22:31 GMT):
https://docs.docker.com/compose/compose-file/#links
ownspies (Tue, 03 Mar 2020 20:22:34 GMT):
use something like
ownspies (Tue, 03 Mar 2020 20:22:40 GMT):
```
peer:
```
ownspies (Tue, 03 Mar 2020 20:22:40 GMT):
```
peer:
links:
- orderer:orderer-01.dev.example.net
- peer-01:peer-01.dev.example.net
```
ownspies (Tue, 03 Mar 2020 20:23:24 GMT):
the left side of the colon is the service name as defined in the docker-compose, the right side is the new alias
ownspies (Tue, 03 Mar 2020 20:23:48 GMT):
this is what you use to reference other services in Docker because typically addresses are assigned dynamically, not statically
Antimttr (Tue, 03 Mar 2020 20:23:51 GMT):
ahh
Antimttr (Tue, 03 Mar 2020 20:23:52 GMT):
interesting
ownspies (Tue, 03 Mar 2020 20:24:02 GMT):
if you use static addresses in Docker, then you can use the extra_hosts option
Antimttr (Tue, 03 Mar 2020 20:24:16 GMT):
i might just do that
Antimttr (Tue, 03 Mar 2020 20:24:23 GMT):
i just want them all using the same ip address
Antimttr (Tue, 03 Mar 2020 20:24:39 GMT):
but then map that to different external hostnames
ownspies (Tue, 03 Mar 2020 20:25:29 GMT):
same IP inside docker or on the host OS ?
Antimttr (Tue, 03 Mar 2020 20:25:40 GMT):
well its the hostOS's main ip adress
ownspies (Tue, 03 Mar 2020 20:26:04 GMT):
also, for the signer certs
Antimttr (Tue, 03 Mar 2020 20:26:05 GMT):
and they all listen on it, but they seem to be trying to use their CN's to connect to eachother
Antimttr (Tue, 03 Mar 2020 20:26:34 GMT):
yeah i could add it as CSR/SAN to the signer certs
ownspies (Tue, 03 Mar 2020 20:26:49 GMT):
```
Subject: C=US, ST=Ohio, L=Cleveland, O=MyOrg, OU=peer, CN=peer-01.core.sit.example.net
...
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
9A:81:74:2D:2F:9C:55:33:F5:38:51:CF:7E:BC:D1:61:35:E2:B7:B6
X509v3 Authority Key Identifier:
keyid:09:35:72:FC:A6:5F:E0:2D:BD:7F:B2:70:4D:EB:D5:F0:6F:0C:7B:49
X509v3 Subject Alternative Name:
DNS:localhost, DNS:peer-01.core.sit.exampl.net, DNS:peer-01, DNS:peer-01.core, DNS:peer-01.core.dev
1.2.3.4.5.6.7.8.1:
{"attrs":{"hf.Affiliation":"","hf.EnrollmentID":"peer-01.core.sit.example.net","hf.Type":"peer"}}
```
Antimttr (Tue, 03 Mar 2020 20:26:49 GMT):
not sure which one it needs so ill do both
Antimttr (Tue, 03 Mar 2020 20:27:38 GMT):
its like the CSR stuff doesnt even show up in the cert
Antimttr (Tue, 03 Mar 2020 20:27:47 GMT):
is that something that just lives on fabric-ca-server db?
ownspies (Tue, 03 Mar 2020 20:28:40 GMT):
I specify custom ones
ownspies (Tue, 03 Mar 2020 20:28:45 GMT):
values for the SAN I mean
Antimttr (Tue, 03 Mar 2020 20:29:04 GMT):
yeah, im going to need to start doing that
Antimttr (Tue, 03 Mar 2020 20:29:23 GMT):
i mistakenly thought putting in ip into the CSR would put it into the SAN
ownspies (Tue, 03 Mar 2020 20:31:00 GMT):
I do set a custom CA config file
ownspies (Tue, 03 Mar 2020 20:31:08 GMT):
``` hosts:
- localhost
# K8S Service
- {{ include "hlf-ca.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
{{- if .Values.ingress.hosts }}
# Ingresses
{{- range .Values.ingress.hosts }}
- {{ . }}
{{- end }}
{{- end }}
```
ownspies (Tue, 03 Mar 2020 20:31:57 GMT):
actually, that's the CA, I need to get the peer config
ownspies (Tue, 03 Mar 2020 20:33:22 GMT):
I do set it somewhere when I register the peer, but I can't remember where I set it
ownspies (Tue, 03 Mar 2020 20:34:38 GMT):
if you need me to find that, let me know
Antimttr (Tue, 03 Mar 2020 20:34:53 GMT):
im not really sure what thats doing
Antimttr (Tue, 03 Mar 2020 20:35:05 GMT):
i mean i see it includes a new property
Antimttr (Tue, 03 Mar 2020 20:35:07 GMT):
to the certificate
Antimttr (Tue, 03 Mar 2020 20:35:26 GMT):
i havent read about those properties much yet
ownspies (Tue, 03 Mar 2020 20:35:30 GMT):
it's just Go template
ownspies (Tue, 03 Mar 2020 20:35:37 GMT):
it's just specifying the host names to use when creating a CSR
ownspies (Tue, 03 Mar 2020 20:35:37 GMT):
it's just specifying the host names to use for the SAN component when creating a CSR
ownspies (Tue, 03 Mar 2020 20:36:13 GMT):
so it includes 'localhost', the Kubernetes DNS name (that is the .svc.cluster.local part), and any hostnames assigned to the ingress
Antimttr (Tue, 03 Mar 2020 20:36:20 GMT):
so that makes it so you dont have to use the -m flag when you call fabric-ca-client ?
ownspies (Tue, 03 Mar 2020 20:36:30 GMT):
I *think* that is what I was doing
Antimttr (Tue, 03 Mar 2020 20:38:46 GMT):
did you already know k8 before you started your hlf project?
Antimttr (Tue, 03 Mar 2020 20:39:05 GMT):
im wondering if i should just bite the bullet and use k8 instead of docker-compose
ownspies (Tue, 03 Mar 2020 20:40:16 GMT):
no, learned it as I went
ownspies (Tue, 03 Mar 2020 20:40:22 GMT):
K8S and Helm charts
ownspies (Tue, 03 Mar 2020 20:40:34 GMT):
I didn't learn the install part, I'm using AWS EKS
ownspies (Tue, 03 Mar 2020 20:40:39 GMT):
but could easily be GCE
ownspies (Tue, 03 Mar 2020 20:40:57 GMT):
nice thing about K8S is portability (as much as anything can be portable)
theDweeb (Wed, 04 Mar 2020 02:40:04 GMT):
Has joined the channel.
theDweeb (Wed, 04 Mar 2020 02:40:04 GMT):
Hey so I cloned the fabric-gateway-java and ran mvn install but I keep running into this error within the orderer.exampled.com container:
[channel testchainid] config requires unsupported channel capabilities: Channel capability V2_0 is required but not supported: Channel capability V2_0 is required but not supported
theDweeb (Wed, 04 Mar 2020 02:40:54 GMT):
I cleared all docker images prior and tried changing the capability version in confitx.yaml but still error, the orderer container closes immediately
theDweeb (Wed, 04 Mar 2020 15:24:52 GMT):
nvm I fixed it. The the script that pulls the images must be incorrect, I used the latest curl command from readingthedocs and it worked.
mauricio (Wed, 04 Mar 2020 16:58:35 GMT):
Hi, I'm getting an error trying to send a transaction (fabcar) with fabric-java-gateway, I don't know what this error means, if I run the fabcar sample for Node.js it works but with Java/Scala doesn't
`ContractException: No valid proposal responses received. 4 peer error responses: Channel
Channel{id: 1, name: mychannel} Sending proposal with transaction:
ae2e7946864382bee521d0c3eff2e347bf9e3fb2c586c6c87032633298392ee3 to Peer{ id: 13, name:
peer0.org2.example.com:9051, channelName: mychannel, url: grpcs://peer0.org2.example.com:9051, mspid: Org2MSP}
failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Unable to resolve host
peer0.org2.example.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: peer0.org2.example.com:
nodename nor servname provided, or not known`
mauricio (Wed, 04 Mar 2020 16:58:35 GMT):
Hi, I'm getting an error trying to send a transaction (fabcar) with fabric-java-gateway, I don't know what this error means, if I run the fabcar sample for Node.js it works but with Java/Scala doesn't
```ContractException: No valid proposal responses received. 4 peer error responses: Channel
Channel{id: 1, name: mychannel} Sending proposal with transaction:
ae2e7946864382bee521d0c3eff2e347bf9e3fb2c586c6c87032633298392ee3 to Peer{ id: 13, name:
peer0.org2.example.com:9051, channelName: mychannel, url: grpcs://peer0.org2.example.com:9051, mspid: Org2MSP}
failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Unable to resolve host
peer0.org2.example.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: peer0.org2.example.com:
nodename nor servname provided, or not known```
braduf (Wed, 04 Mar 2020 18:00:07 GMT):
Has joined the channel.
aatkddny (Wed, 04 Mar 2020 18:44:58 GMT):
fabric-gateway - is this still the only way to override the max message size?
```
p.put("grpc.NettyChannelBuilderOption.maxInboundMessageSize", grpcMaxInboundMessageSize);
p.put("grpc.NettyChannelBuilderOption_maxInboundMessageSize", grpcMaxInboundMessageSize);
```
Antimttr (Wed, 04 Mar 2020 19:06:16 GMT):
there is one option about max message size in the orderer section of the configtx.yaml
Antimttr (Wed, 04 Mar 2020 19:06:22 GMT):
so it would be a per channel option
Antimttr (Wed, 04 Mar 2020 19:06:46 GMT):
```
# Batch Size: Controls the number of messages batched into a block
BatchSize:
# Max Message Count: The maximum number of messages to permit in a batch
MaxMessageCount: 10
# Absolute Max Bytes: The absolute maximum number of bytes allowed for
# the serialized messages in a batch.
AbsoluteMaxBytes: 98 MB
# Preferred Max Bytes: The preferred maximum number of bytes allowed for
# the serialized messages in a batch. A message larger than the preferred
# max bytes will result in a batch larger than preferred max bytes.
PreferredMaxBytes: 512 KB
```
aatkddny (Thu, 05 Mar 2020 00:27:30 GMT):
sigh.
aatkddny (Thu, 05 Mar 2020 00:27:30 GMT):
sigh. the netty max for grpc communications. this has nothing to do with configtx.
aatkddny (Thu, 05 Mar 2020 00:27:30 GMT):
sigh. the netty max for grpc communications. this has nothing to do with configtx. it's an override property passed in through a network config Property for each of the peers and orderers.
Antimttr (Thu, 05 Mar 2020 01:58:14 GMT):
ahh so its an sdk level setting
Antimttr (Thu, 05 Mar 2020 01:58:16 GMT):
gotcha
bestbeforetoday (Thu, 05 Mar 2020 09:58:04 GMT):
I guess your peers are running in local Docker containers so your client will need to resolve them as _localhost_ rather than _peer1.org2.example.com_. If you set an environment variable `org.hyperledger.fabric.sdk.service_discovery.as_localhost` to `true`, this should coerce the SDK to resolve discovered nodes to localhost instead of using their advertised host name
mauricio (Thu, 05 Mar 2020 11:41:23 GMT):
Hi, @bestbeforetoday I already tried that but I'm getting the same error :/
I'm setting `ORG_HYPERLEDGER_FABRIC_SDK_SERVICE_DISCOVERY_AS_LOCALHOST=true` in my ~/.zshrc
mauricio (Thu, 05 Mar 2020 12:48:48 GMT):
I set the `peer1.org2.example.com` to 127.0.0.1 in the `/etc/hosts` and it works, thanks @bestbeforetoday
mauricio (Thu, 05 Mar 2020 12:50:12 GMT):
Do you know why my querys are taking so long in executing, around 11seconds, and the querys are caching and aren't retrieving the last information.
mauricio (Thu, 05 Mar 2020 12:50:12 GMT):
Do you know why my querys are taking so long to execute, around 11seconds, and the querys are caching and aren't retrieving the last information.
bestbeforetoday (Thu, 05 Mar 2020 13:08:49 GMT):
Glad you got that sorted. The environment variable dictates how it SDK handles nodes obtained through service discovery. I guess you had your peers listed in your connection profile, in which case you just need to make sure they resolve, and adding those entries to /etc/hosts is the way I do it
bestbeforetoday (Thu, 05 Mar 2020 13:09:19 GMT):
I don't know what would be causing your queries to be so slow, or why they would be cached. The SDK doesn't cache any results
dan13 (Thu, 05 Mar 2020 13:59:52 GMT):
Have you confirmed that the block has committed to the peer you are querying?
aatkddny (Thu, 05 Mar 2020 18:07:09 GMT):
ok so after a detour through fabric-orderer i'm back to the sdk.
or more accurately fabric-gateway.
it used to be that you could set an override in the properties for each of the peers and orderers to allow a message larger than the default max for netty (which the sdk delegates to for grpc) to be used.
we used it successfully for quite some time.
then we switched to fabric-gateway.
we create a network config with the same parameters (and can see it changes the netty default) but we still can't do anything with a message that *grows* bigger than the default max as a result of the chaincode execution.
so my question is simple - has anyone managed to put a message larger than the 4M (or so) default limit?
if so, how?
Antimttr (Thu, 05 Mar 2020 21:32:57 GMT):
I'm trying to instantiate chaincode on mychannel using the Java sdk, and im calling channel.sendInstantiationProposal(), to my set of peers, I get all proposal responses back failed, however they dont have anything in their message so im kind of at a loss as to how to trouble shoot this, has anyone ever gotten back failed proposal responses with no message?
Antimttr (Thu, 05 Mar 2020 21:54:10 GMT):
so i just enumerated all the messages not just the first one
Antimttr (Thu, 05 Mar 2020 21:54:33 GMT):
now the message for sending the transaction to my first peer on org 1 is still empty, but all the other peers (i sent out 3 proposals) failed due to timeout
Antimttr (Fri, 06 Mar 2020 04:02:09 GMT):
lscc
Jelle.Diet (Fri, 06 Mar 2020 08:26:26 GMT):
can you not look in the logs of the peers themselves?
Antimttr (Fri, 06 Mar 2020 16:29:10 GMT):
hey jelle, i was able to find something in the logs but im not really sure what it means
Antimttr (Fri, 06 Mar 2020 16:29:24 GMT):
`HandleGetState -\u003e DEBU 801cb\u001b[0m [9159c9aa] No state associated with key: mcttrade. Sending RESPONSE with an empty payload\n","stream":"stderr","time":"2020-03-05T22:48:43.709296106Z"}`
obelix (Sun, 08 Mar 2020 14:51:42 GMT):
Has joined the channel.
jital (Mon, 09 Mar 2020 18:31:09 GMT):
Has joined the channel.
jital (Fri, 13 Mar 2020 09:03:01 GMT):
has anyone worked on using the java sdk for android. seems like there are few changes we need to do in sdk itself
jital (Fri, 13 Mar 2020 09:03:01 GMT):
has anyone worked on using the java sdk for android? seems like there are few changes we need to do in sdk itself
mauricio (Mon, 16 Mar 2020 14:38:48 GMT):
Hi, I'm trying to connect fabric-sdk-gateway with my chaincode but I'm getting an error.
```
Execution exception[[GatewayRuntimeException: org.hyperledger.fabric.sdk.exception.ProposalException: org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel qr failed with peer peer0.myorg.com.co. Status FAILURE, details: Channel Channel{id: 1, name: qr} Sending proposal with transaction: cfec84412ab29e66e60f7a12b3652c37ea9b4cbc6fa931ae9510f0ed126aa8ba to Peer{ id: 3, name: peer0.myorg.com.co, channelName: qr, url: grpcs://peer0.myorg.com.co:10051, mspid: MyOrg} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0], cause=javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
...
Caused by: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
```
bestbeforetoday (Tue, 17 Mar 2020 09:58:28 GMT):
Kinda looks like the peer ceritificate isn't signed by a CA that is trusted by your client
mahoney1 (Thu, 19 Mar 2020 11:00:25 GMT):
reminder that the Fabric Application Developer Community call today is at 4pm UTC (4pm UK, 12noon ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Meeting+Agendas:+Fabric+Application+Developer+Community+Call
mahoney1 (Thu, 19 Mar 2020 11:00:25 GMT):
reminder that the Fabric Application Developer Community call today is at 4pm UTC (4pm UK, 12noon ET, 9am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Agendas%3A+Fabric+Application+Developer+Community+Call+Meetings
skoret (Thu, 19 Mar 2020 12:57:43 GMT):
Has joined the channel.
Hana_Ch (Thu, 19 Mar 2020 14:40:17 GMT):
Has joined the channel.
Hana_Ch (Thu, 19 Mar 2020 14:40:18 GMT):
Hello Hyperledger Community .... i am running a problem those days on how to do the discovery of peers and orderers existant in the network with sdk with the same way done with the discovere command of the CLI .... does someone have an idea on howa to do so ... i want to list all existant peers available to sign and validate a transaction , in addition , i want to select a random peer ... i saw that we should configure a discovere peer on sdk in order to initalise the channel with the we use the channel command " sendTransactionProposalToEndorsers" . but this method returns always a nullpointer exception ... I need that answer as soon as possible please ... and thanks
Hana_Ch (Mon, 23 Mar 2020 09:25:31 GMT):
does anyone have a response to this issue please
Hana_Ch (Mon, 23 Mar 2020 11:04:52 GMT):
Hello , when i want to do a network discovery with this channel method : Collection
Hana_Ch (Mon, 23 Mar 2020 11:04:52 GMT):
Hello , when i want to do a network discovery with this channel method : Collection
Hana_Ch (Mon, 23 Mar 2020 13:52:32 GMT):
Hello ... how can we replace this cli command in sdk please :
discover --peerTLSCA tls/ca.crt --userKey msp/keystore/fa65ea6028ce47de4163fb37b5f21529f657d978cd669337248dbfe00a7f74ee_sk --userCert msp/signcerts/Admin@org1.example.com-cert.pem --MSP Org1MSP --tlsCert tls/client.crt --tlsKey tls/client.key peers --server peer0.org1.example.com:7051
aberwag (Tue, 24 Mar 2020 08:08:28 GMT):
Has joined the channel.
Francesco_P (Wed, 25 Mar 2020 11:44:24 GMT):
Has joined the channel.
Francesco_P (Wed, 25 Mar 2020 11:44:25 GMT):
Hi, I'm using the java org.hyperledger.fabric_ca.sdk package to enroll the admin user but when i try to connect the connection goes times out. Below some snippets - HFCAClient caClient = HFCAClient.createNewInstance("http://{IP}:{port}", props); and then final EnrollmentRequest enrollmentRequestTLS = new EnrollmentRequest();-and then- enrollmentRequestTLS.addHost("{IP}"); - and then - Enrollment enrollment = caClient.enroll("admin", "adminpw", enrollmentRequestTLS)
Francesco_P (Wed, 25 Mar 2020 11:44:50 GMT):
how can I fix?
Hana_Ch (Tue, 31 Mar 2020 07:58:50 GMT):
Hello, I have a question please, I want to select a random ordered to send a normal e transaction, I configured a service discovery with one peer with a discovery rule. I had one ordered in my config file and I add it to the channel.... but after adding the discovery, I tried to delete the order and I saw that it doesn't cause problems and the transaction passed normally, and while checking logs, the order of my hyperledger is known.. so I want to know is this a normal behaviour and when I add many orderers, did it know them all and the transaction is sent normally?
qubing (Wed, 01 Apr 2020 05:54:49 GMT):
Any fabric-gateway guys here? I am trying version 2.0 of gateway, found a bit different with 1.4. There is no method to get cert and key in the Identity got from wallet. There was Identity.getCertificates() and Identity.getPrivateKey() in the old version. How can I do now? Thanks.
bestbeforetoday (Wed, 01 Apr 2020 08:03:35 GMT):
Although the Wallet returns an Identity object, it will actually be an X509Identity, which has methods to get the Certificate and PrivateKey objects for the identity: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/X509Identity.html
bestbeforetoday (Wed, 01 Apr 2020 08:05:53 GMT):
Also look at the Identities class for utility methods for translating Certificate and PrivateKey objects to/from PEM strings: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Identities.html
bestbeforetoday (Wed, 01 Apr 2020 08:09:10 GMT):
The reason the Wallet returns the base Identity type is we hope to get other identity types supported (for example HSM-managed identities) that do not necessarily have a Certificate and PrivateKey
bestbeforetoday (Wed, 01 Apr 2020 08:12:24 GMT):
Would it be helpful to avoid your client code having to cast the Identity if the wallet had an overload of the get method something like:
bestbeforetoday (Wed, 01 Apr 2020 08:12:24 GMT):
Would it be helpful to avoid your client code having to cast the Identity if the wallet had an overload of the get method something like:
```
bestbeforetoday (Wed, 01 Apr 2020 08:17:20 GMT):
Then you would call: ```
X509Identity identity = wallet.get(“username”, X509Identity.class);
```
qubing (Wed, 01 Apr 2020 09:51:32 GMT):
I got it. Under your strong support, I successfully upgraded my application program to new version. Thank you so much. Because the main difference between 1.4 and 2.0 in SDK is wallet management, I suggest to provive more samples or test case around it. It will be helpful for developers.:beers:
mahoney1 (Thu, 02 Apr 2020 11:11:12 GMT):
reminder that the Fabric Application Developer Community call today is at 4pm UTC (4pm UK, 11am ET, 8am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Agendas:+Fabric+Application+Developer+Community+Call+Meetings
mahoney1 (Thu, 02 Apr 2020 11:11:12 GMT):
reminder that the Fabric Application Developer Community call today is at 3pm UTC (4pm UK, 11am ET, 8am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Agendas:+Fabric+Application+Developer+Community+Call+Meetings
theDweeb (Thu, 02 Apr 2020 12:44:23 GMT):
I just started using fabric-gateway-java coming from using the nodejs sdk. First thing I noticed is that the CLI container is generating everything instead of having the binaries downloaded on local machine (i.e. like test-network). Which approach is best practices? Is the CLI just for testing?
braduf (Thu, 02 Apr 2020 20:28:06 GMT):
Hi, does anybody know how to set mutual TLS for the Java SDK / Gateway, please?
I can't find anything about it.
Thanks in advance!
Bolzo 1 (Fri, 03 Apr 2020 14:31:13 GMT):
Hi, I'm trying to understand if it possible to get certificate of an already enrolled user from Fabric CA through the SDK. The idea is to avoid storing all certificates on the server which is running the sdk and get the user certificate from the CA when the user needs to call a chaincode. It is possible?
Bolzo 1 (Fri, 03 Apr 2020 14:31:13 GMT):
Hi, I'm trying to understand if it's possible to get certificate of an already enrolled user from Fabric CA through the SDK. The idea is to avoid storing all certificates on the server which is running the sdk and get the user certificate from the CA when the user needs to call a chaincode. It is possible?
theDweeb (Sat, 04 Apr 2020 19:20:56 GMT):
Can anyone help, I am trying to install the fabric-gateway-java maven dependencies for 2.0.0 but they are not being installed / I cannot import the org.hyperledger.fabric.gateway packages. The fabcar example uses 1.4.1 and that works, but for some reason the 2.0.0 are not.
francoisch (Mon, 06 Apr 2020 14:59:29 GMT):
Has joined the channel.
nitishbhardwaj19 (Mon, 06 Apr 2020 16:58:49 GMT):
Hi, I noticed that known limitation of not supporting HSM is removed from the latest README section. Is it resolved in the latest version 2.0 of sdk ?
Bolzo 1 (Tue, 07 Apr 2020 08:32:22 GMT):
I'm trying to connect to my remote fabric CA using this code:
```
Properties properties = new Properties();
properties.setProperty("pemFile", prop.getProperty("caCert"));
HFCAClient hfcaClient = HFCAClient.createNewInstance("org2-ca", "https://myca.org.com:7152", properties);
hfcaClient.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
```
The address is mapped in my hosts file, and the certificate of the CA has `Subject Alternative Name` set to `myca.org.com` but i get the following error:
```
javax.net.ssl.SSLPeerUnverifiedException: Certificate for
Bolzo 1 (Tue, 07 Apr 2020 08:38:43 GMT):
I've run ` echo -n | openssl s_client -connect localhost:7152 -servername myca.org.com 2>/dev/null` and I can see that the cert returned is not the ca-cert.pem which I use to create the CA...
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network: ```
```` gateway.getNetwork("mychannel");` ```
``` The error I have is ```
``` _`Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key`'_```
Could you give me some help? thank you
```
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network: ```
```` gateway.getNetwork("mychannel");` ```
The error I have is
``` _`Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key`'_```
Could you give me some help? thank you
```
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network: ```
gateway.getNetwork("mychannel");
The error I have is
``` _`Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key`'_```
Could you give me some help? thank you
```
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network: ```
gateway.getNetwork("mychannel");
``` _`Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key`'_```
Could you give me some help? thank you
```
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network: ```
gateway.getNetwork("mychannel");
Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key
Could you give me some help? thank you
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
gateway.getNetwork("mychannel");
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");````
```
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");````
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");`
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");````
the error is```
Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key
Could you give me some help? thank you
```
```
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");````
``` ```
the error is```
Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key
Could you give me some help? thank you
```
```
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");````
```
the error is```
Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key
Could you give me some help? thank you
```
```
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");````
```
the error is```
Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key```
```
Could you give me some help? thank you
```
```
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");````
```
the error is```
Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key```
```
Could you give me some help? thank you
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");````
```
the error is```
Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key```
Could you give me some help? thank you
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");````
the error is```
Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key```
Could you give me some help? thank you
Francesco_P (Wed, 08 Apr 2020 11:08:31 GMT):
Hi, I have an error when I get the network:
` gateway.getNetwork("mychannel");`
the error is```
Endpoint grpcs://x.x.x.x:7051, exception 'javax.net.ssl.SSLException: failed to set certificate and key```
Could you give me some help? thank you
bestbeforetoday (Wed, 08 Apr 2020 13:49:25 GMT):
I believe some people have successfully used HSM with the fabric-gateway-java SDK (which is built on the Java SDK), but there is not yet explicit support for an HSM identity in the wallets. See this Jira for details: https://jira.hyperledger.org/browse/FGJ-79
nitishbhardwaj19 (Wed, 08 Apr 2020 13:53:40 GMT):
wow that's a great news. Thanks for sharing this.
Francesco_P (Fri, 10 Apr 2020 10:02:55 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=WZHLyt65Ywgu9HuFs) So is there anyone who helps me?
nitishbhardwaj19 (Fri, 10 Apr 2020 10:57:28 GMT):
Please ensure that you are using host name in URL. If the host is not public, add host entries to your host file.
jorgedr (Fri, 10 Apr 2020 18:25:51 GMT):
Has joined the channel.
jorgedr (Fri, 10 Apr 2020 18:25:52 GMT):
Hey guys, quick question is the Java SDK thread safe? Can I reuse the same Gateway instance to serve concurrent REST API requests for the same user?
jorgedr (Fri, 10 Apr 2020 18:27:56 GMT):
I found this link that says it is https://awesomeopensource.com/project/hyperledger/fabric-sdk-java but since it is not straight from the HLF documentation I wanted to double check.
jital (Mon, 13 Apr 2020 05:24:57 GMT):
I see that endorsing peers if set is only used while submitting transaction, if i want to evaluate a transaction on a specific peer (not from my organisation) is there a way to do it?
```
org.hyperledger.fabric.gateway.impl.TransactionImpl#submit
public byte[] submit(final String... args) throws ContractException, TimeoutException, InterruptedException {
Collection
jital (Mon, 13 Apr 2020 05:24:57 GMT):
I see that endorsing peers if set is only used while submitting transaction, if i want to evaluate a transaction on a specific peer (not from my organisation) is there a way to do it?
```
org.hyperledger.fabric.gateway.impl.TransactionImpl#submit
public byte[] submit(final String... args) throws ContractException, TimeoutException, InterruptedException {
Collection
Paradox-AT (Mon, 13 Apr 2020 10:24:39 GMT):
you can use `createTransaction' instead of 'submitTransaction'. After creating a transaction set the endorsing peers and then do transaction.submit(..args)
jaraujo (Wed, 15 Apr 2020 16:54:24 GMT):
Has joined the channel.
jaraujo (Wed, 15 Apr 2020 18:26:50 GMT):
Hi guys! I've tried several times deploying a Java Contract using Fabric 2.0.1 but every time I commit the chaincode, Fabric can't instantiate a dev-peer. It's just a simple chaincode that implements ContractInterface. Does anyone know what could it be? I'm using Maven as a dependency tool
rthatcher (Thu, 16 Apr 2020 14:52:53 GMT):
reminder that the Fabric Application Developer Community call today is at 3pm UTC (4pm UK, 11am ET, 8am PT) today - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Agendas:+Fabric+Application+Developer+Community+Call+Meetings
Purbaja (Thu, 16 Apr 2020 21:28:46 GMT):
Hi Guys, while using fabric-sdk-java I am getting below exception in submit transaction
Caused by: org.hyperledger.fabric.sdk.exception.ServiceDiscoveryException: Failed to find any endorsers for chaincode nccep. See logs for details
at org.hyperledger.fabric.sdk.ServiceDiscovery.discoverEndorserEndpoint(ServiceDiscovery.java:95)
at org.hyperledger.fabric.sdk.Channel.sendTransactionProposalToEndorsers(Channel.java:3995)
at org.hyperledger.fabric.gateway.impl.TransactionImpl.sendTransactionProposal(TransactionImpl.java:155)
at org.hyperledger.fabric.gateway.impl.TransactionImpl.submit(TransactionImpl.java:91)
nvxtien (Fri, 17 Apr 2020 07:24:56 GMT):
Has joined the channel.
nvxtien (Fri, 17 Apr 2020 07:25:42 GMT):
Hi there,
nvxtien (Fri, 17 Apr 2020 07:26:06 GMT):
Is there any sample for using sdk 2.0?
nvxtien (Fri, 17 Apr 2020 07:26:16 GMT):
Thanks.
heatherp (Fri, 17 Apr 2020 15:01:51 GMT):
Yep, here: https://github.com/hyperledger/fabric-samples/tree/master/fabcar/java
karburator (Sat, 18 Apr 2020 00:18:10 GMT):
Has joined the channel.
braduf (Sat, 18 Apr 2020 03:57:51 GMT):
Hi all, is the feature to set endorsing orgs instead of endorsing peers being implemented in the Java SDK too?
It allready exists in the Node.js SDK and it is very handy when working with private data collections.
braduf (Sat, 18 Apr 2020 03:57:51 GMT):
Hi all, is the feature to set endorsing orgs instead of endorsing peers being implemented in the Java SDK too?
It allready exists in the Node.js SDK and it is very handy when working with private data collections.
https://jira.hyperledger.org/browse/FABN-1425
Does anyone has a status on it for the Java SDK, please?
braduf (Sat, 18 Apr 2020 04:15:36 GMT):
I didn't see it in the backlog, so I added it to Jira.
braduf (Sat, 18 Apr 2020 04:15:36 GMT):
I didn't see it in the backlog, so I added it to Jira: https://jira.hyperledger.org/browse/FGJ-83.
Does anyone wants to work on it together?
nvxtien (Sat, 18 Apr 2020 15:48:17 GMT):
Thanks @heatherp. But this is an example for java-gateway. I need one for java-sdk.
bestbeforetoday (Tue, 21 Apr 2020 08:20:02 GMT):
Yes, you can (and absolutely should!) use the same Gateway, Network or Contract instances for multiple requests from the same client identity
bestbeforetoday (Tue, 21 Apr 2020 08:29:27 GMT):
The peers used to evaluate (rather than submit) transactions is dictated by the query handler. The default will continue to use the first responsive peer it finds in the same organisation as the client identity. There is another default query handler implementation that will round-robin requests across all peers in the same organization as the client identity. You can also write your own query handler implementation if you want specific behaviour or to use specific peers. See here for details: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Gateway.Builder.html#queryHandler-org.hyperledger.fabric.gateway.spi.QueryHandlerFactory-
bestbeforetoday (Tue, 21 Apr 2020 08:32:24 GMT):
I would check the logs on the peer to see if there any clues there on what has gone wrong. Also try the #fabric-java-chaincode channel
knagware9 (Tue, 21 Apr 2020 10:38:06 GMT):
I think java-gateway is the new sdk2.0 for java
jorgedr (Tue, 21 Apr 2020 12:59:57 GMT):
Thank you @bestbeforetoday !
jaraujo (Tue, 21 Apr 2020 22:23:28 GMT):
I also think it is
Francesco_P (Wed, 22 Apr 2020 17:32:44 GMT):
Hi I'm trying to query ledger data with org.hyperledger.fabric.shim.ChaincodeStub getStateByPartialCompositeKey. But it gives me no results...always as there is no data but I know there is. How can i solve? Thank you
jital (Wed, 22 Apr 2020 17:43:11 GMT):
Thanks a lot !!! @bestbeforetoday This helps me out
jital (Wed, 22 Apr 2020 17:46:33 GMT):
java-gateway is the sdk and it includes java-sdk as a dependency in maven
jital (Wed, 22 Apr 2020 17:46:33 GMT):
java-gateway is the sdk and it includes java-sdk as a dependency in maven. You can check E2E tests. those helped me a lot hen i started
jital (Wed, 22 Apr 2020 17:51:08 GMT):
Can you share the params you are using while inserting and querying. may that might help us better. Other way is to try passing only the type and no args. to see if there actually is data. If you want you can query your backing statedb for keys
bestbeforetoday (Thu, 23 Apr 2020 08:25:49 GMT):
You might also want to ask on the #fabric-java-chaincode channel for smart contract implementation questions
Francesco_P (Thu, 23 Apr 2020 08:55:43 GMT):
I apologize. I didn't know. I will move the question on the right channel
bestbeforetoday (Thu, 23 Apr 2020 09:00:52 GMT):
Absolutely fine! You're just more likely to get a useful answer there :)
githubcpc (Mon, 27 Apr 2020 08:09:02 GMT):
@rickr Hi...Why fabric-sdk-java 2.0 TransactionRequest.java remove setChaincodePath method?
Paradox-AT (Mon, 27 Apr 2020 08:10:04 GMT):
Hey Guys,
I am facing issues with API connecting with multiple orderers for queries and transactions.
I have three orderers for our network. All the three orderers are on the same machine so we're using port forwarding for orderer1(8050:7050) and orderer2(9050:7050)
These are the orderer defaults in configtx.yml:
- Host: orderer0.example.com
Port: 7050
...
- Host: orderer1.example.com
Port: 7050
...
- Host: orderer2.example.com
Port: 7050
...
These are the orderer details in connection-profile.jon:
"orderers": {
"orderer0.example.com": {
"url": "grpcs://localhost:7050",
...
"grpcOptions": {
"hostnameOverride": "orderer0.example.com"
}
},
"orderer1.example.com": {
"url": "grpcs://localhost:8050",
...
"grpcOptions": {
"hostnameOverride": "orderer1.example.com"
}
},
"orderer2.example.com": {
"url": "grpcs://localhost:9050",
...
"grpcOptions": {
"hostnameOverride": "orderer2.example.com"
}
},
},
I am using NodeJS fabric gateway to create and do transactions on channels.
When the gateway configuration parameter "asLocalhost" is set to true all the queries and transactions are happening through orderer0. This becomes an issue if orderer0 goes down as the gateway doesn't automatically connect to the remaining orderers.
When the gateway configuration parameter "asLocalhost" is set to false the gateway has the information for all the three orderers unlike when asLocalhost is set to true, but all the channel orderers point to 7050 port instead of their respective ports. It looks like the orderers are being retrieved from consortium. Since we need to connect to orderer1 and orderer2 at 8050 and 9050 ports respectively the API is unable to connect to them at 7050 port.
Paradox-AT (Mon, 27 Apr 2020 08:10:04 GMT):
Hey Guys,
I am facing issues with API connecting with multiple orderers for queries and transactions.
I have three orderers for our network. All the three orderers are on the same machine so we're using port forwarding for orderer1(8050:7050) and orderer2(9050:7050)
These are the orderer defaults in configtx.yml:
``` - Host: orderer0.example.com
Port: 7050
...
- Host: orderer1.example.com
Port: 7050
...
- Host: orderer2.example.com
Port: 7050
...
These are the orderer details in connection-profile.jon:
"orderers": {
"orderer0.example.com": {
"url": "grpcs://localhost:7050",
...
"grpcOptions": {
"hostnameOverride": "orderer0.example.com"
}
},
"orderer1.example.com": {
"url": "grpcs://localhost:8050",
...
"grpcOptions": {
"hostnameOverride": "orderer1.example.com"
}
},
"orderer2.example.com": {
"url": "grpcs://localhost:9050",
...
"grpcOptions": {
"hostnameOverride": "orderer2.example.com"
}
},
},
I am using NodeJS fabric gateway to create and do transactions on channels.
When the gateway configuration parameter "asLocalhost" is set to true all the queries and transactions are happening through orderer0. This becomes an issue if orderer0 goes down as the gateway doesn't automatically connect to the remaining orderers.
When the gateway configuration parameter "asLocalhost" is set to false the gateway has the information for all the three orderers unlike when asLocalhost is set to true, but all the channel orderers point to 7050 port instead of their respective ports. It looks like the orderers are being retrieved from consortium. Since we need to connect to orderer1 and orderer2 at 8050 and 9050 ports respectively the API is unable to connect to them at 7050 port.
Paradox-AT (Mon, 27 Apr 2020 08:10:04 GMT):
Hey Guys,
I am facing issues with API connecting with multiple orderers for queries and transactions.
I have three orderers for our network. All the three orderers are on the same machine so we're using port forwarding for orderer1(8050:7050) and orderer2(9050:7050)
These are the orderer defaults in configtx.yml:
```
- Host: orderer0.example.com
Port: 7050
...
- Host: orderer1.example.com
Port: 7050
...
- Host: orderer2.example.com
Port: 7050
...
```
These are the orderer details in connection-profile.jon:
```
"orderers": {
"orderer0.example.com": {
"url": "grpcs://localhost:7050",
...
"grpcOptions": {
"hostnameOverride": "orderer0.example.com"
}
},
"orderer1.example.com": {
"url": "grpcs://localhost:8050",
...
"grpcOptions": {
"hostnameOverride": "orderer1.example.com"
}
},
"orderer2.example.com": {
"url": "grpcs://localhost:9050",
...
"grpcOptions": {
"hostnameOverride": "orderer2.example.com"
}
},
},
```
I am using NodeJS fabric gateway to create and do transactions on channels.
When the gateway configuration parameter "asLocalhost" is set to true all the queries and transactions are happening through orderer0. This becomes an issue if orderer0 goes down as the gateway doesn't automatically connect to the remaining orderers.
When the gateway configuration parameter "asLocalhost" is set to false the gateway has the information for all the three orderers unlike when asLocalhost is set to true, but all the channel orderers point to 7050 port instead of their respective ports. It looks like the orderers are being retrieved from consortium. Since we need to connect to orderer1 and orderer2 at 8050 and 9050 ports respectively the API is unable to connect to them at 7050 port.
aatkddny (Mon, 27 Apr 2020 15:05:03 GMT):
`NodeJS fabric gateway` You might get a more cogent answer in the js sdk channel. #fabric-sdk-node iirc.
nitishbhardwaj19 (Mon, 27 Apr 2020 16:34:58 GMT):
@bestbeforetoday Hope you are doing good. I just got to know that administrative capabilities would be discontinued from 2.1 version for Node SDK. Is there a plan to deprecate for JAVA sdk as well? I am sure there would be a big reason for this. If you don't mind, could you please share the thought process for this decision.
githubcpc (Tue, 28 Apr 2020 08:17:27 GMT):
@sykesm Hi,Can I install chaincode in fabric-sdk-java v2.0.0 without go modules?
sykesm (Tue, 28 Apr 2020 08:17:28 GMT):
Has joined the channel.
ShobhitSrivastava (Tue, 28 Apr 2020 09:52:24 GMT):
Hi All , I have one peer and orderer running on one server and my java-sdk is in my local system. I am not able to connect my peer from java-sdk when TLS is enabled, can anyone help me what all certificates is needed at sdk end. I generated the certificates via cryptogen tool.
ShobhitSrivastava (Tue, 28 Apr 2020 09:52:24 GMT):
Hi All , I have one peer and orderer running on one server and my java-sdk is in my local system. I am not able to connect my peer from java-sdk when TLS is enabled, can anyone help me what all certificates is needed at sdk end. I generated the certificates via cryptogen tool. Any link to further read on this.
ShobhitSrivastava (Tue, 28 Apr 2020 09:52:24 GMT):
Hi All , I have one peer and orderer running on one server and my java-sdk is in my local system. I am not able to connect my peer from java-sdk when TLS is enabled, can anyone help me what all certificates is needed at sdk end. I generated the certificates via cryptogen tool. Any link to further read on this. Adding @bestbeforetoday , may you please provide details on it?
bestbeforetoday (Tue, 28 Apr 2020 10:50:46 GMT):
The thinking across Fabric in general seems to be that administrative tasks should be performed using the admin command-line tools. Perhaps to ensure consistency with a single admin client implementation and to save re-implementing the same admin capability in all the language SDKs every time anything changes, which is quite a bit of work. When the internals of the Node SDK were re-written for v2.0 we didn't re-implement all the admin capability using the new internal structure. I don't know of any plan right now to remove the admin capability that is there in the Java SDK but I also don't currently expect it to get extended with any new admin features. I did hear some talk of chaincode lifecycle operations possibly being reimplemented in the Node SDK, either as an npm package (within the SDK repository) or as a sample (based on the _fabric-network_ API). I don't have any firm details or timescale for that work though
nitishbhardwaj19 (Tue, 28 Apr 2020 11:20:29 GMT):
Thanks for the details insight @bestbeforetoday this really helps. :)
ShobhitSrivastava (Wed, 29 Apr 2020 07:08:09 GMT):
@bestbeforetoday ..hi, can you provide a working java-sdk sample which has working sample code for connecting to a TLS network?
mahoney1 (Thu, 30 Apr 2020 12:23:25 GMT):
reminder that the Fabric Application Developer Community call today is at 3pm UTC (4pm UK, 11am ET, 8am PT) - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Agendas:+Fabric+Application+Developer+Community+Call+Meetings
lviggiano (Thu, 30 Apr 2020 14:44:54 GMT):
Has joined the channel.
nitishbhardwaj19 (Sat, 02 May 2020 06:41:24 GMT):
Hi, has anyone ever faced this error?
`java.lang.NoSuchMethodError: 'boolean org.bouncycastle.asn1.ASN1ObjectIdentifier.equals(org.bouncycastle.asn1.ASN1Primitive)'`
I am getting this while I am trying to enroll CA admin. HFCAClient has caURL, and name with empty properties. Am I missing some dependency?
nitishbhardwaj19 (Sat, 02 May 2020 06:43:18 GMT):
I get this exception in CryptoPrimitives at `ContentSigner signer = csBuilder.build(pair.getPrivate());` I am using 2.1 sdk
nitishbhardwaj19 (Sat, 02 May 2020 06:43:43 GMT):
pair has a key pair
nitishbhardwaj19 (Sat, 02 May 2020 06:53:36 GMT):
Not faced this in 1.4.x
nitishbhardwaj19 (Sat, 02 May 2020 09:58:59 GMT):
Fixed it. It was an issue with dependency conflict. I am using SpringBoot and it had some conflict with bouncycastle. Checked the exact version which is being used by java-sdk for bouncycastle i.e 1.63 and explicitly added it in my dependency
`compile 'org.bouncycastle:bcpkix-jdk15on:1.63'
compile 'org.bouncycastle:bcprov-jdk15on:1.63'`
nitishbhardwaj19 (Sat, 02 May 2020 09:58:59 GMT):
Fixed it. It was an issue with dependency conflict. I am using SpringBoot and it had some conflict with bouncycastle. Checked the exact version which is being used by java-sdk for bouncycastle i.e 1.63 and explicitly added it in my dependency
`compile 'org.bouncycastle:bcpkix-jdk15on:1.63`
compile 'org.bouncycastle:bcprov-jdk15on:1.63'`
nitishbhardwaj19 (Sat, 02 May 2020 09:58:59 GMT):
Fixed it. It was an issue with dependency conflict. I am using SpringBoot and it had some conflict with bouncycastle. Checked the exact version which is being used by java-sdk for bouncycastle i.e 1.63 and explicitly added it in my dependency
`compile 'org.bouncycastle:bcpkix-jdk15on:1.63`
`compile 'org.bouncycastle:bcprov-jdk15on:1.63`
Mms 11 (Tue, 05 May 2020 20:21:56 GMT):
Has joined the channel.
Mms 11 (Tue, 05 May 2020 20:29:54 GMT):
Can someone help me with a chaincode querying couchDb ?
When calling the CouchDB from a java chaincode for a rather not large data collection (150), the process of the result takes 50 seconds.
I can see that the ChaincodeInvocationTask.invoke got the response rather quick but when it is passed as a response that is taking a long time to process.
This class is created from the response, QueryResultsIteratorImpl in the InvocationStubImpl. Anyone had this when calling InvocationStubImplgetQueryResult
Mms 11 (Tue, 05 May 2020 20:30:27 GMT):
Is there some trick to handle the QueryResultsIteratorImpl to get access to the data without waiting so long ?
aatkddny (Wed, 06 May 2020 03:59:51 GMT):
So will there be any way to automate this or to script a more complex scenario?
Adding (say) a half dozen orgs and 20 channels when you stand up a new environment is not a trivial task. And we stand up and tear down environments more than you'd think.
It's fairly easy to automate using the SDK - we've been doing it for quite some time. I shudder to think of the time sink to do the same actions manually through a CLI.
bestbeforetoday (Wed, 06 May 2020 10:08:27 GMT):
I would try also posting this question on the #fabric-java-chaincode channel
bestbeforetoday (Wed, 06 May 2020 10:19:30 GMT):
Set up, configuration and chaincode deployment can all be automated using the CLI commands, either using scripting or launching the CLI commands from code. The SDK integration tests do this. I appreciate that it's a change if you already have the automation in place using the SDK though. The relevant parts of the Java SDK build are:
- https://github.com/hyperledger/fabric-gateway-java/blob/master/src/test/fixtures/generate.sh
- https://github.com/hyperledger/fabric-gateway-java/blob/67864d8316201ac96286ae8e7afb696ef6483c3e/src/test/java/scenario/ScenarioSteps.java#L113
- https://github.com/hyperledger/fabric-gateway-java/blob/67864d8316201ac96286ae8e7afb696ef6483c3e/src/test/java/scenario/ScenarioSteps.java#L203
bestbeforetoday (Wed, 06 May 2020 10:20:00 GMT):
I expect what's there today in the SDK is likely to remain at least for the 2.x release though
vramaiitkgp (Thu, 07 May 2020 16:31:33 GMT):
Has joined the channel.
vramaiitkgp (Thu, 07 May 2020 16:31:35 GMT):
Hi, I'm running a multi-channel multi-contract application, where the contracts make cross-contract as well as cross-channel invocations. I'm getting a weird error in one of my intermediate transactions where the proposal fails with the error `The proposal responses have 2 inconsistent groups with 0 that are invalid.`. Clearly, this indicates that though each proposal response (from an endorsing peer each) is valid, the two responses are not identical.
The problem is: when I look at the contract container logs, both containers that simulated the transaction show a successful run, exactly what I would have expected them to. Then where could the inconsistency have risen from? How would I go about debugging this?
An even weirder thing: when I add another endorsing peer to the above contract while keeping the rest of the network exactly the same, I get a similar failure but in an earlier stage of my workflow for a different transaction on a different contract (one that succeeded in the earlier run.)
bestbeforetoday (Thu, 07 May 2020 19:00:26 GMT):
Best guess is either:
- The transaction function is non-deterministic so different peers may produce different read/write sets or return values
- The ledger state is not consistent between peers
You would need to dig into the proposal responses to see exactly what is different
Mms 11 (Thu, 07 May 2020 19:34:07 GMT):
Exactly what @bestbeforetoday mentioned. Usually I'm getting this when passing a collection and two or more peers return elements in different order or when your serialization mechanizm return elements in unordered manner.
Mms 11 (Thu, 07 May 2020 19:35:23 GMT):
For example, I created a Jackson based SerializationInferface that is used by the contract I need to specify the order of each property or make it return props in a given order (like alphabetic).
vramaiitkgp (Thu, 07 May 2020 20:46:45 GMT):
You both were exactly right, thanks! I'm calling `putState` on a JSON serialized to a string, and the serialization turns out to be non-deterministic. I found out only when I turned on debug-level logging for the sdk package.
ShobhitSrivastava (Fri, 08 May 2020 04:34:17 GMT):
Hi, I'm trying to add chaincode event listener in fabric-gateway-java. Is there any way to achieve.
bestbeforetoday (Fri, 08 May 2020 09:31:30 GMT):
Look at the `addContractListener` methods on the Contract class: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Contract.html
ShobhitSrivastava (Fri, 08 May 2020 10:51:16 GMT):
okay, thanks
richzhao (Mon, 11 May 2020 09:27:31 GMT):
Has joined the channel.
c0deh0use (Mon, 11 May 2020 15:46:51 GMT):
Has joined the channel.
Bolzo 1 (Tue, 12 May 2020 08:36:20 GMT):
Hi there is some kind of documentation or example on how i can listest to transaction commit event on the low level fabric SDK?
Bolzo 1 (Tue, 12 May 2020 08:36:20 GMT):
Hi there is some kind of documentation or example on how to listen to transaction commit events using the low level fabric SDK?
Bolzo 1 (Tue, 12 May 2020 08:36:20 GMT):
Hi, is there some kind of documentation or example on how to listen to transaction commit events using the low level fabric SDK?
ongchinkai (Wed, 13 May 2020 18:52:57 GMT):
Has joined the channel.
ongchinkai (Wed, 13 May 2020 18:52:58 GMT):
[object Object]
ongchinkai (Wed, 13 May 2020 18:54:30 GMT):
I check my debug logs to see why my EventHub isn't connecting, this is what I see:
2020-05-14 02:37:37 DEBUG EventHub:212 - EventHub{id: 3, name: peer1.org1.isprint.com, channelName: isprintchannel, url: grpcs://127.0.0.1:7053} is connecting.
2020-05-14 02:37:37 DEBUG EventHub:341 - EventHub{id: 3, name: peer1.org1.isprint.com, channelName: isprintchannel, url: grpcs://127.0.0.1:7053} connect is done with connect status: false
2020-05-14 02:37:37 WARN EventHub:280 - EventHub{id: 3, name: peer1.org1.isprint.com, channelName: isprintchannel, url: grpcs://127.0.0.1:7053} terminated is false shutdown is false, retry count 1 has error UNAVAILABLE: io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0].
2020-05-14 02:37:37 WARN EventHub:294 - EventHub{id: 3, name: peer1.org1.isprint.com, channelName: isprintchannel, url: grpcs://127.0.0.1:7053} :StatusRuntimeException Status Status{code=UNAVAILABLE, description=io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0], cause=java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(Unknown Source)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.read(Unknown Source)
at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:247)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1140)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:697)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Unknown Source)
}. Description io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
Are there any relevant settings that I should be setting in my peer/orderer/eventhub?
mahoney1 (Thu, 14 May 2020 08:31:09 GMT):
reminder that the Fabric Application Developer Community call today is at 3pm UTC (4pm UK, 11am ET, 8am PT) - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Agendas:+Fabric+Application+Developer+Community+Call+Meetings
bestbeforetoday (Thu, 14 May 2020 14:11:49 GMT):
Unless you are on an extremely old version of Fabric, I suspect you don't want to be using EventHub at all. These were superseded in the low-level SDK by the peer eventing service. Ideally use the event listening capabilities of the _fabric-gateway-java_ API, which are much easier to use for both realtime listening and event replay. Simply pass in a listener / callback function and events get delivered to you:
- Attach block (or transaction commit) listeners to a Network (analogous to a Channel): https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Network.html
- Attach contract listeners to a Contract to receive chaincode events: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Contract.html
ongchinkai (Thu, 14 May 2020 14:22:04 GMT):
I'm usiing release 1.4 of HLF for now, because the project I inherited was done in that version
bestbeforetoday (Thu, 14 May 2020 14:25:00 GMT):
The fabric-gateway-java API (and low level peer eventing service) are the things to use with Fabric 1.4; not EventHub
bestbeforetoday (Thu, 14 May 2020 14:25:27 GMT):
EventHub is deprecated in v1.4 and removed in 2.x
ongchinkai (Thu, 14 May 2020 14:28:42 GMT):
The thing is, I'm getting a weird timeout error when I use the fabric-gateway
ongchinkai (Thu, 14 May 2020 14:29:14 GMT):
contract.submitTransaction(...) throws me:
Caused by: org.hyperledger.fabric.sdk.exception.TransactionException: Channel isprintchannel, send transactions failed on orderer OrdererClient{id: 13, channel: isprintchannel, name: orderer1.isprint.com:7050, url: grpcs://orderer1.isprint.com:7050}. Reason: timeout after 10000 ms.
ongchinkai (Thu, 14 May 2020 14:31:55 GMT):
And down the stacktrace the root cause seems to be
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection timed out: no further information: peer1.org1.isprint.com/35.186.238.101:7051
But I'm not sure where to continue looking
jital (Thu, 14 May 2020 16:59:19 GMT):
If i do approvedefinitionformyorg using Java SDK i get 200 as statusin response but the definition is not approved, but i do the same from command line it gets approve, is there a known bug in approvedefinitionformyorg?
necessary logs from my peer
Peer Logs when using java SDK
```
2020-05-14 16:26:29.693 UTC [lifecycle] ApproveChaincodeDefinitionForOrg -> INFO 29e Successfully endorsed chaincode approval with name 'rental', package ID 'rental_1:b6cfd5fbbd542458bdf6e16cfaa726e4e287954a733578fed6ee0b47724e5411', on channel 'rentaleconomy' with definition {sequence: 1, endorsement info: (version: '1', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()}
2020-05-14 16:26:29.694 UTC [endorser] callChaincode -> INFO 29f finished chaincode: _lifecycle duration: 1ms channel=rentaleconomy txID=141e6c30
2020-05-14 16:26:29.697 UTC [comm.grpc.server] 1 -> INFO 2a0 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.23.0.1:56682 grpc.code=OK grpc.call_duration=6.5883ms
2020-05-14 16:26:29.749 UTC [lifecycle] CheckCommitReadiness -> INFO 2a1 Successfully checked commit readiness of chaincode name 'rental' on channel 'rentaleconomy' with definition {sequence: 1, endorsement info: (version: '1', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()}
2020-05-14 16:26:29.750 UTC [endorser] callChaincode -> INFO 2a2 finished chaincode: _lifecycle duration: 2ms channel=rentaleconomy txID=887e78a5
2020-05-14 16:26:29.752 UTC [comm.grpc.server] 1 -> INFO 2a3 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.23.0.1:56682 grpc.code=OK grpc.call_duration=5.446ms
2020-05-14 16:26:30.162 UTC [comm.grpc.server] 1 -> INFO 2a4 streaming call completed grpc.service=protos.Deliver grpc.method=Deliver grpc.peer_address=172.23.0.1:56686 error="context finished before block retrieved: context canceled" grpc.code=Unknown grpc.call_duration=666.2672ms
```
Logs when using the shell
```
2020-05-14 16:28:01.256 UTC [endorser] callChaincode -> INFO 2a5 finished chaincode: _lifecycle duration: 0ms channel= txID=5dce4960
2020-05-14 16:28:01.256 UTC [comm.grpc.server] 1 -> INFO 2a6 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.23.0.1:56694 grpc.code=OK grpc.call_duration=1.2999ms
2020-05-14 16:28:01.366 UTC [lifecycle] ApproveChaincodeDefinitionForOrg -> INFO 2a7 Successfully endorsed chaincode approval with name 'rental', package ID 'rental_1:b6cfd5fbbd542458bdf6e16cfaa726e4e287954a733578fed6ee0b47724e5411', on channel 'rentaleconomy' with definition {sequence: 1, endorsement info: (version: '1', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()}
2020-05-14 16:28:01.366 UTC [endorser] callChaincode -> INFO 2a8 finished chaincode: _lifecycle duration: 3ms channel=rentaleconomy txID=668f105b
2020-05-14 16:28:01.371 UTC [comm.grpc.server] 1 -> INFO 2a9 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.23.0.1:56702 grpc.code=OK grpc.call_duration=9.9755ms
2020-05-14 16:28:03.409 UTC [gossip.privdata] StoreBlock -> INFO 2aa [rentaleconomy] Received block [5] from buffer
2020-05-14 16:28:03.411 UTC [committer.txvalidator] Validate -> INFO 2ab [rentaleconomy] Validated block [5] in 1ms
2020-05-14 16:28:03.412 UTC [gossip.privdata] prepareBlockPvtdata -> INFO 2ac Successfully fetched all eligible collection private write sets for block [5] channel=rentaleconomy
2020-05-14 16:28:03.437 UTC [kvledger] CommitLegacy -> INFO 2ad [rentaleconomy] Committed block [5] with 1 transaction(s) in 24ms (state_validation=1ms block_and_pvtdata_commit=12ms state_commit=8ms) commitHash=[d45eacfbfcaaf9b5ac0dc559c12274f8b8db464c3adc08a37cdf2059502a8789]
2020-05-14 16:28:03.449 UTC [comm.grpc.server] 1 -> INFO 2ae streaming call completed grpc.service=protos.Deliver grpc.method=DeliverFiltered grpc.request_deadline=2020-05-14T16:28:31.378Z grpc.peer_address=172.23.0.1:56706 error="context finished before block retrieved: context canceled" grpc.code=Unknown grpc.call_duration=2.069538s
2020-05-14 16:28:06.539 UTC [lifecycle] CheckCommitReadiness -> INFO 2af Successfully checked commit readiness of chaincode name 'rental' on channel 'rentaleconomy' with definition {sequence: 1, endorsement info: (version: '1', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()}
```
ShobhitSrivastava (Fri, 15 May 2020 14:32:30 GMT):
Hi @bestbeforetoday ..I was trying to test the 2.1 version of fabric, using one endorser and orderer. I am getting around 10 Transaction per second. Is there I can do to increase the performance?
bestbeforetoday (Fri, 15 May 2020 16:37:17 GMT):
It's worth understanding the flow. On submit the client is:
1. Gathering endorsements from peers and sending the endorsed proposals to the orderer
2. Orderer gathers transactions until it is ready to cut a block and send it to the peers
3. Peers commit the transactions in the block and emit a block event
4. Client receives block events containing successful transaction events from some number of peers, then returns from the submit call
bestbeforetoday (Fri, 15 May 2020 16:39:53 GMT):
There are several points in the flow that can impact performance:
- Orderer typically waits for a sufficient number of transactions or a time period before cutting a block
- The number of commit events the submit waits for, and from which peers
- Whether the client waits at all for events
- The number of concurrent client invocations
bestbeforetoday (Fri, 15 May 2020 16:43:06 GMT):
If subsequent transactions don't rely on the ledger updates of previous transactions, you can probably gain a big chunk of performance by disabling the commit waiting. Set the commit handler on the gateway to be `NONE`: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Gateway.Builder.html#commitHandler-org.hyperledger.fabric.gateway.spi.CommitHandlerFactory-
bestbeforetoday (Fri, 15 May 2020 16:44:28 GMT):
A scenario where this might be appropriate is a batch process just adding new assets to the ledger. It doesn't affect any of the existing ledger content
bestbeforetoday (Fri, 15 May 2020 16:45:23 GMT):
Another approach might be running more client load in parallel. So multiple threads all submitting transactions
bestbeforetoday (Fri, 15 May 2020 16:47:25 GMT):
Since you only have a single peer, the commit handler type you pick (other than `NONE`) shouldn't affect your performance, but in a larger network then it might. It's a trade-off between performance and the consistency of ledger state you need for subsequent application work
bestbeforetoday (Fri, 15 May 2020 16:48:36 GMT):
If you're really maxing those things out then you might also want to look at the core Fabric configuration. So the wait time before the orderer cuts a block, and also the maximum number of transactions to include in a block
bestbeforetoday (Fri, 15 May 2020 16:50:24 GMT):
You probably want to get quite a lot of transactions in a single block for maximum throughput, but there's a balance to be had between block size and latency before transactions are included in a block and committed on peers
ShobhitSrivastava (Mon, 18 May 2020 06:38:09 GMT):
Thanks @bestbeforetoday for your detailed answer, I optimized java sdk a bit and reached around 125 TPS. I also updated the orderer configuration to decrease the latency of commitTime to be 1 second and number of messages to be 5.
ShobhitSrivastava (Mon, 18 May 2020 06:39:00 GMT):
Also can you confirm if I increase the number of ordering node, will the TPS increase?
ShobhitSrivastava (Mon, 18 May 2020 06:40:04 GMT):
I also set logs to FATAL in peer and orderer config file,
bestbeforetoday (Mon, 18 May 2020 10:15:07 GMT):
I would expect you to be able to get a higher throughput (TPS) with a larger number of messages per block. The optimum numbers are going to be dependent on your workload and performance requirements though
ShobhitSrivastava (Mon, 18 May 2020 10:16:53 GMT):
sure. I will change the configuration.
ShobhitSrivastava (Mon, 18 May 2020 10:16:57 GMT):
thanks
ShobhitSrivastava (Mon, 18 May 2020 10:17:07 GMT):
:slight_smile:
ongchinkai (Mon, 18 May 2020 10:26:47 GMT):
Whenever I try to set up an event listener using the Gateway API in my Java code, it always crashes prematurely. However, my debug log doesn't reflect any errors. Can anyone provide some advice on this?
ShobhitSrivastava (Mon, 18 May 2020 11:13:57 GMT):
changed the orderer config..getting about 200tps now
ShobhitSrivastava (Tue, 19 May 2020 04:43:05 GMT):
Hi @bestbeforetoday ..is there a way in fabric to get the exact time when a transaction reaches Orderer and comes out of the orderer ?
bestbeforetoday (Wed, 20 May 2020 08:16:22 GMT):
Just a heads up since a couple of people requested the changes included... v2.1.2 of _fabric-gateway-java_ has been released:
- https://github.com/hyperledger/fabric-gateway-java/releases/tag/v2.1.2
bestbeforetoday (Wed, 20 May 2020 08:27:48 GMT):
If the top of my head I can't think of anything (except perhaps inspecting logs on the orderer). Transaction events emitted after transactions are committed include a timestamp but I think this is the client timestamp when the transaction was created rather than anything to do with the orderer. Somebody else might have better information
HLFPOC (Wed, 20 May 2020 11:36:51 GMT):
Has joined the channel.
HunterJW (Thu, 21 May 2020 08:27:42 GMT):
Has joined the channel.
HunterJW (Thu, 21 May 2020 08:27:43 GMT):
I want to know whether I can create new channel dynamically using fabric-sdk-java ?:grinning:
aatkddny (Thu, 21 May 2020 14:22:58 GMT):
yes
aatkddny (Thu, 21 May 2020 14:22:58 GMT):
yes - for now. but as with many of the truly useful features it's being deprecated.
ongchinkai (Fri, 22 May 2020 03:35:34 GMT):
I read in the Fabric SDK tutorial (https://github.com/hyperledger/fabric-sdk-java), under ServiceDiscoveryIT.java, that it requires "adding entries in host file to remap docker fabric Peer and Orderers address to localhost" - what does this mean?
ShobhitSrivastava (Fri, 22 May 2020 11:57:40 GMT):
okay, no issue thanks..getting about 296TPS now
bestbeforetoday (Fri, 22 May 2020 12:59:47 GMT):
If you are doing development and running a Fabric network in Docker containers on your local machine, the nodes in the network will likely have addresses such as _peer1.org1.example.org_, which won't resolve in DNS for a client application running on your local machine (outside of the Docker network). One solution is to add those node addresses to your machine's local _hosts_ file so that they are treated as the loopback (locoalhost) address for your machine, e.g. `127.0.0.1`. Another approach if using service discovery to set the environment variable `ORG_HYPERLEDGER_FABRIC_SDK_SERVICE_DISCOVERY_AS_LOCALHOST=true`, which tells the client to treat all the addresses received through service discovery as localhost
bestbeforetoday (Fri, 22 May 2020 12:59:47 GMT):
If you are doing development and running a Fabric network in Docker containers on your local machine, the nodes in the network will likely have addresses such as _peer1.org1.example.org_, which won't resolve in DNS for a client application running on your local machine (outside of the Docker network). One solution is to add those node addresses to your machine's local _hosts_ file so that they are treated as the loopback (locoalhost) address for your machine, e.g. `127.0.0.1`. Another approach if using service discovery is to set the environment variable `ORG_HYPERLEDGER_FABRIC_SDK_SERVICE_DISCOVERY_AS_LOCALHOST=true`, which tells the client to treat all the addresses received through service discovery as localhost
fanjianhang (Tue, 26 May 2020 03:43:03 GMT):
Hi everyone, based on fabric-gateway-java intention that make connect network easier, but i found there are no about fabric-ca interface.My question is, how can i use fabric-gateway-java register and enroll a user identity, then use this identity send tx? Thanks.
fanjianhang (Tue, 26 May 2020 03:43:33 GMT):
Hi everyone, based on fabric-gateway-java intention that make connect network easier, but i found there are no about fabric-ca interface. My question is, how can i use fabric-gateway-java register and enroll a user identity, then use this identity send tx? Thanks.
bestbeforetoday (Tue, 26 May 2020 15:25:53 GMT):
_fabric-gateway-java_ doesn't provide administrative capabilities. You would need to use the fabric-ca CLI, _fabric-sdk-java_ or something else to enroll with the CA. Once you get credentials back from enrollment then you can use _fabric-gateway-java_ to create an Identity object and either store that identity in a wallet or use it directly to connect the Gateway:
- https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Identities.html
- https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Wallet.html
- https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Gateway.Builder.html#identity-org.hyperledger.fabric.gateway.Identity-
fanjianhang (Thu, 28 May 2020 01:13:02 GMT):
Thanks a lot.
fanjianhang (Thu, 28 May 2020 01:14:21 GMT):
Thanks a lot.
nitishbhardwaj19 (Thu, 28 May 2020 03:18:39 GMT):
Hi @fanjianhang You can try this https://hub.docker.com/r/hlfgovernance/fabric-ca-client
nitishbhardwaj19 (Thu, 28 May 2020 05:52:56 GMT):
@bestbeforetoday Hope you are doing good, I just have a query i.e is there a way to generate enrollment using HFCAClient which would have *TLS Web Server Authentication, TLS Web Client Authentication* enabled. Something similar to a behavior like this command: _fabric-ca-client enroll -u https://nitish2:password@localhost:7054 --tls.certfiles tls-cert.pem -M $FABRIC_CA_CLIENT_HOME/msp --enrollment.profile tls --csr.hosts peer1-org1_
nitishbhardwaj19 (Thu, 28 May 2020 05:53:59 GMT):
I know there is a way to specify hostNames at the time of enrollment but couldn't any parameter for --enrollment.profile tls
nitishbhardwaj19 (Thu, 28 May 2020 05:56:06 GMT):
Do I need to specify EnrollmentRequest.profile as "tls"?
nitishbhardwaj19 (Thu, 28 May 2020 06:42:56 GMT):
Yup adding enrollment.profile as tls added TLS Web Server/Client to certificate. Thanks
aguel (Fri, 29 May 2020 08:55:07 GMT):
Has left the channel.
kmadala (Tue, 02 Jun 2020 20:44:08 GMT):
Hi everyone: Have question on Fabric SDK - If fabric SDK receives multiple blocks same time for a given channel, does Fabric SDK code guarantees block Order to client application?
kmadala (Tue, 02 Jun 2020 20:46:37 GMT):
or it's client application responsibility to process the blocks in sequence?
bestbeforetoday (Tue, 02 Jun 2020 21:34:42 GMT):
_fabric-gateway-java_ delivers block events to listeners in order and without duplication: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Network.html#addBlockListener-java.util.function.Consumer-
kmadala (Tue, 02 Jun 2020 22:07:38 GMT):
thanks for your reply. we have a scenario, where we observe client application has not received blocks in order. Ex : Received Block 101 first then Block 100. Based on client application logs, we see same timestamp but different threads delivered blocks to client application. Wondering whether Fabric SDK processes the blocks in parallel threads and delivers blocks to Client.
kmadala (Tue, 02 Jun 2020 22:09:35 GMT):
From Channel.java (FabricSDK 1.4.4 version)
kmadala (Tue, 02 Jun 2020 22:09:36 GMT):
try {
final String blockchainID = blockEvent.getChannelId();
final String from =
format("Channel %s eventqueue got block event with block number: %d for channel: %s, from %s",
name, blockEvent.getBlockNumber(), blockchainID, blockEvent.getPeer() != null ? ("" + blockEvent.getPeer()) :
("" + blockEvent.getEventHub()));
logger.trace(from);
if (!Objects.equals(name, blockchainID)) {
logger.warn(format("Channel %s eventqueue got block event NOT FOR ME channelId %s from %s", name, blockchainID, from));
continue; // not targeted for this channel
}
final ArrayList
kmadala (Tue, 02 Jun 2020 22:10:19 GMT):
seems this piece of code processing the blocks in parallel threads.
bestbeforetoday (Wed, 03 Jun 2020 09:44:40 GMT):
If you are using _fabric-sdk-java_ directly then you may receive duplicate and out of order blocks. If you use the _fabric-gateway-java_ API you will receive blocks in order and without duplication. If you are using _fabric-gateway-java_ and still receive blocks out of order, please raise a bug in Jira: https://jira.hyperledger.org/projects/FGJ
kmadala (Wed, 03 Jun 2020 18:44:43 GMT):
thanks for the response
KyoungsunPark (Thu, 04 Jun 2020 03:36:03 GMT):
Hi, I'm interested in the feature for signing a transaction offline. I found this feature in node sdk but not in sdk java. Someone already created the jira issue(https://jira.hyperledger.org/browse/FABJ-445) regarding this. Is there any update for this or any plan in the future?
bestbeforetoday (Thu, 04 Jun 2020 08:36:18 GMT):
The signing is done by calling `CryptoSuite.sign(PrivateKey, byte[])`. Instead of setting the default CryptoSuite implementation on the HFClient, perhaps you could set your own CryptoSuite implementation that does signing by other means when `sign(PrivateKey, byte[])` is called on it. I think the User object will still need to have a dummy private key assigned to it to prevent some of the SDK code complaining it was missing, but this would be ignored as you are supplying your own signing implementation. Would that satisfy your requirement?
KyoungsunPark (Thu, 04 Jun 2020 10:21:36 GMT):
Thank you for your reply. :) Actually end users don't want to share their private key. They want to sign the transaction in user's device without sharing the private key. I need to pass unsigned proposal and unsigned transaction to end user then get signed proposal and transaction from the user. But as I know, signing is done by private key on user object when sendTransaction is executed so I cannot split the transaction process. How can I create the unsigned proposal(transaction) and send signed proposal to peers(orderers) step by step?
ArigelaSatyanarayana (Thu, 04 Jun 2020 13:04:07 GMT):
Has joined the channel.
bestbeforetoday (Thu, 04 Jun 2020 14:18:00 GMT):
Would it be workable for your CryptoSuite implementation to pass the data to be signed to the client when CryptoSuite.sign() is invoked on it, and then wait for them to return the signed data to you before returning that from the call to CryptoSuite.sign() ?
sanjeevkkn (Thu, 04 Jun 2020 14:30:19 GMT):
Has joined the channel.
sanjeevkkn (Thu, 04 Jun 2020 14:30:20 GMT):
Error: Error handling success response. Value did not match schema:
1. return: Invalid type. Expected: array, given: string
I am facing while getting success response from chaincode using fabric gateway
bestbeforetoday (Thu, 04 Jun 2020 14:40:28 GMT):
Where are you seeing that error and is there any additional information, like a stack trace of logs? That doesn't look like a client-side message that I am familiar with. Could there be an error generated at the peer / chaincode end that you are observing returned to the client?
bestbeforetoday (Thu, 04 Jun 2020 14:40:28 GMT):
Where are you seeing that error and is there any additional information, like a stack trace or logs? That doesn't look like a client-side message that I am familiar with. Could there be an error generated at the peer / chaincode end that you are observing returned to the client?
KyoungsunPark (Fri, 05 Jun 2020 02:07:51 GMT):
Yes, you're right. It is possible to pass the data to sign by CryptoSuite.sign(PrivateKey, byte[]). I'm using Channel.queryByChaincode(QueryByChaincodeRequest queryByChaincodeRequest) when querying the chaincode. Instead of queryByChaincode, I sent the date to the client and return back signed data then tried to send signed proposal to peers. But sendProposalToPeers() is private so I could not send the data to peers. Is there any accessible function for sending proposal to peers? Similarly the function for sending transaction to orderers is not accessible. Signing by CryptoSuite.sign() is workable but it failed to send it peers and orderers using Channel class. Thanks.
bestbeforetoday (Fri, 05 Jun 2020 07:57:35 GMT):
Do you know why and at what point the signed proposal was rejected? Getting the signing correct is not trivial. I would suggest looking at the default CryptoSuite signing implementation: https://github.com/hyperledger/fabric-sdk-java/blob/a66d7080f99846a230a69eeedf115c68167bef86/src/main/java/org/hyperledger/fabric/sdk/security/CryptoPrimitives.java#L756
KyoungsunPark (Mon, 08 Jun 2020 02:20:18 GMT):
Hmm.. signing is no problem as CryptoSuite.sign that you suggested. My problem is that signed proposal cannot be sent to peer by channel.sendProposalToPeers because this is the private function. In node sdk, Channel.sendSignedProposal() is supported and you can find it on https://github.com/hyperledger/fabric-sdk-node/blob/0d24cec10f7a3e0153fcf3f0158a89c5eaa0cfab/docs/tutorials/sign-transaction-offline.md. I need the function to send signed proposal to peers. Thanks.
bestbeforetoday (Mon, 08 Jun 2020 07:58:08 GMT):
I don't think you're understanding what I am suggesting, which is that you:
1. Set your own CryptoSuite implementation on HFClient, with a CryptoSuite.sign() implementation that does your offline signing.
2. Call Channel.sendTransactionProposal() as normal to send the transaction proposal, which will invoke your CryptoSuite.sign() implementation at the appropriate point.
So you use continue to use Channel.sendTransactionProposal() but it uses your signing implementation.
bestbeforetoday (Mon, 08 Jun 2020 07:58:08 GMT):
I don't think you're understanding what I am suggesting, which is that you:
1. Set your own CryptoSuite implementation on HFClient, with a CryptoSuite.sign() implementation that does your offline signing.
2. Call Channel.sendTransactionProposal() as normal to send the transaction proposal, which will invoke your CryptoSuite.sign() implementation at the appropriate point.
So you continue to use Channel.sendTransactionProposal() but it uses your signing implementation. You don't need to use any private methods.
SamYuan1990 (Tue, 09 Jun 2020 10:22:49 GMT):
hi may I ask fabric-gateway-java question here?
SamYuan1990 (Tue, 09 Jun 2020 10:23:11 GMT):
Recently I am coding fabric client application via java.
I am noticed that there seems no connection pool feature provided by either fabric-gateway-java or fabric-sdk-java.
As application developer point of view, I suppose there should be a connection pool, as a sub-system responsible for connecting to fabric.
1) Performance. As it's well known that connection pool is good for performance.
2) Maintainability. Code will be easier to maintain than if each component connected to the fabric itself.
3) Diagnostics. It becomes easier to diagnose and analyze fabric connection usage.
Is there any plan to have a connection pool feature for fabric-gateway-java?
bestbeforetoday (Tue, 09 Jun 2020 10:47:23 GMT):
You should definitely use a Gateway for multiple requests by the same client identity. There is significant overhead associated with connecting to the network so you don't want to be connecting and closing on every request. On the other hand, if you are not going to make any further requests with that client identity, either for the lifetime of the client application or for some significant period of time, it is beneficial to close the connection rather than leave them hanging open. It's difficult for any caching scheme implemented in the SDK to know what your application is going to do in the future and so it's difficult for any caching scheme in the SDK to behave appropriately for your application. It's not very difficult for your application to keep hold of a Gateway instance and reuse it for subsequent requests if it knows that will be required.
bestbeforetoday (Tue, 09 Jun 2020 10:48:04 GMT):
So right now, I don't have any plans to try to implement a caching scheme within the SDK
bestbeforetoday (Tue, 09 Jun 2020 10:53:50 GMT):
It might be possible to optimise the number of gRPC connections created by client applications using the Gateway, by doing some sharing of the underlying connections between Gateway instances. I don't know of any near-term plan to implement those optimisations in the current SDK versions
SamYuan1990 (Tue, 09 Jun 2020 11:10:22 GMT):
Well, I tested and understand that currently to use gateway for multiple requests as your said above.
To have a high thoughput for client application in multiple request scenario.
I received output for gateway query via stringbuffer. with query A or query B, but some error happens as query A with result 210 and query B with result 90.
What I expected, or questioned is that is there any way for safety multiple thread?
I hope by a "pooled feature" can implments that kind of safety multiple thread.
SamYuan1990 (Tue, 09 Jun 2020 11:12:13 GMT):
either reused underlying conenctions or a connection pool export to appplication for inovke as JDBC pool is fine.
SamYuan1990 (Tue, 09 Jun 2020 11:13:26 GMT):
by you say optimise the number of gprc connections underlying, do we have that already? any jira ticket or design document for reference?
bestbeforetoday (Tue, 09 Jun 2020 14:35:15 GMT):
The API should be thread safe. If you find any cases where fabric-gateway-java doesn't behave in a thread safe manner, please raise a bug in Jira. However, the Fabric blockchain network is a distributed ledger and so you should get eventual consistency but not the same kind of consistency you might expect from a centralised system such as a sing instance database. Different peers in the network may be at different block heights and so their world state may be different at any given point in time. The result you get from a query depends on the state of whichever peer the query executes on. The commit and query strategies provided by the Gateway are intended to mitigate this by allowing you to wait for submitted transactions to be committed on peers before subsequently going on to evaluate transactions (query) those peers
bestbeforetoday (Tue, 09 Jun 2020 14:35:15 GMT):
The API should be thread safe. If you find any cases where fabric-gateway-java doesn't behave in a thread safe manner, please raise a bug in Jira. However, the Fabric blockchain network is a distributed ledger and so you should get eventual consistency but not the same kind of consistency you might expect from a centralised system such as a single instance database. Different peers in the network may be at different block heights and so their world state may be different at any given point in time. The result you get from a query depends on the state of whichever peer the query executes on. The commit and query strategies provided by the Gateway are intended to mitigate this by allowing you to wait for submitted transactions to be committed on peers before subsequently going on to evaluate transactions (query) those peers
SamYuan1990 (Tue, 09 Jun 2020 14:40:20 GMT):
got ...
rmnattas (Wed, 10 Jun 2020 17:15:57 GMT):
Has joined the channel.
darapich92 (Thu, 11 Jun 2020 04:56:22 GMT):
Screenshot from 2020-06-11 13-54-03.png
govindvb (Fri, 12 Jun 2020 18:42:17 GMT):
Has joined the channel.
ongchinkai (Mon, 15 Jun 2020 03:38:29 GMT):
Is there any sample code in the Fabric Gateway that demonstrates a simple block listener that stays alive and listens for block events? org.hyperledger.fabric.gateway.impl.BlockListenerTest doesn't contain seem to mention anything beyond adding listeners to the network
nitishbhardwaj19 (Mon, 15 Jun 2020 13:11:45 GMT):
Hi @bestbeforetoday I have just upgraded to java sdk 2.1. I am getting a strange error while I am trying to create a new channel on network. *expected config block type CONFIG_UPDATE, but got: MESSAGE* Could you please let me know if I am missing something?
bestbeforetoday (Tue, 16 Jun 2020 08:02:56 GMT):
What further information are you looking for? Once you attach a block listener, it carries on listening for block events until you remove it or your client application terminates
Bolzo 1 (Wed, 24 Jun 2020 08:48:31 GMT):
I'm using fabric java sdk 1.4.7 (not Gateway) when i call sendTransaction and it return a CompletableFuture
Bolzo 1 (Wed, 24 Jun 2020 08:48:31 GMT):
I'm using fabric java sdk 1.4.7 (not Gateway) when i call sendTransaction it returns a CompletableFuture
Bolzo 1 (Wed, 24 Jun 2020 08:48:31 GMT):
I'm using fabric java sdk 1.4.7 (not Gateway) when I call sendTransaction it returns a CompletableFuture
bestbeforetoday (Wed, 24 Jun 2020 18:13:15 GMT):
I think the value returned should be a transaction event if you have chosen to wait for commit the transaction to commit on peers and it completes successfully. If you have set NOfEvents.nofNoEvents (so not waiting for commit on peers) then it will just return null after a successful send to the orderer
bestbeforetoday (Wed, 24 Jun 2020 18:13:15 GMT):
I think the value returned should be a transaction event if you have chosen to wait for the transaction to commit on peers and it completes successfully. If you have set NOfEvents.nofNoEvents (so not waiting for commit on peers) then it will just return null after a successful send to the orderer
c0deh0use (Thu, 25 Jun 2020 07:35:41 GMT):
Hi guys, could anyone help with batch uploads?
I'm trying to upload around 200-400 records to the blockchain via a java chaincode.
This process takes about 3 -4 minutes which is taking a bit. While uploading around 40-50 records, that takes 5-8 seconds. I identified that such a long time is because of the proposal time response.
Is this a normal speed or is there a way using configuration to speed it up? Is there any „Bulk import features” that I could use ?
HLF - 2.2.1 version
Bolzo 1 (Thu, 25 Jun 2020 13:16:51 GMT):
I understand, I've not set NOfEvents.nofNoEvents so this is not the case. What I've observed is that I have a connection profile which specify all the endorsing peers of any organization. In this scenario the future.get() returns null, but if I remove all the peers not in the org specified in the connection profile the .get() call returns correctly.
To be more clear:
```
```
Bolzo 1 (Thu, 25 Jun 2020 13:16:51 GMT):
I understand, I've not set NOfEvents.nofNoEvents so this is not the case. What I've observed is that I have a connection profile which specify all the endorsing peers of any organization. In this scenario the future.get() returns null, but if I remove all the peers not in the org specified in the connection profile the .get() call returns correctly.
To be more clear:
```
name: fabric-net
x-type: "hlfv1"
version: 1.0.0
license: Apache-2.0
client:
tlsEnable: true
adminUser: xxxxx
adminPassword: xxxxx
enableAuthentication: false
organization: Org2 <--- here
```
If I leave only the peers of Org2 the proccess of sending transaction works correctly. If I specify other peers of other organizations the result is opposite
Bolzo 1 (Thu, 25 Jun 2020 13:16:51 GMT):
I understand, I've not set NOfEvents.nofNoEvents so this is not the case. What I've observed is that I have a connection profile which specifies all the endorsing peers of each organization. In this scenario the future.get() returns null, but if I remove all the peers not in the org specified in the connection profile the .get() call returns correctly.
To be more clear:
```
name: fabric-net
x-type: "hlfv1"
version: 1.0.0
license: Apache-2.0
client:
tlsEnable: true
adminUser: xxxxx
adminPassword: xxxxx
enableAuthentication: false
organization: Org2 <--- here
```
If I leave only the peers of Org2 the proccess of sending transaction works correctly. If I specify other peers of other organizations the result is the opposite.
bestbeforetoday (Thu, 25 Jun 2020 14:49:29 GMT):
Just so I understand what you are doing... do you mean 200 - 400 records in a single transaction, or do you submit a separate transaction for each record? I think in general (and within message size limits) it's more performant to batch multiple records up into a single transaction and do all the putState operations for those records in a single transaction. Another thing to seriously consider is whether these records (or transactions) are independent of each other. If they are independent (so don't touch the same ledger entries) then you can probably get much better performance by executing them in parallel using a multi-threaded client application. Submitting transactions sequentially likely means you'll get one per block and all the latency involved in the block cutting whereas in parallel you will likely get many transactions per block. Another factor (usually determined by whether your transactions and independent or not) is whether you need to wait for transactions to be committed by peers for submitting subsequent transactions. You will get the highest throughput if you don't need to wait for the commits (or possibly optimise by waiting for the commits asynchronously)
bestbeforetoday (Thu, 25 Jun 2020 14:50:51 GMT):
The comparative performance numbers between these two pages might help. They are using a Node.js client but I would expect the performance trends to be consistent.
- https://hyperledger.github.io/caliper-benchmarks/fabric/performance/2.1.0/nodeJS/nodeSDK/submit/create-asset/
- https://hyperledger.github.io/caliper-benchmarks/fabric/performance/2.1.0/nodeJS/nodeSDK/submit/batch-create-asset/
c0deh0use (Fri, 26 Jun 2020 06:36:37 GMT):
Thanks @bestbeforetoday, I'm pushing these messages all in one transaction. The db response time is quick but for some reason the time the client waits for the proposal transaction confirmation to be returned accepted or not takes long minutes (I'm not sure what is the reason as I didn't check detailed debug logs yet). I will have a look at the examples you have send - thx!
Bolzo 1 (Fri, 26 Jun 2020 07:08:02 GMT):
Hi, yesterday I finally moved to fabric gateway 2.1.3 and I have some question about the transaction process. @bestbeforetoday
So, as I understood, when I call `submitTransaction()` the returned byte array is the payload returned by the chaincode.. But, is the transaction successfully committed to the ledger or the call return as the transaction is submitted to the orderer?
Second question: how can I get the transaction Id of a submitted transaction? I need to attach a listener right? But what type? And there is a code example of this?
Bolzo 1 (Fri, 26 Jun 2020 07:08:02 GMT):
Hi, yesterday I finally moved to fabric gateway 2.1.3 and I have some question about the transaction process. @bestbeforetoday
So, as I understood, when I call `submitTransaction()` the returned byte array is the payload returned by the chaincode.. But, is the transaction successfully committed to the ledger or the call return as the transaction is submitted to the orderer?
Second question: how can I get the transaction Id of a submitted transaction? I need to attach a listener right? But what type? And there is a code example of this?
Third question: Is there any function to query an asset using the transaction Id?
bestbeforetoday (Fri, 26 Jun 2020 08:10:09 GMT):
By default `submitTransaction()` will return only after seeing successful commit events from all your organisation peers. You can select alternative default behaviour by setting a different commit handler when connecting the Gateway, or provide your own custom implementation if none of the default options suit you:
- https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Gateway.Builder.html#commitHandler-org.hyperledger.fabric.gateway.spi.CommitHandlerFactory-
If you want different behaviour for different transactions then you can override the default commit handling behaviour on a per-transaction bases:
- https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Transaction.html#setCommitHandler-org.hyperledger.fabric.gateway.spi.CommitHandlerFactory-
In some cases you might want to get the transaction result immediately after the transaction is successfully sent to the orderer but still listen asynchronously (or in another process) for that transaction to commit on peers. You can achieve this by:
1. Use the `NONE` commit handler: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/DefaultCommitHandlers.html#NONE
2. Get the transaction ID prior to submitting the transactions: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Transaction.html#getTransactionId--
3. Also before submitting the transaction (so you don't miss the commit), add a commit listener to the Network to observe commit events for that transaction: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Network.html#addCommitListener-org.hyperledger.fabric.gateway.spi.CommitListener-java.util.Collection-java.lang.String-
There is an example of a commit listener being used in a custom commit handler implementation here: https://github.com/hyperledger/fabric-gateway-java/blob/master/src/test/java/org/hyperledger/fabric/gateway/sample/SampleCommitHandler.java
bestbeforetoday (Fri, 26 Jun 2020 08:32:47 GMT):
Unless you are really pushing the boundaries of transaction throughput or have very strict responsiveness requirements, probably keeping your application code simple and just letting `submit()` deal with any commit event handling you need is a good option
Bolzo 1 (Fri, 26 Jun 2020 08:43:48 GMT):
Thanks for the reply! I understand more clearly now, I'll do my tests based on the use cases that I have
ViokingTung (Mon, 29 Jun 2020 08:39:22 GMT):
Has joined the channel.
ShobhitSrivastava (Mon, 29 Jun 2020 13:49:40 GMT):
Hi @bestbeforetoday ...i needed to query block info and what all transaction it has? Can we do it via java sdk? Please help with this.
nitishbhardwaj19 (Tue, 30 Jun 2020 05:03:09 GMT):
Hi @bestbeforetoday Is there any way to retrieve all transactions/blocks for a channel? I know that we can get recent block for a channel but just curious to know if we have an option to retrieve all blocks/transactions from orderer or peers
bestbeforetoday (Tue, 30 Jun 2020 12:42:30 GMT):
You can add a block listener with replay starting at the first block: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Network.html#addBlockListener-long-java.util.function.Consumer-
bestbeforetoday (Tue, 30 Jun 2020 12:43:01 GMT):
You can access all the transaction events within the block event pretty easily
bestbeforetoday (Tue, 30 Jun 2020 13:20:15 GMT):
If you are replaying a large number of blocks then you might consider using a checkpointer to maintain the current block number the replay has reached in case the client fails and needs to resume from the last processed block: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Network.html#addBlockListener-org.hyperledger.fabric.gateway.spi.Checkpointer-java.util.function.Consumer-
c0deh0use (Wed, 01 Jul 2020 18:26:44 GMT):
So I had a few minutes to look into this.
I’m definitely not exceeding the volumes that the report is saying (going with around 150-300 records) which is a very small value in contrast to what it was presented in the report.
Is there some configurations that would be causing such long executions ? With around 220 records I’m reaching blockchain timeout connection limits
(2020-07-01 17:45:04.380 UTC [endorser] SimulateProposal -> ERRO 195 failed to invoke chaincode poc-services, error: timeout expired while executing transaction
github.com/hyperledger/fabric/core/chaincode.(*Handler).Execute)
c0deh0use (Wed, 01 Jul 2020 18:29:41 GMT):
@bestbeforetoday is there some specific way of handling batch uploads ?
c0deh0use (Thu, 02 Jul 2020 09:44:17 GMT):
Can anyone help with tweaking the performance of the process of uploading a number of records to the blockchain?
I have around 300 records to upload, nothing complex. The TransactionProposal takes so long it is getting timeout by the blockchain
I have been trying to change both the BatchTimeout - set to 10s and BatchSize.MaxMessageCount to 500, but nothing helped with the proposal times. It takes so long that there always is a timeout on the blockchain side.
I’m doing one putState per record, as I couldn’t find a putStates method, can this be the problem ?
I'm running on HLF 2.1.1, with two orgs, one raft orderer.
bestbeforetoday (Thu, 02 Jul 2020 19:25:23 GMT):
It sounds to me like you need some instrumentation (or at least analysis of timestamps in existing logs) to identify exactly where the time is being spent. It's difficult to know what the problem might be without knowing which part of the flow is taking all the time
bestbeforetoday (Thu, 02 Jul 2020 19:30:28 GMT):
One thing to experiment with might be to run a single batch transaction invocation to see what the latency is like. If a single transaction invocation performs well and you are running many transaction invocations in parallel then it might be that something is bottlenecking under load and you start to see failures. If so, it might be you can identify and work to remove that bottleneck, or it might be a case of tuning the rate of transactions to get optimum performance
nitishbhardwaj19 (Mon, 06 Jul 2020 11:04:45 GMT):
Sounds good, thanks @bestbeforetoday :)
baohua (Wed, 08 Jul 2020 01:02:19 GMT):
Has joined the channel.
baohua (Wed, 08 Jul 2020 01:02:19 GMT):
Hi, anyone know which version of sdk-node works best with fabric v1.4.7? I saw there's sdk-node 1.4.11 now.
Bolzo 1 (Mon, 13 Jul 2020 13:00:15 GMT):
Hi @bestbeforetoday, I have a question about the `CommitListener. I've attached a `CommitListener` to a network and I was wondering if it is enough to override the defaul behaviour of the `submit` function. In other words, once I 've attached a listener to a network the submit call is still blocking?
Bolzo 1 (Mon, 13 Jul 2020 13:00:15 GMT):
Hi @bestbeforetoday, I have a question about the `CommitListener`. I've attached a `CommitListener` to a network and I was wondering if it is enough to override the defaul behaviour of the `submit` function. In other words, once I 've attached a listener to a network the submit call is still blocking?
davidkhala (Tue, 14 Jul 2020 02:40:37 GMT):
Has joined the channel.
davidkhala (Tue, 14 Jul 2020 02:40:38 GMT):
These days I am playing with fabric-sdk-java, meanwhile I see a comment saying: `IdeMixTest disabled in Azure Pipelines - it takes too long to run (>2 hours!)`
Could any one talk more about the details of why it take so long? Is time consumed in entropy collecting?
davidkhala (Tue, 14 Jul 2020 07:38:15 GMT):
Along with my deeper trial, it is recorded in my machine that running a single IdemixTask consume about 50 minutes.
bestbeforetoday (Tue, 14 Jul 2020 09:07:15 GMT):
I would recommend using the latest 1.4.x release of the Node SDK for 1.4.x releases of Fabric. The patch versions of the SDK and Fabric are not aligned; just the major/minor numbers. Also... the #fabric-sdk-node channel is a better place for Node SDK questions :)
bestbeforetoday (Tue, 14 Jul 2020 09:13:03 GMT):
The submit will use whatever commit handling behaviour is configured; by default the one specified when connecting the gateway (which itself defaults to MSPID_SCOPE_ALLFORTX). If you don't want the submit to block waiting for commits because you are doing your own listening for commits then use the NONE commit handler. If you want all transaction submits to behave this way by default, set this on the GatewayBuilder when connecting the Gateway. If you just want specific transaction submits to not wait for commits, set the NONE commit handler explicitly on those Transaction objects before calling submit:
- https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Transaction.html#setCommitHandler-org.hyperledger.fabric.gateway.spi.CommitHandlerFactory-
- https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/DefaultCommitHandlers.html#NONE
bestbeforetoday (Tue, 14 Jul 2020 09:55:32 GMT):
From very vague memory... there is some unit and integration testing of Idemix done in the Azure pipelines build; just not that one very long unit test piece since it takes so long to run in the Azure pipelines environment that the builds fail with timeouts. The test drives something like 2500 Idemix operations with many operations running in parallel, I presume to try to flush out any concurrency issues. If you're changing the Idemix code then it would be a good idea to set the appropriate environment variable to enable that test when running tests locally but it's way too long running to be a regularly run unit test
Rahul98 (Wed, 15 Jul 2020 04:28:33 GMT):
Has joined the channel.
Rahul98 (Wed, 15 Jul 2020 04:33:31 GMT):
Hey,I have been trying to run a java code that enrolls the user of the java client on VSCode IDE and am facing errors relating to : error: package javax.json does not exist
import javax.json.Json;
Rahul98 (Wed, 15 Jul 2020 04:33:31 GMT):
Hey,I have been trying to run a java code that enrolls the user of the java client on VSCode IDE and am facing errors relating to : error: package javax.json does not exist
import javax.json.Json;
error: package org.hyperledger.fabric.sdk does not exist
import org.hyperledger.fabric.sdk.QueryByChaincodeRequest;
Even though I have included the dependencies in the pom file ,I face this error,what could possibily be wrong?
bestbeforetoday (Wed, 15 Jul 2020 08:32:31 GMT):
I very rarely use VS Code for Java development and can't say for sure what's causing this for you. One thing you might is running `mvn compile` in your project directory to get Maven to pull down dependencies if you don't already have them
AshutoshKumar7 (Thu, 16 Jul 2020 12:16:08 GMT):
Has joined the channel.
bestbeforetoday (Thu, 16 Jul 2020 19:00:39 GMT):
A v2.2.0 release of _fabric-gateway-java_ has been published to accompany the Fabric 2.2 LTS release: https://github.com/hyperledger/fabric-gateway-java/releases/tag/v2.2.0
Djoust (Mon, 20 Jul 2020 10:01:48 GMT):
Has joined the channel.
Djoust (Mon, 20 Jul 2020 10:01:49 GMT):
Hi, Q: We have a fabric setup where we deploy Go chaincode from source, now i notice that in the SDK the folder "src" is a hardcoded prefix for chaincodeSource location I give of the Go code. The go code I work with doesn't conform to this structure. So i was wondering why the decision was made to put the prefix in it?
(Yes, I know the method is called fromSource :wink: )
This is where the prefix, or to be perfectly correct insertion is added:
https://github.com/hyperledger/fabric-sdk-java/blob/032aa59356575f2d6d2210983c755b5acd0fca38/src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodePackage.java#L255
bestbeforetoday (Tue, 21 Jul 2020 18:03:16 GMT):
I don't know why it was conceived this way. At first glance, this doesn't look ideal to me. Possibly it was due to limitations of the structure expected on the server side prior to Go modules. I've raised this Jira to capture the request for more flexibility: https://jira.hyperledger.org/browse/FABJ-529
bestbeforetoday (Tue, 21 Jul 2020 18:05:58 GMT):
Generally the recommendation today seems to be to use the command-line to package and deploy chaincode rather than the SDKs
Djoust (Wed, 22 Jul 2020 08:30:56 GMT):
Thanks for the quick answer, will watch the story and probably fix it myself
NickName (Wed, 22 Jul 2020 12:43:42 GMT):
Has joined the channel.
NickName (Wed, 22 Jul 2020 12:43:42 GMT):
Hello, I'm trying to measure the throughput of a network that I created using the fabcar chaincode. I have started from the example java application in the fabric-samples repository (https://github.com/hyperledger/fabric-samples/blob/master/fabcar/java/src/main/java/org/example/ClientApp.java) and tried to generate transactions and add commit event listeners to check if the transactions are commited or not. However, all the examples that are present in the documentation require a transaction ID which I cannot obtain. What is the proper way to listen to a commit event using the java gateway?
bestbeforetoday (Wed, 22 Jul 2020 13:02:56 GMT):
Transaction.submit() already waits for commit events before returning (assuming you haven't set the commit handler to `NONE`)
NickName (Thu, 23 Jul 2020 06:35:44 GMT):
Does the java gateway allow flooding the network with transactions? I'm trying to use contract.submitTransaction() but the measured TPS is around 3. Is there a better way to do this?
mahoney1 (Thu, 23 Jul 2020 08:21:37 GMT):
Reminder that the Fabric Application Developer Community call today is at 3pm UTC (4pm UK, 11am ET, 8am PT) - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community - agenda is here: https://wiki.hyperledger.org/display/fabric/Agendas:+Fabric+Application+Developer+Community+Call+Meetings
bestbeforetoday (Thu, 23 Jul 2020 08:48:29 GMT):
By default, contract.submitTransaction() will wait for until a submitted transaction is committed on peers before returning. So with one single-threaded client you will get one transaction per block and you can expect transaction rate to be slow. One approach to driving higher load is to run multiple concurrent clients (or client threads). Another approach is to not wait for transactions to be committed on the submit, which you can achieve by setting the `NONE` commit handler (either as the default when connecting the Gateway or on a per-transaction basis). Just be aware that any subsequent queries or transactions will not see ledger changes resulting from earlier transactions until those earlier transactions are committed
bestbeforetoday (Thu, 23 Jul 2020 08:48:29 GMT):
By default, contract.submitTransaction() will wait until a submitted transaction is committed on peers before returning. So with one single-threaded client you will get one transaction per block and you can expect transaction rate to be slow. One approach to driving higher load is to run multiple concurrent clients (or client threads). Another approach is to not wait for transactions to be committed on the submit, which you can achieve by setting the `NONE` commit handler (either as the default when connecting the Gateway or on a per-transaction basis). Just be aware that any subsequent queries or transactions will not see ledger changes resulting from earlier transactions until those earlier transactions are committed
Funbric (Fri, 31 Jul 2020 07:49:23 GMT):
Has joined the channel.
Funbric (Mon, 03 Aug 2020 02:20:54 GMT):
When I using sdk-java to add an new Org to existing channel (not the peer join a chanenl) by updating channel's configuration.
But I got this warn which seems make the add-org-action failed.
```
Rejecting broadcast of config message from 124.160.109.242:62948 because of error: error applying config update to existing channel 'channel109': error authorizing update: proto: field "common.ConfigUpdate.channel_id" contains invalid UTF-8
```
The Java code is like:
`channel.updateChannelConfiguration(updateChannelConfiguration, peerClient.getUpdateChannelConfigurationSignature(updateChannelConfiguration, peerAdmin));`
The byte[] in updateChannelConfiguration which I'm pretty sure is correct. Because when I save the byte[] 'to xxx.pb', and using that pb file to update by using `peer channel update` command, the result is good。
Anyone familiar with this probleam?
I'm so confused with this problem and would be so grateful if anyone could provide me some advice.
Funbric (Mon, 03 Aug 2020 11:35:09 GMT):
Problem solved! I don't need package the “envelope” like what did in docker container. It already implemented by sdk.
ks.cho (Tue, 04 Aug 2020 11:49:23 GMT):
Has joined the channel.
ks.cho (Tue, 04 Aug 2020 11:49:23 GMT):
I'd like to see the fabric consensus process.
After builds a fabric network of seven peers,
I'd like to check if blocks are created by blocking 2 peers and agreeing only 5 peers.
Tell me how to do it. How can I check it?
ks.cho (Tue, 04 Aug 2020 11:50:49 GMT):
In fabcar examples, how can I execute query and invoke?
ks.cho (Tue, 04 Aug 2020 11:50:49 GMT):
In fabcar examples, how can I execute 'query' and 'invoke'?
I success build up a java fabcar network ( ./startFabric.sh java)
but I don't know how execute 'query' and 'invoke' command
java query? Is it right?
In javascript fabcar network I typed command as 'node query', 'node invoke'. It was successful
ks.cho (Tue, 04 Aug 2020 11:50:49 GMT):
In fabcar examples, how can I execute 'query' and 'invoke'?
I success build up a java fabcar network ( ./startFabric.sh java)
but I don't know how execute 'query' and 'invoke' command
java query? Is it right?
In javascript fabcar network(./startFabric.sh javascript), I typed command as 'node query', 'node invoke'. It was successful
bestbeforetoday (Wed, 05 Aug 2020 09:26:20 GMT):
There is a sample Java client application, which I guess you can run with something like `mvn exec:java -Dexec.mainClass="org.example.ClientApp"`. It runs several queries and transactions. If you want it to do something, you could change that code or write your own client application. The samples are just there to provide working usage examples
bestbeforetoday (Wed, 05 Aug 2020 09:26:20 GMT):
There is a sample Java client application, which I guess you can run with something like `mvn exec:java -Dexec.mainClass="org.example.ClientApp"`. It runs several queries and transactions. If you want it to do something else, you could change that code or write your own client application. The samples are just there to provide working usage examples
AshutoshKumar7 (Wed, 05 Aug 2020 10:35:52 GMT):
I am getting this exception while invoking chaincode using java sdk
AshutoshKumar7 (Wed, 05 Aug 2020 10:35:53 GMT):
org.hyperledger.fabric.gateway.GatewayRuntimeException: org.hyperledger.fabric.sdk.exception.ServiceDiscoveryException: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
Caused by: javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
AshutoshKumar7 (Wed, 05 Aug 2020 10:36:03 GMT):
Any pointers?
bestbeforetoday (Wed, 05 Aug 2020 16:32:33 GMT):
That's not an error I recall seeing before so I really don't know what the problem is. My guess would be that either the client certificate used to establish connection to a peer is not issued by a CA recognised by the peer, or (perhaps more likely) that the peer certificate is not issued by a CA recognised by the client
bestbeforetoday (Wed, 05 Aug 2020 16:50:54 GMT):
If it is the second issue then you might need to import the CA certificate into your client's trust store, either programmatically or using the keytool utility. I'm not an expert in this area though
ongchinkai (Thu, 06 Aug 2020 09:59:14 GMT):
org.hyperledger.fabric.shim.ledger.KeyModification.getTimestamp() - what timestamp does this represent?
bestbeforetoday (Thu, 06 Aug 2020 10:35:05 GMT):
The documentation is published here but I don't think there is a complete implementation of this capability yet, and it is not included in a current release version: https://hyperledger.github.io/fabric-chaincode-java/master/api/index.html?org/hyperledger/fabric/shim/ledger/KeyModification.html
bestbeforetoday (Thu, 06 Aug 2020 10:35:05 GMT):
The documentation is published here ~but I don't think there is a complete implementation of this capability yet, and it is not included in a current release version~ (edit: I was confusing this with some ledger API changes in the current code snapshots): https://hyperledger.github.io/fabric-chaincode-java/master/api/index.html?org/hyperledger/fabric/shim/ledger/KeyModification.html
bestbeforetoday (Thu, 06 Aug 2020 10:35:05 GMT):
The documentation is published here ~but I don't think there is a complete implementation of this capability yet, and it is not included in a current release version~ (edit: I was confusing this with some ledger API changes in the current code snapshots): https://hyperledger.github.io/fabric-chaincode-java/release-2.2/api/index.html?org/hyperledger/fabric/shim/ledger/KeyModification.html
bestbeforetoday (Thu, 06 Aug 2020 10:35:26 GMT):
This question would be better in the #fabric-java-chaincode channel
ongchinkai (Thu, 06 Aug 2020 10:36:25 GMT):
I read the documentation and it seemed quite vague, that's why I came here to ask. I'll go check out that channel, thanks!
bestbeforetoday (Thu, 06 Aug 2020 10:38:50 GMT):
My interpretation of the documentation would be that it returns the point in time at which the key was modified to have the value specified in that KeyModification instance. But somebody on the #fabric-java-chaincode channel should be able to provide a more authoritative answer since that's where the chaincode devs hang out
ongchinkai (Thu, 06 Aug 2020 10:40:50 GMT):
That's my interpretation too, but yes I'll see if I can get a more concise answer on this over there. Cheers
bestbeforetoday (Thu, 06 Aug 2020 10:42:25 GMT):
I'd guess that modification time is actually the timestamp of the transaction that updated the key, since different peers will commit to their local copies of the ledger at different times
ongchinkai (Thu, 06 Aug 2020 10:44:49 GMT):
So in the context of getting the history of the key via stub.getHistoryForKey(...), the last action would be committing the block, and the timestamp would be for that action, I suppose?
aatkddny (Fri, 07 Aug 2020 15:52:04 GMT):
Wow it's been a while since I needed to come on here...
HLF 1.4.5 network using raft. K8S using DinD. This particular one has been stable for a year.
Now all of a sudden it's failing to instantiate chaincode.
It's an automated process using the SDK - and has worked for ever.
It runs just fine right up to the point where it has to instantiate.
The errors are "failed constructing descriptor for chaincodes" and "failed to find all layouts for chaincodes"
It's still processing Tx, i just can't install new chaincode.
Anyone ever run across this? Logs are inconclusive in the peers, the orderers and dind in the peers.
I'm guessing it's a resource starvation issue, but I'm grasping at straws.
aatkddny (Fri, 07 Aug 2020 15:52:04 GMT):
Wow it's been a while since I needed to come on here...
HLF 1.4.5 network using raft. K8S using DinD. This particular one has been stable for a year.
Now all of a sudden it's failing to instantiate chaincode.
It's an automated process using the SDK - and has worked for ever.
It runs just fine right up to the point where it has to instantiate.
The errors are "failed constructing descriptor for chaincodes" and "failed to find all layouts for chaincodes"
It's still processing Tx, i just can't install new chaincode.
Anyone ever run across this? Logs are inconclusive in the peers, the orderers and dind in the peers.
I'm guessing it's a resource starvation issue, but I'm grasping at straws. Anyone ever see this?
yacovm (Fri, 07 Aug 2020 17:06:24 GMT):
> Wow it's been a while since I needed to come on here...
You make it sound like you hate being here
yacovm (Fri, 07 Aug 2020 17:06:24 GMT):
> Wow it's been a while since I needed to come on here...
You make it sound like you hate being here, @aatkddny
yacovm (Fri, 07 Aug 2020 17:07:18 GMT):
> The errors are "failed constructing descriptor for chaincodes" and "failed to find all layouts for chaincodes"
This is a discovery error....
yacovm (Fri, 07 Aug 2020 17:07:28 GMT):
How are the logs of the peers doing?
yacovm (Fri, 07 Aug 2020 17:07:41 GMT):
> Logs are inconclusive in the peers, the orderers and dind in the peers.
What do you mean inconclusive?
yacovm (Fri, 07 Aug 2020 17:08:08 GMT):
> I'm guessing it's a resource starvation issue, but I'm grasping at straws. Anyone ever see this?
Give me some logs to look at...
aatkddny (Fri, 07 Aug 2020 19:37:50 GMT):
@yacovm - not really. more because the thing has just been working. so i haven't had anything to ask about, and have been working on something different.
aatkddny (Fri, 07 Aug 2020 19:37:50 GMT):
@yacovm - not really. more because the thing has just been working. so i haven't had anything to ask about, and have been working on something different.
inconclusive because they don't say anything that points to an issue anywhere.
the peers still run transactions on other channels just fine - it's only when we try to upgrade chaincode that it's an issue. (and the chaincode is at something like V2.63 in increments of 0.01 so it's nothing new here).
aatkddny (Fri, 07 Aug 2020 19:37:50 GMT):
@yacovm - not really. more because the thing has just been working. so i haven't had anything to ask about, and have been working on something different.
inconclusive because they don't say anything that points to an issue anywhere.
the peers still run transactions on other channels just fine - it's only when we try to upgrade chaincode that it's an issue. (and the chaincode is at something like V2.63 in increments of 0.01 so it's nothing new here).
discovery isn't throwing any errors - this channel has 6 peers for 3 orgs and 3 anchors. all the messages look good for the comms back and forth.
aatkddny (Fri, 07 Aug 2020 19:37:50 GMT):
@yacovm - not really. more because the thing has just been working. so i haven't had anything to ask about, and have been working on something different.
i'm saying that the logs are inconclusive because they don't say anything that points to an issue anywhere. tried restarting the peer with debug logging on and that too doesn't really say much.
the peers still run transactions on other channels just fine - it's only when we try to upgrade chaincode that it's an issue. (and the chaincode is at something like V2.63 in increments of 0.01 so it's nothing new here).
discovery isn't throwing any errors - this channel has 6 peers for 3 orgs and 3 anchors. all the messages look good for the comms back and forth.
yacovm (Fri, 07 Aug 2020 20:32:51 GMT):
@aatkddny maybe you want to open a JIRA?
aatkddny (Sat, 08 Aug 2020 02:44:57 GMT):
I'm waiting on better logs.
bestbeforetoday (Sun, 09 Aug 2020 13:59:01 GMT):
If the logs don't point to an obvious issue, it might also be useful to know whether the same chaincode upgrade works using the CLI commands, to try to isolate whether the issue is client (SDK) side or server-side
aatkddny (Mon, 10 Aug 2020 00:12:06 GMT):
As an fyi:
We don't use the CLI. There's too many channels to look after so it's all been automated through the SDK.
I am in no hurry at all to move to the version where that support has been dropped...
jtonline (Mon, 10 Aug 2020 14:22:04 GMT):
Has joined the channel.
aatkddny (Mon, 10 Aug 2020 20:02:34 GMT):
And the logs made it pretty clear what the problem was when I finally got my grubby fingers on them. One of the nodes had drifted in time so it was out of synch with the others. Fix that and hey presto - it is all back working.
aatkddny (Mon, 10 Aug 2020 20:02:34 GMT):
And the logs made it pretty clear what the problem was when I finally got my grubby fingers on them. One of the nodes had drifted in time so it was out of synch with the others. Fix that and hey presto - it is all back working.
Getting a ca37c error but that's not preventing us deploying.
bestbeforetoday (Tue, 11 Aug 2020 14:07:48 GMT):
:thumbsup:
bestbeforetoday (Tue, 11 Aug 2020 14:15:18 GMT):
Whisper it but the API to deploy chaincode is still there in fabric-sdk-java v2.2. It was only the v2 Node SDK where this got lost when all the internals were reworked for v2. There is a community proposal to contribute a Node admin package for v2 (raised on last week's contributor meeting)
aatkddny (Tue, 11 Aug 2020 18:54:17 GMT):
What about all the other stuff?
We stand up a network soup to nuts using the APIs.
Creating channels, adding anchors, installing and instantiating chaincodes, the lot. With an egg on top.
bestbeforetoday (Tue, 11 Aug 2020 18:55:58 GMT):
I think everything that was there in fabric-sdk-java v1.4 is still there in v2.2. I certainly don't recall anything being actively removed
aatkddny (Tue, 11 Aug 2020 19:50:11 GMT):
:thumbsup:
ks.cho (Wed, 12 Aug 2020 10:03:00 GMT):
can u explain more detail? I don't understand what you mean
bestbeforetoday (Wed, 12 Aug 2020 15:42:58 GMT):
In the Node.js sample, when you run `node query` you are running a client application contained in the `query.js` file. From memory, that client application just runs a query and prints the results
bestbeforetoday (Wed, 12 Aug 2020 15:43:53 GMT):
There isn't an exactly equivalent sample Java application. Instead there is a sample application that does several pieces of work: queries and transactions
bestbeforetoday (Wed, 12 Aug 2020 15:44:55 GMT):
The Java/Maven equivalent to the `node fileName` command to launch the sample client application is the Maven command-line above
bestbeforetoday (Wed, 12 Aug 2020 15:46:12 GMT):
The samples are just examples of how to code a client application
bestbeforetoday (Wed, 12 Aug 2020 15:56:25 GMT):
If you want a command-line utility that can be used to submit or evaluate (i.e. query) arbitrary transactions then there are the `peer chaincode invoke` and `peer chaincode query` commands: https://hyperledger-fabric.readthedocs.io/en/latest/commands/peerchaincode.html
zhiqiang 1 (Sat, 15 Aug 2020 04:40:33 GMT):
I am a newbie to fabric. I recently received a request that I need to use fabric-sdk-go to query block information, but when initializing the SDK, I found that too much configuration is required. How do I quickly configure the SDK? Just call QueryBlock This function
danilofaria (Mon, 17 Aug 2020 13:33:58 GMT):
Has joined the channel.
pkirkinezis (Mon, 17 Aug 2020 18:50:18 GMT):
Has joined the channel.
pkirkinezis (Mon, 17 Aug 2020 18:52:55 GMT):
the easiest way it throuth fabric gateway .
danilofaria (Tue, 18 Aug 2020 00:57:47 GMT):
Hello folks, I am having an issue with Chaincode installation using `hfClient.sendLifecycleInstallChaincodeRequest` (using 2.1.0).
Most of the times it works fine, but it flakes sometimes and fails with at least one failed response such that:
• status: FAILURE
• message: Channel Channel{id: 20, name: } sending proposal with transaction 48b874f0f818e5e0df55a574cce59e052a8e8e7f3382711b83b5bdb5089c7633 to Peer{ id: 2, name: peer0, channelName: mainchannel, url: grpcs://peer0.org1.example.com:7051} failed because of timeout(60000 milliseconds) expiration
• response.getPackageId() throws
org.hyperledger.fabric.sdk.exception.ProposalException: Status of install proposal did not ret ok for Peer{ id: 2, name: peer0, channelName: mainchannel, url: grpcs://peer0.org1.example.com:7051}, FAILURE
danilofaria (Tue, 18 Aug 2020 00:58:22 GMT):
i have searched tirelessly across the web for a solution but have not been able to find it. i was wondering if this is a known issue and how to fix it
pkirkinezis (Tue, 18 Aug 2020 07:00:05 GMT):
Mornings to the community . Which is the best way to store identity secret so i can use it afterwords ?
pkirkinezis (Tue, 18 Aug 2020 07:01:13 GMT):
For example would it be a best practice to create table on the database and save userId , certificate, private key (string) , hashed identity secret ?
pkirkinezis (Tue, 18 Aug 2020 07:02:04 GMT):
i mean the enrollment secret ..
bestbeforetoday (Tue, 18 Aug 2020 09:50:16 GMT):
If you have the certificate and private key you don't need the enrolment secret. It is just used to obtain the certificate from the CA. Best practice is probably for the CA to be configured to only allow enrollment to happen only once. That way, if you try to retrieve your certificate using enrollment and it fails, you know somebody else has obtained your enrollment secret and retrieved your certificate before you, so the identity has been compromised. It also prevents somebody from discovering your secret after you have retrieved your certificate and grabbing it from the CA after you, also compromising the identity.
pkirkinezis (Tue, 18 Aug 2020 10:02:59 GMT):
Thanks for you reply . How i can store private key on a database ? Because i dont want to store a wallet neather haveing keyfile to a filesystem path and retrieve them .
bestbeforetoday (Tue, 18 Aug 2020 10:04:51 GMT):
There is a CouchDB wallet store implementation if you want to use a Wallet to store to CouchDB: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Wallets.html#newCouchDBWallet-java.net.URL-java.lang.String-
pkirkinezis (Tue, 18 Aug 2020 10:05:32 GMT):
My concept is to use a Maria DB database(already exists on main app) in which every API will query to get the certs or credentials needed to enroll a user and execute query
bestbeforetoday (Tue, 18 Aug 2020 10:07:38 GMT):
Other alternatives are to:
1. Write your own WalletStore implementation to store at a location of your choosing; or
2. (If you don't want to use the wallet data format) you can just store the certificate and private key PEM from your Identity however you want, the create an Identity object using those credentials when you need to connect.
You can connect the Gateway using just an Identity and no Wallet: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Gateway.Builder.html#identity-org.hyperledger.fabric.gateway.Identity-
There are some helper function for converting certificates and private keys in the Identities class: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Identities.html
bestbeforetoday (Tue, 18 Aug 2020 10:07:38 GMT):
Other alternatives are to:
1. Write your own WalletStore implementation to store at a location of your choosing; or
2. (If you don't want to use the wallet data format) you can just store the certificate and private key from your Identity however you want, thne create an Identity object using those credentials when you need to connect.
You can connect the Gateway using just an Identity and no Wallet: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Gateway.Builder.html#identity-org.hyperledger.fabric.gateway.Identity-
There are some helper function for converting certificates and private keys in the Identities class: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Identities.html
pkirkinezis (Tue, 18 Aug 2020 10:10:21 GMT):
How can i convert private key from Enrollment object to private key pem ?
pkirkinezis (Tue, 18 Aug 2020 10:12:07 GMT):
My registration process is the bellow :
RegistrationRequest registrationRequest = new RegistrationRequest(username);
registrationRequest.setAffiliation(env.getProperty("affiliation"));
registrationRequest.setEnrollmentID(username);
registrationRequest.setSecret(secret);
String eSecret = caClient.register(registrationRequest, adminUserContext);
enrollment = caClient.enroll(username, eSecret);
final PrivateKey privateKey = enrollment.getKey();
pkirkinezis (Tue, 18 Aug 2020 10:13:09 GMT):
After the registration I enroll a user and call gateway builder to execute queries
pkirkinezis (Tue, 18 Aug 2020 10:13:09 GMT):
After the registration is success for every api call I enroll a user and call gateway builder to execute queries
pkirkinezis (Tue, 18 Aug 2020 10:20:02 GMT):
After enrollment with secret and userid i create a Enrolement object that then used to create a identity like bellow
pkirkinezis (Tue, 18 Aug 2020 10:20:03 GMT):
X509Identity userIdentity = newX509Identity(env.getProperty("mspid"), Identities.readX509Certificate(enrollment.getCert()), enrollment.getKey());
pkirkinezis (Tue, 18 Aug 2020 10:21:45 GMT):
So i can save Cert as string to database , but how I can save privatekey as string to database because toString() creates the string with curves X,Y.
bestbeforetoday (Tue, 18 Aug 2020 10:22:48 GMT):
It might be simpler to call the method to create directly from an enrollment: `X509Identity userIdentity = Identities.newX509Identity("mspId", enrollment);`
bestbeforetoday (Tue, 18 Aug 2020 10:23:55 GMT):
There are also `Identities.toPemString()` methods that will convert both Certificate and PrivateKey objects to PEM strings
bestbeforetoday (Tue, 18 Aug 2020 10:25:25 GMT):
And you can read those PEM strings back in using the `readX509Certificate()` and `readPrivateKey()` methods on Identities
bestbeforetoday (Tue, 18 Aug 2020 10:25:30 GMT):
Look at the Javadoc: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Identities.html
pkirkinezis (Tue, 18 Aug 2020 10:26:39 GMT):
I can't thank you enough I was stragling more than 2 days. I will try your recomentation by creating pem string .
bestbeforetoday (Tue, 18 Aug 2020 10:28:52 GMT):
:thumbsup:
bestbeforetoday (Tue, 18 Aug 2020 10:40:52 GMT):
First, I would suggest using v2.2.x, although I don't think that will change any behaviour
bestbeforetoday (Tue, 18 Aug 2020 10:51:14 GMT):
Do you know how long the chaincode install operation is typically taking? I am wondering if the operation is sometimes taking longer than the default proposal wait timeout. In which case you could set a larger number on your request object
danilofaria (Tue, 18 Aug 2020 10:51:14 GMT):
i cant upgrade at the moment. would you have any other pointers?
danilofaria (Tue, 18 Aug 2020 10:51:52 GMT):
it usually takes around 20 seconds. but sometimes it just takes forever and times out
bestbeforetoday (Tue, 18 Aug 2020 10:51:53 GMT):
I actually thought the default timeout was 120 seconds rather than the 60 seconds that you are seeing. Maybe that changed at some point though
danilofaria (Tue, 18 Aug 2020 10:54:27 GMT):
i older versions this step was a lot faster and never timed out
danilofaria (Tue, 18 Aug 2020 10:54:27 GMT):
in older versions this step was a lot faster and never timed out
bestbeforetoday (Tue, 18 Aug 2020 10:55:04 GMT):
It might also be worth checking the peer logs so see if the chaincode install is running successfully there
danilofaria (Tue, 18 Aug 2020 10:55:40 GMT):
sometimes this bit shows up:
```
peer0.org1.example.com_1 | 2020-08-12 17:08:18.657 UTC [endorser] SimulateProposal -> ERRO 03d failed to invoke chaincode _lifecycle, error: timeout expired while executing transaction
peer0.org1.example.com_1 | github.com/hyperledger/fabric/core/chaincode.(*Handler).Execute
peer0.org1.example.com_1 | /go/src/github.com/hyperledger/fabric/core/chaincode/handler.go:1215
peer0.org1.example.com_1 | github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).execute
```
danilofaria (Tue, 18 Aug 2020 10:57:09 GMT):
i also noticed that when this happens, retry attempts also fail
bestbeforetoday (Tue, 18 Aug 2020 11:08:12 GMT):
I think there is a configurable peer timeout you can set too. It might be `CORE_CHAINCODE_EXECUTETIMEOUT`, which you set as an environment variable on the peer Docker container. Something like: `CORE_CHAINCODE_EXECUTETIMEOUT=300s`
danilofaria (Tue, 18 Aug 2020 11:57:30 GMT):
is it common for that step to take that long?
bestbeforetoday (Tue, 18 Aug 2020 12:06:43 GMT):
From memory, the install step does a fair bit of work, like building a chaincode docker container, so it might take some time to download and assemble dependencies. I guess it is also possible there is an issue so it might be worth looking into more logs of what is going on in the `_lifecycle` chaincode
pkirkinezis (Wed, 19 Aug 2020 08:59:35 GMT):
I fast querstion . Is there any way to enroll a user without a sectet . Only with private key and certification?
deployer21 (Wed, 19 Aug 2020 13:27:07 GMT):
Has joined the channel.
deployer21 (Wed, 19 Aug 2020 13:29:22 GMT):
Hello guys, can someone explain the difference between fabric-sdk-java and fabric-gateway-java?
Which Jar file should I use in my Java Application to interact with the network?
Thx
bestbeforetoday (Wed, 19 Aug 2020 13:40:12 GMT):
See the opening section of the fabric-sdk-java README: https://github.com/hyperledger/fabric-sdk-java/blob/master/README.md
pkirkinezis (Wed, 19 Aug 2020 17:21:43 GMT):
Let me refraze. I would like to know if you dont save identity secret anywhere and for some reason you loose keyfiles how we can retrieve this identity
pkirkinezis (Wed, 19 Aug 2020 17:23:39 GMT):
Or maybe create keyfiles with expiration date
pkirkinezis (Wed, 19 Aug 2020 17:24:23 GMT):
If you dont have the secret you cannot create new cert files for the specific user
rthatcher (Thu, 20 Aug 2020 14:19:19 GMT):
Reminder that the Fabric Application Developer Community call today is at 3pm UTC (4pm UK, 11am ET, 8am PT) - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community
bestbeforetoday (Thu, 20 Aug 2020 14:48:14 GMT):
I suspect the answer might be for the CA to issue a new certificate and revoke the previous one (if it hasn't expired). You could ask on the #fabric-ca channel as somebody there might have better information
pkirkinezis (Thu, 20 Aug 2020 15:16:35 GMT):
thanks
Nick (Sat, 22 Aug 2020 04:33:25 GMT):
Has joined the channel.
Nick (Mon, 24 Aug 2020 01:06:30 GMT):
Hello guys, can you help suggest what the best practice is to query a specific peer with java sdk.
Nick (Mon, 24 Aug 2020 01:08:37 GMT):
With service discovery, it seems we lost the capability to limit the peer that sdk can see, which was done in connection profile in previous release.
bestbeforetoday (Tue, 25 Aug 2020 08:43:42 GMT):
You can provide your own plugin logic for picking the peer(s) used to evaluate queries by setting a query handler when connecting the Gateway: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Gateway.Builder.html#queryHandler-org.hyperledger.fabric.gateway.spi.QueryHandlerFactory-
I don't think there is a sample query handler with the Java SDK but the implementation should be pretty straightforward. The QueryHandlerFactory function you supply as part of the Gateway connect gets called with the Network when it is first required. It should pick the required peer(s) and then return a QueryHandler instance, which again is just a functional interface that will be invoked (with a Query object parameter) each time a transaction is evaluated. All you have to do in your code is tell the Query object which peer to use and return the results.
bestbeforetoday (Tue, 25 Aug 2020 08:45:14 GMT):
Some other doc pages that might help:
- https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/spi/QueryHandlerFactory.html
- https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/spi/QueryHandler.html
- https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/spi/Query.html
Nick (Tue, 25 Aug 2020 08:46:57 GMT):
Thank you Mark. Will take a deeper look at the queryhandler.
bestbeforetoday (Tue, 25 Aug 2020 08:48:27 GMT):
Your code can probably be simpler than the default implementations, but it might help to look at that code.
QueryHandlerFactory: https://github.com/hyperledger/fabric-gateway-java/blob/7133cf423dc07092d2ad0b0e418b88191e4e385a/src/main/java/org/hyperledger/fabric/gateway/DefaultQueryHandlers.java#L28
QueryHandler: https://github.com/hyperledger/fabric-gateway-java/blob/7133cf423dc07092d2ad0b0e418b88191e4e385a/src/main/java/org/hyperledger/fabric/gateway/impl/query/SingleQueryHandler.java#L36
Nick (Tue, 25 Aug 2020 08:52:47 GMT):
It's nice to know SDK has provided an interface to customize the behavior of query.
Nick (Wed, 26 Aug 2020 04:47:57 GMT):
Hi team, how can I enable debug/trace log for fabric-gateway-java.
Nick (Wed, 26 Aug 2020 04:48:40 GMT):
For fabric-sdk-java is stated to set env variable ORG_HYPERLEDGER_FABRIC_SDK_LOGLEVEL=TRACE
akshay.sood (Wed, 26 Aug 2020 07:05:32 GMT):
Has joined the channel.
akshay.sood (Wed, 26 Aug 2020 07:06:02 GMT):
Hi guys,
I am new to Java SDK. Can anyone refer me to any sample sdk implementation for ZKP?
bestbeforetoday (Wed, 26 Aug 2020 14:44:08 GMT):
I think setting the environment variable as for _fabric-sdk-java_ will also toggle trace for _fabric-gateway-java_. Alternatively, since the SDKs use Log4J by default, you can include a `log4j.properties` configuration file in your classpath, similar to this: https://github.com/hyperledger/fabric-gateway-java/blob/master/src/test/resources/log4j.properties
bestbeforetoday (Wed, 26 Aug 2020 14:56:38 GMT):
There is some general information on Idemix (the zero-knowledge proof implementation) and Fabric here: https://hyperledger-fabric.readthedocs.io/en/release-2.2/idemix.html
bestbeforetoday (Wed, 26 Aug 2020 14:57:31 GMT):
I don't know of any good worked examples of Idemix usage but this integration test uses and enrolls Idemix identities so may be of some help: https://github.com/hyperledger/fabric-sdk-java/blob/master/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIdemixIT.java
Nick (Wed, 26 Aug 2020 23:58:19 GMT):
Thank you Mark.
pkirkinezis (Thu, 27 Aug 2020 05:33:54 GMT):
Hi to the community . Does enyone faced a problem i have . My fabric netowork is up and running 1.5 months now . Today without chaning anything , my JAVA SDK program returns to "{"result":"","errors":[{"code":0,"message":"The CSR subject common name must equal the enrollment ID"}
],"messages":[],"success":false}" whenever i try interact woth the blockchain .
akshay.sood (Thu, 27 Aug 2020 07:19:33 GMT):
@bestbeforetoday Thanks for the suggestion. Do you know where can I store this idemix identity so that I can reuse it again
bestbeforetoday (Thu, 27 Aug 2020 09:07:22 GMT):
That looks like an error message from the CA related to enrolment. It might be worth exploring why your application is re/enrolling identities to obtain certificates if it's been running for 1.5 months. You could also try the #fabric-ca channel to see if anyone has better information on why the CA might be generating that error
pkirkinezis (Thu, 27 Aug 2020 09:18:22 GMT):
I been testing a new user registration . So i enroll admin so then to be able to register a new user. Is this flow correct ?
akshay.sood (Thu, 27 Aug 2020 09:52:26 GMT):
Clipboard - August 27, 2020 3:22 PM
akshay.sood (Thu, 27 Aug 2020 09:53:27 GMT):
@bestbeforetoday I have actually successfully enrolled idemix user. I am not sure how to use the instance of idemix user. Can you navigate me to the documentation of java sdk and tell me how do I invoke a transaction using this idemix user?
bestbeforetoday (Thu, 27 Aug 2020 10:35:39 GMT):
You just set the Idemix user as the user context on your HFClient, the same as you would for a regular X509 identity
bestbeforetoday (Thu, 27 Aug 2020 10:43:30 GMT):
When it comes to storing the Idemix credentials, that's not something I've played with. Possibly you can just store your certificate and private key from the first step of enrollment with the CA and then use those credentials to make the call to `ca.idemixEnroll()` each time you restart your application
bestbeforetoday (Thu, 27 Aug 2020 10:52:31 GMT):
Yes, in as much as you likely need some admin credentials to register a new user identity. Once you've enrolled an identity and obtained their credentials (certificate and private key) you should probably keep those credentials and not re-enroll with the CA each time you want to get them
pkirkinezis (Thu, 27 Aug 2020 12:52:30 GMT):
How i can get Enroment for adminUserContext
pkirkinezis (Thu, 27 Aug 2020 12:52:32 GMT):
?
pkirkinezis (Thu, 27 Aug 2020 12:53:10 GMT):
My registration suquence looks like this UserContext adminUserContext = new UserContext();
adminUserContext.setName(registerar.getName());
adminUserContext.setAffiliation(env.getProperty("mspid"));
adminUserContext.setMspId(env.getProperty("mspid"));
adminUserContext.setEnrollment(caClient.enroll(registerar.getName(), registerar.getEnrollSecret()));
RegistrationRequest registrationRequest = new RegistrationRequest(username);
registrationRequest.setAffiliation(env.getProperty("affiliation"));
registrationRequest.setEnrollmentID(username);
registrationRequest.setSecret(secret);
String eSecret = caClient.register(registrationRequest, adminUserContext);
pkirkinezis (Thu, 27 Aug 2020 12:53:10 GMT):
My registration suquence looks like this
UserContext adminUserContext = new UserContext();
adminUserContext.setName(registerar.getName());
adminUserContext.setAffiliation(env.getProperty("mspid"));
adminUserContext.setMspId(env.getProperty("mspid"));
adminUserContext.setEnrollment(caClient.enroll(registerar.getName(), registerar.getEnrollSecret()));
RegistrationRequest registrationRequest = new RegistrationRequest(username);
registrationRequest.setAffiliation(env.getProperty("affiliation"));
registrationRequest.setEnrollmentID(username);
registrationRequest.setSecret(secret);
String eSecret = caClient.register(registrationRequest, adminUserContext);
bestbeforetoday (Thu, 27 Aug 2020 14:50:42 GMT):
Within your code you have `caClient.enroll(registerar.getName(), registerar.getEnrollSecret())`, which gives you an `Enrollment` object. You are then attaching this to your admin `User` object with `adminUserContext.setEnrollment()`. You can get the `Enrollment` object back from your admin `User` object with `adminUserContext.getEnrollment()`. The `Enrollment` has the methods `getKey()` and `getCert()`, which are the credentials you should probaby be storing rather than re-enrolling with the CA every time you need to use them
bestbeforetoday (Thu, 27 Aug 2020 14:54:11 GMT):
`getCert()` gives you a String with is the X.509 certificate in PEM encoding. `getKey()` gives you a Java `PrivateKey` object. The _fabric-gateway-java_ API has some utility functions for translating between PrivateKey and X509Certificate objects to/from PEM encoded data: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Identities.html
bestbeforetoday (Thu, 27 Aug 2020 14:54:27 GMT):
Or you can use other libraries for this directly
akshay.sood (Thu, 27 Aug 2020 15:05:00 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=5vSnTBWhqFTAyNcoh) @bestbeforetoday I was trying to use java gateway. Do you know if we can use it with gateway?
bestbeforetoday (Thu, 27 Aug 2020 16:21:27 GMT):
The Gateway doesn't have explicit support for Idemix identities. _However_, I think you can probably get it to work by:
1. Build/connect a Gateway instance using an X509Identity (so containing the MSP ID, real certificate and private key)
2. Before using the Gateway for *anything* else, set your Idemix User context on the underlying HFClient using `gateway.getClient().setUserContext(yourIdemixUser)`
bestbeforetoday (Thu, 27 Aug 2020 16:29:59 GMT):
Ah, just remembered that `getClient()` isn't exposed on the Gateway interface to protect users from the implementation details that might change. It's a bit of a hack (and so isn't guaranteed to continue to work in the future) but you can cast the `Gateway` instance to a `GatewayImpl` instance to get access to the `getClient()` method. I'd be interested to hear if it works. If so, maybe proper Idemix support could be added to _fabric-gateway-java_ in the future relatively easily
pkirkinezis (Fri, 28 Aug 2020 05:47:24 GMT):
Yeah to create adminUserContext is easy and then get enrolment . But this is not persistant i have to run caClient.enroll(registerar.getName(), registerar.getEnrollSecret()) in every register http request . I am not using sessions so i can't persist between request the adminUserContext . The best way is to user private key and pemcert to create enrollment
pkirkinezis (Fri, 28 Aug 2020 06:06:04 GMT):
Is it possible to read pri
pkirkinezis (Fri, 28 Aug 2020 06:06:38 GMT):
priv_key cert pem from a file ? I have a keyfile folder that i have the keys
Funbric (Fri, 28 Aug 2020 08:29:33 GMT):
Clipboard - 2020年8月28日下午4点29分
Funbric (Fri, 28 Aug 2020 08:43:11 GMT):
Clipboard - 2020年8月28日下午4点42分
Funbric (Fri, 28 Aug 2020 08:45:44 GMT):
Clipboard - 2020年8月28日下午4点45分
bestbeforetoday (Fri, 28 Aug 2020 08:54:23 GMT):
Yes, I already mentioned how...
The fabric-gateway-java API has some utility functions for translating between PrivateKey and X509Certificate objects to/from PEM encoded data: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Identities.html
bestbeforetoday (Fri, 28 Aug 2020 08:55:13 GMT):
You probably want:
- https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Identities.html#readX509Certificate-java.io.Reader-
- https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Identities.html#readPrivateKey-java.io.Reader-
bestbeforetoday (Fri, 28 Aug 2020 09:02:43 GMT):
And from a Java perspective, and easy way to get a Reader for your certificate/key file is: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#newBufferedReader-java.nio.file.Path-
bestbeforetoday (Fri, 28 Aug 2020 09:02:43 GMT):
And from a Java perspective, an easy way to get a Reader for your certificate/key file that you can pass to those method is: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#newBufferedReader-java.nio.file.Path-
bestbeforetoday (Fri, 28 Aug 2020 09:02:43 GMT):
And from a Java perspective, an easy way to get a Reader for your certificate/key file that you can pass to those methods is: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#newBufferedReader-java.nio.file.Path-
pkirkinezis (Fri, 28 Aug 2020 09:42:17 GMT):
I,ve tried to create enrollement staticly having cert pem and priv_sk declared in the code as strings.
Enrollment enrollment;
if(usertype.matches(CLIENT_ORG) ) {
enrollment = new X509Enrollment(Identities.readPrivateKey(PRIV_SK_CLIENT),CERT_CLIENT);
} else if(usertype.matches(DEBTOR_ORG) ) {
enrollment = new X509Enrollment(Identities.readPrivateKey(PRIV_SK_DEBTOR),CERT_DEBTOR);
} else {
throw new Exception("No valid usertype");
}
return enrollment;
pkirkinezis (Fri, 28 Aug 2020 09:43:51 GMT):
The above code enrolls admin . By i get Authentication failure in hyperledger fabric while registering the new User, using the admin enrollment i created
pkirkinezis (Fri, 28 Aug 2020 10:22:18 GMT):
Something else . Enroll creates new keys everytime or it gives you the same keys ?
bestbeforetoday (Fri, 28 Aug 2020 10:24:55 GMT):
I think argument 2 is a serialized ChaincodeDeploymentSpec protobuf, and argument 3 is a serialized SignaturePolicyEnvelope protobuf: https://github.com/hyperledger/fabric/blob/ddffd901a677c0b284a9e0e0608f00290ebf4430/core/scc/lscc/lscc.go#L983
bestbeforetoday (Fri, 28 Aug 2020 10:25:02 GMT):
I would probably look to use the compiled protobuf Java implementation classes to work with them, e.g. `org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeDeploymentSpec.parseFrom()`
bestbeforetoday (Fri, 28 Aug 2020 10:38:15 GMT):
Enrollment is about getting the CA to issue a signed certificate for your identity. You can supply an existing public/private key pair to the enrollment request. If you don't supply a public/private key pair then enrollment will generate a new key for you client-side every time, and then request a signed certificate for this key pair from the CA
pkirkinezis (Fri, 28 Aug 2020 10:39:30 GMT):
Thank for you reply i mean when i enroll with "username" and "secret" new keys are being generated ?
bestbeforetoday (Fri, 28 Aug 2020 10:40:37 GMT):
Yes
pkirkinezis (Fri, 28 Aug 2020 10:41:45 GMT):
So to get the same cert and private key and not generate new ones i have to "reenroll " and not "enroll" ?
bestbeforetoday (Fri, 28 Aug 2020 10:47:35 GMT):
You should just keep hold of your certificate and private key. Once you have them you don't need to talk to the CA anymore. The CA doesn't have your private key
pkirkinezis (Fri, 28 Aug 2020 10:50:10 GMT):
Ok yeah that how i did it now i just used all keys so that why authendication failure . I got new keys with enrolling admin user (with secret) and saved them and now i use this as admin keys and everything works
bestbeforetoday (Fri, 28 Aug 2020 10:51:41 GMT):
:thumbsup:
pkirkinezis (Fri, 28 Aug 2020 10:52:04 GMT):
I mean old keys *
pkirkinezis (Fri, 28 Aug 2020 10:58:20 GMT):
The keys produced by fabric ca have a expiration date or they exist until i invoke them manually ?
pkirkinezis (Fri, 28 Aug 2020 10:59:19 GMT):
I know that you can configure them . I mean is there a default config for certs and keys ?
pkirkinezis (Fri, 28 Aug 2020 11:00:25 GMT):
I found this one https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/serverconfig.html
Funbric (Sat, 29 Aug 2020 13:34:09 GMT):
Thanks 啊咯
Funbric (Sat, 29 Aug 2020 13:37:07 GMT):
Thanks a lot! It confused me and my team for long time. Thanks again!
NizomjonKhajiev (Sat, 29 Aug 2020 14:46:13 GMT):
Has joined the channel.
NizomjonKhajiev (Sat, 29 Aug 2020 14:46:13 GMT):
org.hyperledger.fabric_ca.sdk.HFCAClient$AllHostsSSLSocketFactory cannot be cast to org.apache.http.conn.socket.ConnectionSocketFactory
NizomjonKhajiev (Sat, 29 Aug 2020 14:46:27 GMT):
How Can I resolve this issue ?
SubhodI (Sat, 29 Aug 2020 15:28:52 GMT):
Has joined the channel.
SubhodI (Sat, 29 Aug 2020 15:28:52 GMT):
Hi
SubhodI (Sat, 29 Aug 2020 15:29:36 GMT):
Duplicate question: Copied from #fabric-questions
I understand how fabric-gateway-sdk can pickup a wallet to submit transactions.
As in the gateway documentation,
``` Path walletDirectory = Paths.get("wallet");
Wallet wallet = Wallets.newFileSystemWallet(walletDirectory);
// Path to a common connection profile describing the network.
Path networkConfigFile = Paths.get("connection.json");
// Configure the gateway connection used to access the network.
Gateway.Builder builder = Gateway.createBuilder()
.identity(wallet, "user1")
.networkConfig(networkConfigFile); ```
How to create this wallet file? This wallet has to be registered with the CA too. I am wondering how to register a user with the certificate authority and create a wallet file out of those?
SubhodI (Sat, 29 Aug 2020 15:29:36 GMT):
Duplicate question: Pasting here from #fabric-questions
I understand how fabric-gateway-sdk can pickup a wallet to submit transactions.
As in the gateway documentation,
``` Path walletDirectory = Paths.get("wallet");
Wallet wallet = Wallets.newFileSystemWallet(walletDirectory);
// Path to a common connection profile describing the network.
Path networkConfigFile = Paths.get("connection.json");
// Configure the gateway connection used to access the network.
Gateway.Builder builder = Gateway.createBuilder()
.identity(wallet, "user1")
.networkConfig(networkConfigFile); ```
How to create this wallet file? This wallet has to be registered with the CA too. I am wondering how to register a user with the certificate authority and create a wallet file out of those?
YangMiranda (Mon, 31 Aug 2020 17:17:37 GMT):
Has joined the channel.
YangMiranda (Mon, 31 Aug 2020 17:17:37 GMT):
Hi, is it possible to change the Identity Enrollment Secret with HFCAClient object? It seems possible with CLI tool, but it's not clear with fabric-sdk-java
bestbeforetoday (Tue, 01 Sep 2020 09:53:30 GMT):
If you enroll using the HFCAClient in _fabric-sdk-java_ you will get back an Enrollment object, which contains an X.509 certificate and a private key. This can be turned into a Gateway Identity that can be stored in a wallet using `Identities.newX509Identity()`: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Identities.html#newX509Identity-java.lang.String-org.hyperledger.fabric.sdk.Enrollment-
bestbeforetoday (Tue, 01 Sep 2020 09:57:03 GMT):
If you already have an X.509 certificate and private key, perhaps from some other method of (or previous) enrollment, there are other methods on the `Identities` class to help you build a Gateway identity from `X509Certificate` and `PrivateKey` objects, and to convert to/from PEM-encoded forms on these objects: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Identities.html
bestbeforetoday (Tue, 01 Sep 2020 09:58:24 GMT):
There are methods on the `Wallets` class to allow you to create new or reference existing wallets backed by various types of storage: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Wallets.html
bestbeforetoday (Tue, 01 Sep 2020 09:59:38 GMT):
So after enrollment, you create an Identity and Wallet object and then just `put()` the Identity into the Wallet: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Wallet.html#put-java.lang.String-org.hyperledger.fabric.gateway.Identity-
bestbeforetoday (Tue, 01 Sep 2020 10:01:08 GMT):
If you have some other mechanism for storing and retrieving identity information, you have the option to connect a Gateway with a specific identity and not use a wallet at all: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Gateway.Builder.html#identity-org.hyperledger.fabric.gateway.Identity-
bestbeforetoday (Tue, 01 Sep 2020 10:03:34 GMT):
That's not an error I recall seeing before. Is there any more context, like a stacktrace to help pin down what's going on?
bestbeforetoday (Tue, 01 Sep 2020 10:13:00 GMT):
Not sure I 100% understand what you're trying to do but... you can specify the desired enrollment secret on the RegistrationRequest passed to `HFCAClient.register()`
YangMiranda (Tue, 01 Sep 2020 17:27:48 GMT):
Thanks fo answer the question.
Today i can register a user using some admin credentials and the method you told. I'm thinking in a case that user want to change his password used to enroll certs in a procedure implemented with SDK. It seems possible with CLI command, but it's not clear with SDK. (https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/users-guide.html?highlight=modify#modifying-an-identity)
bestbeforetoday (Wed, 02 Sep 2020 08:36:37 GMT):
I'm not sure what that CLI command is doing under the covers (might be worth asking on #fabric-ca, since I guess it might just be calling _register_ again) but I don't know of a modify operation provided by HFCAClient
bestbeforetoday (Wed, 02 Sep 2020 08:38:27 GMT):
Be wary of viewing this as changing the user's password though. The enrollment secret is just some arbitrary secret used to allow the user to be securely issued a certificate by the CA. Once they have the certificate (and corresponding private key), they should be storing and using that certificate and private key, not enrolling again. So the secret should generally be a one time thing
cri 323 (Wed, 02 Sep 2020 13:34:25 GMT):
Has joined the channel.
cri 323 (Wed, 02 Sep 2020 13:34:26 GMT):
Hello, is it possible to add a new organisation only using HF Gateway and dockers? I have tried to follow https://hyperledger-fabric-ca.readthedocs.io/en/latest/operations_guide.html#setup-cas to build my own CA and perform the admin enroling, but enroling from Gateway did not create the same directory hierachy like the one from fabric-ca-client, is there any example how to add a new organisation using the java HF Gateway / SDK? Are there any example for this? Thank you.
mahoney1 (Thu, 03 Sep 2020 13:53:59 GMT):
Reminder that the Fabric Application Developer Community call today is at 3pm UTC (4pm UK, 11am ET, 8am PT) - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.community
lherskind (Fri, 04 Sep 2020 08:29:54 GMT):
Has joined the channel.
lherskind (Fri, 04 Sep 2020 08:29:54 GMT):
Hi, when we are using RAFT as the consensus, our transactions created with the gateway are reject because they fail the TLS handshake. When we are using kafka which does not require TLS the sample works just as intended.
Does anyone know how to include a TLS certificate in the wallet? Or have a sample that works with RAFT as consensus?
Thank you very much.
nkl199 (Fri, 04 Sep 2020 09:08:05 GMT):
which client side library are you using?
nkl199 (Fri, 04 Sep 2020 09:08:05 GMT):
which client side library are you using? (and at what versino?)
nkl199 (Fri, 04 Sep 2020 09:08:05 GMT):
which client side library are you using? (and at what version?)
nkl199 (Fri, 04 Sep 2020 09:08:05 GMT):
which client side library version?
akshay.sood (Fri, 04 Sep 2020 09:44:00 GMT):
Clipboard - September 4, 2020 3:13 PM
akshay.sood (Fri, 04 Sep 2020 09:44:01 GMT):
@bestbeforetoday I actually tried it with java sdk and set the user context as Idemix enrolled user. The problem is that the peer is throwing error `zero-knowledge proof is invalid`. I have attached the screenshot also
akshay.sood (Fri, 04 Sep 2020 09:45:42 GMT):
Clipboard - September 4, 2020 3:15 PM
akshay.sood (Fri, 04 Sep 2020 09:45:43 GMT):
This is how I am assigning the idemix user to userContext
akshay.sood (Fri, 04 Sep 2020 09:46:06 GMT):
```fun generateIdemixUser(username: String, enrolment: Enrollment): AppUser{
val idemixEnrollment= getCAClient().idemixEnroll(enrolment, "Org1IDEMixMSP")
return AppUser(username, "org1", "Org1MSP", idemixEnrollment)
}```
akshay.sood (Fri, 04 Sep 2020 09:47:02 GMT):
I am not sure what I did wrong
nkl199 (Fri, 04 Sep 2020 09:47:21 GMT):
worth checking that the connection profile is specifying grpcs connections and that you are supplying the correct tlsca root cert
nkl199 (Fri, 04 Sep 2020 09:48:08 GMT):
an example ccp for tls is here: https://github.com/hyperledger/fabric-gateway-java/blob/master/src/test/java/org/hyperledger/fabric/gateway/connection-tls.json
akshay.sood (Fri, 04 Sep 2020 10:49:38 GMT):
This is my configtx.yaml file
https://hastebin.com/oyomupagaz.makefile
akshay.sood (Fri, 04 Sep 2020 10:49:44 GMT):
https://hastebin.com/oyomupagaz.makefile
bestbeforetoday (Fri, 04 Sep 2020 10:59:35 GMT):
Nothing is jumping out at me as a problem with that config or code. I'm not an Idemix expert though, and I'm not sure if any of the people who developed the Idemix support are still active in the community
akshay.sood (Fri, 04 Sep 2020 11:00:36 GMT):
No problem @bestbeforetoday. Thanks anyway for your help :)
bestbeforetoday (Fri, 04 Sep 2020 11:01:08 GMT):
@adc Any ideas on the Identity Mixer issues above? ^^^
akshay.sood (Fri, 04 Sep 2020 11:09:47 GMT):
@bestbeforetoday I am using ca of org1 to register & enroll the idenity. Is that a problem?
bestbeforetoday (Fri, 04 Sep 2020 13:01:43 GMT):
The tests look like they use a admin identity to register the user with the CA, then the user enrolls using their secret, then there is an idemixEnroll with the user's enrollment and Idemix MSP ID. That Idemix enrollment replaces the user's enrollment, but it still keeps the user's actual MSP ID. The Idemix MSP ID looks to only be used for idemixEnroll(): https://github.com/hyperledger/fabric-sdk-java/blob/655639204cefa9515cd27b8c4a9a4109da574b29/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIdemixIT.java#L121
bestbeforetoday (Fri, 04 Sep 2020 13:01:43 GMT):
The tests look like they use an admin identity to register the user with the CA, then the user enrolls using their secret, then there is an idemixEnroll with the user's enrollment and Idemix MSP ID. That Idemix enrollment replaces the user's enrollment, but it still keeps the user's actual MSP ID. The Idemix MSP ID looks to only be used for idemixEnroll(): https://github.com/hyperledger/fabric-sdk-java/blob/655639204cefa9515cd27b8c4a9a4109da574b29/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIdemixIT.java#L121
bestbeforetoday (Fri, 04 Sep 2020 13:02:43 GMT):
I'm not spotting how that is different to what you have done
ckong (Mon, 07 Sep 2020 03:54:54 GMT):
Has joined the channel.
ckong (Mon, 07 Sep 2020 03:56:32 GMT):
Does the Fabric Java SDK allow creation of a channel starting from creating a genesis block?
ckong (Mon, 07 Sep 2020 04:00:34 GMT):
Context is I want to create a channel programmatically using the SDK as much as possible, and I would like to know what I can/not do using the SDK.
Jakeeyturner (Mon, 07 Sep 2020 10:13:08 GMT):
Has joined the channel.
ckong (Wed, 09 Sep 2020 02:39:16 GMT):
In order to create a channel I need to create a .tx file. Can I use the Java SDK to generate this .tx file?
akshay.sood (Wed, 09 Sep 2020 05:22:17 GMT):
@bestbeforetoday it is working fine now. I was using wrong ca server and thats why it was rejecting my zkp identity
bestbeforetoday (Wed, 09 Sep 2020 07:19:17 GMT):
:thumbsup:
akshay.sood (Thu, 10 Sep 2020 07:26:51 GMT):
Thanks @bestbeforetoday :)
ckong (Thu, 10 Sep 2020 08:45:56 GMT):
Can anyone explain the difference between channel.addPeer() and channel.joinPeer()?
bestbeforetoday (Thu, 10 Sep 2020 10:37:08 GMT):
I believe `addPeer()` is just adding it your client channel configuration, similar to including it in the connection profile. So just making your client aware of a peer that is already a member of the channel. `joinPeer()` is actually trying to make a new peer a member of a channel
ckong (Fri, 11 Sep 2020 02:40:41 GMT):
Since there seems to be a functional difference between the two, after I create a new Channel object and before I do channel.initialize(), which is the correct way to add peers - addPeer() or joinPeer()?
bestbeforetoday (Fri, 11 Sep 2020 07:39:56 GMT):
If the peer is already a member of the network and you just want to make your client aware of it then `addPeer()`. If the peer is not a member of a network and you want to join it as an additional node, `joinPeer()`
amolpednekar (Fri, 11 Sep 2020 08:00:43 GMT):
Does the java sdk gateway abstraction not allow to create/join channels or have any apis for chaincode lifecyle ops? (install/approve/commit..) ?
amolpednekar (Fri, 11 Sep 2020 08:01:12 GMT):
and if not, are there samples on how to use the SDK for these ops(for v2.2)
bestbeforetoday (Fri, 11 Sep 2020 12:00:58 GMT):
_fabric-gateway-java_ is focused enabling client applications to interact with the ledger through transactions and events. It doesn't provide administrative functions. Where practical, I would recommend using the `peer` CLI for administrative tasks
bestbeforetoday (Fri, 11 Sep 2020 12:04:37 GMT):
The lower level _fabric-sdk-java_ has administrative capability, and you are fine to use that, but how well it stays in step with future admin capabilities is likely to be determined by how much development effort the community is able to put into updating it
amolpednekar (Fri, 11 Sep 2020 15:08:12 GMT):
@bestbeforetoday Thanks for the reply.
Your comment on fabric-sdk-java is a suprising indeed and I did notice that. Only 1 integration test is up-to-date with 2.x code. Is this the case with other SDK's too (node)? That admin capabilities might not be available quickly?
Because I feel this would be important for any software vendor wanting to build APIs around such operations for serious projects
amolpednekar (Fri, 11 Sep 2020 15:08:12 GMT):
@bestbeforetoday Thanks for the reply.
Your comment on fabric-sdk-java is a suprising indeed and I did notice that. Only 1 integration test is up-to-date with 2.x code. Is this the case with other SDK's too (node)? That admin capabilities might not be available quickly or supported at all?
Because I feel this would be important for any software vendor wanting to build APIs around such operations for serious projects
amolpednekar (Fri, 11 Sep 2020 15:08:12 GMT):
@bestbeforetoday Thanks for the reply.
Your comment on fabric-sdk-java is a suprising indeed and I did notice that. Only 1 integration test is up-to-date with 2.x code. Is this the case with other SDK's too (NodeJS)? That admin capabilities might not be available quickly or supported at all?
Because I feel this would be important for any software vendor wanting to build APIs around such operations for serious projects
lquintai (Mon, 14 Sep 2020 08:22:55 GMT):
Has joined the channel.
vineeta (Mon, 14 Sep 2020 10:13:46 GMT):
Has joined the channel.
vineeta (Mon, 14 Sep 2020 10:49:38 GMT):
```
Hi,Is there any API to add private data collections to service discovery using java fabric gateway like contract.addDiscoveryInterest API used in Node.js gateway?
```
vineeta (Mon, 14 Sep 2020 10:50:26 GMT):
Hi, Is there any API to add private data collections to service discovery using java fabric gateway like contract.addDiscoveryInterest API used in Node.js gateway?
bestbeforetoday (Tue, 15 Sep 2020 12:13:27 GMT):
Not today, no. You would probably need to use `setEndorsingPeers()` on the Transaction to achieve a similar thing: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Transaction.html#setEndorsingPeers-java.util.Collection-
bestbeforetoday (Tue, 15 Sep 2020 12:15:32 GMT):
That does rely on you to identify the peers that need to be used for endorsement. If a collection is available to all peers in given organization(s) then you could use `network.getChannel().getPeersForOrganization()` to get candidate peers
schinivision (Thu, 17 Sep 2020 10:51:40 GMT):
Can someone please point me at the grpc connection timout setting. I am querying a large batch and the connection times out after 35 seconds.. The Chaincode will return but can not hand over the data to the Applikation due to the closed connection.
schinivision (Thu, 17 Sep 2020 10:51:40 GMT):
Can someone please point me at the grpc connection timout setting. I am querying a large batch and the connection times out after 35 seconds.. The Chaincode will return but can not hand over the data to the Applikation due to the closed connection.
Error Msg:
`sending proposal with transaction 4ac1dc4ee1dd7e98636ed50e24b3f7169b06000eb01faea514d2103cb298cd48 to Peer{ id: 2, name: peer0, channelName: testChannel, url: grpc://
schinivision (Thu, 17 Sep 2020 10:51:40 GMT):
Can someone please point me at the grpc connection timout setting. I am querying a large batch and the connection times out after 35 seconds.. The Chaincode will return but can not hand over the data to the Applikation due to the closed connection.
Error Msg:
`sending proposal with transaction 4ac1dc4ee1dd7e98636ed50e24b3f7169b06000eb01faea514d2103cb298cd48 to Peer{ id: 2, name: peer0, channelName: testChannel, url: grpc://
schinivision (Thu, 17 Sep 2020 10:51:40 GMT):
Can someone please point me at the grpc connection timout setting. I am querying a large batch and the connection times out after 35 seconds.. The Chaincode will return but can not hand over the data to the Applikation due to the closed connection.
Error Msg:
`sending proposal with transaction 4ac1dc4ee1dd7e98636ed50e24b3f7169b06000eb01faea514d2103cb298cd48 to Peer{ id: 2, name: peer0, channelName: testChannel, url: grpc://
mahoney1 (Thu, 17 Sep 2020 14:42:59 GMT):
Reminder that the Fabric Application Developer Community call today is at 3pm UTC (4pm UK, 11am ET, 8am PT) Agenda: https://wiki.hyperledger.org/display/fabric/Agendas:+Fabric+Application+Developer+Community+Call+Meetings - Join via Zoom from PC, Mac, Linux, iOS or Android: https://zoom.us/my/hyperledger.communit
mahoney1 (Thu, 17 Sep 2020 15:26:45 GMT):
ok all - so the meeting ^^ is open now - password is THVoQXVHYUVWbHIwOFdvME0xN0lCZz09 when prompted - apologies - this was prompted by changes that Zoom (the host) have made, apparently
lupass93 (Thu, 17 Sep 2020 23:34:25 GMT):
Hi!
lupass93 (Thu, 17 Sep 2020 23:37:24 GMT):
I'm studying connection profile in hyperledger fabric. I would learn to define and make a connection profile for Java sdk for production network. But In the docs there is only guidelines for a test/development mode. I ask if you have a guidelines for define and make it for production mode. Thank you very much! 😊
bestbeforetoday (Fri, 18 Sep 2020 10:24:51 GMT):
There is no fundamental difference between a connection profile used to connect to a production or test/development network. The connection profile simply describes nodes (peers and orderers) to which the client can connect. My advice would be to configure your network to use discovery and minimise the nodes in the connection profile to peers the client should use to for initial connection and the discover the rest of the network nodes. That way you don't need to push new connection profiles out to all of your clients if the network topology changes
bestbeforetoday (Fri, 18 Sep 2020 10:26:55 GMT):
The only thing that springs to mind that is sometimes an issue in a production environment is idle gRPC connections getting more aggressively closed by ingress controllers or firewalls in the cloud deployment. You might want to specify gRPC connection properties like keep-alives, and the connection profile is a place this can be done
lupass93 (Fri, 18 Sep 2020 11:38:13 GMT):
Thank you very much for the answer.
About information like tlsCAcerts pem file, Is it safe to expose this information in connection profile file?
amolpednekar (Fri, 18 Sep 2020 12:44:31 GMT):
@bestbeforetoday I am trying to test the gateway wrapper with private data, using this chaincode - https://github.com/hyperledger/fabric-samples/tree/master/asset-transfer-private-data/chaincode-go
I have modified the assetCollection's Endorsement Policy from "OR('Org1MSP.member', 'Org2MSP.member')" to "AND('Org1MSP.member', 'Org2MSP.member')"
{
"name": "assetCollection",
"policy": "OR('Org1MSP.member', 'Org2MSP.member')",
"requiredPeerCount": 0,
"maxPeerCount": 1,
"blockToLive":1000000,
"memberOnlyRead": false,
"memberOnlyWrite": false,
"endorsementPolicy": {
"signaturePolicy": "AND('Org1MSP.member', 'Org2MSP.member')"
}
But I get an endorsement failure on the peer
`2020-09-18 12:39:24.522 UTC [vscc] Validate -> ERRO 1f2 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for collection assetCollection chaincode private in tx 25:0 failed: signature set did not satisfy policy
2020-09-18 12:39:24.522 UTC [committer.txvalidator] validateTx -> ERRO 1f3 Dispatch for transaction txId = 5c72d5ec8e38f8172e3ba41ccd4e2915011c6ce6f9d289d495109b816e84f9d4 returned error: validation of endorsement policy for collection assetCollection chaincode private in tx 25:0 failed: signature set did not satisfy policy`
It works fine when the policy is OR(Org1, Org2). i tried to set the endorsing peers manually as well, but no difference
I see this issue only with private data chaincodes. Am I missing something here?
amolpednekar (Fri, 18 Sep 2020 12:44:31 GMT):
@bestbeforetoday I am trying to test the gateway wrapper with private data, using this chaincode - https://github.com/hyperledger/fabric-samples/tree/master/asset-transfer-private-data/chaincode-go
I have modified the assetCollection's Endorsement Policy from "OR('Org1MSP.member', 'Org2MSP.member')" to "AND('Org1MSP.member', 'Org2MSP.member')"
{
"name": "assetCollection",
"policy": "OR('Org1MSP.member', 'Org2MSP.member')",
"requiredPeerCount": 0,
"maxPeerCount": 1,
"blockToLive":1000000,
"memberOnlyRead": false,
"memberOnlyWrite": false,
"endorsementPolicy": {
"signaturePolicy": "AND('Org1MSP.member', 'Org2MSP.member')"
}
But I get an endorsement failure on the peer
`
2020-09-18 12:39:24.522 UTC [vscc] Validate -> ERRO 1f2 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for collection assetCollection chaincode private in tx 25:0 failed: signature set did not satisfy policy
2020-09-18 12:39:24.522 UTC [committer.txvalidator] validateTx -> ERRO 1f3 Dispatch for transaction txId = 5c72d5ec8e38f8172e3ba41ccd4e2915011c6ce6f9d289d495109b816e84f9d4 returned error: validation of endorsement policy for collection assetCollection chaincode private in tx 25:0 failed: signature set did not satisfy policy`
It works fine when the policy is OR(Org1, Org2). i tried to set the endorsing peers manually as well, but no difference
I see this issue only with private data chaincodes. Am I missing something here?
amolpednekar (Fri, 18 Sep 2020 12:44:31 GMT):
@bestbeforetoday I am trying to test the gateway wrapper with private data, using this chaincode - https://github.com/hyperledger/fabric-samples/tree/master/asset-transfer-private-data/chaincode-go
I have modified the assetCollection's Endorsement Policy from "*OR*('Org1MSP.member', 'Org2MSP.member')" to "*AND*('Org1MSP.member', 'Org2MSP.member')"
{
"name": "assetCollection",
"policy": "OR('Org1MSP.member', 'Org2MSP.member')",
"requiredPeerCount": 0,
"maxPeerCount": 1,
"blockToLive":1000000,
"memberOnlyRead": false,
"memberOnlyWrite": false,
"endorsementPolicy": {
"signaturePolicy": "AND('Org1MSP.member', 'Org2MSP.member')"
}
But I get an endorsement failure on the peer
`2020-09-18 12:39:24.522 UTC [vscc] Validate -> ERRO 1f2 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for collection assetCollection chaincode private in tx 25:0 failed: signature set did not satisfy policy
2020-09-18 12:39:24.522 UTC [committer.txvalidator] validateTx -> ERRO 1f3 Dispatch for transaction txId = 5c72d5ec8e38f8172e3ba41ccd4e2915011c6ce6f9d289d495109b816e84f9d4 returned error: validation of endorsement policy for collection assetCollection chaincode private in tx 25:0 failed: signature set did not satisfy policy`
It works fine when the policy is OR(Org1, Org2). i tried to set the endorsing peers manually as well, but no difference
I see this issue only with private data chaincodes. Am I missing something here?
amolpednekar (Fri, 18 Sep 2020 12:44:31 GMT):
@bestbeforetoday I am trying to test the gateway with private data, using this chaincode - https://github.com/hyperledger/fabric-samples/tree/master/asset-transfer-private-data/chaincode-go
I have modified the assetCollection's Endorsement Policy from "*OR*('Org1MSP.member', 'Org2MSP.member')" to "*AND*('Org1MSP.member', 'Org2MSP.member')"
{
"name": "assetCollection",
"policy": "OR('Org1MSP.member', 'Org2MSP.member')",
"requiredPeerCount": 0,
"maxPeerCount": 1,
"blockToLive":1000000,
"memberOnlyRead": false,
"memberOnlyWrite": false,
"endorsementPolicy": {
"signaturePolicy": "AND('Org1MSP.member', 'Org2MSP.member')"
}
But I get an endorsement failure on the peer
`2020-09-18 12:39:24.522 UTC [vscc] Validate -> ERRO 1f2 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for collection assetCollection chaincode private in tx 25:0 failed: signature set did not satisfy policy
2020-09-18 12:39:24.522 UTC [committer.txvalidator] validateTx -> ERRO 1f3 Dispatch for transaction txId = 5c72d5ec8e38f8172e3ba41ccd4e2915011c6ce6f9d289d495109b816e84f9d4 returned error: validation of endorsement policy for collection assetCollection chaincode private in tx 25:0 failed: signature set did not satisfy policy`
It works fine when the policy is OR(Org1, Org2). i tried to set the endorsing peers manually as well, but no difference
I see this issue only with private data chaincodes. Am I missing something here?
amolpednekar (Fri, 18 Sep 2020 12:44:31 GMT):
@bestbeforetoday I am trying to test the gateway with private data, using this chaincode - https://github.com/hyperledger/fabric-samples/tree/master/asset-transfer-private-data/chaincode-go
I have modified the assetCollection's Endorsement Policy from "*OR*('Org1MSP.member', 'Org2MSP.member')" to "*AND*('Org1MSP.member', 'Org2MSP.member')"
I am calling the "CreateAsset" function - https://github.com/hyperledger/fabric-samples/blob/master/asset-transfer-private-data/chaincode-go/chaincode/asset_transfer.go#L50
{
"name": "assetCollection",
"policy": "OR('Org1MSP.member', 'Org2MSP.member')",
"requiredPeerCount": 0,
"maxPeerCount": 1,
"blockToLive":1000000,
"memberOnlyRead": false,
"memberOnlyWrite": false,
"endorsementPolicy": {
"signaturePolicy": "AND('Org1MSP.member', 'Org2MSP.member')"
}
But I get an endorsement failure on the peer
`2020-09-18 12:39:24.522 UTC [vscc] Validate -> ERRO 1f2 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for collection assetCollection chaincode private in tx 25:0 failed: signature set did not satisfy policy
2020-09-18 12:39:24.522 UTC [committer.txvalidator] validateTx -> ERRO 1f3 Dispatch for transaction txId = 5c72d5ec8e38f8172e3ba41ccd4e2915011c6ce6f9d289d495109b816e84f9d4 returned error: validation of endorsement policy for collection assetCollection chaincode private in tx 25:0 failed: signature set did not satisfy policy`
It works fine when the policy is OR(Org1, Org2). i tried to set the endorsing peers manually as well, but no difference
I see this issue only with private data chaincodes. Am I missing something here?
bestbeforetoday (Fri, 18 Sep 2020 12:55:15 GMT):
An X.509 certificate is essentially a public key and digital signature to prove the validity of that public key, so it should be safe to distribute
bestbeforetoday (Fri, 18 Sep 2020 15:45:51 GMT):
I haven't looked closely at that scenario but it would be worth looking at the logs for the chaincode Docker containers to see what happened in each organization, and perhaps also looking at the proposal responses attached to the ContractException thrown at the client end. From the error I'm guessing that the proposal was not endorsed by one of the organizations
vioking (Fri, 18 Sep 2020 16:51:28 GMT):
Has joined the channel.
ckong (Mon, 21 Sep 2020 03:30:48 GMT):
Regarding channel.sendTransactionProposal() vs channel.sendTransaction(), correct me if my understanding is wrong but the former only simulates the transaction in the peers with the chaincode, while the latter is where the actual transaction is processed. In that case, how necessary is it for a client calling channel.sendTransaction() to handle the results returned?
amolpednekar (Mon, 21 Sep 2020 06:04:48 GMT):
@bestbeforetoday Thanks for the pointers. So I noticed that chaincode logs on org2 are not getting updated, so its not executing.
Then I checked the proposal response on the client as you mentioned, and I see this
"CreateAsset cannot be performed: Error client from org Org1MSP is not authorized to read or write private data from an org Org2MSP peer"
But as per the collection details, both "memberOnlyRead": false, "memberOnlyWrite": false,
So it should work, no?
amolpednekar (Mon, 21 Sep 2020 06:29:22 GMT):
Update: Issue fixed
There was a function on the chaincode which checks whether clientMSP matches peerMSP, and this was returning and error response. Disabling this fixed it.
https://github.com/hyperledger/fabric-samples/blob/master/asset-transfer-private-data/chaincode-go/chaincode/asset_transfer.go#L561
@bestbeforetoday Can you tell how this function is different from what memberOnlyRead/memberOnlyWrite property in collections config does?
amolpednekar (Mon, 21 Sep 2020 06:29:22 GMT):
Update: Issue fixed
There was a function on the chaincode which checks whether clientMSP matches peerMSP, and this was returning and error response. Disabling this fixed it.
https://github.com/hyperledger/fabric-samples/blob/master/asset-transfer-private-data/chaincode-go/chaincode/asset_transfer.go#L561
erin-hughes (Mon, 21 Sep 2020 07:58:23 GMT):
Has joined the channel.
andrew-coleman (Mon, 21 Sep 2020 09:22:05 GMT):
I strongly recommend you use the high-level 'gateway' API to submit transactions (https://github.com/hyperledger/fabric-gateway-java), much less code to write. It handles the gathering of endorsements, sending to ordering service, awaiting commit events, etc for you
ckong (Mon, 21 Sep 2020 10:50:51 GMT):
This is one of the things which I will have to look at soon, but for now I'm bound by constraints. How should the result from channel.sendTransaction() be handled, if at all?
bestbeforetoday (Tue, 22 Sep 2020 09:46:58 GMT):
If the CompletableFuture it returns completes exceptionally then something went wrong: either the send to the orderer failed or (if your transaction options say it should wait for commit events) then the required number of commits were not observed within a timeout period.
bestbeforetoday (Tue, 22 Sep 2020 09:49:05 GMT):
If it completes successfully then it successfully sent the transaction to the orderer and, if your transaction options say you wanted to wait for commit events, it also received the required number of events. If it waited for events then an event is returned
bestbeforetoday (Tue, 22 Sep 2020 09:50:25 GMT):
But as mentioned above, using the higher level Gateway API (which layers on top of the low-level API, so you can use them in combination) is preferred
letch2010 (Tue, 22 Sep 2020 15:21:27 GMT):
Has joined the channel.
bh4rtp (Thu, 24 Sep 2020 01:44:58 GMT):
hi, does java sdk have addDiscoveryInterest function as node sdk?
amolpednekar (Thu, 24 Sep 2020 09:53:35 GMT):
@bh4rtp Nope; check above ^^
I was able to send transaction and get endorsement for a CC function containing a PDC write without having to set EP's explicitly in any case.
bestbeforetoday (Thu, 24 Sep 2020 10:49:26 GMT):
Not right now, no. Probably the best you can do right now is, if you know the organizations needed for endorsement, get the peers for those organizations (from `network.getChannel()`) and set them as the endorsing peers on the Transaction: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Transaction.html#setEndorsingPeers-java.util.Collection-
ashutosh_kumar (Fri, 25 Sep 2020 15:34:20 GMT):
Folks , we are on Fabric 1.4.x and planning on moving to Fabric 2.x. We are using JAVA SDK. Any_ suggestion for migrating JAVA SDK from 1.4.x to 2.0 ?
danilofaria (Fri, 25 Sep 2020 18:38:15 GMT):
I would like to have people try my java fabric app without disclosing the source code. for the java code, this is fine. however for the chaincode written in go, this is a bit tricker as the uncompiled source code is needed for installing the chaincode. any tips on how to make the app available for local usage in a way that the chaincode source code is not visible?
xxds (Tue, 29 Sep 2020 08:38:16 GMT):
Has joined the channel.
xxds (Tue, 29 Sep 2020 08:38:17 GMT):
`Exception in thread "main" org.hyperledger.fabric.gateway.GatewayRuntimeException: org.hyperledger.fabric.sdk.exception.ProposalException: org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel defaultchannel failed with peer bookspeer0. Status FAILURE, details: Channel Channel{id: 1, name: defaultchannel} Sending proposal with transaction: f0dc7d73d530f31e532a7ee16ac03562c030cbebee218ba618f343d43a5c20d4 to Peer{ id: 5, name: bookspeer0, channelName: defaultchannel, url: grpcs://172.20.41.228:7006, mspid: books-MSP} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=javax.net.ssl.SSLHandshakeException: error:10000412:SSL routines:OPENSSL_internal:SSLV3_ALERT_BAD_CERTIFICATE
at io.netty.handler.ssl.ReferenceCountedOpenSslEngine.shutdownWithError(ReferenceCountedOpenSslEngine.java:897)
at io.netty.handler.ssl.ReferenceCountedOpenSslEngine.sslReadErrorResult(ReferenceCountedOpenSslEngine.java:1147)
at io.netty.handler.ssl.ReferenceCountedOpenSslEngine.unwrap(ReferenceCountedOpenSslEngine.java:1101)
at io.netty.handler.ssl.ReferenceCountedOpenSslEngine.unwrap(ReferenceCountedOpenSslEngine.java:1169)
at io.netty.handler.ssl.ReferenceCountedOpenSslEngine.unwrap(ReferenceCountedOpenSslEngine.java:1212)
at io.netty.handler.ssl.SslHandler$SslEngineType$1.unwrap(SslHandler.java:216)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1297)
at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1199)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1243)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
}
at org.hyperledger.fabric.gateway.impl.TransactionImpl.submit(TransactionImpl.java:121)
at test2.test.main(test.java:179)`
xxds (Tue, 29 Sep 2020 08:39:19 GMT):
Hi Iam getting the above error while invoking transaction.How to resolve using mutual tls.
xxds (Tue, 29 Sep 2020 08:39:19 GMT):
Hi Iam getting the above error while invoking transaction.How to resolve?Iam using mutual tls.
xxds (Tue, 29 Sep 2020 08:39:51 GMT):
#fabric #fabric-ca
xxds (Tue, 29 Sep 2020 08:58:04 GMT):
@rickr
bestbeforetoday (Tue, 29 Sep 2020 10:30:02 GMT):
My guess from the `SSLV3_ALERT_BAD_CERTIFICATE` is that your client didn't like the peer TLS certificate. Possibly because the signing CA certificate is not in the client JDKs trust store
xxds (Tue, 29 Sep 2020 10:31:18 GMT):
is there proper connection.yaml for mutual tls???
bestbeforetoday (Tue, 29 Sep 2020 10:35:48 GMT):
There looks to be an option that can be added to a peer definition in a connection profile to tell it the CA certificate: https://github.com/hyperledger/fabric-gateway-java/blob/7133cf423dc07092d2ad0b0e418b88191e4e385a/src/test/java/org/hyperledger/fabric/gateway/connection-tls.json#L106
xxds (Tue, 29 Sep 2020 10:37:06 GMT):
why ther is no option to provide clientcertfile clientkey ?
bestbeforetoday (Tue, 29 Sep 2020 10:38:47 GMT):
I wonder if a more realistic solution is to add the CA certificate to the Java trust store using `keytool`, although this isn't something I've played with much personally
bh4rtp (Wed, 30 Sep 2020 03:26:59 GMT):
hi, does java sdk filter the status code from the chaincode response? how can i get the status code from sdk?
vineeta (Thu, 01 Oct 2020 06:45:35 GMT):
@bestbeforetoday Do we have to set up endorsing peers explicitly using setEndorsingPeers() for a transaction?I tried running private data asset-transfer sample on 3 organisation network(with 2 peer each per org) In createAsset transaction with EndorsementPolicy(Org1,Org3) proposal was not sent to Org3.peer0 (as there was no chaincode logs for Org3) and transaction commit failed due to endorsement policy failure, If I setEndorsingPeers for Org1 &Org3 transaction gets committed.
vineeta (Thu, 01 Oct 2020 06:45:35 GMT):
@bestbeforetoday Do we have to set up endorsing peers explicitly using setEndorsingPeers() for a transaction?
I tried running private data asset-transfer sample on 3 organisation network(with 2 peer each per org) In createAsset transaction with EndorsementPolicy(Org1,Org3) proposal was not sent to Org3.peer0 (as there was no chaincode logs for Org3) and transaction commit failed due to endorsement policy failure, If I setEndorsingPeers for Org1 &Org3 transaction gets committed.
Same network works with fabric sample nodejs application where I had not setup endorsing peers/orgs explicitly
vineeta (Thu, 01 Oct 2020 06:45:35 GMT):
@bestbeforetoday Do we have to set up endorsing peers explicitly using setEndorsingPeers() for a transaction?
I tried running private data asset-transfer sample on 3 organisation network(with 2 peer each per org) In createAsset transaction with EndorsementPolicy(Org1,Org3) proposal was not sent to Org3.peer0 (as there was no chaincode logs for Org3) and transaction commit failed due to endorsement policy failure, If I setEndorsingPeers for Org1 &Org3 transaction gets committed.
Same network works with fabric sample nodejs application where I do not need to setup endorsing peers explicitly
```
vineeta (Thu, 01 Oct 2020 06:45:35 GMT):
@bestbeforetoday Do we have to set up endorsing peers explicitly using setEndorsingPeers() for a transaction?
I tried running private data asset-transfer sample on 3 organisation network(with 2 peer each per org) In createAsset transaction with EndorsementPolicy(Org1,Org3) proposal was not sent to Org3.peer0 (as there was no chaincode logs for Org3) and transaction commit failed due to endorsement policy failure, If I setEndorsingPeers for Org1 &Org3 transaction gets committed.
Same network works with fabric sample nodejs application where I do not need to setup endorsing peers explicitly
bestbeforetoday (Thu, 01 Oct 2020 09:07:44 GMT):
The Node.js sample _asset-transfer-private-data_ application sets the collections required for endorsement using the contract.addDiscoveryInterest() call available in the Node SDK: https://hyperledger.github.io/fabric-sdk-node/release-2.2/tutorial-discovery-fabric-network.html
bestbeforetoday (Thu, 01 Oct 2020 09:09:10 GMT):
There is not (yet) an equivalent in the Java SDK so the discovery-based endorsement is only considering the chaincode endorsement policy and not considering the required data collections
bestbeforetoday (Thu, 01 Oct 2020 09:10:16 GMT):
The workaround is to set the peers of the organizations that have access to the required data collections as the endorsing peers for the transaction
bestbeforetoday (Thu, 01 Oct 2020 09:32:57 GMT):
The status code just indicates to the SDK whether the proposal was successfully processed by the peer. It isn't an HTTP status code and isn't used to send application level information. What you get back is the payload or error message associated with a successful or unsuccessful transaction invocation
xxds (Mon, 05 Oct 2020 08:57:20 GMT):
No subject alternative names present
is therer a way to skip this verification???
pkirkinezis (Tue, 06 Oct 2020 12:44:31 GMT):
Hi to all is there a way to change password for user that are not registar? I am currently using the above logic for password uupdate
HFCAIdentity ide = caClient.newHFCAIdentity(user); // In newHFCAIdentity an EnrollmentID is passed
ide.setSecret(newPassword); // Here is the new password set
ide.update(userctx); // Here the user is updated.
arpitsoman (Wed, 07 Oct 2020 14:51:08 GMT):
Has joined the channel.
arpitsoman (Wed, 07 Oct 2020 14:51:09 GMT):
Hi All, I am trying to set up my client in Java using fabric gateway for a TLS enabled network where CLIENTAUTHREQUIRED=true, I observed that we need to pass the client.key and client.crt also in the connection profile, but I am not sure how to do it, can someone please help me with the connection.yaml for tls enabled network?
deployer21 (Wed, 07 Oct 2020 15:31:33 GMT):
Hello, can anyone tell if there is a way of skipping these steps each time you want to access the blockchain? 'Cause every HTTP Request I do, always takes around 16 mad seconds! It's inconceivable for any application performance
Path walletPath = Paths.get("wallet");
Wallet wallet = Wallets.newFileSystemWallet(walletPath);
// load a CCP
Path networkConfigPath = Paths.get("src", "crypto-material", "peerOrganizations", "org1.example.com", "connection-org1.json");
Gateway.Builder builder = Gateway.createBuilder();
builder.identity(wallet, "appUser").networkConfig(networkConfigPath).discovery(true);
try (Gateway gateway = builder.connect()) {
gateway.getNetwork("mychannel").getContract("basic", "AssetTransfer").submitTransaction("DeleteAsset", assetID);
return 1;
} catch (Exception e) {
}
bestbeforetoday (Wed, 07 Oct 2020 15:48:17 GMT):
If you are submitting subsequent requests with the same client identity, keep hold of the Gateway instance for that identity and use it for multiple requests instead of closing after every request
deployer21 (Thu, 08 Oct 2020 09:20:53 GMT):
Do you think that a queue + a thread implementation would do it or you have a better suggestion?
deployer21 (Thu, 08 Oct 2020 09:20:53 GMT):
Do you think that a queue + a thread implementation would do it or you have a better suggestion? And thanks :+1:
pkirkinezis (Thu, 08 Oct 2020 12:53:50 GMT):
Hi is anyone familiar with this error PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors while trying to enroll a user
bh4rtp (Thu, 08 Oct 2020 23:34:59 GMT):
@bestbeforetoday can i only check the status of transaction by catching exceptions?
bestbeforetoday (Fri, 09 Oct 2020 08:22:15 GMT):
Typically we expect submitted transactions to work (end return the transaction response). If they fail endorsement, fail to send to the orderer, or (if you haven't turned off commit waiting) fail to see successful commit events within a timeout period, you will get an exception. The ContractException will have the proposal responses attached so you can look at any information contained within them, including the error response payload
pkirkinezis (Mon, 12 Oct 2020 06:14:59 GMT):
Hi to anyone . I have a question about speed perfomance and invoke query . Is a good practice to open a gateway everytime i want to run a query or a invoke ? Or is there any other way?
mbwhite (Mon, 12 Oct 2020 07:53:02 GMT):
Hello as @bestbeforetoday suggested in the previous thread - hold on to the gateway (and other objects if at all possible)
Recreating the objects each time is inefficient.
For queries make sure it's a evaluate not a submit.
pkirkinezis (Mon, 12 Oct 2020 08:59:17 GMT):
Yeah i am trying to find a way to keep specific gateway (with chaincode and channel) persistent in every request
pkirkinezis (Mon, 12 Oct 2020 08:59:28 GMT):
is that a good aproach ?
mbwhite (Mon, 12 Oct 2020 09:39:21 GMT):
yes if you can do that..
pkirkinezis (Mon, 12 Oct 2020 13:27:56 GMT):
It is hard to persist an object in java with specific user input . Bean is not working in my case
bestbeforetoday (Tue, 13 Oct 2020 08:32:41 GMT):
Persisting sounds to me like serializing it, either to some persistent storage or perhaps to something like an HTTP session. You definitely *don't* want to do this with a Gateway or Network object
bestbeforetoday (Tue, 13 Oct 2020 08:35:52 GMT):
A simple example of where you would want to keep hold of a Gateway is a client application that is going to submit (or evaluate) multiple transactions. Create the Gateway, Network and Contract once, use them for all of your transactions, then close the Gateway at the end
pkirkinezis (Tue, 13 Oct 2020 08:37:12 GMT):
How can i persist of the Gateway/ contact ?
bestbeforetoday (Tue, 13 Oct 2020 08:37:36 GMT):
If you are running an intermediary, like a REST server, which is submitting transactions driven by client requests, you're probably either:
1. Using a single Fabric client identity for the REST server; or
2. Using different Fabric client identities for each "user" driving REST requests into the system
pkirkinezis (Tue, 13 Oct 2020 08:37:51 GMT):
Simply how can i create a gateway/contract once and use it in every HTTP api request
bestbeforetoday (Tue, 13 Oct 2020 08:38:27 GMT):
If your intermediary using a single "system" Fabric identity, just have it create a Gateway instance with that identity, and keep hold of that Gateway for use by all the requests that arrive at your intermediary
pkirkinezis (Tue, 13 Oct 2020 08:39:07 GMT):
After login success I use the the specific user who logged in to interact
pkirkinezis (Tue, 13 Oct 2020 08:39:25 GMT):
So i have one hyperledger fabric user for every application user .
pkirkinezis (Tue, 13 Oct 2020 08:40:08 GMT):
I don't use one identity to create only a sigle instance of gateway .
bestbeforetoday (Tue, 13 Oct 2020 08:40:30 GMT):
If you have different Fabric identities for each user then you've got to find the right balance. For a very low transaction rate it might be OK to just create and close a Gateway around every request
pkirkinezis (Tue, 13 Oct 2020 08:41:12 GMT):
Yes I do it this way but its a little slow that way .
bestbeforetoday (Tue, 13 Oct 2020 08:41:27 GMT):
For any kind of transaction load you probably want to save those Gateway instances and reuse them. So you might need to have some kind of cache of Gateway instances keyed by client identity
pkirkinezis (Tue, 13 Oct 2020 08:41:40 GMT):
it takes around 2s for gateway to connect for every user.
bestbeforetoday (Tue, 13 Oct 2020 08:42:53 GMT):
Something as simple as a Map of identity name to Gateway instance might be sufficient
pkirkinezis (Tue, 13 Oct 2020 08:44:21 GMT):
xm yeah good idea i will try to create a global mapper of id/conctact and retrive when needed
bestbeforetoday (Tue, 13 Oct 2020 08:44:30 GMT):
As usual with caches, getting things in there is the easy part. Depending on your system and workload, you might need to put some work into taking out of the cache things that don't need to be there anymore
bestbeforetoday (Tue, 13 Oct 2020 08:44:54 GMT):
I expect there are some pre-written caching libraries out there that might be useful but I don't have any recommendations
pkirkinezis (Tue, 13 Oct 2020 08:45:39 GMT):
Yeah i tried it with @bean springboot . Maybe i will try @autowire a map
pkirkinezis (Tue, 13 Oct 2020 08:46:18 GMT):
I use a network resolver and tried to autowire it but it doesn't work as we described
bestbeforetoday (Tue, 13 Oct 2020 08:47:00 GMT):
Just remember that it is the Gateway that needs to eventually have `close()` called on it, so don't lose your Gateway objects
pkirkinezis (Tue, 13 Oct 2020 08:47:45 GMT):
Yeah so gateway is not closing by it self?
pkirkinezis (Tue, 13 Oct 2020 08:47:55 GMT):
after maybe somtime of inactivity?
pkirkinezis (Tue, 13 Oct 2020 08:48:28 GMT):
Maybe i will have to craete /logout api call to run .close()
bestbeforetoday (Tue, 13 Oct 2020 09:28:22 GMT):
The underlying gRPC connection may get closed after some idle period, but the Gateway objects themselves don't have any kind of timeout where they clean up resources
dyhack (Wed, 14 Oct 2020 01:09:56 GMT):
Has joined the channel.
dyhack (Wed, 14 Oct 2020 01:09:56 GMT):
The sample in https://github.com/hyperledger/fabric-gateway-java,How to use tls in the java-gateway-sdk?
pkirkinezis (Wed, 14 Oct 2020 06:01:50 GMT):
So best way possible is to have a logout api call on the application . So when a user logs out i will call gateway /logout to run .close()
pkirkinezis (Wed, 14 Oct 2020 06:02:08 GMT):
Thats the best way i can thing of for now
bestbeforetoday (Wed, 14 Oct 2020 08:06:34 GMT):
For a TLS connecton to nodes, you just need a `grpcs` rather than `grpc` endpoint URL, and for the CA certificates for your network to be trusted by your client. One option for making the CA certificates available is to include them in your connection profile, as in this connection profile: https://github.com/hyperledger/fabric-gateway-java/blob/master/src/test/java/org/hyperledger/fabric/gateway/connection-tls.json
bestbeforetoday (Wed, 14 Oct 2020 08:14:54 GMT):
I don't know what's best for your application design. If you have the concept of them being logged in or out then a logout seems reasonable, and the cleanup of the Gateway instance could be done when their login session is ended, either by explicit logout or a session timeout. Im sure there are plenty of other approaches that would be viable too, such as a timeout on cached Gateway entries based on when they were last accessed. Or you could wrap the Gateway instance in your own Gateway implementation where a call to `close()` doesn't actually close the wrapped Gateway but is used to track when it is no longer in use by client code. Whatever works for you
dyhack (Wed, 14 Oct 2020 08:15:16 GMT):
I have solve the tls connection
dyhack (Wed, 14 Oct 2020 08:15:29 GMT):
Clipboard - October 14, 2020 4:15 PM
dyhack (Wed, 14 Oct 2020 08:16:01 GMT):
How to solve this problem ?
dyhack (Wed, 14 Oct 2020 08:16:03 GMT):
Caused by: org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel mychannel failed with peer peer0.org1.example.com. Status FAILURE, details: Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: 0bacf4e15cd703db21f0d4b9e33f12221ea3c06ccfbca56368aa9049f936a4fc to Peer{ id: 3, name: peer0.org1.example.com, channelName: mychannel, url: grpcs://10.10.9.110:7051, mspid: Org1MSP} failed because of: gRPC failure=Status{code=UNKNOWN, description=error validating proposal: access denied: channel [mychannel] creator org [Org1MSP], cause=null}
dyhack (Wed, 14 Oct 2020 08:16:05 GMT):
please
mbwhite (Wed, 14 Oct 2020 08:31:24 GMT):
Access Denied - I'd double check all the users and wallets.. it's very easy to end using a old identity.
dyhack (Wed, 14 Oct 2020 08:36:15 GMT):
you mens the wallet?
dyhack (Wed, 14 Oct 2020 08:36:27 GMT):
How 同
xxds (Wed, 14 Oct 2020 08:36:39 GMT):
allowAllHostNames will setting this property true help resolve this exception :No subject alternative names present
PS:i dont want to set hostnameoverride
mbwhite (Wed, 14 Oct 2020 08:36:56 GMT):
yes - that would be the first place I'd check.. that you've correctly imported the correct identity
dyhack (Wed, 14 Oct 2020 08:37:16 GMT):
Clipboard - October 14, 2020 4:37 PM
dyhack (Wed, 14 Oct 2020 08:37:30 GMT):
How to generate a new wallet ?
mbwhite (Wed, 14 Oct 2020 08:38:07 GMT):
how are you creating your fabric -network?
dyhack (Wed, 14 Oct 2020 08:38:26 GMT):
I use the test-network base on babric 2.2.1
xxds (Wed, 14 Oct 2020 08:39:05 GMT):
i faced similar problem earlier problem was my old docker volumes were not removed.
i pruned old volumes and started from the begining it worked fine
mbwhite (Wed, 14 Oct 2020 08:39:14 GMT):
so check the sample applications in the simple asset transfer.. they are th e apps there show you how to do this.
mbwhite (Wed, 14 Oct 2020 08:39:26 GMT):
and yes it could be something is out of date...
xxds (Wed, 14 Oct 2020 08:40:10 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=vSXXRCTA87kphbNQh) @mbwhite can ou assist me in this
mbwhite (Wed, 14 Oct 2020 08:40:32 GMT):
^ sorry not sure I follow
dyhack (Wed, 14 Oct 2020 08:41:22 GMT):
I just use the fabric gete-way-java
dyhack (Wed, 14 Oct 2020 08:41:52 GMT):
When I first run the demo .It show me the tls problem
dyhack (Wed, 14 Oct 2020 08:42:28 GMT):
I solve this by copy the peers and order certificate into my floder
dyhack (Wed, 14 Oct 2020 08:42:44 GMT):
Clipboard - October 14, 2020 4:42 PM
xxds (Wed, 14 Oct 2020 08:42:53 GMT):
#fabric-ca
mbwhite (Wed, 14 Oct 2020 08:43:55 GMT):
sorry can you explain a bit more context
mbwhite (Wed, 14 Oct 2020 08:47:10 GMT):
mm not sure exactly what the configuration issue is here...
mbwhite (Wed, 14 Oct 2020 08:47:26 GMT):
You shouldn't really need to be copying those files around.
dyhack (Wed, 14 Oct 2020 08:48:19 GMT):
If I do not copy it ,the tls problem?
dyhack (Wed, 14 Oct 2020 08:48:33 GMT):
Clipboard - October 14, 2020 4:48 PM
dyhack (Wed, 14 Oct 2020 08:48:36 GMT):
Clipboard - October 14, 2020 4:48 PM
mbwhite (Wed, 14 Oct 2020 08:49:12 GMT):
this the test-network from fabric -samples
mbwhite (Wed, 14 Oct 2020 08:49:20 GMT):
master branch
dyhack (Wed, 14 Oct 2020 08:49:31 GMT):
yes:woo:
dyhack (Wed, 14 Oct 2020 08:50:27 GMT):
I just want use sdk,connect with the blockchain and run chaincode on it
dyhack (Wed, 14 Oct 2020 08:52:12 GMT):
the java-sdk not detail
usage,not like the node sdk
dyhack (Wed, 14 Oct 2020 09:14:31 GMT):
@mbwhite how i do?please..
dyhack (Thu, 15 Oct 2020 07:31:37 GMT):
thanks,I have solve this problem,And can call the chainchode
pkirkinezis (Thu, 15 Oct 2020 13:11:05 GMT):
Hi to the community . Is there a way to change the secret (used in registration ) of a registered user in hyperledger fabric via SDK?
pkirkinezis (Thu, 15 Oct 2020 13:11:39 GMT):
A similar functionality like change password on a regular application
pkirkinezis (Fri, 16 Oct 2020 09:03:52 GMT):
I can guess there is no way to change password then ? I 've searched to the java sdk code to find something without a luck
bestbeforetoday (Fri, 16 Oct 2020 09:34:03 GMT):
It's important to understand that this is not a password in the conventional sense -- as in a user ID / password used as your credentials. The enrollment secret is a (one-time) secret that grants you the ability to enroll an identity with the certificate authority. So it allows you to get the CA to issue a signed certificate corresponding to your private key. Your private key is your "password" in the user ID / password sense
pkirkinezis (Mon, 19 Oct 2020 08:18:32 GMT):
So is there a good practice to change secret? For my application secret is the same as user password .
pkirkinezis (Mon, 19 Oct 2020 08:19:59 GMT):
I understood what you are describing . But I don't save anywhere the secret phrase only the user password so i if a user change his password i will have to change the secret also ./
pkirkinezis (Mon, 19 Oct 2020 08:21:01 GMT):
I found a solution in the weekend with HFCAIdentity has a function update . So i set HFCAIdentity and then set a new secret and run update function.
dyhack (Tue, 20 Oct 2020 00:55:05 GMT):
How to solve this problem
dyhack (Tue, 20 Oct 2020 00:55:08 GMT):
Clipboard - October 20, 2020 8:55 AM
bestbeforetoday (Tue, 20 Oct 2020 09:01:32 GMT):
It sounds like what you are doing is, every time a user connects, generate a new private key for that user and get a new signed certificate for that key from the CA. This sounds kinda wasteful, and means that if somebody steals that enrollment secret they can generate their own private keys and have them signed by the CA as being valid credentials for the user
pkirkinezis (Tue, 20 Oct 2020 09:03:06 GMT):
Νο . Not at all . I am generating once keys priv and pem adn save them in database . Also o keep the secret on database to .
pkirkinezis (Tue, 20 Oct 2020 09:03:51 GMT):
Then when the user changes password on the app I call my blockchain api and change only the secret from blockchain and database
bestbeforetoday (Tue, 20 Oct 2020 09:04:14 GMT):
Ah, OK. So you are not calling enroll() again. In which case, why do you need to change the enrollment secret?
pkirkinezis (Tue, 20 Oct 2020 09:04:45 GMT):
because i want for convinient the enrollment secret to be the same as the password the user has in the application
bestbeforetoday (Tue, 20 Oct 2020 09:05:10 GMT):
If you are never going to use the enrollment secret, why does it matter if they are the same?
pkirkinezis (Tue, 20 Oct 2020 09:07:40 GMT):
Yeah I was very so and so for this solution . Because everything is encrypted and then decrepted I can keep the secret once the first time user is registered/enrolled and kleep it the same as long as possible
pkirkinezis (Tue, 20 Oct 2020 09:08:38 GMT):
And use it only when the priv_sk and pem are invalidated or something to enroll the user again.
pkirkinezis (Tue, 20 Oct 2020 09:08:38 GMT):
And use it when the priv_sk and pem are invalidated or something to enroll the user again.
jtonline (Tue, 20 Oct 2020 15:54:46 GMT):
What instructions are you following? As far as I know the test-network default chaincode has changed in the latest fabric-samples and the init ledger transaction looks slightly different in the docs...
https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html
dcof (Wed, 21 Oct 2020 09:16:01 GMT):
Has joined the channel.
dyhack (Thu, 22 Oct 2020 01:41:07 GMT):
通用领域
生物医药
我解决了这个问题,应该是gradle打包的时候设置的maincalss 的问题,导致链码容器里面的程序没有正常运行起来。实际上docker container已经创建了,但是启动失败
I have solved this problem. It should be the maincalss problem set when gradle was packaged, which caused the program in the chain code container not to run normally. Actually, the docker container has been created, but the startup failed
dyhack (Thu, 22 Oct 2020 01:41:18 GMT):
I have solved this problem. It should be the maincalss problem set when gradle was packaged, which caused the program in the chain code container not to run normally. Actually, the docker container has been created, but the startup failed
dcof (Fri, 23 Oct 2020 12:28:31 GMT):
hi, I'm trying to use the java sdk to update the channel configuration and introduce the initial anchor peer configuration. I tried this in a way to load the generated anchros.tx and create a UpdateChannelConfiguration object and then call `channel.updateChannelConfiguration()` method and pass the respective parameters. However, I get a 400 bad request error. On the orderer log I found this error: "error authorizing update: proto: field "common.ConfigUpdate.channel_id" contains invalid UTF-8". When I use the file via the cli like in most tutorials, everything works fine. Is this, in general, an okay-way to do it or how would I introduce the anchor peers via the SDK? Did anyone encounter a similar error before?
rrishmawi (Sat, 24 Oct 2020 07:03:03 GMT):
Hey Experts, I am conducting a research about Chaincode vulnerabilities, and I am in need for a real world open source Chaincodes written in GoLang? Do you know of any, I looked up Github and most of the repositories so far only examples or tutorials. I appreciate your help.
andrew-coleman (Mon, 26 Oct 2020 11:12:55 GMT):
Is there a particular reason you want to do this via the SDK? For admin tasks such as this, you can script it using the command line
dcof (Mon, 26 Oct 2020 12:34:54 GMT):
we're evaluating a more flexible approach in channel creation coupled with our actual application and therefore we're trying the SDK functionality. In the meantime i found a workaround which let's me register peers per organisaztion as anchor peers via the sdk. however, the usage of the created anchors.tx file does not work yet
ericmvaughn (Mon, 26 Oct 2020 16:28:49 GMT):
Has left the channel.
tn_220 (Tue, 27 Oct 2020 01:54:18 GMT):
Has joined the channel.
troyronda (Wed, 28 Oct 2020 17:44:41 GMT):
Has left the channel.
jashi 4 (Sun, 01 Nov 2020 11:26:22 GMT):
Has joined the channel.
jashi 4 (Sun, 01 Nov 2020 11:26:23 GMT):
How can I resolve following error when creating channel using fabric-java-sdk using mychannel.tx file
org.hyperledger.fabric.sdk.exception.TransactionException: Channel mychannel, send transaction failed on orderer OrdererClient{id: 8, channel: mychannel, name: orderer, url: grpcs://localhost:7050}. Reason: Channel mychannel orderer orderer status returned failure code 400 (BAD_REQUEST) during orderer next
at org.hyperledger.fabric.sdk.OrdererClient.sendTransaction(OrdererClient.java:240) ~[fabric-sdk-java-2.2.2.jar:na]
at org.hyperledger.fabric.sdk.Orderer.sendTransaction(Orderer.java:164) ~[fabric-sdk-java-2.2.2.jar:na]
at org.hyperledger.fabric.sdk.Channel.sendUpdateChannel(Channel.java:538) ~[fabric-sdk-java-2.2.2.jar:na]
at org.hyperledger.fabric.sdk.Channel.
Nick (Mon, 02 Nov 2020 02:01:52 GMT):
Hi Team, after discovery of orderer nodes, which node will Java SDK connect to submit transaction?The options I could imagine is
1. Leader orderer node
2. The first one returned in orderer nodes list returned by discovery
3. randomly select one.
husnain (Tue, 03 Nov 2020 11:45:16 GMT):
Has joined the channel.
bestbeforetoday (Tue, 03 Nov 2020 14:08:10 GMT):
It sounds like the config update is not being sent using an ID with the required privileges, i.e. an admin identity
bestbeforetoday (Tue, 03 Nov 2020 14:12:25 GMT):
There SDK doesn't guarantee any particular behaviour but the current implementation will pick a random orderer for each transaction invocation, and then will fail-over to other (randomly selected) orderers if one is unavailable
conanoc (Tue, 10 Nov 2020 09:43:28 GMT):
Has joined the channel.
conanoc (Tue, 10 Nov 2020 11:03:57 GMT):
Is it possible to install chaincode in CDS format using fabric-java-sdk v1.4 ? I'm not sure which API should I use to set cds file in InstallProposalRequest:
https://javadoc.io/static/org.hyperledger.fabric-sdk-java/fabric-sdk-java/1.4.13/org/hyperledger/fabric/sdk/InstallProposalRequest.html
nkl199 (Tue, 10 Nov 2020 11:44:24 GMT):
You can send a `ChaincodePackageInstallRequest`
```
const pkgBuffer: Buffer = await fs.readFile(pathToPackage);
const installRequest: Client.ChaincodePackageInstallRequest = {
targets: [peer],
chaincodePackage: pkgBuffer,
txId: this.client.newTransactionID()
};
```
gravity (Tue, 10 Nov 2020 11:49:44 GMT):
Hello everyone. Is it still ok to use just Java SDK for application development or is it better to move to Gateway ASAP?
We have an application that run on the top Fabric 1.4.8 with Java SDK (1.4.8 )
nkl199 (Tue, 10 Nov 2020 13:22:32 GMT):
the recommendation is to move to the gateway
conanoc (Wed, 11 Nov 2020 02:05:21 GMT):
You seem to use fabric-node-sdk. I'm looking for a solution with java-sdk.
heschaun (Thu, 12 Nov 2020 10:00:51 GMT):
Has joined the channel.
pkirkinezis (Thu, 12 Nov 2020 15:30:12 GMT):
Hey to the communit when gateway reply "Transaction commit was rejected by peer" what that means ? Where I have to start debugging on chaincode level or network level?
bestbeforetoday (Thu, 12 Nov 2020 16:12:19 GMT):
Just as background, what has happened is that:
1. The transaction proposal has obtained endorsement(s)
2. The endorsed transaction submitted to the orderer
3. Orderer has committed the transaction to a block and distributed to peers
4. Peer has failed to validate the transaction so it has not updated the ledger
5. Client has received the block event containing the transaction, noticed that it is marked invalid, and thrown an exception back to your application
bestbeforetoday (Thu, 12 Nov 2020 16:14:45 GMT):
The reason for the commit failure might be an MVCC failure, where the ledger state touched by the transaction is different to the state when endorsement occurred. So two or more concurrent transactions accessed and/or modified the same ledger keys
bestbeforetoday (Thu, 12 Nov 2020 16:15:23 GMT):
It might be that it didn't meet the endorsement requirements for the operation performed
bestbeforetoday (Thu, 12 Nov 2020 16:15:47 GMT):
The place to look is the peer logs to get more details on the cause
bestbeforetoday (Thu, 12 Nov 2020 16:17:11 GMT):
At the client end, the ContractException thrown should have all the proposal responses attached to the exception, which might help in diagnosing the problem, particularly once the cause is clear from the peer logs
pkirkinezis (Thu, 12 Nov 2020 16:18:25 GMT):
my peers are on multiple different serversbut on my network config i have only the peers of the node i enrolled
bestbeforetoday (Thu, 12 Nov 2020 16:21:08 GMT):
If you are using discovery, the client will discover (at runtime) all of the network nodes, even if they are not in your connection profile
pkirkinezis (Thu, 12 Nov 2020 16:22:31 GMT):
how i can check that?
bestbeforetoday (Thu, 12 Nov 2020 16:23:11 GMT):
If you are not using discovery and your configuration profile doesn't contain enough peers (or peers from enough different organizations) to meet endorsement requirements, that might result in submitted transactions failing to successfully commit
bestbeforetoday (Thu, 12 Nov 2020 16:24:12 GMT):
You need to find the reason for the failure in the peer logs to know how to resolve the issue. All the network peers receive the same committed blocks so you should be able to look in the logs of any network peer
pkirkinezis (Thu, 12 Nov 2020 16:24:27 GMT):
is discovery mode set to channel config ?
xingyuan426 (Fri, 13 Nov 2020 01:54:31 GMT):
Has joined the channel.
lupass93 (Wed, 18 Nov 2020 17:00:37 GMT):
Hi All!
How Java sdk Client can get the payload of an Exception that is generated from Chaincode via ChaincodeException?
The Chaincode throw a ChaincodeException with a String Message and String payload.
I can get Message of the ChaincodeException from Client sdk java but I miss how I can get the payload Exception for do operations relied upon the payload
Thanks very much
bestbeforetoday (Thu, 19 Nov 2020 12:06:41 GMT):
Using _fabric-gateway-java_ the `ContractException` thrown should have all the proposal response objects attached:
https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/ContractException.html#getProposalResponses()
bestbeforetoday (Thu, 19 Nov 2020 12:11:37 GMT):
You should be able to pick the payload bytes from them, something along the lines of:
```
byte[] payload = e..getProposalResponses().stream()
.map(ProposalResponse::getProposalResponse)
.map(FabricProposalResponse.ProposalResponse::getPayload)
.filter(Objects::nonNull)
.findFirst()
.map(ByteString::toByteArray)
.orElse(null);
```
bestbeforetoday (Thu, 19 Nov 2020 12:11:37 GMT):
You should be able to pick the payload bytes from them, something along the lines of:
```
byte[] payload = e.getProposalResponses().stream()
.map(ProposalResponse::getProposalResponse)
.map(FabricProposalResponse.ProposalResponse::getPayload)
.filter(Objects::nonNull)
.findFirst()
.map(ByteString::toByteArray)
.orElse(null);
```
lupass93 (Thu, 19 Nov 2020 12:41:34 GMT):
I tried this way, but unfortunately the payload is empty, although in the Chaincode it actually passes to the Constructor of ChaincodeException both the String Message and the String payload.
lupass93 (Thu, 19 Nov 2020 12:42:54 GMT):
As if the payload did not reach Contractexception
bestbeforetoday (Fri, 20 Nov 2020 10:38:09 GMT):
I could easily be missing something but, having a quick look at the Java chaincode implementation, I don't think the payload from the ChaincodeException is being included in the proposal response. It might be worth raising a bug report in Jira: https://jira.hyperledger.org/projects/FABCJ
zilich (Sun, 22 Nov 2020 10:46:30 GMT):
Has joined the channel.
sidoussou (Mon, 23 Nov 2020 23:27:00 GMT):
Has joined the channel.
Darren-Matthews (Wed, 25 Nov 2020 20:51:19 GMT):
Has joined the channel.
sj1 4 (Thu, 26 Nov 2020 00:45:22 GMT):
Has joined the channel.
ps.agboola.ayodeji (Thu, 26 Nov 2020 18:42:55 GMT):
Has joined the channel.
vijay5378 (Mon, 30 Nov 2020 13:10:47 GMT):
HI all, Is fabric-java-sdk compatible with the new features available in 2.3.0?(Specifically removing the need for a system channel)?
yacovm (Mon, 30 Nov 2020 15:16:02 GMT):
It's a REST API... you don't need SDK to support it
vijay5378 (Mon, 30 Nov 2020 15:41:10 GMT):
When you try HFClient.newChannel(), you get an error : "channel001 expected config block type CONFIG_UPDATE, but got: MESSAGE". The same code executes normally when there was a system channel and a channel configtx was created using -outputCreateChannelTx.
pkirkinezis (Tue, 01 Dec 2020 06:50:10 GMT):
Hi to the community i would like to ask a question . On my API implementation i have a /logout that also runs gateway.close() . The function gateway.close() takes around 3-5 seconds to run and makes my logout functionality slow.
pkirkinezis (Tue, 01 Dec 2020 06:50:24 GMT):
Any suugestions?
bestbeforetoday (Tue, 01 Dec 2020 09:23:19 GMT):
I suspect the time is being spent closing down the lower-level SDK Channel(s) underpinning the Gateway implementation: https://github.com/hyperledger/fabric-sdk-java/blob/ee596ea3786958a30852eda1987511080d49b2b8/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L6257
bestbeforetoday (Tue, 01 Dec 2020 09:24:28 GMT):
The Gateway calls this shutdown with the `force` argument as `false`. It might be we could speed things up by changing it to a force shutdown but I'm not sure if this is preferable to letting things shutdown gracefully
bestbeforetoday (Tue, 01 Dec 2020 09:26:08 GMT):
I guess ideally it would be good to pin exactly what piece within that channel shutdown is causing the delay and see if that can be changed to make it faster
bestbeforetoday (Tue, 01 Dec 2020 09:27:58 GMT):
Perhaps as a workaround from your application level you could use an `ExecutorService` to run the `gateway.close()` on a separate thread and complete your shutdown as soon as the close has been scheduled to run rather than waiting for it to complete
bestbeforetoday (Tue, 01 Dec 2020 09:29:55 GMT):
Feel free to raise an issue in Jira to record this issue though: https://jira.hyperledger.org/projects/FGJ
sijo.c (Thu, 03 Dec 2020 22:11:29 GMT):
Has joined the channel.
sijo.c (Thu, 03 Dec 2020 22:11:30 GMT):
In fabric2.2 network with 1 org with 3 peers, default endorsement policy, seeing this intermittently in java sdk. After a while new client calls succeeds.
```message = 400 BAD_REQUEST "Commit strategy failed"; nested exception is org.hyperledger.fabric.gateway.ContractException: Commit strategy failed, context = Commit strategy failed, cause = {}
org.hyperledger.fabric.gateway.ContractException: Commit strategy failed
at org.hyperledger.fabric.gateway.impl.CommitHandlerImpl.processStrategyResult(CommitHandlerImpl.java:121)
at org.hyperledger.fabric.gateway.impl.CommitHandlerImpl.onDisconnectEvent(CommitHandlerImpl.java:114)```
sijo.c (Thu, 03 Dec 2020 22:13:11 GMT):
Pointers appreciated.No error seen in Peer logs. just no commit logs seen in this case.
sijo.c (Thu, 03 Dec 2020 22:13:27 GMT):
Can this happen due to unstable network etc, or can this be an app issue resulting in write conflict?
bestbeforetoday (Fri, 04 Dec 2020 10:25:19 GMT):
If the transaction fails to commit (i.e. the client receives a block event containing the transaction and it is marked as unsuccessful) then I would expect to get an exception reading something like:
> Transaction commit was rejected by peer peer1.example.org
bestbeforetoday (Fri, 04 Dec 2020 10:27:17 GMT):
I suspect that the gRPC event stream to all of the peers has failed and so the client has given up trying to observe the commit
bestbeforetoday (Fri, 04 Dec 2020 10:27:38 GMT):
So definitely this could be caused by an unstable network
bestbeforetoday (Fri, 04 Dec 2020 10:28:21 GMT):
The transaction may have in fact committed fine. The client just doesn't know because it failed to observe either a commit success or failure
danilofaria7 (Fri, 04 Dec 2020 12:36:28 GMT):
Has joined the channel.
danilofaria7 (Fri, 04 Dec 2020 12:36:28 GMT):
hello folks. simple question: when using a BlockListener, how can I check that a transaction is an init transaction (invoked with --isInit)? I cant seem to find anything like that in BlockInfo.TransactionEnvelopeInfo.TransactionActionInfo
sijo.c (Fri, 04 Dec 2020 15:41:07 GMT):
thanks!
danilofaria7 (Fri, 04 Dec 2020 19:46:43 GMT):
As I could not find such feature, I made a PR. Please do consider it: https://github.com/hyperledger/fabric-sdk-java/pull/106
fanjianhang (Mon, 07 Dec 2020 03:35:33 GMT):
hi all, i use fabric-gateway-java in my project to send transactions to fabric2.2.0 network, but i sometimes got the error especiailly when i invoke chaincode in the first time, the errors are `org.hyperledger.fabric.sdk.exception.TransactionException: Channel mychannel, send transaction failed on orderer OrdererClient{id: 139, channel: mychannel, name: orderer1.org1.example.com, url: grpcs://localhost:8050}. Reason: Channel mychanne
l orderer orderer1.org1.example.com status returned failure code 503 (SERVICE_UNAVAILABLE) during orderer next` or `java.util.concurrent.TimeoutException: Timeout waiting for commit of transaction`, in addition, it invoke successfully when i try next time, could somebody help me, thanks a lot.
james-wallis (Mon, 07 Dec 2020 10:44:37 GMT):
Has joined the channel.
andrew-coleman (Mon, 07 Dec 2020 11:33:54 GMT):
It might be that the chaincode is still instantiating and is not ready for use the first time you try and invoke it. In the scenario tests, we put a sleep in between the chaincode deploy and the first invocation
fanjianhang (Wed, 09 Dec 2020 03:43:15 GMT):
[ ](https://chat.hyperledger.org/channel/fabric-sdk-java?msg=Cv6wRzWkQzauBn8Qc) Thanks, my chaincode has ran for a while, it usually made the error when use gateway to connect to the network in the first time, i am so confused.
SamYuan1990 (Wed, 09 Dec 2020 13:14:08 GMT):
hi for fabric-java-sdk, I noticed that there is a property called org.hyperledger.fabric.sdk.security.HLSDKJCryptoSuiteFactory, which means if I want to switch this Factory to my own impl, I just make a jar package with my impl and change this org.hyperledger.fabric.sdk.security.HLSDKJCryptoSuiteFactory to my own class name?
SamYuan1990 (Wed, 09 Dec 2020 13:28:29 GMT):
and also, I am able to use org.hyperledger.fabric.sdk.security_curve_mapping to switch the curve used?
SamYuan1990 (Wed, 09 Dec 2020 14:00:07 GMT):
but it is confusing me as in config.java it says ... * Crypto configuration settings -- settings should not be changed. ??
SamYuan1990 (Wed, 09 Dec 2020 15:22:01 GMT):
can any one help with my questions above? As may I modify security related config items in config.properties file to change settings such as using other curve for encrypt and decrypt works?
bestbeforetoday (Wed, 09 Dec 2020 18:22:03 GMT):
@SamYuan1990 all the signing should be done by the `CryptoSuite` implementation set on the `HFClient` using `setCryptoSuite()`. So I guess you should be able to just construct your own implementation of the `CryptoSuite` interface that does signing by whatever method you choose when its `sign()` method is called with the user context's private key and message bytes to sign
bestbeforetoday (Wed, 09 Dec 2020 18:30:41 GMT):
As we're developing the multi-language _fabric-gateway_ API, I'm trying to make this easier by just having the client application explicitly pass in a signing implementation function, with default signing implementations provided for standard methods such as P-256 with EC private key:
https://github.com/hyperledger/fabric-gateway/blob/c4f708d09c7525ca689fc7116119de134c60cca8/java/src/main/java/org/hyperledger/fabric/client/Gateway.java#L103
SamYuan1990 (Thu, 10 Dec 2020 12:11:07 GMT):
ok, thanks.
AnandBanik (Sun, 20 Dec 2020 14:58:41 GMT):
Has joined the channel.
alacambra (Wed, 23 Dec 2020 22:09:38 GMT):
Has joined the channel.
dyhack (Sun, 03 Jan 2021 11:11:09 GMT):
How to solve this problem ?
dyhack (Sun, 03 Jan 2021 11:11:11 GMT):
Clipboard - January 3, 2021 7:11 PM
pkirkinezis (Mon, 04 Jan 2021 09:15:29 GMT):
Hi to the community
pkirkinezis (Mon, 04 Jan 2021 09:19:52 GMT):
I am having touble with java gateway . I am running my java project as a docker container . I am geeting a very high memeory /swap usage if a gateway connection is opened for a long time (aprox 1 week) without closing the connection. Is it realted to gateway connection my problem ?
pkirkinezis (Mon, 04 Jan 2021 09:20:19 GMT):
I normal situations where i press logout and i close the gateway connection i not having this issue?
pkirkinezis (Mon, 04 Jan 2021 09:20:19 GMT):
I normal situations where i press logout and i close the gateway connection i not having this issue
bestbeforetoday (Tue, 05 Jan 2021 11:33:18 GMT):
It might be worth asking in the #fabric-java-chaincode channel as this looks to be an error in the chaincode / smart contract
bestbeforetoday (Tue, 05 Jan 2021 11:42:21 GMT):
If you have any profiling information that shows which objects are consuming the increased heap space, it would be helpful to raise a bug report with that information in Jira: https://jira.hyperledger.org/projects/FGJ
pkirkinezis (Thu, 07 Jan 2021 14:42:59 GMT):
Yeah i am not 100% confidend that this is not caused by me not hadling the java sdk the right way .
bestbeforetoday (Thu, 07 Jan 2021 20:32:46 GMT):
You could try triggering some JVM heap dumps as the heap size is growing and use a heap analyzer on the output. These long-running issues are not so easy to investigate though :(
pkirkinezis (Fri, 08 Jan 2021 06:40:17 GMT):
Yeah I will try your suggestion . I am aware of the problem . I am not very familiar with heap analyzers .
pkirkinezis (Fri, 08 Jan 2021 06:40:28 GMT):
Thanks for your valauble help .
bdierberger (Fri, 08 Jan 2021 12:15:57 GMT):
Has joined the channel.
Sandyzhanghs (Sun, 10 Jan 2021 04:58:34 GMT):
Has joined the channel.
Kestutis_Gudynas (Tue, 12 Jan 2021 10:25:27 GMT):
Has joined the channel.
WilsonHUANGWS (Wed, 13 Jan 2021 09:51:30 GMT):
Has joined the channel.
deployer21 (Sat, 16 Jan 2021 21:02:51 GMT):
Hello, I am a little bit confused on how to store data in the ledger. Basically, I read the fabric-sdk-java documentation, and the sample they were using was something like this:
...
try (Gateway gateway = builder.connect()) {
Network network = gateway.getNetwork("mychannel");
Contract contract = network.getContract("fabcar");
...
However, the theory says that, first, a proposal must be validated by the committing peers, and then, it should be submitted to the orderer node. Something like this:
...
Collection
gravity (Sun, 17 Jan 2021 17:36:19 GMT):
Hello everyone
I quite do not understand the concept behind Wallet. Is it very convenient to store a Wallet with identities on a filesystem and issue file reads every time a user issues a transaction?
First of all, it can be slow. Second, it requires additional efforts where and how to store Wallet file. Or am I getting it wrong?
Thanks in advance.
cmhacker (Mon, 18 Jan 2021 10:08:25 GMT):
Has joined the channel.
cmhacker (Mon, 18 Jan 2021 10:09:20 GMT):
Hello everyone, How I can use fabric2.x chaincode life cycle API in JAVA ??
mayktu (Mon, 18 Jan 2021 22:14:52 GMT):
Has joined the channel.
action-sj (Tue, 19 Jan 2021 06:09:29 GMT):
Has joined the channel.
bestbeforetoday (Tue, 19 Jan 2021 11:21:32 GMT):
The filesystem is not read every time you submit a transaction. The identity is read from the wallet at the point you connect the Gateway. You should not be throwing away your Gateway and re-connecting on every transaction. This will be a much bigger performance impact that reading a small (likely cached) file from the filesystem as it will discard and re-establish gRPC network connections on every transaction
bestbeforetoday (Tue, 19 Jan 2021 11:23:27 GMT):
You've also got the option of reading the wallet identity into memory as an Identity object and connecting Gateway using only that in-memory object: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Gateway.Builder.html#identity(org.hyperledger.fabric.gateway.Identity)
bestbeforetoday (Tue, 19 Jan 2021 11:24:59 GMT):
Or if it's easier to manage a collection of in-memory Identity objects then you can stick them into an in-memory wallet for the lifetime of your application: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Wallets.html#newInMemoryWallet()
bestbeforetoday (Tue, 19 Jan 2021 11:28:15 GMT):
A singe call to `contract.submitTransaction("txName", "arg1", "arg2")` will do the following:
1. Send a proposal to peers for endorsement
2. Submit a transaction (including endorsments) to the orderer
3. Wait for transaction events from peers to confirm the transaction committed successfully
bestbeforetoday (Tue, 19 Jan 2021 11:37:19 GMT):
The _fabric-sdk-java_ API has some Lifecycle-related functions on `HFClient` and `Channel`:
- https://javadoc.io/doc/org.hyperledger.fabric-sdk-java/fabric-sdk-java/latest/org/hyperledger/fabric/sdk/HFClient.html
- https://javadoc.io/doc/org.hyperledger.fabric-sdk-java/fabric-sdk-java/latest/org/hyperledger/fabric/sdk/Channel.html
bestbeforetoday (Tue, 19 Jan 2021 11:38:05 GMT):
However, I'm not certain they are really up-to-date with the current Lifecycle deployment implementation so I'm not sure I would recommend relying on them
bestbeforetoday (Tue, 19 Jan 2021 11:39:12 GMT):
The `peer chaincode lifecycle` CLI commands are better maintained and supported so, if you can make use of them, I would recommend that instead: https://hyperledger-fabric.readthedocs.io/en/release-2.2/commands/peerlifecycle.html
skulos (Tue, 26 Jan 2021 11:56:11 GMT):
Has joined the channel.
sj1 4 (Wed, 27 Jan 2021 16:51:56 GMT):
Hi.
Do you know how to apply CouchDB to your Spring Data structure?
dyhack (Fri, 29 Jan 2021 13:48:24 GMT):
Hello,Does Java chain code not support operations like new date()?
deployer21 (Fri, 29 Jan 2021 15:20:00 GMT):
So that seems to be a complete proposal interaction process that does everything by itself.. but is it recommended? Where can I learn more about these? Thank you for your help
bestbeforetoday (Fri, 29 Jan 2021 16:12:00 GMT):
https://hyperledger-fabric.readthedocs.io/en/release-2.2/developapps/application.html
bestbeforetoday (Fri, 29 Jan 2021 16:12:29 GMT):
https://hyperledger.github.io/fabric-gateway-java/
nike (Mon, 01 Feb 2021 07:16:53 GMT):
Has joined the channel.
nike (Mon, 01 Feb 2021 07:16:54 GMT):
hello.does anyone know how to set DISCOVERY_AS_LOCALHOST in Fabric -Gateway -Java?Gateway always resolvers the peer/orderer address to localhost. I set the environment variable, but it doesn't work. Fabric and Gateway versions are 2.2.0.
cmhacker (Mon, 01 Feb 2021 09:00:35 GMT):
static {
System.setProperty("org.hyperledger.fabric.sdk.service_discovery.as_localhost", "false");
}
nike (Mon, 01 Feb 2021 09:03:53 GMT):
Thank you so much. It worked!:woo:
nike (Mon, 01 Feb 2021 10:01:55 GMT):
Hi, bigwig!Have you ever encountered this kind of problem?The CLI call is normal. The gateway call to chaincode prompts not install.My Fabric network has 3 organizations, and each organization has 2 peers, one of which has ChainCode installed.
danilofaria7 (Mon, 01 Feb 2021 17:22:28 GMT):
probably because your chaincode should be deterministic
fanjianhang (Tue, 02 Feb 2021 03:19:25 GMT):
hi all, i use fabric-gateway-java 2.2.0 to connect 2.2.0 fabric network, but i got the error `Caused by: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
at io.grpc.Status.asRuntimeException(Status.java:534)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:533)
at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:464)
at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:428)
at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:461)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:553)
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:68)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:739)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:718)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: io.netty.buffer.PooledByteBufAllocator.
fanjianhang (Tue, 02 Feb 2021 03:20:58 GMT):
hi all, i use fabric-gateway-java 2.2.0 to connect 2.2.0 fabric network, but i got the error: ```
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
at io.grpc.Status.asRuntimeException(Status.java:534)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:533)
at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:464)
at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:428)
at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:461)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:553)
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:68)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:739)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:718)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: io.netty.buffer.PooledByteBufAllocator.
bestbeforetoday (Tue, 02 Feb 2021 18:42:23 GMT):
Does the problem still occur with _fabric-gateway-java_ version 2.2.1?
gravity (Tue, 02 Feb 2021 18:53:59 GMT):
does anybody know how to configure java sdk (not gateway) to work via mutual TLS?
Javi (Wed, 03 Feb 2021 08:51:55 GMT):
hi all! I see in my client logs a lot of lines with a WARN that says: `Failed to discover peer endpoint information xxxxx for chaincode xxxxx`. But if I send transactions it works without problems, any idea?
Javi (Wed, 03 Feb 2021 08:56:21 GMT):
i'm using version 1.4.4
sijo.c (Wed, 03 Feb 2021 23:06:27 GMT):
question on CCP: does specifying orderer list in ConnectionProfile improve the writes? ( Our write operation call, after long period of inactivity fails with error `org.hyperledger.fabric.gateway.ContractException: Commit strategy failed`)
sijo.c (Wed, 03 Feb 2021 23:08:38 GMT):
Confused from readthe docs: Orderer is documented but default connectionProfile downloaded from IBP does not contain orderer list
sijo.c (Wed, 03 Feb 2021 23:08:43 GMT):
https://hyperledger-fabric.readthedocs.io/en/latest/developapps/connectionprofile.html#sample
sijo.c (Wed, 03 Feb 2021 23:09:20 GMT):
wonder if order is discovered by the client, using service discovery, could that be causing above error
sijo.c (Wed, 03 Feb 2021 23:11:50 GMT):
Full stack ```
```
sijo.c (Wed, 03 Feb 2021 23:11:50 GMT):
Full stack ```
109 org.hyperledger.fabric.gateway.ContractException: Commit strategy failed
110 at org.hyperledger.fabric.gateway.impl.commit.CommitHandlerImpl.processStrategyResult(CommitHandlerImpl.java:122)
111 at org.hyperledger.fabric.gateway.impl.commit.CommitHandlerImpl.onDisconnectEvent(CommitHandlerImpl.java:115)
112 at org.hyperledger.fabric.gateway.impl.commit.CommitHandlerImpl.access$100(CommitHandlerImpl.java:26)
113 at org.hyperledger.fabric.gateway.impl.commit.CommitHandlerImpl$1.acceptDisconnect(CommitHandlerImpl.java:38)
114 at org.hyperledger.fabric.gateway.impl.event.CommitListenerSession$$Lambda$1170/0x000000007097aad0.accept(Unknown Source)
115 at org.hyperledger.fabric.gateway.impl.event.PeerDisconnectInterceptor.lambda$notifyListeners$0(PeerDisconnectInterceptor.java:65)
116 at org.hyperledger.fabric.gateway.impl.event.PeerDisconnectInterceptor$$Lambda$1177/0x000000001000bb10.accept(Unknown Source)
117 at org.hyperledger.fabric.gateway.impl.event.ListenerSet.lambda$forEach$0(ListenerSet.java:63)
118 at org.hyperledger.fabric.gateway.impl.event.ListenerSet$$Lambda$1160/0x000000001c0066a0.accept(Unknown Source)
119 at java.base/java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4698)
120 at java.base/java.util.Collections$SetFromMap.forEach(Collections.java:5581)
121 at org.hyperledger.fabric.gateway.impl.event.ListenerSet.forEach(ListenerSet.java:61)
122 at org.hyperledger.fabric.gateway.impl.event.PeerDisconnectInterceptor.notifyListeners(PeerDisconnectInterceptor.java:65)
123 at org.hyperledger.fabric.gateway.impl.event.PeerDisconnectInterceptor.handleDisconnect(PeerDisconnectInterceptor.java:36)
124 at org.hyperledger.fabric.gateway.impl.event.PeerDisconnectInterceptor$$Lambda$1173/0x00000000709832e0.disconnected(Unknown Source)
125 at org.hyperledger.fabric.sdk.Peer.lambda$reconnectPeerEventServiceClient$2(Peer.java:387)
126 at org.hyperledger.fabric.sdk.Peer$$Lambda$1176/0x00000000340154a0.run(Unknown Source)
127 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)```
bestbeforetoday (Thu, 04 Feb 2021 14:15:01 GMT):
This error suggests that the transaction was successfully sent to the orderer for commit but all the peers the client expected to receive events from disconnected before the client received block events including the committed transaction
bestbeforetoday (Thu, 04 Feb 2021 14:16:36 GMT):
One possible cause is that idle connections are being closed very aggressively between the client and peers. If this is the case then changing the default gRPC keep-alive times may help to prevent the event listening connections from being closed
sijo.c (Thu, 04 Feb 2021 14:50:30 GMT):
thanks. Looking the logs more closely
sijo.c (Thu, 04 Feb 2021 14:54:29 GMT):
I see after write, the peer finish cc execute, then orderer logs "Writing block [dd] .." within same time period. But peer don't commit until 15min later. Could it also be caused by peer<>orderer connection. In peer log, every few hours I see this WARN ``` 2021-02-04 12:55:23.229 UTC [peer.blocksprovider] DeliverBlocks -> WARN 15880 Could not connect to ordering service: could not dial endpoint 'ibpsw-dev-hpassorderingservicenode1-orderer.hpdev02alb1801-1-191d58cd794cfca115b4da1d4e99e52b-0000.us-south.containers.appdomain.cloud:443': failed to create new connection: context deadline exceeded channel=hpass-ch
2021-02-04 13:55:26.230 UTC [peer.blocksprovider] DeliverBlocks -> WARN 15a6e Could not connect to ordering service: could not dial endpoint 'ibpsw-dev-hpassorderingservicenode1-orderer.hpdev02alb1801-1-191d58cd794cfca115b4da1d4e99e52b-0000.us-south.containers.appdomain.cloud:443': failed to create new connection: context deadline exceeded channel=hpass-ch
```
sijo.c (Thu, 04 Feb 2021 14:54:29 GMT):
I see after write, the peer finish cc execute, then orderer logs "Writing block [dd] .." within same time period. But peer don't commit until 15min later. Could it also be caused by peer<>orderer connection. In peer log, every few hours I see this WARN ``` 2021-02-04 12:55:23.229 UTC [peer.blocksprovider] DeliverBlocks -> WARN 15880 Could not connect to ordering service: could not dial endpoint 'orderingservicenode1-orderer...:443': failed to create new connection: context deadline exceeded channel=ch
2021-02-04 13:55:26.230 UTC [peer.blocksprovider] DeliverBlocks -> WARN 15a6e Could not connect to ordering service:```
sijo.c (Thu, 04 Feb 2021 15:00:43 GMT):
thank you ! for looking into this @bestbeforetoday . here is the peer log timestamps ```
ESC[34m2021-02-04 14:10:22.113 UTC [comm.grpc.server] 1 -> INFO 15ae6ESC[0m streaming call completed grpc.service=protos.Deliver grpc.method=Deliver grpc.peer_address=172.17.22.67:17049 error="context finished before block retrieved: context canceled" grpc.code=Unknown grpc.call_duration=50.136955329s
ESC[34m2021-02-04 14:10:41.685 UTC [endorser] callChaincode -> INFO 15aebESC[0m finished chaincode: cscc duration: 0ms channel= txID=cc7ef9a2
...
...
2021-02-04 14:27:22.072 UTC [gossip.privdata] StoreBlock -> INFO 15bd8 [ch] Received block [60] from buffer
2021-02-04 14:27:22.074 UTC [committer.txvalidator] Validate -> INFO 15bd9^[[0m [ch] Validated block [60] in 1ms
```
sijo.c (Thu, 04 Feb 2021 15:01:13 GMT):
does this confirm gRPC keep-alive as cause?
sijo.c (Thu, 04 Feb 2021 15:01:13 GMT):
does this confirm gRPC keep-alive may help?
ndr_brt (Mon, 22 Feb 2021 12:50:32 GMT):
Has joined the channel.
bh4rtp (Wed, 24 Feb 2021 07:18:54 GMT):
hi, does java sdk support discovery with collection configuration now?
bestbeforetoday (Wed, 24 Feb 2021 10:02:05 GMT):
Unfortunately not but you can work around this by explicitly specifying the set of peers to use for endorsement using `Transaction.setEndorsingPeers()`: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Transaction.html#setEndorsingPeers(java.util.Collection)
bh4rtp (Wed, 24 Feb 2021 12:23:46 GMT):
Ok, thank you. I am waiting for the implementation:)
deployer21 (Wed, 24 Feb 2021 15:33:53 GMT):
If submitTransaction automatically listens for transaction events how is it possible to receive a "Future Completed Exceptionally" error?
deployer21 (Wed, 24 Feb 2021 18:45:27 GMT):
I've more logs in
https://stackoverflow.com/questions/66350698/hyperledger-fabric-java-sdk-future-completed-exceptionally-sendtransaction
pkirkinezis (Thu, 25 Feb 2021 14:11:42 GMT):
I posting also here because i am not sure where this error bellongs
2021-02-25 13:28:45.006 UTC [common.ledger.blockledger.file] Next -> ERRO 94b3f error opening block file /var/hyperledger/production/ledgersData/chains/chains/devchannel/blockfile_000000: open /var/hyperledger/production/ledgersData/chains/chains/devchannel/blockfile_000000: too many open files
2021-02-25 13:28:45.006 UTC [common.deliver] deliverBlocks -> ERRO 94b40 [channel: devchannel] Error reading from channel, cause was: SERVICE_UNAVAILABLE
does anyone experienced such an issue?
ndr_brt (Fri, 26 Feb 2021 08:06:28 GMT):
hi to everyone, I can't find a channel for fabric-gateway so I will ask here.
there's a way, in fabric gateway, to catch concurrent modification exceptions? the `contract.submitTransaction` method exits with a `ContractException` that does not contains references to the kind of error.
I know that this is possible in fabric-sdk-java (catching CompletionException and extracting its cause TransactionEventException that contains the `11` validation code), but would be nice if this could be possible also in fabric-gateway.
bestbeforetoday (Fri, 26 Feb 2021 10:50:43 GMT):
Right now that transaction validation code is getting swallowed by the fabric-gateway code. I agree that would be useful information to pass back to the caller. I guess you've just raised the feature request in Jira? https://jira.hyperledger.org/browse/FGJ-103
bestbeforetoday (Fri, 26 Feb 2021 10:51:00 GMT):
If so, thank you for raising that :thumbsup:
bestbeforetoday (Fri, 26 Feb 2021 11:05:13 GMT):
There is actually a work-around you could employ, which is to implement your own commit handler so you deal with the committed transactions directly and can pull out whatever information you need: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/spi/CommitHandlerFactory.html
bestbeforetoday (Fri, 26 Feb 2021 11:05:25 GMT):
There is sample code linked there that you can just cut & paste
bestbeforetoday (Fri, 26 Feb 2021 11:06:27 GMT):
You register the default handler on the Gateway connect: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Gateway.Builder.html#commitHandler(org.hyperledger.fabric.gateway.spi.CommitHandlerFactory)
bestbeforetoday (Fri, 26 Feb 2021 11:06:58 GMT):
Or you can register a specific handler to use per transaction invocation: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Transaction.html#setCommitHandler(org.hyperledger.fabric.gateway.spi.CommitHandlerFactory)
bestbeforetoday (Fri, 26 Feb 2021 11:07:52 GMT):
But again I think having the exception thrown from the submit include this information for you would be nicer
ndr_brt (Fri, 26 Feb 2021 11:10:15 GMT):
Thanks for the reply, I'm creating a pull request for the case.
In the meantime I will try with the CommitHandler approach.
bestbeforetoday (Fri, 26 Feb 2021 11:23:19 GMT):
If you want to make the code change, that's great. It might be worth defining a `CommitException` as a subclass of the `ContractException`, and which includes the `BlockEvent.TransactionEvent`. Calling code can pull the transaction status and any other information they might want from that event object
bestbeforetoday (Fri, 26 Feb 2021 11:23:55 GMT):
I think the only code you'll need to change is in `CommitHandlerImpl.onTxEvent()`
bestbeforetoday (Fri, 26 Feb 2021 11:27:51 GMT):
I would also declare the exception explicitly on `Contract.submitTransaction()` and `Transaction.submit()` along with accompanying Javadoc
bestbeforetoday (Fri, 26 Feb 2021 11:28:39 GMT):
If you're working on it, assign the Jira to yourself and move it into working state
deployer21 (Fri, 26 Feb 2021 18:47:39 GMT):
just updated it*
pkirkinezis (Mon, 08 Mar 2021 15:47:42 GMT):
getConfigBlock failure panic error . Did anyone have ever seen this error before ?
pkirkinezis (Mon, 08 Mar 2021 17:51:24 GMT):
the error alos says "uncaught synchronization gateway"
bestbeforetoday (Tue, 09 Mar 2021 11:55:34 GMT):
Is there any context to stack trace around that? It doesn't ring any bells as a client-side error, so is that something you're seeing from the peer end? If so, one of the other channels might get more visibility from core Fabric contributors and maintainers
pkirkinezis (Tue, 09 Mar 2021 11:59:19 GMT):
Clipboard - March 9, 2021 1:59 PM
pkirkinezis (Tue, 09 Mar 2021 11:59:52 GMT):
I get an infinity loop when ` Network network = gateway.getNetwork(channelName);` is about to run
pkirkinezis (Tue, 09 Mar 2021 12:00:23 GMT):
The error can be seen in the above screen shot . GRPC gets in panic mode
bestbeforetoday (Tue, 09 Mar 2021 12:07:08 GMT):
That NoClassDefFoundError looks bad. I wonder if some versions of gRPC / Netty packages are out of step. It might be worth clearing out your local Maven repository cache and trying again. Also check if any of your code has direct (or indirect) dependencies on those Netty packages. `mvn dependency:list` and `mvn dependency:tree` might help. If you can't get to the bottom of it and it's easily reproducible then you could raise a bug report in Jira with all the dependency and version information (including the SDK version): https://jira.hyperledger.org/browse/FGJ
pkirkinezis (Tue, 09 Mar 2021 12:35:11 GMT):
Would , by any chance , be a network-config.yaml problem ?
pkirkinezis (Tue, 09 Mar 2021 12:36:58 GMT):
Because i have servers . One server has the 3 oerderer / 1 node . The other 5 has 1 node each .
pkirkinezis (Tue, 09 Mar 2021 13:52:47 GMT):
yeah it was a dependency error between java-sdk hyperledger java-gateway . The version i have imported to my gradle.build were incompatable
pkirkinezis (Tue, 09 Mar 2021 13:52:47 GMT):
yeah it was a dependency error between java-sdk hyperledger and java-gateway hyperledger . The version i have imported to my gradle.build were incompatable
pkirkinezis (Tue, 09 Mar 2021 14:00:06 GMT):
Thank again for your help
bestbeforetoday (Wed, 10 Mar 2021 10:37:16 GMT):
Glad you got it working :thumbsup:
roberto.cangiamila (Thu, 11 Mar 2021 12:09:14 GMT):
Hello everybody .. i have to execute an evaluate transaction .. to got private data .. but i also need to execute it by discovery enabled .. there is a way? Thanks a lot ..
roberto.cangiamila (Thu, 11 Mar 2021 12:11:32 GMT):
i'm using release 1.4 ..
roberto.cangiamila (Thu, 11 Mar 2021 14:26:25 GMT):
reload .. Hello everybody .. i have to execute a query on ledger .. but i also need to execute it by discovery enabled .. there is a way? Thanks a lot ..
i'm using release 1.4 ..
roberto.cangiamila (Thu, 11 Mar 2021 14:26:35 GMT):
:sweat_smile:
roberto.cangiamila (Thu, 11 Mar 2021 16:43:39 GMT):
.. i solved by myself ..
ymo 7 (Fri, 12 Mar 2021 08:13:03 GMT):
Has joined the channel.
ymo 7 (Thu, 18 Mar 2021 03:47:50 GMT):
Does anyone know of a sample sdk java project that is interacting with fabric running inside kubernetes ? please let me know. i am having troubles getting the sdk tested on kubernetes cluster
Unicow (Fri, 26 Mar 2021 14:07:35 GMT):
Has joined the channel.
Unicow (Fri, 26 Mar 2021 14:07:35 GMT):
Hello, do you recommend away or any tutorials on how to start creating a HLF Network using the java sdk?
bestbeforetoday (Fri, 26 Mar 2021 14:30:42 GMT):
I would recommend not using the SDK to create the network. Instead, look at the example of creating and configuring a network in the Fabric samples: https://hyperledger-fabric.readthedocs.io/en/latest/test_network.html
bestbeforetoday (Fri, 26 Mar 2021 14:32:11 GMT):
When it comes to developing a client application using the SDK, there is a section in the main Fabric docs on developing applications that describes all the concepts, although I think the code examples are all JavaScript. The asset-transfer-basic sample might be a good place to start for Java: https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-basic/application-java/src/main/java/application/java/App.java
bestbeforetoday (Fri, 26 Mar 2021 14:32:53 GMT):
Along with the Java SDK documentation: https://hyperledger.github.io/fabric-gateway-java/
Unicow (Fri, 26 Mar 2021 16:20:51 GMT):
Thanks!
But why not using the SDK to create a network? What if I want to create and manage a network programmatically?
I am aware of the client application using SDK. That's about invoking a transaction, right?
Unicow (Fri, 26 Mar 2021 16:20:51 GMT):
Thanks!
But why not using the SDK to create a network? What if I want to create and manage a network programmatically?
I am aware a bit of the client application using SDK. That's about invoking a transaction, right?
tac911 (Fri, 26 Mar 2021 23:07:46 GMT):
Has joined the channel.
tac911 (Fri, 26 Mar 2021 23:07:47 GMT):
Hello. Sorry if this has been asked before. I tried to search for it first.
I'm running HLF 2.2.2 (from fabric-samples) and am using the Java SDK 2.2 (as in the GitHub example). I have replaced the channel and chaincode as well as the pem files of course.
I have issues to submit a transaction with
`byte[] mintTokensResult = contract.createTransaction("Mint").submit("1000");`
It fails while trying to connect to orderer:
```
Caused by: org.hyperledger.fabric.sdk.exception.TransactionException: Channel erc20channel, send transaction failed on orderer OrdererClient{id: 12, channel: erc20channel, name: orderer.example.com:7050, url: grpcs://orderer.example.com:7050}. Reason: UNAVAILABLE: Unable to resolve host orderer.example.com
...
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Unable to resolve host orderer.example.com
...
Caused by: java.lang.RuntimeException: java.net.UnknownHostException: orderer.example.com: nodename nor servname provided, or not known
```
My connection.json looks like this:
```
{
"name": "test-network-org1",
"version": "1.0.0",
"client": {
"organization": "Org1",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
}
}
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com"
],
"certificateAuthorities": [
"ca.org1.example.com"
]
}
},
"orderers": {
"orderer.example.com": {
"url": "grpcs://localhost:7050",
"grpcOptions": {
"ssl-target-name-override": "orderer.example.com"
}
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpcs://localhost:7051",
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\nMII...hI5Iy1T1hxE=\n-----END CERTIFICATE-----\n"
},
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.example.com",
"hostnameOverride": "peer0.org1.example.com"
}
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "https://localhost:7054",
"caName": "ca-org1",
"tlsCACerts": {
"pem": ["-----BEGIN CERTIFICATE-----\nMII...5Iy1T1hxE=\n-----END CERTIFICATE-----\n"]
},
"httpOptions": {
"verify": false
}
}
}
}
```
It also fails with connection.yaml
```
---
name: mint-network-org1
version: 1.0.0
client:
organization: Org1
connection:
timeout:
peer:
endorser: '300'
organizations:
Org1:
mspid: Org1MSP
peers:
- peer0.org1.example.com
certificateAuthorities:
- ca.org1.example.com
peers:
peer0.org1.example.com:
url: grpcs://localhost:7051
tlsCACerts:
path: fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
certificateAuthorities:
ca.org1.example.com:
url: https://localhost:7054
caName: ca-org1
tlsCACerts:
path: fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem
httpOptions:
verify: false
orderers:
orderer.example.com:
url: grpcs://localhost:7050
grpcOptions:
ssl-target-name-override: orderer.example.com
tlsCACerts:
path: fabric-samples/test-network/organizations/ordererOrganizations/example.com/msp/cacerts/tlsca.example.com-cert.pem
# crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
```
Does anyone experienced this before and can help me to solve this?
Many thanks in advance!
tac911 (Fri, 26 Mar 2021 23:07:47 GMT):
Hello. Sorry if this has been asked before. I tried to search for it first.
I'm running HLF 2.2.2 (from fabric-samples) and am using the Java SDK 2.2 (as in the GitHub example). I have replaced the channel and chaincode as well as the pem files of course.
I have issues to submit a transaction with
`byte[] mintTokensResult = contract.createTransaction("Mint").submit("1000");`
Evaluating works fine
```
byte[] queryBalanceResult = contract.evaluateTransaction("ClientAccountBalance");
```
It fails while trying to connect to the orderer that it can't find in URL `grpcs://orderer.example.com:7050` - it seems like it's ignoring the config?
```
Caused by: org.hyperledger.fabric.sdk.exception.TransactionException: Channel erc20channel, send transaction failed on orderer OrdererClient{id: 12, channel: erc20channel, name: orderer.example.com:7050, url: grpcs://orderer.example.com:7050}. Reason: UNAVAILABLE: Unable to resolve host orderer.example.com
...
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Unable to resolve host orderer.example.com
...
Caused by: java.lang.RuntimeException: java.net.UnknownHostException: orderer.example.com: nodename nor servname provided, or not known
```
My connection.json looks like this:
```
{
"name": "test-network-org1",
"version": "1.0.0",
"client": {
"organization": "Org1",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
}
}
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com"
],
"certificateAuthorities": [
"ca.org1.example.com"
]
}
},
"orderers": {
"orderer.example.com": {
"url": "grpcs://localhost:7050",
"grpcOptions": {
"ssl-target-name-override": "orderer.example.com"
}
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpcs://localhost:7051",
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\nMII...hI5Iy1T1hxE=\n-----END CERTIFICATE-----\n"
},
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.example.com",
"hostnameOverride": "peer0.org1.example.com"
}
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "https://localhost:7054",
"caName": "ca-org1",
"tlsCACerts": {
"pem": ["-----BEGIN CERTIFICATE-----\nMII...5Iy1T1hxE=\n-----END CERTIFICATE-----\n"]
},
"httpOptions": {
"verify": false
}
}
}
}
```
It also fails with connection.yaml
```
---
name: mint-network-org1
version: 1.0.0
client:
organization: Org1
connection:
timeout:
peer:
endorser: '300'
organizations:
Org1:
mspid: Org1MSP
peers:
- peer0.org1.example.com
certificateAuthorities:
- ca.org1.example.com
peers:
peer0.org1.example.com:
url: grpcs://localhost:7051
tlsCACerts:
path: fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
certificateAuthorities:
ca.org1.example.com:
url: https://localhost:7054
caName: ca-org1
tlsCACerts:
path: fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem
httpOptions:
verify: false
orderers:
orderer.example.com:
url: grpcs://localhost:7050
grpcOptions:
ssl-target-name-override: orderer.example.com
tlsCACerts:
path: fabric-samples/test-network/organizations/ordererOrganizations/example.com/msp/cacerts/tlsca.example.com-cert.pem
# crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
```
Does anyone experienced this before and can help me to solve this?
Many thanks in advance!
cmhacker (Mon, 29 Mar 2021 17:39:50 GMT):
You should add extra host in you docker-compose file. where you can bridge the your IP address and your domain name for example. extra_hosts:
- "peer0.example.com:172.x.x.x"
-"peer1.example.com:172.x.x.x"
cmhacker (Mon, 29 Mar 2021 17:40:17 GMT):
Similarly you can do this for orderer
KyoungsunPark (Wed, 31 Mar 2021 02:14:07 GMT):
Hello, I was wondering if you plan to release the sdk for fabric 2.3. When you are planning to release sdk java and gateway java for fabric 2.3.x? Thank you.
KyoungsunPark (Wed, 31 Mar 2021 02:14:07 GMT):
Hello, I was wondering if you plan to release the sdk for fabric 2.3. When are you planning to release sdk java and gateway java for fabric 2.3.x? Thank you.
bestbeforetoday (Thu, 01 Apr 2021 08:00:08 GMT):
We are not currently planning on release a v2.3 of the SDKs since all the v2.2 SDK capability still works fine with Fabric v2.3
bestbeforetoday (Thu, 01 Apr 2021 08:00:08 GMT):
We are not currently planning to release a v2.3 of the SDKs since all the v2.2 SDK capability still works fine with Fabric v2.3
knagware9 (Mon, 05 Apr 2021 15:55:37 GMT):
@Unicow Latest fabric release not supporting sdk for managing network and admin related operations. CLI is prefered way managing fabric network.
ganesh_nic (Wed, 07 Apr 2021 06:18:43 GMT):
Has joined the channel.
ganesh_nic (Wed, 07 Apr 2021 06:19:16 GMT):
WE are getting error
cannot run peer because error when setting up MSP of type bccsp from directory /home/fabric-samples/test-network/organizations/peerOrganizations/Org1.example.com/users/Admin@org1.example.com/msp:keyMaterial not found in SigningIdentityInfo
PL update with some solution to it
guoger (Wed, 07 Apr 2021 08:48:12 GMT):
Has joined the channel.
guoger (Wed, 07 Apr 2021 08:49:49 GMT):
@mbwhite would it be possible to include [pr 63](https://github.com/hyperledger/fabric-chaincode-java/pull/63) into a patch release on 2.2? per comment [here](https://github.com/hyperledger/fabric-chaincode-java/pull/63#issuecomment-796445592)
guoger (Wed, 07 Apr 2021 08:49:49 GMT):
@mbwhite would it be possible to include [pr 63](https://github.com/hyperledger/fabric-chaincode-java/pull/63) into a patch release on 2.2? per comment [here](https://github.com/hyperledger/fabric-chaincode-java/pull/63#issuecomment-796445592), thx!
roberto.cangiamila (Thu, 08 Apr 2021 13:23:06 GMT):
Hello everyone .. i need to specify custom peeroptions to enabled registerEventsForFilteredBlocks.. how can i do that? can anyone suggest me? i'm using fabric-gateway-java and networkConfig..thank's!!!
roberto.cangiamila (Thu, 08 Apr 2021 14:34:21 GMT):
here
roberto.cangiamila (Thu, 08 Apr 2021 15:24:04 GMT):
a little help?
nkl199 (Thu, 08 Apr 2021 16:18:01 GMT):
Has left the channel.
Unicow (Wed, 14 Apr 2021 07:20:16 GMT):
@knagware9 Thanks, but are you sure about that? In the github repo I read that these operations are supported in release-notes 2.0.
https://github.com/hyperledger/fabric-sdk-java/blob/main/docs/release_v2.0.0_notes.md
knagware9 (Wed, 14 Apr 2021 12:10:41 GMT):
Yes, I am sure. if it was available in java sdk and supported then it wont be maintain like node.js sdk not support admin operations
roberto.cangiamila (Mon, 19 Apr 2021 09:11:49 GMT):
Good morning, i would like to fork release-1.4 repo to implement new feature: to Enable/disable filterBlock. How can i do that? Thanks
priya1234 (Tue, 20 Apr 2021 09:58:04 GMT):
Has joined the channel.
priya1234 (Tue, 20 Apr 2021 09:58:05 GMT):
Hi Everyone, Using contract.submitTransaction() is taking more time by waiting for commit events. So, Is there is a way to improve the performance using fabric sdk java?
cmhacker (Tue, 20 Apr 2021 10:27:21 GMT):
check your configtx.yaml file and changed if BatchTimeout: 2s then changed it to BatchTimeout: 0.1s
cmhacker (Tue, 20 Apr 2021 10:27:21 GMT):
check your configtx.yaml file and changed BatchTimeout: 2s to BatchTimeout: 0.1s
bestbeforetoday (Tue, 20 Apr 2021 10:37:55 GMT):
You'll find that as you push more concurrent load into the system the blocks get cut faster as you hit the setting for maximum transactions in a block quicker than the the batch timeout
bestbeforetoday (Tue, 20 Apr 2021 10:39:15 GMT):
I'd be wary of setting the batch timeout very low as this may mean that under load you don't have time to get so many transactions batched into each block. Although some benchmarking would help find the best trade-off for your case
bestbeforetoday (Tue, 20 Apr 2021 10:41:21 GMT):
If your transactions don't touch the same ledger keys so it's safe to submit subsequent transactions before previous ones commit, you can use multiple threads at the client end to submit multiple transactions concurrently
bestbeforetoday (Tue, 20 Apr 2021 10:42:44 GMT):
Or if you don't want to wait for the commits to be confirmed, you can use the `DefaultCommitHandlers.NONE` commit handler: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/DefaultCommitHandlers.html#NONE
bestbeforetoday (Tue, 20 Apr 2021 10:43:31 GMT):
You can specify either a default commit handler for all transactions when connecting the Gateway: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Gateway.Builder.html#commitHandler(org.hyperledger.fabric.gateway.spi.CommitHandlerFactory)
bestbeforetoday (Tue, 20 Apr 2021 10:44:07 GMT):
Or specify the commit handler to use for each transaction: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Transaction.html#setCommitHandler(org.hyperledger.fabric.gateway.spi.CommitHandlerFactory)
cmhacker (Tue, 20 Apr 2021 10:57:16 GMT):
Thank you so much this is really helpful.
priya1234 (Wed, 21 Apr 2021 06:05:53 GMT):
Thank you
Sachith.Liyanagama (Thu, 22 Apr 2021 21:11:32 GMT):
Has joined the channel.
Sachith.Liyanagama (Thu, 22 Apr 2021 21:11:38 GMT):
Hello everyone i am new to Hyperledger. I've created a basic blockchain using the Vscode ibm plugin and successfully created a chaincode as well. Now i am working on a java based rest api using the vscode liberty plugin. Apparently i can only use evaluate transaction command in the JAVA SDK. Submit transaction seems to be not working. Anyone knows a solution for this?
cmhacker (Fri, 23 Apr 2021 04:39:32 GMT):
Could you please share your logs or the errors that your facing??
Sachith.Liyanagama (Fri, 23 Apr 2021 05:55:54 GMT):
Hi thanks for your support.error: static interface method invocations are not supported in -source 7
Gateway.Builder builder = Gateway.createBuilder();
^
(use -source 8 or higher to enable static interface method invocations)
Sachith.Liyanagama (Fri, 23 Apr 2021 06:18:59 GMT):
Sachith.Liyanagama - Fri Apr 23 2021 08:18:53 GMT+0200 (Central European Summer Time).txt
Sachith.Liyanagama (Fri, 23 Apr 2021 06:19:09 GMT):
Hi here I recreate the error.
bestbeforetoday (Fri, 23 Apr 2021 10:22:03 GMT):
fabric-gateway-java requires Java 8 or later: https://github.com/hyperledger/fabric-gateway-java#compatibility
Sachith.Liyanagama (Fri, 23 Apr 2021 19:32:54 GMT):
Actually i am using java 11.
Sachith.Liyanagama (Fri, 23 Apr 2021 19:33:56 GMT):
It is working for evaluate transaction in order to query.
Bolzo 1 (Mon, 26 Apr 2021 15:05:34 GMT):
Hi all! Is there a way to determine if the network (endorsing peer) is down?
Bolzo 1 (Mon, 26 Apr 2021 15:05:34 GMT):
Hi all! Is there a way to determine if the network (endorsing peer) is down? I create a Gateway connection the usal way then with my Gateway object I do this `Network channel = gateway.getNetwork(channelName);`
This logs this error `ERROR org.hyperledger.fabric.sdk.Channel - Channel Channel{id: 1, name: mychannel1} Sending proposal with transaction: 0a65bd570e0dcc1e78199d5540c05339072f0eaa95e1a5e4cb6ade6a0e6508b7 to Peer{ id: 2, name: peer0.org2.mydomain.com, channelName: mychannel1, url: grpcs://peer0.org2.mydomain.com:YYYY1, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: peer0.org2.mydomain.com/x.x.x.x:YYYY
Caused by: java.net.ConnectException: Connection refused: no further information`
But it seems that is not rethrown to my call so I cannot catch it in my try catch block.
My problem is that after that call to get the channel i start doing parallel work using `commitListener` and my calls go on timeout as expected.
I wonder if there is a way to understand when the gateway can't connect to the network and avoid useless instructions.
My understanding of this behaviour (logging and not throwning) is that maybe the connection it's restablished after the error log, dunno if I'm wrong on this
Bolzo 1 (Mon, 26 Apr 2021 15:05:34 GMT):
Hi all! Is there a way to determine if the network (endorsing peer) is down? I create a Gateway connection the usal way then with my Gateway object I do this `Network channel = gateway.getNetwork(channelName);`
This logs this error ```ERROR org.hyperledger.fabric.sdk.Channel - Channel Channel{id: 1, name: mychannel1} Sending proposal with transaction: 0a65bd570e0dcc1e78199d5540c05339072f0eaa95e1a5e4cb6ade6a0e6508b7 to Peer{ id: 2, name: peer0.org2.mydomain.com, channelName: mychannel1, url: grpcs://peer0.org2.mydomain.com:YYYY1, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: peer0.org2.mydomain.com/x.x.x.x:YYYY
Caused by: java.net.ConnectException: Connection refused: no further information```
But it seems that is not rethrown to my call so I cannot catch it in my try catch block.
My problem is that after that call to get the channel i start doing parallel work using `commitListener` and my calls go on timeout as expected.
I wonder if there is a way to understand when the gateway can't connect to the network and avoid useless instructions.
My understanding of this behaviour (logging and not throwning) is that maybe the connection it's restablished after the error log, dunno if I'm wrong on this
Bolzo 1 (Mon, 26 Apr 2021 15:05:34 GMT):
Hi all! Is there a way to determine if the network (endorsing peer) is down? I create a Gateway connection the usal way then with my Gateway object I do this `Network channel = gateway.getNetwork(channelName);`
Then, after some second the application logs this error ```ERROR org.hyperledger.fabric.sdk.Channel - Channel Channel{id: 1, name: mychannel1} Sending proposal with transaction: 0a65bd570e0dcc1e78199d5540c05339072f0eaa95e1a5e4cb6ade6a0e6508b7 to Peer{ id: 2, name: peer0.org2.mydomain.com, channelName: mychannel1, url: grpcs://peer0.org2.mydomain.com:YYYY1, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: peer0.org2.mydomain.com/x.x.x.x:YYYY
Caused by: java.net.ConnectException: Connection refused: no further information```
But it seems that is not rethrown to my call so I cannot catch it in my try catch block.
My problem is that after that call to get the channel i start doing parallel work using `commitListener` and my calls go on timeout as expected.
I wonder if there is a way to understand when the gateway can't connect to the network and avoid useless instructions.
My understanding of this behaviour (logging and not throwning) is that maybe the connection it's restablished after the error log, dunno if I'm wrong on this
Bolzo 1 (Mon, 26 Apr 2021 15:05:34 GMT):
Hi all! Is there a way to determine if the network (endorsing peer) is down? I create a Gateway connection the usal way then with my Gateway object I do this `Network channel = gateway.getNetwork(channelName);`
Then, after some seconds the application logs this error ```ERROR org.hyperledger.fabric.sdk.Channel - Channel Channel{id: 1, name: mychannel1} Sending proposal with transaction: 0a65bd570e0dcc1e78199d5540c05339072f0eaa95e1a5e4cb6ade6a0e6508b7 to Peer{ id: 2, name: peer0.org2.mydomain.com, channelName: mychannel1, url: grpcs://peer0.org2.mydomain.com:YYYY1, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: peer0.org2.mydomain.com/x.x.x.x:YYYY
Caused by: java.net.ConnectException: Connection refused: no further information```
But it seems that is not rethrown to my call so I cannot catch it in my try catch block.
My problem is that after that call to get the channel i start doing parallel work using `commitListener` and my calls go on timeout as expected.
I wonder if there is a way to understand when the gateway can't connect to the network and avoid useless instructions.
My understanding of this behaviour (logging and not throwning) is that maybe the connection it's restablished after the error log, dunno if I'm wrong on this
baohua (Wed, 28 Apr 2021 18:04:19 GMT):
When build the `javaenv` docker image from, met such error of
``` > [dependencies 5/18] ADD build/distributions/ /root/:ADD; failed to compute cache key: "/build/distributions" not found: not found``` Any idea how to fix it? Thanks!
bestbeforetoday (Thu, 29 Apr 2021 08:31:50 GMT):
It might be worth asking in #fabric-java-chaincode
Jaswanth1994 (Mon, 10 May 2021 02:36:35 GMT):
Has joined the channel.
Francesco_P (Wed, 19 May 2021 06:49:46 GMT):
hi. I jhave an example network with 2 org and 1 orderer. I renewed certificates with f*abric-ca-client enroll* and then *reenroll*. I copied on the host client the certs: *ca.org1.example.com-cert.pem*, *cert.pem* and the last generated private key. I'm having an exception when i call *gateway.getNetwork("mychannel")* . Someone can help me?
Francesco_P (Wed, 19 May 2021 06:49:46 GMT):
hi. I have an example network with 2 org and 1 orderer. I renewed certificates with f*abric-ca-client enroll* and then *reenroll*. I copied on the host client the certs: *ca.org1.example.com-cert.pem*, *cert.pem* and the last generated private key. I'm having an exception when i call *gateway.getNetwork("mychannel")* . Someone can help me?
Sachith.Liyanagama (Sun, 30 May 2021 16:07:52 GMT):
Dear all, I am new to Hyperledger and I keep receiving Error `1_8:02:47.336 [Default Executor-thread-1360] ERROR org.hyperledger.fabric.gateway.impl.TransactionImpl - No valid proposal responses received. 1 peer error responses: Channel Channel{id: 10, name: mychannel} Sending proposal with transaction: e5e6552232bae72ad3cbded52e34e0efcbeb3ea8c7e739f8338840dee4d874d2 to Peer{ id: 14, name: org1peer-api.127-0-0-1.nip.io:8083, channelName: mychannel, url:
grpc://localhost:8083, mspid: Org1MSP} failed because of: gRPC failure=Status{code=UNKNOWN, description=null, cause=java.lang.UnsupportedOperationException` when I invoke Submittransaction in an Rest API created based on Open Liberty. Can I please know why this is happening?.
Sachith.Liyanagama (Sun, 30 May 2021 16:08:33 GMT):
If I use evaluateTransaction it works without any error.
konda.kalyan (Mon, 31 May 2021 06:22:46 GMT):
My guess is that, Submittransaction is not run succssfully on required number of peers (as per the endorsement policy). Check if the transaction/chaincode has run all required number of peers or not. On the other hand, it is sufficient that evaluateTransaction is required to run any one endorsing peer and don't need to satisfy the endorsement policy.
bestbeforetoday (Tue, 01 Jun 2021 09:42:34 GMT):
Strange that evaluate is working but submit is failing during endorsement, as the evaluate is effectively just an endorsement. Is there a stacktrace to help pinpoint where the error is coming from?
banikanand (Wed, 02 Jun 2021 18:39:28 GMT):
Has joined the channel.
banikanand (Wed, 02 Jun 2021 19:32:58 GMT):
hello....I am looking for some help with parsing data from BlockEvent or Block object. Essentially, I have a blockListener from where i would like to get the channel-name, chaincode name, function name and the data. When i SysOut `block.getData()` , i can see all of them, i don't know how to parse and get the values in String. I think it's in Protobuf format which need to be converted to UTF format. Would appreciate any help with this. Thanks!
banikanand (Wed, 02 Jun 2021 19:34:28 GMT):
@bestbeforetoday
bestbeforetoday (Thu, 03 Jun 2021 17:22:42 GMT):
They are actually wrapper objects around the actual protobuf classes, and are defined by the low-level (fabric-sdk-java) SDK. They loosely mirror the protobuf structure (which is fairly convoluted) but should provide methods for you to navigate down to all the information you need: https://javadoc.io/doc/org.hyperledger.fabric-sdk-java/fabric-sdk-java/latest/org/hyperledger/fabric/sdk/BlockEvent.html
jimthematrix (Mon, 07 Jun 2021 15:58:58 GMT):
Has left the channel.
indranil32 (Tue, 08 Jun 2021 08:18:07 GMT):
Has joined the channel.
indranil32 (Tue, 08 Jun 2021 08:18:15 GMT):
Under https://github.com/hyperledger there are many Java Client SDK projects like fabric-gateway / fabric-gateway-java / fabric-sdk-java...
why are there so many Java clients ?
how do I choose which one to use ?
bestbeforetoday (Tue, 08 Jun 2021 09:08:11 GMT):
I appreciate it could be more obvious. The README for each repo does give some guidance though. From *fabric-sdk-java*
> This project provides a low-level API for interacting with Hyperledger Fabric blockchain networks, and is used by the high-level Hyperledger Fabric Gateway SDK for Java
bestbeforetoday (Tue, 08 Jun 2021 09:08:36 GMT):
So that points to *fabric-gateway-java* as the API to use
bestbeforetoday (Tue, 08 Jun 2021 09:12:08 GMT):
The *fabric-gateway* API (https://github.com/hyperledger/fabric-gateway) is still under development. It provides a consistent client API in Java, Go and Node, with much of the heavy-lifting moved to a server-side Fabric Gateway component, implemented in the peer. This capability does not exist in any released version of Fabric, only in development builds. So this will likely become the preferred API in the future but is not the one to pick for applications you want to deploy right now. Feedback and suggestions on the Fabric Gateway API are very welcome
indranil32 (Tue, 08 Jun 2021 09:13:35 GMT):
awesome... thanks
indranil32 (Wed, 09 Jun 2021 11:02:28 GMT):
If using implementation 'org.hyperledger.fabric:fabric-gateway-java:2.2.X' with fabric test-network 2.3.2 I am getting a netty method not found exception
indranil32 (Wed, 09 Jun 2021 11:02:50 GMT):
org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel mychannel failed with peer peer0.org1.example.com. Status FAILURE, details: Channel Channel{id: 1, name:
mychannel } Sending proposal with transaction: 227ac21c1d271ebcd252c3f7e261c998f0fab426ed6ea0a80e4c4aa96675dba3 to Peer{ id: 2, name: peer0.org1.example.com, channelName: navis, url: grpcs
://localhost:7051, mspid: Org1MSP} failed because of: gRPC failure=Status{code=INTERNAL, description=Panic! This is a bug!, cause=java.lang.NoSuchMethodError: io.netty.buffer.PooledByt
eBufAllocator.
indranil32 (Wed, 09 Jun 2021 11:02:50 GMT):
org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel mychannel failed with peer peer0.org1.example.com. Status FAILURE, details: Channel Channel{id: 1, name:
mychannel } Sending proposal with transaction: 227ac21c1d271ebcd252c3f7e261c998f0fab426ed6ea0a80e4c4aa96675dba3 to Peer{ id: 2, name: peer0.org1.example.com, channelName: mychannel , url: grpcs
://localhost:7051, mspid: Org1MSP} failed because of: gRPC failure=Status{code=INTERNAL, description=Panic! This is a bug!, cause=java.lang.NoSuchMethodError: io.netty.buffer.PooledByt
eBufAllocator.
indranil32 (Wed, 09 Jun 2021 11:03:20 GMT):
works with 2.1.1
indranil32 (Wed, 09 Jun 2021 11:05:12 GMT):
https://github.com/hyperledger/fabric-gateway-java#compatibility --> according to this it should not be
bestbeforetoday (Wed, 09 Jun 2021 15:52:23 GMT):
@indranil32 This is a bit worrying. The builds for both _fabric-gateway-java_ and the low-level _fabric-sdk-java_ on which it is built are both showing their tests passing. I see that the _fabric-gateway-java_ v2.2.x tests are running with _fabric-sdk-java_ v2.2.6 against Fabric v2.2 nodes. Since this looks at first glance to be a purely client-side error, I'm not sure why the Fabric version should be a factor. My suspicion would be some kind of conflict in versions of SDK and/or gRPC/protobuf library versions in your environment compared to what are running in the automated builds. Could you raise a bug report in Jira including as much information as you can on the problem (full stack trace of the errors, `mvn dependency:tree` output, and _ideally_ an extremely simple client project, perhaps using one of the sample networks, that can be used to reproduce the error): https://jira.hyperledger.org/projects/FGJ
indranil32 (Wed, 09 Jun 2021 16:31:57 GMT):
https://jira.hyperledger.org/browse/FGJ-111
bestbeforetoday (Wed, 09 Jun 2021 17:15:46 GMT):
Thank you! :thumbsup:
tac911 (Fri, 11 Jun 2021 14:03:54 GMT):
Why does this limitation exist in Fabric? It limits the development of smart contracts that can be called by other contracts. Listening to events defined in the called-contract is not possible and it requires to listen to the outer-most contract, which could be complicated if there are multiple ones. Anyone has an idea how to overcome this?
https://hlf.readthedocs.io/en/latest/developapps/transactioncontext.html#stub
setEvent(): Smart contracts use this API to add an event to a transaction response. *Note that only a single event can be created in a transaction, and must originate from the outer-most contract when contracts invoke each other via invokeChaincode. * ...
tac911 (Fri, 11 Jun 2021 14:31:49 GMT):
Is it normal that closing the Gateway takes a couple of seconds? We have run a simple test with logging the steps in our methods, and you can see in the bold part, it takes 6 seconds to close the Gateway. We are using the standard method of creating the Gateway as shown in the examples for Java SDK.
2021-06-11 16:22:12.942*** PERF *** Called TokenHLF.MintTo. Building Gateway...
2021-06-11 16:22:12.947*** PERF *** Connected to Gateway. Getting Network...
2021-06-11 16:22:14.172*** PERF *** Got Network. Getting Chaincode...
2021-06-11 16:22:14.176*** PERF *** Invoking MintTo...
2021-06-11 16:22:17.103*** PERF *** Completed MintTo...
2021-06-11 16:22:17.11*** PERF *** Invoking updated BalanceOf...
*
2021-06-11 16:22:17.353*** PERF *** Completed updated BalanceOf. Closing gateway...
*
*2021-06-11 16:22:26.395*** PERF *** Closed gateway. Parsing response...
*
2021-06-11 16:22:26.396*** PERF *** Returning TokenHLF.MintTo...
tac911 (Fri, 11 Jun 2021 14:31:49 GMT):
Is it normal that closing the Gateway takes a like 9 seconds? We are running a simple test with logging the steps in our methods, and you can see in the bold part, it takes 6 seconds to close the Gateway. We are using the standard method of creating the Gateway as shown in the examples for Java SDK.
2021-06-11 16:22:12.942*** PERF *** Called TokenHLF.MintTo. Building Gateway...
2021-06-11 16:22:12.947*** PERF *** Connected to Gateway. Getting Network...
2021-06-11 16:22:14.172*** PERF *** Got Network. Getting Chaincode...
2021-06-11 16:22:14.176*** PERF *** Invoking MintTo...
2021-06-11 16:22:17.103*** PERF *** Completed MintTo...
2021-06-11 16:22:17.11*** PERF *** Invoking updated BalanceOf...
*
2021-06-11 16:22:17.353*** PERF *** Completed updated BalanceOf. Closing gateway...
*
*2021-06-11 16:22:26.395*** PERF *** Closed gateway. Parsing response...
*
2021-06-11 16:22:26.396*** PERF *** Returning TokenHLF.MintTo...
jital (Sat, 12 Jun 2021 07:14:15 GMT):
Currently, PeerEventServiceClient connects to all the peers on the network (even the one not from my organisations). If a peer is down due to some reason, it leads to increase in CPU usage due to connection retries.
1. Can we have a mechanism to restrict PeerEventServiceClient to only connect to peers from my organization or something?
2. Also do we have some docs around Event service features. We are banking on it, I want to read on recommeded practices for delivery guarantees and everything
bestbeforetoday (Mon, 14 Jun 2021 08:37:14 GMT):
You're right that the Java SDK maintains eventing connections to all network peers. It would be possible to change this behaviour but I suspect it would be quite a lot of work, and it's not something I am likely to have time to do, but anyone can contribute changes. It looks like the config property `org.hyperledger.fabric.sdk.peer.retry_wait_time` (or as the environment variable `ORG_HYPERLEDGER_FABRIC_SDK_PEER_RETRY_WAIT_TIME`) should set the wait time between connection attempts, so setting that higher than the default 500ms might help
bestbeforetoday (Mon, 14 Jun 2021 08:41:54 GMT):
The fabric-gateway-java API should ensure that you receive events in order and without duplication, regardless of whether peers being used for eventing go down or come back online: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Network.html#addBlockListener(java.util.function.Consumer)
bestbeforetoday (Mon, 14 Jun 2021 08:44:38 GMT):
You an use a Checkpointer for either block or contract/chaincode event listening. This makes it easier to track the last processed event and allow your client application to resume listening from where it left off after a restart: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Contract.html#addContractListener(org.hyperledger.fabric.gateway.spi.Checkpointer,java.util.function.Consumer)
bestbeforetoday (Mon, 14 Jun 2021 08:46:15 GMT):
There is a Checkpointer implementation provided that writes its state to a local file, or you can provide your own Checkpointer implementation: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/DefaultCheckpointers.html#file(java.nio.file.Path)
longdoan7421 (Mon, 14 Jun 2021 13:58:36 GMT):
Has joined the channel.
jital (Thu, 17 Jun 2021 04:22:06 GMT):
@bestbeforetoday I can pick up the changes for connecting to eventing on same org peers.
Can we have a quick discussion before i start?
Yep we have implemented our checkpointer too :D
indranil32 (Sun, 20 Jun 2021 11:24:25 GMT):
Do we have a Java-eventHub sample in fabric - samples ?
indranil32 (Sun, 20 Jun 2021 11:26:18 GMT):
https://oss.sonatype.org/content/repositories/orghyperledgerfabric-sdk-java-1059/ --> this link is broken
bestbeforetoday (Tue, 22 Jun 2021 10:43:22 GMT):
Off the top of my head, I can't think of a specific Java sample, although the pattern is essentially the same as this JavaScript sample: https://github.com/hyperledger/fabric-samples/blob/1cd71fd26a867efcb0577e02fa42a48a3203ec51/asset-transfer-events/application-javascript/app.js#L235-L255
bestbeforetoday (Tue, 22 Jun 2021 10:44:23 GMT):
You attach a listener function that will get invoked when your chaincode emits events using the Contract's `addContractListener()` methods: https://hyperledger.github.io/fabric-gateway-java/release-2.2/org/hyperledger/fabric/gateway/Contract.html
bestbeforetoday (Tue, 22 Jun 2021 10:45:53 GMT):
That was a staging package that has now been published as v2.2.7: https://search.maven.org/artifact/org.hyperledger.fabric-sdk-java/fabric-sdk-java/2.2.7/jar
bestbeforetoday (Tue, 22 Jun 2021 10:56:07 GMT):
Sorry for not getting back to you more quickly. I'm just getting to this now. Perhaps you could start by creating a story in Jira with a description of the behaviour you want to implement and we can refine from there? https://jira.hyperledger.org/projects/FGJ/
bestbeforetoday (Tue, 22 Jun 2021 11:09:48 GMT):
The Node SDK is implemented differently and only tries to pull events from a single peer at a time. It may be a bit ambitious to try to make such a big change to the Java SDK
bestbeforetoday (Tue, 22 Jun 2021 11:11:20 GMT):
The pool of peers selected for eventing by the Node SDK is limited to the peers in the client's org (unless there are no peers in their org, in which case all network peers are considered). An approach similar to this might be more practical for the Java SDK
bestbeforetoday (Tue, 22 Jun 2021 11:12:49 GMT):
So only peers in the client's org are marked as having the `PeerRole.EVENT_SOURCE` role, and that role is not included for peers in other orgs
bestbeforetoday (Tue, 22 Jun 2021 11:13:49 GMT):
So the SDK would still be actively receiving events from multiple peers, but only peers in the client's org
bestbeforetoday (Tue, 22 Jun 2021 11:15:30 GMT):
Just need to consider the case where the client's org does not have any peers, and how to deal with that. A simple option might be to have a configuration flag, but this makes it much easier for clients to get it wrong and be confused why eventing isn't working. Better would be to be able to detect that condition automatically and react appropriately
SatheeshNehru (Wed, 23 Jun 2021 15:48:32 GMT):
HI using connection.json to submit transaction
getting exception couldnt submit transaction to orderer
unable to resolve hostname orderer_continer_name
SatheeshNehru (Wed, 23 Jun 2021 15:51:58 GMT):
@tac911 did you resolved this
jital (Thu, 24 Jun 2021 05:21:07 GMT):
Created JIRA
https://jira.hyperledger.org/projects/FGJ/issues/FGJ-112
bestbeforetoday (Thu, 24 Jun 2021 08:27:16 GMT):
:thumbsup:
ivanovv (Mon, 28 Jun 2021 13:13:07 GMT):
Hi, I am looking at the old questions about the functionality to sign transactions (payload) offline and the proposed solutions to use a custom CryptoSuite class that implements the sign() method. Reading this recommendation I'm asking myself if the SDK will tolerate a couple of remote calls (for example a request to a remote Wallet/HSM device to sign the payload in a secure environment). Is this use case scenario not considered as a possible one, during the design of the fabric-sdk-java? Thanks.
ivanovv (Mon, 28 Jun 2021 13:13:07 GMT):
Hi, I am looking at the old questions about the functionality to sign transactions (payload) offline and the proposed solutions to use a custom CryptoSuite class that implements the sign() method. Reading this recommendation I'm asking myself if the SDK will tolerate a couple of remote calls (for example a request to a remote Wallet/HSM device to sign the payload in a secure environment). Is this use case scenario not considered as a possible one, during the design of the fabric-sdk-java?
Thanks.
ivanovv (Mon, 28 Jun 2021 13:13:07 GMT):
Hi, I am looking at the old questions about the functionality to sign transactions (payload) offline and the proposed solutions to use a custom CryptoSuite class that implements the sign() method.
Reading this recommendation I'm asking myself if the SDK will tolerate a couple of remote calls (for example a request to a remote Wallet/HSM device to sign the payload in a secure environment).
Is this use case scenario not considered as a possible one, during the design of the fabric-sdk-java?
Thanks.
ivanovv (Mon, 28 Jun 2021 13:13:07 GMT):
Hi guys,
I am looking at the old questions about the functionality to sign transactions (payload) offline and the proposed solutions to use a custom CryptoSuite class that implements the sign() method.
Reading this recommendation I'm asking myself if the fabric-sdk-java will tolerate a couple of remote calls (for example a request to a remote Wallet/HSM device to sign the payload in a secure environment).
Is this use case scenario not considered as a possible one, during the design of the fabric-sdk-java? I'm curious, in case it was considered, what was the reasoning for the decision, not to implement any functionality that will support this use case?
Thanks.
ivanovv (Mon, 28 Jun 2021 13:13:07 GMT):
Hi guys,
I am looking at the old questions about the functionality to sign transactions (payload) offline and the proposed solutions to use a custom CryptoSuite class that implements the sign() method.
Reading this recommendation I'm asking myself if the fabric-sdk-java will tolerate a couple of remote calls (for example a request to a remote Wallet/HSM device to sign the payload in a secure environment).
Is this use case scenario not considered as a possible one, during the design of the fabric-sdk-java? I'm curious, in case it was considered, what was the reasoning/possible workaround for the decision, not to implement any functionality that will support this use case?
Thanks.
ivanovv (Mon, 28 Jun 2021 13:13:07 GMT):
Hi guys,
I am looking at the old questions about the functionality to sign transactions (payload) offline and the proposed solutions to use a custom CryptoSuite class that implements the sign() method.
Reading this recommendation I'm asking myself if the fabric-sdk-java will tolerate a couple of remote calls (for example a request to a remote Wallet/HSM device to sign the payload in a secure environment).
Is this use case scenario not considered as a possible one, during the design of the fabric-sdk-java? I'm curious, in case it was considered, what was the reasoning (or possible workaround) for the decision, not to implement any functionality that will support this use case?
Thanks.
ivanovv (Mon, 28 Jun 2021 13:13:07 GMT):
Hi guys,
I am looking at the old questions about the functionality to sign transactions (payload) offline and the proposed solutions to use a custom CryptoSuite class that implements the sign() method.
Reading this recommendation I'm asking myself if the fabric-sdk-java will tolerate a couple of remote calls (for example a request to a remote Wallet/HSM device to sign the payload in a secure environment).
Is this use-case scenario not considered as a possible one, during the design of the fabric-sdk-java? I'm curious, in case it was considered, what was the reasoning (or possible workaround) for the decision, not to implement any functionality that will support this use-case?
Thanks.
ivanovv (Mon, 28 Jun 2021 13:13:07 GMT):
Hi guys,
I am looking at the old questions about the functionality to sign transactions (payload) offline and the proposed solutions to use a custom CryptoSuite class that implements the sign() method.
Reading this recommendation I'm asking myself if the fabric-sdk-java will tolerate a couple of remote calls (for example a request to a remote Wallet/HSM device to sign the payload in a secure environment).
Is this use-case scenario not considered as a possible one, during the design of the fabric-sdk-java? I'm curious, in case it was considered, what was the reasoning (or possible workaround) for the decision, not to implement any functionality that will support this use-case?
Thanks.
PS. The question could be extended with the scenario of a mobile user signing a payload received as QR code on another device.
```
ivanovv (Mon, 28 Jun 2021 13:13:07 GMT):
Hi guys,
I am looking at the old questions about the functionality to sign transactions (payload) offline and the proposed solutions to use a custom CryptoSuite class that implements the sign() method.
Reading this recommendation I'm asking myself if the fabric-sdk-java will tolerate (the latency of) a couple of remote calls (for example a request to a remote Wallet/HSM device to sign the payload in a secure environment).
Is this use-case scenario not considered as a possible one, during the design of the fabric-sdk-java? I'm curious, in case it was considered, what was the reasoning (or possible workaround) for the decision, not to implement any functionality that will support this use-case?
Thanks.
PS. The question could be extended with the scenario of a mobile user signing a payload received as QR code on another device.
```
ivanovv (Mon, 28 Jun 2021 13:13:07 GMT):
Hi guys,
I am looking at the old questions about the functionality to sign transactions (payload) offline and the proposed solutions to use a custom CryptoSuite class that implements the sign() method.
Reading this recommendation I'm asking myself if the fabric-sdk-java will tolerate (the latency of) a couple of remote calls (for example a request to a remote Wallet/HSM device to sign the payload in a secure environment).
Is this use-case scenario (not) considered as a possible one, during the design of the fabric-sdk-java? I'm curious, in case it was considered, what was the reasoning (or possible workaround) for the decision, not to implement any functionality that will support this use-case?
Thanks.
PS. The question could be extended with the scenario of a mobile user signing a payload received as QR code on another device.
```
ivanovv (Mon, 28 Jun 2021 13:59:08 GMT):
PS.
bestbeforetoday (Tue, 29 Jun 2021 09:10:54 GMT):
I don't know the intent of the people who designed and developed the low-level fabric-sdk-java but, from the presence of the CryptoSuite as a pluggable element, I think there was an intention to allow alternative signing implementations to be provided. I don't see why using an HSM for signing shouldn't be included in that, and it is supported in a similar manner in the Node SDK
bestbeforetoday (Tue, 29 Jun 2021 09:11:22 GMT):
I don't see any reason why HSM signing can't be made to work with the Java SDK. It's just a question of time and effort to implement it
bestbeforetoday (Tue, 29 Jun 2021 09:14:13 GMT):
The CryptoSuite itself is quite a large interface to implement so just support signing, so it's not necessarily the easiest job, but perhaps some elements of it not used purely for signing can be either delegated to the existing CryptoSuite implementation or just not supported (throw `UnsupportedOperationException`) to make it easier to implement if you only need signing and not the CA operations like enrollment
bestbeforetoday (Tue, 29 Jun 2021 09:17:44 GMT):
The _fabric-gateway_ API being developed right now was designed to better decouple the signing implementation from the SDK itself and make it very easy to build and use new signing implementations
bestbeforetoday (Tue, 29 Jun 2021 09:18:48 GMT):
The signing implementation is a simple function that you can implement however you want: https://hyperledger.github.io/fabric-gateway/main/api/java/org/hyperledger/fabric/client/identity/package-summary.html
bestbeforetoday (Tue, 29 Jun 2021 09:19:14 GMT):
And this is then just passed in when connecting the Gateway client (see code example here): https://hyperledger.github.io/fabric-gateway/main/api/java/index.html
bestbeforetoday (Tue, 29 Jun 2021 09:35:39 GMT):
For "off-line signing", where the client application doesn't have the client signing credentials and needs to go back to a remote client (e.g. that mobile user) who holds the signing keys, the future Fabric Gateway API has a specific asynchronous flow designed to support that. See Off-line signing examples here: https://hyperledger.github.io/fabric-gateway/main/api/java/org/hyperledger/fabric/client/Contract.html
ivanovv (Tue, 29 Jun 2021 11:01:02 GMT):
Hi bestbeforetoday,
ivanovv (Tue, 29 Jun 2021 11:01:02 GMT):
Hi bestbeforetoday, thanks for the extended explanation. When could we expect the documented feature/APi from your latest link to be implemented?```
```
ivanovv (Tue, 29 Jun 2021 11:01:02 GMT):
Hi bestbeforetoday,
thanks for the extended explanation. When could we expect the documented feature/APi from your latest link to be implemented (in months/quarters)?
ivanovv (Tue, 29 Jun 2021 11:01:02 GMT):
Hi bestbeforetoday,
thanks for the extended explanation. When could we expect the documented feature/APi from your latest link to be implemented (in months/quarters)?```
Thanks,
Venko
PS. Regarding the other options, personally I'd be afraid to implement 2 (or more) remote hops in a sync method, because of the latency (thread blocking) problems, that could hurt the scalability.
ivanovv (Tue, 29 Jun 2021 11:01:02 GMT):
Hi bestbeforetoday,
thanks for the extended explanation. When could we expect the documented feature/APi from your latest link to be implemented (in months/quarters)?
Thanks,
Venko
PS. Regarding the other options, personally I'd be afraid to implement 2 (or more) remote hops in a sync method, because of the latency (thread blocking) problems, that could hurt the scalability.
ivanovv (Tue, 29 Jun 2021 13:39:02 GMT):
Hi bestbeforetoday,
thanks for the extended explanation. When could we expect the documented feature/API from your latest link to be officially released (in months/quarters)?
Thanks,
Venko
bestbeforetoday (Tue, 29 Jun 2021 16:45:03 GMT):
I couldn't commit to any exact timescale but the current intention is to have a Fabric release supporting a first stable version of that client API late this year. I would guess end of 3Q or later. But that really is purely a statement of intent, not any kind of firm date. It depends on how quickly development progresses, feedback / requirements and any issues we might run into a long the way
mkumarceg444 (Thu, 01 Jul 2021 13:09:47 GMT):
Has joined the channel.
mkumarceg444 (Thu, 01 Jul 2021 13:09:48 GMT):
Hi, Can anyone provide samples/steps to bring up fabric-java-sdk to interact with fabric network.
mkumarceg444 (Thu, 01 Jul 2021 13:10:48 GMT):
i checked https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-ledger-queries and basic examples but, i could not find steps to bring it up. Can you please help on this
mkumarceg444 (Thu, 01 Jul 2021 13:11:54 GMT):
Even if there is any other sample is there fine
mkumarceg444 (Thu, 01 Jul 2021 13:11:54 GMT):
Even if there is any other sample also fine
Djoust (Fri, 02 Jul 2021 07:23:24 GMT):
You can check the java sdk e2e tests in the source, but if you wanna just do the basic interactions with the network and chaincode its recommended to use the gateway
chakri07 (Sun, 04 Jul 2021 12:04:43 GMT):
Has joined the channel.
mkumarceg444 (Tue, 06 Jul 2021 14:38:36 GMT):
Hi, i am trying to interact fabric network using fabric-sdk-java, but facing error like https://jira.hyperledger.org/browse/FGJ-111
or javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
i am tried with fabric images 2.2.2 and fabric-sdk-java 2.2.7/2.2.2/2.1.1
but ending up with error while trying to initialize channel
if possible can you please tell me some working version combination, i will try with that
mkumarceg444 (Wed, 07 Jul 2021 07:43:38 GMT):
Hi, i am facing the error when i try to invoke the chaincode, org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel mychannel failed with peer peer0.org1.example.com. Status FAILURE, details: Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: 918b1a2dd8f0b1b7aa29158a3b28d5dfd94de8fae36c422d8d4d9ded68160ab8 to Peer{ id: 2, name: peer0.org1.example.com, channelName: mychannel, url: grpcs://MYHOSTNAME:7051} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0], cause=javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
mkumarceg444 (Wed, 07 Jul 2021 07:44:37 GMT):
i am running fabric network in one host and running SDK in another host, facing this problem
mkumarceg444 (Wed, 07 Jul 2021 07:48:00 GMT):
can anyone please suggest me should i need to mention or include my fabric-sdk-java deployed host name anywhere during fabric register.
indranil32 (Wed, 07 Jul 2021 09:46:13 GMT):
Did you update your hosts file to resolve peer0.org1.example.com to a proper IP/DNS ?
mkumarceg444 (Wed, 07 Jul 2021 14:01:58 GMT):
now it is working by passing values to --csr-host and setting SANS
mkumarceg444 (Wed, 07 Jul 2021 15:29:06 GMT):
Hi, I am facing some strange error, i tried persisting state value in the fabric network using the putstate through the fabric-gateway-java. i am getting success response. But, the same while trying to query i am getting "*unexpected end of JSON input*" and the for the getstate getting [] in the network. Can you please suggest on this
baohua (Thu, 29 Jul 2021 18:28:42 GMT):
Hi, for the sample code of `Path walletDirectory = Paths.get("wallet");` given at https://github.com/hyperledger/fabric-gateway-java, where can we find the `wallet` file? Thanks!
dan13 (Fri, 30 Jul 2021 22:02:14 GMT):
At that directory, however the Paths.get() will resolve for where the code is executing. The wallet file must be created by some code, see: https://hyperledger.github.io/fabric-gateway-java/master/org/hyperledger/fabric/gateway/Wallets.html
Bolzo 1 (Mon, 02 Aug 2021 08:31:19 GMT):
Hi, I have a question about peer connection using Fabric Gateway. I have a connection profile in which i specify 2 peer of my organization (these peer are also endoring peer, only they have the chaincode installed). Time to time happens that the Gateway automattically tries to send transaction to a peer of another organization in the channel, and that peer is not an endorsing peer. The problem that I face is the fact that the gateway when tries to connect to the other org peer, it uses the logic address (i.e. peer0.otherOrg.com) which cannot be resolved by the dns, so this results in a unknow host exception.
Any thoughts on this? The desired outcome is that my gateway connects only to my org endorsing peers for the submit transaction part.
conanoc (Thu, 05 Aug 2021 01:43:11 GMT):
The behavior seems normal. Clients should connect to peers of other organizations.
What's the endorsement policy of your channel?
deployer21 (Mon, 16 Aug 2021 14:20:16 GMT):
Hello, I've a question concerning data loss after rolling back blocks after a transaction error occurs. I'm using a high-throughput ledger, and from time to time the submitted transaction can throw a ContractException due to a IllegalArgumentException.
This happens nearly 1 time in 500 submitted ones, but It causes the ledger to rollback the last 5/6 blocks to a certain security point, causing the loss of data contained in those blocks. I mean, after I catch the exception, surrounding the submitTransaction with a try/catch, I'm able to resend the failed payload and it is processed successfully. However, the data from the previous transactions is lost. What can I do to prevent this?
bestbeforetoday (Tue, 17 Aug 2021 17:30:20 GMT):
If the peer is discarding previously committed blocks, that sounds to me like it could be a more serious issue with the peer itself. You might want to raise an issue
bestbeforetoday (Tue, 17 Aug 2021 17:33:15 GMT):
If it's a client-side SDK failure that shouldn't be happening then it would help to raise an issue against the SDK with as much diagnostic information as you can get, including at the very least the stack trace of the exception being generated, a snippet of the failing client code, and any information on particular inputs/parameters supplied by your client application that trigger the error
deployer21 (Wed, 18 Aug 2021 11:18:58 GMT):
Hello @bestbeforetoday , and thank you for your answer.
The problem causing these errors is related to when a peer has generated a block in pos X and receives from gossip a different block in same position X. Which causes him to discard the received block, losing that information.
Warning Message from peer logs (docker):
2021-08-18 11:12:53.630 UTC [gossip.state] func1 -> WARN c38 Block [681] received from gossip wasn't added to payload buffer: Ledger height is at 682, cannot enqueue block with sequence of 681
deployer21 (Wed, 18 Aug 2021 11:59:38 GMT):
Another question I got is why does blocks are constantly generated with only one transaction in it? I've configured a batch timeout of 1s and a BatchSize.MaxMessageCount of 100. I was expectng that, to generate a new block, I'd have to send 100 messages or something, however, in my network, If I send like 10 new transactions in a second, it generates 10 new blocks in the ledger, with the message: "Committed block [1698] with 1 transaction(s) in 24ms";
ckong (Thu, 19 Aug 2021 03:41:53 GMT):
I have a question about using Fabric Gateway. How can I obtain the transaction ID from contract.submitTransaction()? I tried the longform Transaction t = contract.createTransaction(name), but Transaction doesn't have any ways to return me the transaction ID either.
ckong (Thu, 19 Aug 2021 03:45:02 GMT):
I see Transaction#getTransactionId() in release-2.2, but I'm using release-1.4 because I'm working on Fabric v1.4.x. Is there any other way for me to get the transaction ID?
ckong (Thu, 19 Aug 2021 04:47:41 GMT):
Can I use Gateway release-2.2 to connect to a Fabric network running Fabric v1.4.x? @bestbeforetoday
bestbeforetoday (Thu, 19 Aug 2021 09:22:29 GMT):
That sounds like maybe peer ledgers have somehow diverged. I'm not sure exactly how this might have happened or the best way to fix it, but it doesn't sound good
bestbeforetoday (Thu, 19 Aug 2021 09:29:10 GMT):
If you just want to capture all the transaction IDs submitted then one hack might be to implement your own CommitHandlerFactory, which is set on Gateway connect: https://hyperledger.github.io/fabric-gateway-java/release-1.4/org/hyperledger/fabric/gateway/Gateway.Builder.html#commitHandler-org.hyperledger.fabric.gateway.spi.CommitHandlerFactory-
bestbeforetoday (Thu, 19 Aug 2021 09:31:05 GMT):
Your CommitHandlerFactory implementation could capture the transaction ID and then just defer to one of the default handlers so you don't actually need to implement a complete handler: https://hyperledger.github.io/fabric-gateway-java/release-1.4/org/hyperledger/fabric/gateway/DefaultCommitHandlers.html
bestbeforetoday (Thu, 19 Aug 2021 09:31:34 GMT):
If you can possibly move to v2.2 then your life will be much easier though
ckong (Thu, 19 Aug 2021 09:31:58 GMT):
But would v2.2 be compatible with Fabric v1.4.x?
bestbeforetoday (Thu, 19 Aug 2021 09:34:04 GMT):
Good question. I have seen the v2.2 Node SDK used successfully with v1.4 Fabric (provided you don't use an v2.2-specific features). It's not something I've tried with the Java SDK but you could give it a try. The protobuf and gRPC definitions used for communication between client and peer typically have pretty good compatibility
bestbeforetoday (Thu, 19 Aug 2021 09:34:04 GMT):
Good question. I have seen the v2.2 Node SDK used successfully with v1.4 Fabric (provided you don't use any v2.2-specific features). It's not something I've tried with the Java SDK but you could give it a try. The protobuf and gRPC definitions used for communication between client and peer typically have pretty good compatibility
yacovm (Thu, 19 Aug 2021 09:34:40 GMT):
> [gossip.state] func1 -> WARN c38 Block [681] received from gossip wasn't added to payload buffer: Ledger height is at 682, cannot enqueue block with sequence of 681
yacovm (Thu, 19 Aug 2021 09:34:45 GMT):
this doesn't mean it's a different block
yacovm (Thu, 19 Aug 2021 09:35:08 GMT):
it just means that we pulled block 681 but we somehow got block 682 via a different manner so no need for it
yacovm (Thu, 19 Aug 2021 09:35:14 GMT):
it's benign, ignore this warning
bestbeforetoday (Thu, 19 Aug 2021 09:37:58 GMT):
@yacovm Thanks for weighing in! In earlier post @deployer21 says that the peer is actually rolling back / discarding previously committed blocks. This sounds to me like something that shouldn't be possible. I can't say whether it's really happening on the log messages above are just giving a false impression that it is.
bestbeforetoday (Thu, 19 Aug 2021 09:37:58 GMT):
@yacovm Thanks for weighing in! In earlier post @deployer21 says that the peer is actually rolling back / discarding previously committed blocks. This sounds to me like something that shouldn't be possible. I can't say whether it's really happening or the log messages above are just giving a false impression that it is.
yacovm (Thu, 19 Aug 2021 09:38:21 GMT):
what kind of storage is the peer using ?
yacovm (Thu, 19 Aug 2021 09:38:30 GMT):
Is it using an NFS mount?
deployer21 (Thu, 19 Aug 2021 11:03:58 GMT):
@yacovm @bestbeforetoday thank you for your help.
deployer21 (Thu, 19 Aug 2021 11:05:24 GMT):
@yacovm peers are docker containers with volumes being mapped at docker network .yamls.
deployer21 (Thu, 19 Aug 2021 11:13:38 GMT):
Results_Comparison.jpg
deployer21 (Thu, 19 Aug 2021 11:13:41 GMT):
@yacovm I don't know why then, some updates that I send to the ledger are being ignored or lost somehow.. I'm saving negotiation results both in application memory and to the ledger, and some assets at the ledger are 100% equal to the ones in memory, while others are like 95% or something..
deployer21 (Thu, 19 Aug 2021 11:15:27 GMT):
I don't see any other error/warning in peer logs that could justify it
deployer21 (Thu, 19 Aug 2021 11:17:28 GMT):
To contextualise you, the values after B(blockchain) should match the values after C(application)
Param-S (Thu, 19 Aug 2021 13:01:38 GMT):
Has joined the channel.
yacovm (Thu, 19 Aug 2021 16:54:57 GMT):
maybe some updates are ignored because they are invalid transactions due to MVCC conflicts?
yacovm (Thu, 19 Aug 2021 16:55:25 GMT):
if this is a high throughput network it makes sense no?
bestbeforetoday (Tue, 24 Aug 2021 16:56:04 GMT):
I suspect your client application isn't driving enough concurrent transaction load for your block cutting configuration. I certainly can observe large numbers of transactions in a single block with a multi-threaded client driving load
vlaca (Mon, 13 Sep 2021 09:01:08 GMT):
Has joined the channel.
Ashish (Wed, 15 Sep 2021 13:43:55 GMT):
If all I want to do is install and instantiate, with the java SDK. Then I don't have to supply the event hub url right?
Ashish (Wed, 15 Sep 2021 13:43:55 GMT):
If all I want to do is install and instantiate, with the java SDK. Then I don't have to supply the event hub url right?
The reason is, somehow my eventhub is not connecting at all.
`2021-09-15 11:19:12,333 DEBUG EventHub:212 - EventHub{id: 16, name: peer0.OrgA, channelName: fabricchannel, url: grpcs://172.19.112.107:7053} is connecting.
2021-09-15 11:19:12,335 DEBUG Endpoint:298 - Endpoint grpcs://172.19.112.107:7053 with no ssl context
2021-09-15 11:19:12,335 DEBUG Endpoint:271 - Endpoint grpcs://172.19.112.107:7053, using CN overrideAuthority: 'peer0.OrgA'
2021-09-15 11:19:12,336 DEBUG EventHub:341 - EventHub{id: 16, name: peer0.OrgA, channelName: fabricchannel, url: grpcs://172.19.112.107:7053} connect is done with connect status: false
2021-09-15 11:19:12,337 WARN EventHub:280 - EventHub{id: 16, name: peer0.OrgA, channelName: fabricchannel, url: grpcs://172.19.112.107:7053} terminated is false shutdown is false, retry count 301651 has error UNAVAILABLE: io exception.
2021-09-15 11:19:12,337 WARN EventHub:294 - EventHub{id: 16, name: peer0.OrgA, channelName: fabricchannel, url: grpcs://172.19.112.107:7053} :StatusRuntimeException Status Status{code=UNAVAILABLE, description=io exception, cause=io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /172.19.112.107:7053
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:325)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:634)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused
... 11 more`
Ashish (Wed, 15 Sep 2021 13:43:55 GMT):
If all I want to do is install and instantiate, with the java SDK. Then I don't have to supply the event hub url right?
The reason is, somehow my eventhub is not connecting at all.
`2021-09-15 11:19:12,333 DEBUG EventHub:212 - EventHub{id: 16, name: peer0.OrgA, channelName: fabricchannel, url: grpcs://172.19.112.107:7053} is connecting.
2021-09-15 11:19:12,335 DEBUG Endpoint:298 - Endpoint grpcs://172.19.112.107:7053 with no ssl context
2021-09-15 11:19:12,335 DEBUG Endpoint:271 - Endpoint grpcs://172.19.112.107:7053, using CN overrideAuthority: 'peer0.OrgA'
2021-09-15 11:19:12,336 DEBUG EventHub:341 - EventHub{id: 16, name: peer0.OrgA, channelName: fabricchannel, url: grpcs://172.19.112.107:7053} connect is done with connect status: false
2021-09-15 11:19:12,337 WARN EventHub:280 - EventHub{id: 16, name: peer0.OrgA, channelName: fabricchannel, url: grpcs://172.19.112.107:7053} terminated is false shutdown is false, retry count 301651 has error UNAVAILABLE: io exception.
2021-09-15 11:19:12,337 WARN EventHub:294 - EventHub{id: 16, name: peer0.OrgA, channelName: fabricchannel, url: grpcs://172.19.112.107:7053} :StatusRuntimeException Status Status{code=UNAVAILABLE, description=io exception, cause=io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /172.19.112.107:7053
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:325)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:634)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused
... 11 more`
And after some 31000 retry's the Txn timeout causes it to stop the flow. But Instantiation happens just fine.
ckong (Fri, 17 Sep 2021 08:08:20 GMT):
I invoke Gateway#getNetwork(String) with the name of a non-existent channel. Despite printing a long stack trace, the resulting Network object I get is non-null. How do I prove that I am calling a non-existent channel?
ckong (Fri, 17 Sep 2021 08:10:04 GMT):
Is there a simple way to check if a channel exists or not?
ckong (Fri, 17 Sep 2021 08:15:47 GMT):
Another question is, what is the rationale behind creating a Network object for a channel regardless of whether it exists or not?
vlaca (Fri, 17 Sep 2021 14:28:02 GMT):
which version of fabric are you using?
ckong (Mon, 20 Sep 2021 01:37:18 GMT):
I'm using 1.4.9
jkneubuhl (Mon, 18 Oct 2021 16:43:32 GMT):
Has joined the channel.
ravinayag (Thu, 28 Oct 2021 09:34:25 GMT):
Has joined the channel.
ravinayag (Thu, 28 Oct 2021 09:35:00 GMT):
How to reproduce :
1, Clone the fabrice samples,
2, goto fabricsamples\fabcar and start the network.
3, Copy the relevant files and the connection files, fabcar\java- src, pom.xml
4, Run the java client for fabcar from a different machine. ( in may case windows )
Response :
Able to add the Wallets, but getting below grpc comm error.
Steps tried :
Added the org2 peer in connection.yaml file still not resolving..
Added DNS entries, no improvement
expecting: Grpcs should take the hostname/fqdn peer name from the configured variable from the docker-compose file.
Any alternate options to override the setting ? How can i override the hostname setting from the grpcs://localhost:9051 ?
For Error , refer the attachment error file.txt
ravinayag (Thu, 28 Oct 2021 09:38:14 GMT):
errrorfile.txt
nkaramolegos (Mon, 08 Nov 2021 14:36:58 GMT):
Has joined the channel.
nkaramolegos (Mon, 08 Nov 2021 14:36:59 GMT):
Hello, is there any example for share (i.e github) using the java sdk to deploy and update the chainode, to join the orgs (peers) to channel, and to create new channels?
LakshmiMurali (Tue, 09 Nov 2021 08:06:09 GMT):
Has joined the channel.
LakshmiMurali (Tue, 09 Nov 2021 08:06:10 GMT):
Hi Team,
I have setup fabric 2.2.4 network with 4 organizations, each having 1 peer.
Fabric SDK version :2.2.4
We used cryptogen to create certificate materials.
Application V2 capability :false
Channel V2 capability : true
Orderer V2 capability : true
TLS is enabled.
Install is working fine and 4 containers are getting generated. But while triggering instantiation, getting below error.
`Channel fabricchannel, transaction: e59e974de2641efe70a312575f4aaeb7726a7b80bf189a2ef03af7457a7e48aa got back from peer Peer{ id: 83, name: peer0.Org2, channelName: fabricchannel, url: grpcs://172.19.99.56:9051} status: 500, message: error in simulation: failed to execute transaction e59e974de2641efe70a312575f4aaeb7726a7b80bf189a2ef03af7457a7e48aa: error sending: chaincode stream terminated`
LakshmiMurali (Tue, 09 Nov 2021 08:06:10 GMT):
Hi Team,
I have setup fabric 2.2.4 network with 4 organizations, each having 1 peer.
Fabric SDK version :2.2.4
We used cryptogen to create certificate materials.
Application V2 capability :false
Channel V2 capability : true
Orderer V2 capability : true
TLS is enabled.
Install is working fine and 4 containers are getting generated. But while triggering instantiation, getting below error.
`Channel fabricchannel, transaction: e59e974de2641efe70a312575f4aaeb7726a7b80bf189a2ef03af7457a7e48aa got back from peer Peer{ id: 83, name: peer0.Org2, channelName: fabricchannel, url: grpcs://172.19.99.56:9051} status: 500, message: error in simulation: failed to execute transaction e59e974de2641efe70a312575f4aaeb7726a7b80bf189a2ef03af7457a7e48aa: error sending: chaincode stream terminated`
Please help
bestbeforetoday (Thu, 25 Nov 2021 16:46:57 GMT):
A v0.2.0 pre-release version of the new *fabric-gateway* client API for use with Fabric v2.4 has been published/tagged. This makes use of the new Fabric Gateway service in v2.4 peers, and provides completely consistent functionality to applications written in Go, Node and Java. Provided no stop-ship issues are identified, this is what we are planning to release alongside Fabric v2.4 as a supplement to the existing SDKs so please feel free to try it out and provide feedback.
- https://github.com/hyperledger/fabric-gateway
- https://search.maven.org/artifact/org.hyperledger.fabric/fabric-gateway
(As I type it's not showing up in the Maven Central search but is published to the Maven Central repository)
bestbeforetoday (Thu, 25 Nov 2021 17:38:13 GMT):
Just a note that a current (development) build of the Fabric peer is required. This will not work with the v2.4 beta release. There is a `make pull-latest-peer` Makefile target in the fabric-gateway repository that will pull down and tag the latest peer images
bestbeforetoday (Tue, 04 Jan 2022 14:55:37 GMT):
fabric-sdk-java v2.2.11 is released, pulling in the latest round of Log4j vulnerability fixes (Log4j v2.17.1):
- https://github.com/hyperledger/fabric-sdk-java/releases/tag/v2.2.11
- https://search.maven.org/artifact/org.hyperledger.fabric-sdk-java/fabric-sdk-java/2.2.11/jar
ShobhitSrivastava (Thu, 13 Jan 2022 04:45:37 GMT):
Hi All..just had one question. I have two peers network with majority endorsement policy. I logged into couchDB UI and changed one key value. However when I am reading this key from chaincode, I am still getting old value. Any information on this? I tried this with fabric 2.4 release.
ShobhitSrivastava (Thu, 13 Jan 2022 04:45:37 GMT):
Hi All..just had one question. I have two peers network with majority endorsement policy. I logged into couchDB UI and changed one key's value. However when I am reading this key from chaincode, I am still getting old value. Any information on this? I tried this with fabric 2.4 release.
ShobhitSrivastava (Thu, 13 Jan 2022 04:45:37 GMT):
Hi All..just had one question. I have two peers network with majority endorsement policy. I logged into couchDB UI and changed one key's value. However when I am reading this key from chaincode, I am still getting old value. Any information on this? I tried this with fabric 2.4 release. @rickr ..adding please take a look.
bestbeforetoday (Tue, 08 Feb 2022 10:19:30 GMT):
v1.0.1 of the Fabric Gateway client API (Go, Node and Java) for use with Fabric v2.4+ is released: https://github.com/hyperledger/fabric-gateway/releases/tag/v1.0.1
bestbeforetoday (Tue, 15 Feb 2022 10:33:30 GMT):
Hyperledger chat is migrating from Rocket.Chat to Discord. There is a *fabric-client-apis* channel in Discord that can be used in place of this one: https://discord.com/channels/905194001349627914/943089887589048350
To sign up for the Hyperledger Discord server, use this link: https://discord.gg/hyperledger
Shweta1 (Wed, 16 Mar 2022 16:08:06 GMT):
Has joined the channel.
Shweta1 (Wed, 16 Mar 2022 16:08:59 GMT):
i am using the fabric-sdk-java 2.0 and trying to invoke the system chaincode `qscc` GetBlockByNumber.But the response is not in readable format.
How i can decode block in sdk java.
byte[] result= contract.evaluateTransaction("getBlockByNumber","channel",6);
rjones (Tue, 22 Mar 2022 19:53:08 GMT):
rjones (Tue, 22 Mar 2022 19:53:09 GMT):
rjones (Wed, 23 Mar 2022 17:25:13 GMT):