How to get peer admin's certificate and key on Bluemix?

0 votes
I am trying to deploy my bna on Bluemix but i am not getting how to get the cert and key of peer admin.
How can I get it?
Jul 16, 2018 in Blockchain by digger
• 26,550 points
84 views

1 answer to this question.

0 votes

Follow the steps mentioned below:

Create connection profile

~/.composer-connection-profiles/bmx-stage1-kubes/connection.json


{
 "name": "bmx-stage1-kubes-org1",
 "description": "Connection profile for IBM Blockchain Platform",
 "type": "hlfv1",
 "orderers": [
  {
   "url": "grpc://169.47.123.123:31010"
  }
 ],
 "ca": {
 "url": "http://169.47.123.123:30000",
 "name": "CA1"
 },
"peers": [
{
 "requestURL": "grpc://169.47.123.123:30110",
 "eventURL": "grpc://169.47.123.123:30111"
 }
 ],
 "keyValStore": "/Users/jeff/.composer-credentials/bmx-stage1-kubes-
  org1",
 "channel": "channel1",
 "mspID": "Org1MSP",
 "timeout": 300
}


Make sure the public address matches the public address of your kubernetes cluster.

After setting up my kubernetes env, you should get the appropriate admin creds that you can use to create an admin id (PeerAdmin) 
In order to grab the creds, you first need to access one of the pods in my kubernetes cluster

kubectl exec -ti $(kubectl get pods | grep ca| awk '{print $1}') bash

Then you have to get the cert file and the key file for the ca. You will find the cert file here:

/shared/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/admincerts
you will find the key file here:

/shared/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore
Then copy the contents of those files into a cert file (admincert.pem) and a private key file (key.pem) on your local system and then run:

composer identity import -p bmx-stage1-kubes-org1 -u PeerAdmin -c admincert.pem -k key.pem
This will create your PeerAdmin (admin identity)

then run

composer network deploy -a myBNA.bna -p bmx-stage1-kubes-org1 -i PeerAdmin -s abc

answered Jul 16, 2018 by slayer
• 29,170 points

Related Questions In Blockchain

0 votes
1 answer

How to get notified when an event triggers on ethereum smart contract?

Here's a simple example for web3js 1.0.0.beta*: function handler ...READ MORE

answered Jun 8, 2018 in Blockchain by ariaholic
• 7,340 points
445 views
0 votes
1 answer

How to get all address and send ethers in solidity using a loop?

I found a similar code somewhere: contract  Holders{ uint ...READ MORE

answered Jul 31, 2018 in Blockchain by digger
• 26,550 points
240 views
0 votes
1 answer

How to get results by running the voting code on Ethereum?

In mist go to your contract and ...READ MORE

answered Sep 18, 2018 in Blockchain by digger
• 26,550 points
36 views
0 votes
1 answer

Hyperledger Fabric: How to get transaction history using key?

history, err := stub.GetHistoryForKey(key_value) for history.HasNext() { ...READ MORE

answered Nov 20, 2018 in Blockchain by Omkar
• 67,660 points
810 views
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,550 points
83 views
+1 vote
1 answer

How do i change the names of validating peers in IBM Bluemix blockchain?

IBM Bluemix Blockchain service Hyperledger Fabric v0.6 will ...READ MORE

answered Apr 10, 2018 in Blockchain by Perry
113 views
0 votes
1 answer