Chapter 12. Corda RPC and Vault Queries

Up until now, we’ve interacted with the Corda ledger through shells and command-line interfaces, mostly to invoke node services, like the identity service, and CorDapps, including flows and some vault queries. From within flow code, Corda services were programmatically invoked via the service hub gateway. However, for Corda to be of any use in real-world applications, external systems need to access a CorDapp or a node’s services. For an external system like a web application or integration tier, communication with Corda is an absolute requirement for the Corda platform to be of any practical use. Fortunately, the Corda framework provides an API into Corda services, allowing other systems to integrate and invoke flows, manage the network and nodes, and extensively query state information in the vault. This API is known as the Corda Remote Procedure Call, or Corda RPC service.

In this chapter, we’ll take a comprehensive tour of the Corda RPC service that provides a gateway for external systems to interact with Corda services in any node. If the RPC acronym reminds you of technologies like DCE-RPC, CORBA, IIOP, RMI, or Microsoft DCOM, that’s because there’s some overlap, but also some significant differences. Corda RPC provides a client-side SDK that can marshal calls and parameters, as do the aforementioned technologies, but the remote wire protocol is instead AMQP/1.0 running over Apache Artemis message queues. Binary protocols like Java’s ...

Get Mastering Corda 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.