Chapter 5. Smart Contract Invocation
This chapter equips you with the knowledge you need to invoke smart contracts. We’ll use the prerequisites installed in Chapter 4. Then, using a script, we’ll start and stop a local Fabric test network and deploy the Fabcar smart contract.
Since we are leveraging Fabcar and the Fabric test network, we start with a review of fabric-samples, the Fabcar smart contract, and the Fabric test network. We’ll then start our test network and deploy the Fabcar smart contract. Next, we’ll go through the steps executed by the script. Once our test network is up and running with the Fabcar smart contract deployed, we’ll invoke Fabcar smart contract functions. We’ll use the peer invoke
command as well as a command-line Node.js application to execute a Fabcar smart contract function. The Node.js application will use the Fabric Client SDK for Node.js.
This chapter will help you achieve the following practical goals:
Invoking smart contracts via the command-line interface
Evaluating transaction functions for queries
Submitting transactions and query transaction history
Creating and issuing an application contract
Overview of fabric-samples, Fabcar, and the Test Network
In this section, you’ll learn how to start, deploy, and invoke a smart contract on the Hyperledger Fabric test network. We’ll first look at the structure and components of fabric-samples. Then we’ll walk through the essential steps for deploying our sample smart contract, Fabcar. Once Fabric ...
Get Hands-On Smart Contract Development with Hyperledger Fabric V2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.