- Notifications
You must be signed in to change notification settings - Fork3
Rust libraries for doing Corda RPC
License
djc/corda-rpc
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Because I no longer work at ING or on any Corda-related projects, this crate isunlikely to see further development unless funding appears -- I am available ona freelance basis. I'm happy to answer questions aboutthe code and its current state, and I intend to provide (passive) maintenance(like PR code reviews) of this code going forward.
Corda is an open source blockchain platform. To work with a Corda node,your code needs to communicate overAMQP 1.0 with the broker run by the node.This project targets stable Rust and uses asynchronous network I/O built on Tokio. This might beuseful for code running in constrained environments (IoT) or interfacing with other native code.
This project was written withinING Bank, while working on theValueX project to create a digital securities distribution platform for institutional investors.The provided functionality is separated into three crates, as explained below.
Thecurrent state of the project can be described as pre-alpha. So far I have worked to get a simpleRPC call to the Corda node to work, and everything provided is only complete insofar as needed forthat purpose. The example code innetwork-map-snapshotwill trigger an RPC call on the Corda node as desired and return the proper response. However, thisonly works against a Corda node which hassome changes applied to it.
While the Corda RPC protocol builds on top of the AMQP 1.0 standard, it defines its own encodingschema serialization to protocol to make protocol messages self-describing. This crate containsimplementations of the required serialization and deserialization primitives, and will containother code specific to Corda going forward. The ideal end goal would be an implementation matchingCorda'sCordaRPCOps interface.
The name "AMQP" is often used to refer toversion 0.9.1of the protocol, as implemented by RabbitMQ and many other software components. Despite the shared name,AMQP 1.0 as standardized by OASIS deviates substantially from the 0.9.1 protocol. This crate aims to providea generally usable (not specific to Corda) implementation of a protocol client.
As mentioned above, the library currently falls short of that goal. While it provides a robust version ofthe parts of the protocol that are strictly needed to start exchanging messages with a broker, many partsare missing or incomplete. Nevertheless, the building blocks provided (in particular, the serializationand deserialization based on Rust's powerful serde framework) should in many cases make it straightforwardto fill in the missing bits.
The implementation of the oasis-amqp crate is supported by a single procedural macro which derivesrequired implementations ofserde::Deserialize
andoasis_amqp::Described
for any type definitions.