Skip to content

Commit b120437

Browse files
authored
documentation (#566)
Signed-off-by: Angelo De Caro <[email protected]>
1 parent 25ab661 commit b120437

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+687
-3960
lines changed

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ clean:
117117
rm -rf ./integration/token/dvp/fabtoken/cmd/
118118
rm -rf ./integration/token/interop/fabtoken/cmd/
119119
rm -rf ./integration/token/interop/dlog/cmd/
120-
rm -rf ./samples/fungible/cmd
121-
rm -rf ./samples/nft/cmd
122120

123121
.PHONY: clean-fabric-peer-images
124122
clean-fabric-peer-images:

README.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
[![Go](https://github.com/hyperledger-labs/fabric-token-sdk/actions/workflows/tests.yml/badge.svg)](https://github.com/hyperledger-labs/fabric-token-sdk/actions/workflows/go.yml)
55
[![CodeQL](https://github.com/hyperledger-labs/fabric-token-sdk/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/hyperledger-labs/fabric-token-sdk/actions/workflows/codeql-analysis.yml)
66

7-
The `Fabric Token SDK` is a set of API and services that let developers create
8-
token-based distributed application on Hyperledger Fabric.
7+
The `Fabric Token SDK` provides a collection of APIs and services that streamline development for token-based distributed applications.
98

109
# Disclaimer
1110

@@ -15,17 +14,16 @@ The project will be subject to rapid changes to complete the open-sourcing proce
1514
# Useful Links
1615

1716
- [`Documentation`](./docs/design.md): Discover the design principles of the Fabric Token SDK.
18-
- [`Samples`](./samples/README.md): A collection of sample applications that demonstrate the use of the Fabric Token SDK.
17+
- [`Fabric Samples`](https://github.com/hyperledger/fabric-samples/tree/main/token-sdk) Token SDK sample application is the
18+
quickest way to get a full network running with a REST API to issue, transfer and redeem tokens right away.
1919
- `Feedback`: Your help is the key to the success of the Fabric Token SDK.
2020
- Submit your issues [`here`][`fabric-token-sdk` Issues].
2121
- Found a bug? Need help to fix an issue? You have a great idea for a new feature? Talk to us! You can reach us on
2222
[Discord](https://discord.gg/hyperledger) in #fabric-token-sdk.
2323

2424
- [`Fabric Smart Client`](https://github.com/hyperledger-labs/fabric-smart-client): The Token SDK leverages the
2525
`Fabric Smart Client` for transaction orchestration, storing tokens and wallets, and more. Check it out.
26-
- [Fabric Samples](https://github.com/hyperledger/fabric-samples/tree/main/token-sdk) Token SDK sample application is the
27-
quickest way to get a full network running with a REST API to issue, transfer and redeem tokens right away.
28-
26+
-
2927
# Getting started
3028

3129
Clone the code and make sure it is on your `$GOPATH`.
@@ -81,34 +79,42 @@ If you want to provide your own versions of the fabric binaries then just set `F
8179
In this comprehensive guide, we'll walk you through two essential aspects of the Fabric Token-SDK. Firstly, you'll learn how to develop a straightforward token application to manage a currency. You'll grasp the fundamentals of creating tokens, and implementing transaction logic using the Fabric Token-SDK. Once you've mastered the application development, we'll then show you how to effortlessly deploy it in your existing Fabric network, ensuring a seamless integration with your blockchain infrastructure. By the end of this tutorial, you'll be equipped with the skills to expand your blockchain capabilities and unleash the true potential of decentralized currency management. (Refers to [Fabric Samples](https://github.com/hyperledger/fabric-samples/tree/main/token-sdk))
8280

8381

84-
<!-- markdown-link-check-disable -->
8582
# Motivation
8683

87-
[Hyperledger Fabric]('https://wiki.hyperledger.org/display/fabric') is a permissioned, modular, and extensible open-source DLT platform. Fabric architecture follows a novel `execute-order-validate` paradigm that supports distributed execution of untrusted code in an untrusted environment. Indeed, Fabric-based distributed applications can be written in any general-purpose programming language.
88-
Fabric does not depend on a native cryptocurrency as it happens for existing blockchain platforms that require “smart-contracts” to be written in domain-specific languages or rely on a cryptocurrency.
84+
**Hyperledger Fabric: Blockchain Built for Business**
85+
86+
Hyperledger Fabric ([https://hyperledger-fabric.readthedocs.io/](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.
87+
88+
**Beyond Cryptocurrencies: Tokenizing the World**
8989

90-
Blockchain technologies are accelerating the shifting towards a decentralised economy. Cryptocurrencies are reshaping the financial landscape to the extent that even central banks are now testing the technology to propose what is known as the `central bank digital currency`. But it is more than this. Real-world assets are being tokenised as fungible or non-fungible assets represented by tokens on a blockchain. Thus enabling business opportunities to extract more value.
90+
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.
9191

92-
Developing token-based applications for Hyperledger Fabric is not easy. Fabric does not provide an out-of-the-box SDK that let developers create tokens that represents any kind of asset. Developers are left on their own and this exposes them to useless duplication of code and security vulnerabilities.
92+
**The Challenge: Building Tokenized Applications**
9393

94-
What would happen if the developers could use a `Fabric Token SDK` that let:
95-
- Create tokens that represents any kind of asset (baked by a real-world asset or virtual);
96-
- Choose the privacy level that best fits the use-case without changing the application logic;
97-
- Orchestrate token transaction in a peer-to-peer fashion;
98-
- Perform atomic swaps;
99-
- Audit transactions before they get committed;
100-
- Interoperate with token systems in other blockchain networks;
101-
- Add a token layer to existing Fabric distributed application?
94+
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.
10295

103-
Developing Enterprise Token-based distributed applications would become simpler and more secure.
104-
<!-- markdown-link-check-disable -->
96+
**Introducing the Fabric Token SDK: Streamlining Tokenized Development (and Beyond)**
97+
98+
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:
99+
100+
* **Tokenization Made Easy:** Create tokens representing any type of asset, be it physical or digital.
101+
* **Privacy by Design:** Select the appropriate privacy level for your specific use case, without modifying your application logic.
102+
* **Peer-to-Peer Transactions:** Orchestrate token transfers directly between users, streamlining the process.
103+
* **Atomic Swaps:** Facilitate secure exchanges of different tokens without relying on intermediaries.
104+
* **Transaction Auditing:** Review transactions before they are finalized, ensuring accuracy and compliance.
105+
* **Interoperability:** Connect with token systems on other blockchain networks, fostering broader ecosystems.
106+
* **Seamless Integration:** Add a token layer to existing applications, regardless of platform, with minimal effort.
107+
108+
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.
105109

106110
# Testing Philosophy
107111

108112
[Write tests. Not too many. Mostly Integration](https://kentcdodds.com/blog/write-tests)
109113

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

116+
For more information about our integration tests, look [`here`](./docs/itests.md).
117+
112118
# Versioning
113119

114120
We use [`SemVer`](https://semver.org/) for versioning. For the versions available, see the [`tags on this repository`](https://github.com/hyperledger-labs/fabric-token-sdk/tags).

cmd/tokengen/samples/topology/fungible.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/artifactgen"
1515
"github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/token"
1616
fabric2 "github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/token/fabric"
17-
"github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views"
17+
"github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views"
1818
tokenSDK "github.com/hyperledger-labs/fabric-token-sdk/token/sdk"
1919
)
2020

cmd/tokengen/samples/topology/fungible.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ topologies:
126126
github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk:
127127
original: sdk
128128
alias: sdk1
129-
github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views:
129+
github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views:
130130
original: views
131131
alias: views
132132
github.com/hyperledger-labs/fabric-token-sdk/token/sdk:
133133
original: sdk
134134
alias: sdk
135135
Imports:
136136
- github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk
137-
- github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views
137+
- github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views
138138
- github.com/hyperledger-labs/fabric-token-sdk/token/sdk
139139
Factories:
140140
- id: issue
@@ -168,15 +168,15 @@ topologies:
168168
github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk:
169169
original: sdk
170170
alias: sdk1
171-
github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views:
171+
github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views:
172172
original: views
173173
alias: views
174174
github.com/hyperledger-labs/fabric-token-sdk/token/sdk:
175175
original: sdk
176176
alias: sdk
177177
Imports:
178178
- github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk
179-
- github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views
179+
- github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views
180180
- github.com/hyperledger-labs/fabric-token-sdk/token/sdk
181181
Factories:
182182
- id: register
@@ -203,15 +203,15 @@ topologies:
203203
github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk:
204204
original: sdk
205205
alias: sdk1
206-
github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views:
206+
github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views:
207207
original: views
208208
alias: views
209209
github.com/hyperledger-labs/fabric-token-sdk/token/sdk:
210210
original: sdk
211211
alias: sdk
212212
Imports:
213213
- github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk
214-
- github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views
214+
- github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views
215215
- github.com/hyperledger-labs/fabric-token-sdk/token/sdk
216216
Factories:
217217
- id: transfer
@@ -253,15 +253,15 @@ topologies:
253253
github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk:
254254
original: sdk
255255
alias: sdk1
256-
github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views:
256+
github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views:
257257
original: views
258258
alias: views
259259
github.com/hyperledger-labs/fabric-token-sdk/token/sdk:
260260
original: sdk
261261
alias: sdk
262262
Imports:
263263
- github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk
264-
- github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views
264+
- github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views
265265
- github.com/hyperledger-labs/fabric-token-sdk/token/sdk
266266
Factories:
267267
- id: transfer
@@ -305,15 +305,15 @@ topologies:
305305
github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk:
306306
original: sdk
307307
alias: sdk1
308-
github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views:
308+
github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views:
309309
original: views
310310
alias: views
311311
github.com/hyperledger-labs/fabric-token-sdk/token/sdk:
312312
original: sdk
313313
alias: sdk
314314
Imports:
315315
- github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk
316-
- github.com/hyperledger-labs/fabric-token-sdk/samples/fungible/views
316+
- github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views
317317
- github.com/hyperledger-labs/fabric-token-sdk/token/sdk
318318
Factories:
319319
- id: transfer
File renamed without changes.

0 commit comments

Comments
 (0)