Samples are a collection of small and simple apps that demonstrate how to use the library.
To run the samples, we recommend to use go 1.20
. You will also need docker as it is needed by Fabric.
To make sure you have all the required docker images, you can run make docker-images
in the
Fabric Smart Client repository folder ($FSC_PATH
).
I Owe You
: In this example, we orchestrate a simpleI Owe You
use case between alender
and aborrower
, mediated by anapprover
.Fabric to Fabric Interoperability via Weaver Relay
: In this example, we see how to use the weaver relay infrastructure to perform queries between two Fabric networks.Institutional Review Board (IRB) Sample
: This demos shows how to use Fabric Private Chaincode in combination with Fabric Smart Clients.
The samples will make use of docker to run various components. To make sure you have all the docker images you need,
please, run make docker-images
in the folder $FSC_PATH
.
($FSC_PATH
refers to the Fabric Smart Client repository in your filesystem see getting started)
Integration tests are useful to show how multiple components work together. The Fabric Smart Client comes equipped with some of them to show the main features. To run the integration tests, you need to have Docker installed and ready to be used.
Each integration test bootstraps the FSC and Fabric networks as needed, and initiate the
business processes by invoking the initiator view
on the specific FSC nodes.
Here is a list of available integration tests:
Ping Pong
: A simple ping-pong between two FSC nodes to start with the basics. Moreover, we will learn more about theState-Based Programming model
.Secured Asset Transfer
: In this example, our starting point is theSecured asset transfer in Fabric
sample. The objectives are manifolds:- First, to show how the
Fabric Smart Client
's integration infrastructure provides a convenient programmatic environment to test chaincodes-based solutions. Already a huge improvement for the developers. - Second, to highlights the limitations of the current sample and show how these limitations can be overcome
using the
Fabric Smart Client
's advanced capabilities.
- First, to show how the
Fabric Private Chaincode: Echo
: In this example, we show how to invoke a Fabric Private Chaincode calledEcho
.Orion: Cars
: In this example, we show how to orchestrate transactions forOrion
.
Topology logging levels can be configured with SetLogging
method. However, it is not possible to disable logging completely with the mentioned method because FSC may require to inspect the output of the commands that are run inside the topology.
If you are using FSC outside of ginkgo tests need to disable logging, or use a stream other then stdout
, you can use the following two methods.
flogging.Global.SetWriter()
allows to modify the stream used for FSC log messages.- Assigning
ginkgo.GinkgoWriter
the required stream redirects the command output, such as Fabric node.
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-smart-client project
make download-fabric
export FAB_BINS=$PWD/../fabric/bin