-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dviejokfs <[email protected]>
- Loading branch information
Showing
10 changed files
with
11,186 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
id: followerchannel | ||
title: Follower channel | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
id: getting-started | ||
title: Getting started | ||
--- | ||
|
||
|
||
## Enroll the orderer CA | ||
```bash | ||
CA_NAME=ord-ca | ||
CA_NAMESPACE=default | ||
CA_MSPID=OrdererMSP | ||
CA_TYPE=tlsca # can be `ca` or `tlsca` | ||
kubectl hlf ca register --name=ord-ca --user=admin --secret=adminpw --type=admin \ | ||
--enroll-id enroll --enroll-secret=enrollpw --mspid OrdererMSP | ||
|
||
kubectl hlf ca enroll --name=$CA_NAME --namespace=$CA_NAMESPACE \ | ||
--user=admin --secret=adminpw --mspid $CA_MSPID \ | ||
--ca-name $CA_TYPE --output orderermsp.yaml | ||
``` | ||
|
||
## Enroll the admin peer organization | ||
|
||
```bash | ||
CA_NAME=org1-ca | ||
CA_NAMESPACE=default | ||
CA_MSPID=Org1MSP | ||
CA_TYPE=ca # can be `ca` or `tlsca` | ||
kubectl hlf ca register --name=org1-ca --user=admin --secret=adminpw --type=admin \ | ||
--enroll-id enroll --enroll-secret=enrollpw --mspid Org1MSP | ||
|
||
kubectl hlf ca enroll --name=$CA_NAME --namespace=$CA_NAMESPACE \ | ||
--user=admin --secret=adminpw --mspid $CA_MSPID \ | ||
--ca-name $CA_TYPE --output org1msp.yaml | ||
``` | ||
|
||
|
||
## Create secret | ||
|
||
We need to create a secret for the operator to use the certificates to create the channel and update the channel configuration. | ||
|
||
```bash | ||
kubectl create secret generic wallet --namespace=default \ | ||
--from-file=org1msp.yaml=$PWD/org1msp.yaml \ | ||
--from-file=orderermsp.yaml=$PWD/orderermsp.yaml | ||
``` | ||
|
||
## Create the channel | ||
|
||
First, we need to obtain the orderer TLS certificate, this would need to be performed for each orderer that is in the consenters list. | ||
|
||
```bash | ||
kubectl get fabricorderernodes ord-node1 \ | ||
-o jsonpath='{.status.tlsCert}' > ./orderer-cert.pem | ||
``` | ||
|
||
Second, we create the main channel CRD and apply it. | ||
|
||
```bash | ||
kubectl hlf channelcrd main create \ | ||
--channel-name=demo \ | ||
--name=demo \ | ||
--orderer-orgs=OrdererMSP \ | ||
--peer-orgs=Org1MSP \ | ||
--admin-orderer-orgs=OrdererMSP \ | ||
--admin-peer-orgs=Org1MSP \ | ||
--secret-name=wallet \ | ||
--secret-ns=default \ | ||
--consenters=ord-node1.default:7050 \ | ||
--consenter-certificates=./orderer-cert.pem \ | ||
--identities="OrdererMSP;admin-tls-ordservice.yaml" \ | ||
--identities="Org1MSP;peer-org1.yaml" | ||
|
||
``` | ||
|
||
|
||
|
||
## Join the channel for Org1MSP | ||
First, we need to obtain the orderer TLS certificate, this would need to be performed for each orderer that is in the consenters list. | ||
|
||
```bash | ||
kubectl get fabricorderernodes ord-node1 \ | ||
-o jsonpath='{.status.tlsCert}' > ./orderer-cert.pem | ||
``` | ||
|
||
Second, we create the main channel CRD and apply it. | ||
```bash | ||
kubectl hlf channelcrd follower create \ | ||
--channel-name=demo \ | ||
--mspid=Org1MSP \ | ||
--name="demo-org1msp" \ | ||
--orderer-certificates="./orderer-cert.pem" \ | ||
--orderer-urls="grpcs://ord-node1.default:7050" \ | ||
--anchor-peers="org1-peer0:7051" \ | ||
--peers="org1-peer0.default" \ | ||
--secret-name=wallet \ | ||
--secret-ns=default \ | ||
--secret-key="peer-org1.yaml" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
id: mainchannel | ||
title: Main channel | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
id: manage | ||
title: Manage the channel | ||
--- | ||
|
||
## Add peer organization to the channel | ||
|
||
|
||
You can add more organizations by updating the `peerOrganizations` or `externalPeerOrganizations` property in the [`FabricMainChannel`](../reference/reference.md#hlf.kungfusoftware.es/v1alpha1.FabricMainChannel) CRD. | ||
|
||
If the organization is not in the cluster, you need to add the organization to the `externalPeerOrganizations` property, with the `mspID`, `signRootCert` and `tlsRootCert`. | ||
|
||
```yaml | ||
externalPeerOrganizations: | ||
- mspID: <MSP_ID> | ||
signRootCert: | | ||
<SIGN_ROOT_CRT_PEM> | ||
tlsRootCert: | | ||
<TLS_ROOT_CRT_PEM> | ||
``` | ||
If the organization is in the cluster, you need to add the organization to the `peerOrganizations` property, with the `mspID`, `signRootCert` and `tlsRootCert`. | ||
|
||
```yaml | ||
peerOrganizations: | ||
- caName: <CA_NAME> | ||
caNamespace: <CA_NS> | ||
mspID: <MSP_ID> | ||
``` | ||
|
||
|
||
|
||
## Add orderer organization to the channel | ||
|
||
|
||
You can add more organizations by updating the `peerOrganizations` or `externalPeerOrganizations` property in the [`FabricMainChannel`](../reference/reference.md#hlf.kungfusoftware.es/v1alpha1.FabricMainChannel) CRD. | ||
|
||
If the organization is not in the cluster, you need to add the organization to the `externalPeerOrganizations` property, with the `mspID`, `signRootCert` and `tlsRootCert`. | ||
|
||
```yaml | ||
externalOrdererOrganizations: | ||
- mspID: <MSP_ID> | ||
signRootCert: | | ||
<SIGN_ROOT_CRT_PEM> | ||
tlsRootCert: | | ||
<TLS_ROOT_CRT_PEM> | ||
ordererEndpoints: # orderer endpoints for the organization in the channel configuration | ||
- <ORDERER0_ENDPOINT> | ||
``` | ||
|
||
If the organization is in the cluster, you need to add the organization to the `peerOrganizations` property, with the `mspID`, `signRootCert` and `tlsRootCert`. | ||
|
||
```yaml | ||
ordererOrganizations: | ||
- caName: <CA_NAME> | ||
caNamespace: <CA_NS> | ||
externalOrderersToJoin: | ||
- host: <ADMIN_ORDERER_HOST> | ||
port: <ADMIN_ORDERER_PORT> | ||
mspID: <MSP_ID> | ||
ordererEndpoints: # orderer endpoints for the organization in the channel configuration | ||
- <ORDERER0_ENDPOINT> | ||
orderersToJoin: [] | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
id: upgrade | ||
title: Upgrade | ||
--- | ||
|
||
### Upgrading the Kubectl HLF Plugin | ||
|
||
```bash | ||
# when kubectl-hlf is in the krew-index | ||
kubectl krew upgrade hlf | ||
``` | ||
|
||
|
||
### Verifying the installation | ||
If the following command shows the list of commands of HLF, it means that the installation has been succesfull. | ||
|
||
```bash | ||
kubectl hlf --help | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
id: reference | ||
title: Reference | ||
--- | ||
|
||
# HLF Operator API | ||
|
||
|
||
import Technical from './technical.md' | ||
|
||
<Technical /> | ||
|
Oops, something went wrong.