Querying the ledger
The simplest operation an application can perform is to query a ledger. Let's examine how the registration
and trading
applications query a ledger in different networks:
Figure 7.10: The simplest operation an application can perform is to query a ledger
In Figure 7.10, we can see that peer1
has the registration
contract installed, making it available to all applications connected to the vehicle-registration
network. Similarly, Peer1
also has car
contract
installed for participants in the car
-trading
network. The registration
application uses the registration
contract to query the registration
ledger, and the car contract
to query the trading
ledger.
But where are the registration
and car
ledgers in Figure 7.10? Let's take a closer look at the smart contracts to find out.
Smart contract packaging and namespaces
Smart contracts are placed in a package for both logical grouping and distribution. Consider an example:
Figure...