前一步: 部署一个k8s集群 <==> 下一步:安装智能合约
Fabric-operator是通过Operator技术使用
custom resources来部署Hyperledger Fabric网络中CA,peer,orderer节点的一种工具和方式。最终它会将CA,Peer,Orderer转化为对应的k8s资源,如Pod
,Deployment
, Service
, 和 Ingress
一旦Fabric网络启动完成,可以使用peer
和命令行工具通过Ingress来访问fabric网络。创建通道,合约和应用部署。
just check-kube
- 安装 fabric-operator Kubernetes Custom Resources
kubectl apply -k https://github.com/hyperledger-labs/fabric-operator.git/config/crd
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节点的日志。
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
- Deploy the Fabric Operations Console
- Build a network with the Ansible Blockchain Collection
前一步: 部署一个k8s集群 <==> 下一步:安装智能合约