The fabric-admin-sdk provides administrative APIs for creating and configuring Hyperledger Fabric networks, and for deploying smart contracts (chaincode) to those networks.
For information on using the fabric-admin-sdk, please visit the Go API documentation. The API documentation includes some usage examples. Additionally, the scenario tests can be used as an example of an end-to-end flow, covering channel creation and smart contract deployment.
The current API for client applications to transact with Fabric networks (the Fabric Gateway client API) does not provide the administrative capabilities of the legacy client application SDKs. The fabric-admin-sdk aims to provide this programmatic administrative capability for use-cases where the Fabric CLI commands are not the best fit. A specific objective is to support the development of Kubernetes operators.
More detailed information on the motivation and objectives of the fabric-admin-sdk can be found in the associated Fabric Admin SDK RFC.
This repository contains APIs written in Go and JavaScript. In order to build these components, the following need to be installed and available in the PATH:
In order to run scenario test, Docker is also required.
This project includes a Dev Container configuration that includes all of the pre-requisite software described above in a Docker container, avoiding the need to install them locally. The only requirement is that Docker is installed and available.
Opening the project folder in an IDE such as VS Code (with the Dev Containers extention) should offer the option of opening in the Dev Container. Alternatively, VS Code allows the remote repository to opened directly in an isolated Dev Container.
Note: When the repository is first cloned, some mock implementations used for testing will not be present and the Go code will show compile errors. These can be generated explicitly by running
make generate
.
The following Makefile targets are available:
make generate
- generate mock implementations used by unit testsmake lint
- run linting checks for the Go codemake unit-test-go
- run unit tests for the Go APImake unit-test-node
- run unit tests for the Node APImake unit-test
- run unit tests for all language implementations
The initial submission and implementation of fabric-admin-sdk was driven by members of the Technical Working Group China / 超级账本中国技术工作组 (TWGC):
Here are steps in short for any contribution.
- check license and code of conduct
- fork this project
- make your own feature branch
- change and commit your changes, please use
git commit -s
to commit as we enabled DCO - raise PR
Please review the Hyperledger Code of Conduct before participating. It is important that we keep things civil.