Scalar DL 3.5 is released!
We are pleased to announce that we have released a new minor version of Scalar DL, Scalar DL 3.5.0. It’s a minor release, but it’s got a lot of backward-compatible new features and improvements, such as a new contract interface. This blog post shares some important new features and improvements. For Scalar DL design and implementation, please take a look at the previous blog post. (Japanese version is here)
New Contract and Function interfaces
This is the biggest update in this release. Until 3.4, we only have Contract as a base interface of Contacts. It is good enough for many cases but is not flexible or efficient enough in some cases since Contract’s arguments types and return type (and the data type that Ledger interface manipulates in the Contract) are tied to a specific class of a JSON library called JSONP.
The new Contract interface (called ContractBase) generalizes the class using Generics so that it can essentially handle arbitrary classes as long as they can be serialized to String. Due to the current Contract mechanism, we only support several predefined classes at the moment, but you can create more flexible and efficient Contracts now. You can still use the old Contract, which is now deprecated, but please use new interfaces if you are creating new Scalar DL applications. There are similar issues also in Function, so we added a new Function interface as well.
For more information, please take a look at the following documents.
- https://github.com/scalar-labs/scalardl/blob/master/docs/how-to-write-contract.md
- https://github.com/scalar-labs/scalardl/blob/master/docs/how-to-write-function.md
New ClientServiceFactory
ClientService class is an entry point for interacting with Scalar DL servers such as Ledger and Auditor. We have been providing a factory class named ClientServiceFactory to create a ClientService instance easily. However, until 3.4, the ClientServiceFactory was a little inefficient in terms of resource usage. For example, it didn’t reuse a gRPC connection it could have reused. Thus, we updated ClientServiceFactory in 3.5 to make it reuse resources such as connections and key signers as much as possible.
For how to use the new ClientServiceFactory, please take a look at the following document.
Putting scan and put in a Contract
Until 3.4, we can only use the scan operation of Ledger interface in a read-only Contract to guarantee transaction correctness; thus, we couldn’t do put and scan in a Contract. However, we overcome the limitation, and now you can put them in a Contract.
Summary
We released Scalar DL 3.5, which contains great enhancements and improvements for users. For learning about Scalar DL, please take a look at the blog posts and the documents. If you want to try Scalar DL, please contact us.