Skip to content

Latest commit

 

History

History
107 lines (62 loc) · 3.16 KB

File metadata and controls

107 lines (62 loc) · 3.16 KB

部署一个fabric网络

前一步: 部署一个k8s集群 <==> 下一步:安装智能合约


Fabric-operator是通过Operator技术使用 custom resources来部署Hyperledger Fabric网络中CApeerorderer节点的一种工具和方式。最终它会将CA,Peer,Orderer转化为对应的k8s资源,如Pod,Deployment, Service, 和 Ingress

一旦Fabric网络启动完成,可以使用peer和命令行工具通过Ingress来访问fabric网络。创建通道,合约和应用部署。

Fabric Operator

执行:

just check-kube

示例网络

kubectl apply -k https://github.com/hyperledger-labs/fabric-operator.git/config/crd
  • 部署 CA, peer, 和 orderer 资源。并等待operator完成k8s上的资源创建 Pods, Deployments, Services, 和 Ingress
just cloud-network
  • 建立通道:
just cloud-channel
  • 建立TLS证书,channel msp,用户证书创建:
export WORKSHOP_CRYPTO=$WORKSHOP_PATH/infrastructure/sample-network/temp

检查

curl \
  -s \
  --cacert $WORKSHOP_CRYPTO/cas/org1-ca/tls-cert.pem \
  https://$WORKSHOP_NAMESPACE-org1-ca-ca.$WORKSHOP_INGRESS_DOMAIN/cainfo \
  | jq

云原生和peer节点日志

我们可以通过如下方式获取peer节点信息比如peer节点的日志。

kubectl config set-context --current --namespace=test-network
kubectl get pods

假设org1 peer1 pod名称为org1-peer1-79df64f8d8-7m9mt, 我们可以通过如下命令来获取日志,从而观察peer节点上的通道,合约,和落块情况。

kubectl logs -f org1-peer1-79df64f8d8-7m9mt peer

您也可以使用其他工具如k9s utility.比如:

k9s -n test-network

You'll see the fabric-operator, peer, orderer, and CA pods. Navigate around by hitting ENTER on one of the pods, ENTER again on one of the containers, and then hit 0 to tail the container's log. Go back up by hitting ESCAPE. More tips are available at the top of the k9s user interface.

调试

# While running "just cloud-network and/or just cloud-channel":
tail -f infrastructure/sample-network/network-debug.log

进一步拓展:


前一步: 部署一个k8s集群 <==> 下一步:安装智能合约