mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-19 08:15:08 +00:00
* Addresses Issue #548 by providing a simple guide for running Java chaincode as a service with a local debugger. Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * missed a couple of bash syntax errors Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Add metadata and activate examples to the CC README Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * move ccpackage/ contents into network script Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Fix CI test - Azure mounts git checkout at a different folder root path Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Update test-network-k8s README with updated cc deploy commands Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Run basic-asset transfer CI tests with Java + golang CC in Azure Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * remove (obsolete) test-net chaincode/ folder Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Address some PR review feedback points - README reorg Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Use the SDKs contract router Main, not a local entrypoint Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * bump the build - remove trailing newlines from a README Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
79 lines
2.6 KiB
Markdown
79 lines
2.6 KiB
Markdown
# Kubernetes Test Network
|
|
|
|
This project re-establishes the Hyperledger [test-network](../test-network) as a _cloud native_ application.
|
|
|
|
### Objectives:
|
|
|
|
- Provide a simple, _one click_ activity for running the Fabric test network.
|
|
- Provide a reference guide for deploying _production-style_ networks on Kubernetes.
|
|
- Provide a _cloud ready_ platform for developing chaincode, Gateway, and blockchain apps.
|
|
- Provide a Kube supplement to the Fabric [CA Operations and Deployment](https://hyperledger-fabric-ca.readthedocs.io/en/latest/deployguide/ca-deploy.html) guides.
|
|
- Support a transition to [Chaincode as a Service](https://hyperledger-fabric.readthedocs.io/en/latest/cc_service.html).
|
|
- Support a transition from the Internal, Docker daemon to [External Chaincode](https://hyperledger-fabric.readthedocs.io/en/latest/cc_launcher.html) builders.
|
|
- Run on any Kube.
|
|
|
|
_Fabric, Ahoy!_
|
|
|
|
|
|
## Prerequisites
|
|
|
|
- [Docker](https://www.docker.com)
|
|
- [kubectl](https://kubernetes.io/docs/tasks/tools/)
|
|
- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
|
|
- [jq](https://stedolan.github.io/jq/)
|
|
|
|
|
|
## Quickstart
|
|
|
|
Create a local Kubernetes cluster:
|
|
```shell
|
|
./network kind
|
|
```
|
|
|
|
Launch the network, create a channel, and deploy the [basic-asset-transfer](../asset-transfer-basic) smart contract:
|
|
```shell
|
|
./network up
|
|
./network channel create
|
|
|
|
./network chaincode deploy asset-transfer-basic basic_1.0 $PWD/../asset-transfer-basic/chaincode-java
|
|
```
|
|
|
|
Invoke and query chaincode:
|
|
```shell
|
|
./network chaincode invoke asset-transfer-basic '{"Args":["CreateAsset","1","blue","35","tom","1000"]}'
|
|
./network chaincode query asset-transfer-basic '{"Args":["ReadAsset","1"]}'
|
|
```
|
|
|
|
Access the blockchain with a [REST API](https://github.com/hyperledger/fabric-samples/tree/main/asset-transfer-basic/rest-api-typescript):
|
|
```shell
|
|
./network rest-easy
|
|
```
|
|
|
|
Tear down the test network:
|
|
```shell
|
|
./network down
|
|
```
|
|
|
|
Tear down the cluster:
|
|
```shell
|
|
./network unkind
|
|
```
|
|
|
|
|
|
## [Detailed Guides](docs/README.md)
|
|
|
|
- [Working with Kubernetes](docs/KUBERNETES.md)
|
|
- [Certificate Authorities](docs/CA.md)
|
|
- [Launching the Test Network](docs/TEST_NETWORK.md)
|
|
- [Working with Channels](docs/CHANNELS.md)
|
|
- [Working with Chaincode](docs/CHAINCODE.md)
|
|
- [Working with Applications](docs/APPLICATIONS.md)
|
|
|
|
|
|
## Areas for Improvement / TODOs
|
|
|
|
- [ ] Refine the recipe and guidelines for use with `k3s` / `nerdctl` (rancherdesktop.io) as an alternative to Docker / KIND.
|
|
- [ ] Test the recipe with OCP, AWS, gcp, Azure, etc. (These should ONLY differ w.r.t. pvc and ingress)
|
|
- [ ] Address any of the 20+ todo: notes in network.sh
|
|
- [ ] Implement mutual TLS across peers, orderers, and clients.
|
|
- [ ] Caliper?
|