8 releases (breaking)

0.10.1 Mar 28, 2024
0.9.0 Feb 20, 2024
0.6.0 Nov 27, 2023
0.2.0 Jun 27, 2023

#391 in Magic Beans

Download history 13/week @ 2024-01-29 8/week @ 2024-02-05 145/week @ 2024-02-19 47/week @ 2024-02-26 2/week @ 2024-03-04 11/week @ 2024-03-11 223/week @ 2024-03-25 239/week @ 2024-04-01

473 downloads per month

Apache-2.0

1MB
24K SLoC

This module provides an SDK for developing Linera applications using Rust.

A Linera application consists of two WebAssembly binaries: a contract and a service. In both binaries, there should be a shared application state. The state is a type that represents what the application would like to persist in storage across blocks, and must implement the Contract trait in the contract binary and the Service trait in the service binary.

The application can select between two storage backends to use. Selecting the storage backend is done by specifying both the Contract::Storage and the Service::Storage associated types.

The SimpleStateStorage backend stores the application's state type by serializing it into binary blob. This allows the entire contents of the state to be persisted and made available to the application when it is executed.

The ViewStateStorage backend stores the application's state using the linera-views, a framework that allows loading selected parts of the state. This is useful if the application's state is large and doesn't need to be loaded in its entirety for every execution.

The contract binary should use the contract! macro to export the application's contract endpoints implemented via the Contract trait implementation.

The service binary should use the service! macro to export the application's service endpoints implemented via the Service trait implementation.

Examples

The examples directory contains some example applications.

Contributing

See the CONTRIBUTING file for how to help out.

License

This project is available under the terms of the Apache 2.0 license.

Dependencies

~24–66MB
~1M SLoC