Getting started
#
TutorialResources:
#
Create Kubernetes ClusterTo start deploying our red fabric we have to have a Kubernetes cluster. For this we will use KinD.
Ensure you have these ports available before creating the cluster:
- 80
- 443
If these ports are not available this tutorial will not work.
#
Install Kubernetes operatorIn this step we are going to install the kubernetes operator for Fabric, this will install:
- CRD (Custom Resource Definitions) to deploy Certification Fabric Peers, Orderers and Authorities
- Deploy the program to deploy the nodes in Kubernetes
To install helm: https://helm.sh/docs/intro/install/
#
Install the Kubectl pluginTo install the kubectl plugin, you must first install Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/install/
Afterwards, the plugin can be installed with the following command:
#
Install IstioInstall Istio binaries on the machine:
Install Istio on the Kubernetes cluster:
Peer
organization#
Deploy a #
Environment Variables for AMD (Default)#
Environment Variables for ARM (Mac M1)#
Configurar DNS interno#
Deploy a certificate authorityCheck that the certification authority is deployed and works:
Register a user in the certification authority of the peer organization (Org1MSP)
#
Deploy a peerCheck that the peer is deployed and works:
Orderer
organization#
Deploy an To deploy an Orderer
organization we have to:
- Create a certification authority
- Register user
orderer
with passwordordererpw
- Create orderer
#
Create the certification authorityCheck that the certification authority is deployed and works:
orderer
#
Register user #
Deploy ordererCheck that the orderer is running:
#
Prepare connection string to interact with ordererTo prepare the connection string, we have to:
- Get the connection string without users
- Register a user in the certification authority for signature
- Get the certificates using the user created above
- Attach the user to the connection string
- Get the connection string without users
- Register a user in the TLS certification authority
- Get the certificates using the certificate
- Attach the user to the connection string
#
Create channelTo create the channel we need to first create the wallet secret, which will contain the identities used by the operator to manage the channel
#
Register and enrolling OrdererMSP identity#
Register and enrolling Org1MSP identity#
Create the secret#
Create main channel#
Join peer to the channel#
Install a chaincode#
Prepare connection string for a peerTo prepare the connection string, we have to:
Get connection string without users for organization Org1MSP and OrdererMSP
Register a user in the certification authority for signing (register)
Obtain the certificates using the previously created user (enroll)
Attach the user to the connection string
Get connection string without users for organization Org1MSP and OrdererMSP
- Register a user in the certification authority for signing
- Get the certificates using the user created above
- Attach the user to the connection string
#
Create metadata file#
Prepare connection file#
Deploy chaincode container on clusterThe following command will create or update the CRD based on the packageID, chaincode name, and docker image.
#
Check installed chaincodes#
Approve chaincode#
Commit chaincode#
Invoke a transaction on the channel#
Query assets in the channelAt this point, you should have:
- Ordering service with 1 nodes and a CA
- Peer organization with a peer and a CA
- A channel demo
- A chaincode install in peer0
- A chaincode approved and committed
If something went wrong or didn't work, please, open an issue.
#
Cleanup the environment#
Troubleshooting#
Chaincode installation/build errorChaincode installation/build can fail due to unsupported local kubertenes version such as minikube.
If your purpose is to test the hlf-operator please consider to switch to kind that is tested and supported.