Open kalleknast opened 5 years ago
hmm I have never dealt with a CA before I will try things out and let you know.
I am having trouble starting the fabric-ca container. This is what I am receiving after I ran the scripts. Does it run on your environment?
I also couldn't find the enrollAdmin.js file. Let me know if you left that one out on purpose.
I just forgot to push enrollAdmin.js
. It is done now.
The fabric-ca container starts fine for me. I think it is important to properly clean out everything and run configure.sh
. I just used ./stop.sh
, ./configure.sh
and then started the network. However, I think there is still something weird. If you look on line 12 of docker-compose-base.yaml
, you'll see what looks like a hardcoded key. Does that make sense? If not, how can we replace it?
Oh yea I don't think it makes sense and I found two examples on how to replace it. I am still trying to figure out what it means exactly but here are the two examples.
As you can see both methods are under the replacePrivateKey()
function
I found a way to update, modify or delete the affiliation using the client-ca.
Great! I'll fix it tomorrow evening.
I got stuck. I tried using the SDK
fabric_ca_client.newAffiliationService().create({ "name": "house01" }, admin_user)
but it doesn't fly.
However, the real issues come when I try to run queries or writing.
I thought that maybe it would be better to follow the balance-transfer
example, but I cannot even run the example. I hope I'll get more time to troubleshoot this in the weekend.
I think the reason why you couldn't run query is that you don't have a function called "Query". That's a key variable that needs to be implemented within the chaincode file.
You can take a look at the IBM tut here https://www.ibm.com/developerworks/community/blogs/8d277a63-4204-4fd3-8cb8-b7cb222cd522/entry/Write_deploy_invoke_and_query_Chaincode_on_Blockchain_Hyperlegder_network?lang=en
Since our chaincode is called carecords, the complete command is
bash peer chaincode query -C $CHANNEL_NAME -n carecords -c '{"Args":["getRecord","a"]}'
There were little errors in the chaincode file and I also added the testing script that you can run section by section against the smart contract. I pushed them to my branch if you want to take a look.
Thanks! I'll get to it next week.
Hi Team , I am using Hyperledger Fabric Sdk , Balance Transfer 1.4 getiing the below issue , when adding "org3 " in network as :-- [2019-10-19 17:52:24.159] [ERROR] Helper - Failed to get registered user: Jim_003 with error: Error: fabric-ca request register failed with errors [[{"code":0,"message":"Registration of 'Jim_003' failed in affiliation validation: Failed getting affiliation 'org3.department1': : scode: 404, code: 63, msg: Failed to get Affiliation: sql: no rows in result set"}]]
Kindly help me how i can fix this issue .
@rakeshjha2k6
affiliations are hardcoded in /etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
:
affiliations:
org1:
- department1
- department2
org2:
- department1
You need to provide your own customized config file instead of the auto-generated one.
In
registerUser.js
, the call tofabric_ca_client.register(...)
only seems to work whenaffiliation
is set to'org1.department1'
. Trying with'house01'
gives an error.It seems like the affiliations are hardcoded in
/etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
in theca.microgrid.org
container.How to set the affiliations properly?