Re: Issues w/ tutorial: Build Your First Network
email4tong@gmail.com
Salmon, You can give this a try. It is a lot easier. litong01/minifabric
Thanks.
On Wednesday, January 29, 2020, 5:58:44 PM EST, Salmon, Erika <esalmon@...> wrote:
Hi,
I’m having issues in this tutorial and I’m not sure why or how to resolve it. I follow every step exactly but when in bash I enter the command:
#peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
After I enter it, I get this error:
2020-01-29 22:46:13.000 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized 2020-01-29 22:46:13.019 UTC [cli.common] readBlock -> INFO 002 Expect block, but got status: &{NOT_FOUND} 2020-01-29 22:46:13.022 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized 2020-01-29 22:46:13.452 UTC [cli.common] readBlock -> INFO 004 Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:13.455 UTC [channelCmd] InitCmdFactory -> INFO 005 Endorser and orderer connections initialized 2020-01-29 22:46:13.656 UTC [cli.common] readBlock -> INFO 006 Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:13.662 UTC [channelCmd] InitCmdFactory -> INFO 007 Endorser and orderer connections initialized 2020-01-29 22:46:13.863 UTC [cli.common] readBlock -> INFO 008 Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:13.867 UTC [channelCmd] InitCmdFactory -> INFO 009 Endorser and orderer connections initialized 2020-01-29 22:46:14.069 UTC [cli.common] readBlock -> INFO 00a Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:14.073 UTC [channelCmd] InitCmdFactory -> INFO 00b Endorser and orderer connections initialized 2020-01-29 22:46:14.275 UTC [cli.common] readBlock -> INFO 00c Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:14.278 UTC [channelCmd] InitCmdFactory -> INFO 00d Endorser and orderer connections initialized 2020-01-29 22:46:14.480 UTC [cli.common] readBlock -> INFO 00e Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:14.484 UTC [channelCmd] InitCmdFactory -> INFO 00f Endorser and orderer connections initialized 2020-01-29 22:46:14.687 UTC [cli.common] readBlock -> INFO 010 Received block: 0
Could you please help me resolve this? I would like to continue with the tutorials but this error is preventing me from going forward.
Kind Regards,
Erika Salmon
|
||||||||
|
||||||||
Re: Peer communication during chaincode execution
Yacov
See https://jira.hyperledger.org/browse/FAB-11980
May I ask why do you need it? what's your use case? From: "Kimheng SOK" <sok.kimheng@...> To: hyperledger-fabric@... Date: 01/29/2020 11:57 PM Subject: [EXTERNAL] [Hyperledger Fabric] Peer communication during chaincode execution Sent by: fabric@... Dear all, I wonder is it possible for peers to pass message to each other on the channel during the chaincode execution in the context of chaincode developer level not the protocol level? Or we need to modify the gossip protocol it self. Appreciate for answering the question.
|
||||||||
|
||||||||
Issues w/ tutorial: Build Your First Network
esalmon@...
Hi,
I’m having issues in this tutorial and I’m not sure why or how to resolve it. I follow every step exactly but when in bash I enter the command:
#peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
After I enter it, I get this error:
2020-01-29 22:46:13.000 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized 2020-01-29 22:46:13.019 UTC [cli.common] readBlock -> INFO 002 Expect block, but got status: &{NOT_FOUND} 2020-01-29 22:46:13.022 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized 2020-01-29 22:46:13.452 UTC [cli.common] readBlock -> INFO 004 Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:13.455 UTC [channelCmd] InitCmdFactory -> INFO 005 Endorser and orderer connections initialized 2020-01-29 22:46:13.656 UTC [cli.common] readBlock -> INFO 006 Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:13.662 UTC [channelCmd] InitCmdFactory -> INFO 007 Endorser and orderer connections initialized 2020-01-29 22:46:13.863 UTC [cli.common] readBlock -> INFO 008 Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:13.867 UTC [channelCmd] InitCmdFactory -> INFO 009 Endorser and orderer connections initialized 2020-01-29 22:46:14.069 UTC [cli.common] readBlock -> INFO 00a Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:14.073 UTC [channelCmd] InitCmdFactory -> INFO 00b Endorser and orderer connections initialized 2020-01-29 22:46:14.275 UTC [cli.common] readBlock -> INFO 00c Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:14.278 UTC [channelCmd] InitCmdFactory -> INFO 00d Endorser and orderer connections initialized 2020-01-29 22:46:14.480 UTC [cli.common] readBlock -> INFO 00e Expect block, but got status: &{SERVICE_UNAVAILABLE} 2020-01-29 22:46:14.484 UTC [channelCmd] InitCmdFactory -> INFO 00f Endorser and orderer connections initialized 2020-01-29 22:46:14.687 UTC [cli.common] readBlock -> INFO 010 Received block: 0
Could you please help me resolve this? I would like to continue with the tutorials but this error is preventing me from going forward.
Kind Regards,
Erika Salmon
|
||||||||
|
||||||||
Re: Chaincode gets instantiated but not able to invoke or list it
#fabric
#fabric-chaincode
stefan.riembauer@...
Hey mrudav, Did you make any progress on this? I am trying the same and it also fails at initializing the chaincode. On the worker node I can see that the chaincode container is started with a log message like "successfully started, sending signal to peer node". Also almost the exact configuration worked about a week ago with eks. Meanwhile I think that this could be a problem on the ami/docker/kubernetes-version which is used on eks... I purged my whole setup today and retried but still the same problem.. br Stefan
|
||||||||
|
||||||||
Peer communication during chaincode execution
Kimheng SOK
Dear all, I wonder is it possible for peers to pass message to each other on the channel during the chaincode execution in the context of chaincode developer level not the protocol level? Or we need to modify the gossip protocol it self. Appreciate for answering the question.
|
||||||||
|
||||||||
anyone able to iterate over records using getStateByRange?
Siddharth Jain
this method:
Note that startKey and endKey can be empty string, which implies unbounded
range query on start or end.
is supposed to enable enumerating records in the database but when we tried it, it did not work. e.g.:
public async getAssets(ctx:
Context): Promise<Asset[]> {
const assets:
Asset[] = [];
const results =
await ctx.stub.getStateByRange('',
'');
while (true) {
let item =
await results.next();
if (item.done) {
break;
} else {
let buffer =
item.value.getValue();
let asset =
JSON.parse(buffer.buffer.toString())
as Asset; // buffer.buffer returns many records not just once and the JSON.parse will fail
assets.push(asset);
}
}
await results.close();
return assets;
}
buffer.toString()
"ByteBufferNB(offset=22,markedOffset=-1,limit=386,capacity=1981)"
buffer.buffer.toString()
"
�
�
mycc00000�{"createdBy":"","id":"00000","lastModifiedBy":"","metadata":"","owner":"org2MSP"}
�
�
mycc00001�{"createdBy":"","id":"00001","lastModifiedBy":"","metadata":"","owner":"org1MSP"}
�
�
mycc00002�{"createdBy":"","id":"00002","lastModifiedBy":"","metadata":"","owner":"org1MSP"}
�
�
mycc00003�{"createdBy":"","id":"00003","lastModifiedBy":"","metadata":"","owner":"org1MSP"}
�
�
mycc00004�{"createdBy":"","id":"00004","lastModifiedBy":"","metadata":"","owner":"org1MSP"}$efc8d188-16ae-41e8-a024-7880a8d0bf31"
JSON.parse(buffer.buffer.toString())
SyntaxError: Unexpected token � in JSON at position 1
buffer.buffer.buffer.toString()
"[object ArrayBuffer]"
has anyone been able to use this method successfully?
|
||||||||
|
||||||||
Faisal
Error: error reading response body
We have the following environment setup and configurations for an HLF 1.4.2 network.
1- Network deployed using docker swarm with service recovery 2- Peer and CouchDB directories mapped in order to persist data to maintain state after crashes 3- Prometheus deployed for event monitoring and log aggregation 4- Configuration for CouchDB set to a. - CORE_LEDGER_STATE_COUCHDBCONFIG_REQUESTTIMEOUT=120s b. - CORE_LEDGER_STATE_COUCHDBCONFIG_MAXRETRIES=5 c. - CORE_LEDGER_STATE_COUCHDBCONFIG_MAXUPDATEBATCHSIZE=5000 d. - CORE_LEDGER_STATE_COUCHDBCONFIG_INTERNALQUERYLIMIT=5000 e. - CORE_LEDGER_STATE_COUCHDBCONFIG_TOTALQUERYLIMIT=5000
The CouchDB and Peer are running on the same HOST and the specs for the host are given below
RAM: 8GB Processor: Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz Storage: 400GB CPU Cores: 2
The Peer sends a request to CouchDB for committing a block and in return gets an invalid response or the connection times out which causes the peer to crash. The logs can be found in the peer.log file attached.
As a result of this only the PEER container crashes, and the swarm creates a new peer container to recover. The CouchDB container doesn’t crash and maintains the healthy state. When we looked at the Prometheus dashboard to check if there was any downtime for the peer, we see that there was no downtime recorded may be because the scrape_interval is set to 30sec and the service returns to its healthy state before it. Please note that after the crash we don’t lose any state or see issues with any of the other services. https://jira.hyperledger.org/browse/FAB-16611?jql=text%20~%20%22couch%20db%20timeout%22
Expectation: we are looking for either a fixed version of CouchDB that doesn't throw this error or fixed code in the peer so that if CouchDB returns this error the peer can retry the request or handle it gracefully without crashing.
|
||||||||
|
||||||||
Re: Error: could not assemble transaction: ProposalResponsePayloads do not match
Kimheng SOK
I got this error often, the reason is all the peer node execute their own chaincode individually and even if the result is successful, it doesn't means that all the payload are the same. By looking at the payload we can see that the output from different peer are different. So to solve the problem is to find the root cause inside our chaincode that make the different output. Normally I try to print the output step by step to see where there is the problem and solve it. I used Nodejs chaincode, so console.log and console.info is what help me to see the inequality of the output, and then using docker logs ChaincodeContainerID to view the output.
On Wed, Jan 29, 2020 at 1:29 AM Siddharth Jain <siddjain@...> wrote:
|
||||||||
|
||||||||
Re: CORE_PEER_CHAINCODEADDRESS when peer is not running in a docker container
Nye Liu <nye@...>
Whatever public IP other peers would use to connect to it. Docker and NAT (in docker's case double or triple NAT) complicate matters, you will have to pay attention to how you will have peers communicating and how you will be deploying TLS certs. Docker supposedly simplifies things for novices but in my experience it makes any rational p2p design a huge pain.
On Tue, Jan 28, 2020, 2:20 PM Siddharth Jain <siddjain@...> wrote:
|
||||||||
|
||||||||
CORE_PEER_CHAINCODEADDRESS when peer is not running in a docker container
Siddharth Jain
What should be the CORE_PEER_CHAINCODEADDRESS when the peer is not running in a docker container? E.g., peer is running on the host and listening for chaincode at 0.0.0.0:7052. If we set CORE_PEER_CHAINCODEADDRESS
to 127.0.0.1:7051 then for the chaincode container 127.0.0.1 maps to the docker container itself not the host.
|
||||||||
|
||||||||
Re: Error: could not assemble transaction: ProposalResponsePayloads do not match
Siddharth Jain
could anyone point us to the code where the response payload is generated? is there any doc explaining what the response payload is? its a byte array but what does it contain?
From: Siddharth Jain <siddjain@...>
Sent: Monday, January 27, 2020 5:17 PM To: fabric@... <fabric@...> Subject: Error: could not assemble transaction: ProposalResponsePayloads do not match
we get this error when trying to invoke the chaincode on a network of 3 peers. However, we have verified if we invoke the chaincode individually on the peer nodes, all of them respond with Chaincode invoke successful. result: status:200. does
anyone have any idea what could be wrong here?
|
||||||||
|
||||||||
Re: Storing/Retrieving key values in a collaborative way - endorsement policy
David Enyeart
Your question gets to the heart of many use cases. And with v2.0 release coming, this is a great time to have the discussion. You have two options to choose from depending on your specific requirements: Hello Fabric guys, I have a scenario where there are X orgs in a Hyperledger Fabric network. I would like to have each org can create/set/reset their respective values for key(s). However, other orgs should be able to only read them but not modify them. Also, as there is only possible to set one policy per Chaincode, I have to use `OutOf()` but this would end up to an ability to modify org1’s changes without involving org1. E.g. Lets say there are 10 orgs in a Hyperledger Fabric network. Usual approach which we all know that works: 1. N (say N=2) Orgs should be able to set a unique key+value pair (can be implemented with Endorsement policy of type `OutOf(E[, E...])`) - Org1 creates the key+value pair and gets signed from any of OrgX (2..N) 2. Implicit: Any 2 Orgs is able to modify any key+value pair 3. Any one of those orgs is able to get the value from the key (IIRC) My Requirements: 1. An org (containing multiple peers) should be able to set a unique key+value pair 2. Only that org can modify the key+value pair which it had set 3. Any one of orgs in Hyperledger Fabic network is able to read value from key I have tried going through older mail archives (not all though) and didn’t find anything relevant. The closest one which had relevance is, solved by private data collection which I am not sure if that solution applies here. Hyperledger Fabric version can be: 1.4.x or 2.x Please let me know your suggestions. Any answers like “Hyperledger is not suited for your purpose…” is also welcome :) Thanks, - Anoop
|
||||||||
|
||||||||
Storing/Retrieving key values in a collaborative way - endorsement policy
Anoop Vijayan <anoop@...>
Hello Fabric guys,
I have a scenario where there are X orgs in a Hyperledger Fabric network. I would like to have each org can create/set/reset their respective values for key(s). However, other orgs should be able to only read them but not modify them. Also, as there is only possible to set one policy per Chaincode, I have to use `OutOf()` but this would end up to an ability to modify org1’s changes without involving org1. E.g. Lets say there are 10 orgs in a Hyperledger Fabric network. Usual approach which we all know that works: 1. N (say N=2) Orgs should be able to set a unique key+value pair (can be implemented with Endorsement policy of type `OutOf(E[, E...])`) - Org1 creates the key+value pair and gets signed from any of OrgX (2..N) 2. Implicit: Any 2 Orgs is able to modify any key+value pair 3. Any one of those orgs is able to get the value from the key (IIRC) My Requirements: 1. An org (containing multiple peers) should be able to set a unique key+value pair 2. Only that org can modify the key+value pair which it had set 3. Any one of orgs in Hyperledger Fabic network is able to read value from key I have tried going through older mail archives (not all though) and didn’t find anything relevant. The closest one which had relevance is, solved by private data collection which I am not sure if that solution applies here. Hyperledger Fabric version can be: 1.4.x or 2.x Please let me know your suggestions. Any answers like “Hyperledger is not suited for your purpose…” is also welcome :) Thanks, - Anoop
|
||||||||
|
||||||||
Error: could not assemble transaction: ProposalResponsePayloads do not match
Siddharth Jain
we get this error when trying to invoke the chaincode on a network of 3 peers. However, we have verified if we invoke the chaincode individually on the peer nodes, all of them respond with Chaincode invoke successful. result: status:200. does
anyone have any idea what could be wrong here?
|
||||||||
|
||||||||
signature set did not satisfy policy
#fabric
#fabric-questions
George
I've created a network configuration with 2 orgs, each one with 1 peer and CA.
I've successfully installed and instantiated my chaincode on both peers
But after invoking a transaction this error occurs on both peers:
~~~
peer0.org1.example.com|2020-01-27 21:32:00.531 UTC [committer.txvalidator] validateTx -> ERRO 047 VSCCValidateTx for transaction txId = d18ad9c8c5e6aada47b7c8677676b4d748bf2ae16256c093ae8f9dfb0bf17779 returned error: VSCC error: endorsement policy failure, err: signature set did not satisfy policy
peer0.org2.example.com|2020-01-27 21:32:00.531 UTC [committer.txvalidator] validateTx -> ERRO 069 VSCCValidateTx for transaction txId = d18ad9c8c5e6aada47b7c8677676b4d748bf2ae16256c093ae8f9dfb0bf17779 returned error: VSCC error: endorsement policy failure, err: signature set did not satisfy policy
~~~
that's how I installed the chaincode on both peers:
~~~
peer chaincode install -n mycc -v 1.0 -l node -p /opt/gopath/src/github.com/mychaincodes/
~~~
that's how I instantiated my contract
~~~
peer chaincode instantiate -o orderer.example.com:7050 --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca.example.com-cert.pem -C $CHANNEL_NAME -n mycc -l node -v 1.0 -c '{"Args":[]}' -P "AND ('Org1MSP.member','Org2MSP.member')"
~~~
and that's how I invoked transaction
~~~
peer chaincode invoke -o orderer.example.com:7050 --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/ca/ca.example.com-cert.pem -C mychannel -n mycc --peerAddresses peer0.org1.example.com:7051 --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem -c '{"Args":["createMyAsset","001","Model X"]}'
~~~
Thanks in advance
|
||||||||
|
||||||||
revive^CC: static analysis of Go smart contracts
|
||||||||
|
||||||||
Re: CORE_PEER_ADDRESS vs CORE_PEER_LISTENADDRESS
Nye Liu <nye@...>
Listen is for the bind() call. Peer address is the externally visible address published during discovery. Please research bind() if that is unclear.
On Mon, Jan 27, 2020, 11:57 AM Siddharth Jain <siddjain@...> wrote:
|
||||||||
|
||||||||
Re: CORE_PEER_ADDRESS vs CORE_PEER_LISTENADDRESS
Siddharth Jain
One more question.
I am assuming the CORE_PEER_CHAINCODEADDRESS and CORE_PEER_CHAINCODELISTENADDRESS are analogous to CORE_PEER_ADDRESS and CORE_PEER_LISTENADDRESS
respectively i.e.,
whereas the CORE_PEER_LISTENADDRESS
is the address the peer will listen on for communication from other peers and orderers the CORE_PEER_CHAINCODELISTENADDRESS is the address
the peer will listen on for communication from chaincode container. And the logic for other two env variables is same.
So
now the question is can one set CORE_PEER_LISTENADDRESS = CORE_PEER_CHAINCODELISTENADDRESS
and CORE_PEER_ADDRESS = CORE_PEER_CHAINCODEADDRESS or will that create a problem. If yes, why?
From: Yacov Manevich <YACOVM@...>
Sent: Monday, January 27, 2020 11:33 AM To: Siddharth Jain <siddjain@...> Cc: fabric@... <fabric@...> Subject: Re: [Hyperledger Fabric] CORE_PEER_ADDRESS vs CORE_PEER_LISTENADDRESS What if your friend is abroad and you're calling his office phone, and he configured his office phone to redirect the call to his cellphone?
The listen address is the address the peer binds its socket. It can be 0.0.0.0 for instance. The peer address is an address that the peer publishes to other peers in its organization via gossip. Imagine that you have a VM and inside the VM you have a docker container that runs the peer. The address of the docker container is 172.20.0.2 so you'd want to bind to this address. However, other peers cannot reach your docker container via this address, and they need to use the VM's IP which can be like 10.0.0.2 So you'd want to configure your peer address to be the VM's external address and have a port forwarding rule. From: "Siddharth Jain" <siddjain@...> To: "fabric@..." <fabric@...> Date: 01/27/2020 09:27 PM Subject: [EXTERNAL] [Hyperledger Fabric] CORE_PEER_ADDRESS vs CORE_PEER_LISTENADDRESS Sent by: fabric@... from the docs w.r.t. CORE_PEER_ADDRESS it is said that this represents the endpoint to other peers in the same organization. and CORE_PEER_LISTENADDRESS is The Address at local network interface this Peer will listen on. So why would anyone want to set these two differently? If my friend's actual phone number is 123-456-7890 (the CORE_PEER_LISTENADDRESS) and the number I have in my phone book is 234-567-8901 (the CORE_PEER_ADDRESS) then there is bound to be a problem when I try to call my friend. So why does Fabric open up this possibility?
|
||||||||
|
||||||||
Re: CORE_PEER_ADDRESS vs CORE_PEER_LISTENADDRESS
Yacov
What if your friend is abroad and you're
calling his office phone, and he configured his office phone to redirect
the call to his cellphone?
The listen address is the address the peer binds its socket. It can be 0.0.0.0 for instance. The peer address is an address that the peer publishes to other peers in its organization via gossip. Imagine that you have a VM and inside the VM you have a docker container that runs the peer. The address of the docker container is 172.20.0.2 so you'd want to bind to this address. However, other peers cannot reach your docker container via this address, and they need to use the VM's IP which can be like 10.0.0.2 So you'd want to configure your peer address to be the VM's external address and have a port forwarding rule. From: "Siddharth Jain" <siddjain@...> To: "fabric@..." <fabric@...> Date: 01/27/2020 09:27 PM Subject: [EXTERNAL] [Hyperledger Fabric] CORE_PEER_ADDRESS vs CORE_PEER_LISTENADDRESS Sent by: fabric@... from the docs w.r.t. CORE_PEER_ADDRESS it is said that this represents the endpoint to other peers in the same organization. and CORE_PEER_LISTENADDRESS is The Address at local network interface this Peer will listen on. So why would anyone want to set these two differently? If my friend's actual phone number is 123-456-7890 (the CORE_PEER_LISTENADDRESS) and the number I have in my phone book is 234-567-8901 (the CORE_PEER_ADDRESS) then there is bound to be a problem when I try to call my friend. So why does Fabric open up this possibility?
|
||||||||
|
||||||||
CORE_PEER_ADDRESS vs CORE_PEER_LISTENADDRESS
Siddharth Jain
from the docs w.r.t. CORE_PEER_ADDRESS it is said that this represents the endpoint to other peers in the same organization.
and CORE_PEER_LISTENADDRESS is The Address at local network interface this Peer will listen on.
So why would anyone want to set these two differently? If my friend's actual
phone number is 123-456-7890 (the
CORE_PEER_LISTENADDRESS) and the number I have in my phone book is 234-567-8901 (the CORE_PEER_ADDRESS) then there is bound to
be a problem when I try to call my friend. So why does Fabric open up this possibility?
|
||||||||
|