16 releases (7 breaking)

new 0.11.3 May 22, 2024
0.10.5 May 22, 2024
0.10.1 Mar 28, 2024
0.6.0 Nov 27, 2023
0.2.0 Jun 27, 2023

#264 in Magic Beans

Download history 10/week @ 2024-01-31 3/week @ 2024-02-07 83/week @ 2024-02-14 79/week @ 2024-02-21 31/week @ 2024-02-28 4/week @ 2024-03-06 8/week @ 2024-03-13 60/week @ 2024-03-20 176/week @ 2024-03-27 41/week @ 2024-04-03 64/week @ 2024-04-10 14/week @ 2024-04-17 78/week @ 2024-05-01 210/week @ 2024-05-08 1268/week @ 2024-05-15

1,556 downloads per month
Used in linera-service

Apache-2.0

1.5MB
28K 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. Both binaries have access to the same application and chain specific storage. The service only has read-only access, while the contract can write to it. The storage should be used to store the application state, which is persisted across blocks. The state can be a custom type that uses linera-views, a framework that allows lazily 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 create a type to implement the Contract trait. The type can store the ContractRuntime and the state, and must have its implementation exported by using the contract! macro.

The service binary should create a type to implement the Service trait. The type can store the ServiceRuntime and the state, and must have its implementation exported by using the service! macro.

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–68MB
~1M SLoC