Home

Awesome

Fabric Token SDK

License Go Report Card Go CodeQL

The Fabric Token SDK provides a collection of APIs and services that streamline development for token-based distributed applications.

Disclaimer

Fabric Token SDK has not been audited and is provided as-is, use at your own risk. The project will be subject to rapid changes to complete the open-sourcing process, and the list of features.

Useful Links

Getting started

Clone the code and make sure it is on your $GOPATH. (Important: we assume in this documentation and default configuration that your $GOPATH has a single root-directory!). Sometimes, we use $FTS_PATH to refer to the Fabric Token SDK repository in your filesystem.

export FTS_PATH=$GOPATH/src/github.com/hyperledger-labs/fabric-token-sdk
git clone https://github.com/hyperledger-labs/fabric-token-sdk.git $FTS_PATH

Further information

Fabric Token SDK uses a system called NWO from Fabric Smart Client for its integration tests and samples to programmatically create a fabric network along with the fabric-smart-client nodes. The current version of fabric that is tested can be found in the project Makefile set in the FABRIC_VERSION variable.

In order for a fabric network to be able to be created you need to ensure you have downloaded the appropriate version of the hyperledger fabric binaries from Fabric Releases and unpack the compressed file onto your file system. This will create a directory structure of /bin and /config. You will then need to set the environment variable FAB_BINS to the bin directory. For example if you unpacked the compressed file into /home/name/fabric then you would

export FAB_BINS=/home/name/fabric/bin

Do not store the fabric binaries within your fabric-token-sdk cloned repo as this will cause problems running the samples and integration tests as they will not be able to install chaincode.

Almost all the samples and integration tests require the fabric binaries to be downloaded and the environment variable FAB_BINS set to point to the directory where these binaries are stored. One way to ensure this is to execute the following in the root of the fabric-token-sdk project

make download-fabric
export FAB_BINS=$PWD/../fabric/bin

You can also use this to download a different version of the fabric binaries for example

FABRIC_VERSION=2.5 make download-fabric

If you want to provide your own versions of the fabric binaries then just set FAB_BINS to the directory where all the fabric binaries are stored.

Utilities

Additional Resources

Motivation

Hyperledger Fabric: Blockchain Built for Business

Hyperledger Fabric (https://hyperledger-fabric.readthedocs.io/) is an open-source platform designed for permissioned blockchain networks. It offers a modular and extensible architecture, allowing for customization and future growth. Unlike traditional blockchains, Fabric applications can be written in any general-purpose programming language, making them more accessible to developers.

Beyond Cryptocurrencies: Tokenizing the World

While blockchain is often associated with cryptocurrencies, its potential extends far beyond. Fabric allows for the creation of tokens that represent real-world assets, both fungible (like loyalty points) and non-fungible (like unique digital artwork). This opens doors for new business models and unlocks additional value from existing assets.

The Challenge: Building Tokenized Applications

Developing applications that leverage tokens on Hyperledger Fabric can be complex. Fabric lacked a built-in SDK for creating and managing tokens, forcing developers to build solutions from scratch. This not only led to wasted effort with duplicated code, but also exposed applications to potential security vulnerabilities.

Introducing the Fabric Token SDK: Streamlining Tokenized Development (and Beyond)

The Fabric Token SDK has evolved beyond its initial focus on Hyperledger Fabric. It now empowers developers with the following capabilities across various platforms, including permissioned blockchains like Fabric and even centralized systems like Orion:

With a robust Fabric Token SDK, developing secure and efficient enterprise-grade tokenized applications becomes a reality, offering flexibility for developers to choose the platform that best suits their needs.

Testing Philosophy

Write tests. Not too many. Mostly Integration

We also believe that when developing new functions running tests is preferable than running the application to verify the code is working as expected.

For more information about our integration tests, look here.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the Apache 2 License - see the LICENSE file for details