Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
Signed-off-by: dviejokfs <[email protected]>
  • Loading branch information
dviejokfs committed Sep 20, 2022
1 parent 6c200d5 commit 1a33109
Show file tree
Hide file tree
Showing 10 changed files with 11,186 additions and 9 deletions.
7 changes: 4 additions & 3 deletions api/hlf.kungfusoftware.es/v1alpha1/hlf_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1714,9 +1714,10 @@ type FabricMainChannelExternalPeerOrganization struct {
}

type FabricMainChannelExternalOrdererOrganization struct {
MSPID string `json:"mspID"`
TLSRootCert string `json:"tlsRootCert"`
SignRootCert string `json:"signRootCert"`
MSPID string `json:"mspID"`
TLSRootCert string `json:"tlsRootCert"`
SignRootCert string `json:"signRootCert"`
// Orderer endpoints for the organization in the channel configuration
OrdererEndpoints []string `json:"ordererEndpoints"`
}
type OrgCertsRef struct {
Expand Down
Empty file added docs/reference/technical.md
Empty file.
6 changes: 6 additions & 0 deletions website-docs/docs/channel-management/followerchannel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: followerchannel
title: Follower channel
---


98 changes: 98 additions & 0 deletions website-docs/docs/channel-management/getting-started.md
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"
```
4 changes: 4 additions & 0 deletions website-docs/docs/channel-management/mainchannel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
id: mainchannel
title: Main channel
---
66 changes: 66 additions & 0 deletions website-docs/docs/channel-management/manage.md
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: []
```


19 changes: 19 additions & 0 deletions website-docs/docs/kubectl-plugin/upgrade.md
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
```
12 changes: 12 additions & 0 deletions website-docs/docs/reference/reference.md
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 />

Loading

0 comments on commit 1a33109

Please sign in to comment.