6 releases
0.3.0 | Oct 11, 2023 |
---|---|
0.2.0 | Sep 13, 2023 |
0.1.3 | Sep 11, 2023 |
0.1.0 | Aug 30, 2023 |
#18 in #memory-region
51 downloads per month
Used in 2 crates
(via piecrust)
31KB
544 lines
π-crust
piecrust
is a Rust workspace containing two crates, piecrust
and piecrust-uplink
, that together form the WASM virtual machine for running, handling and creating Dusk smart contracts.
Workspace Members
- piecrust: WASM virtual machine for running Dusk's smart contracts.
- piecrust-uplink: The library that allows you to create smart contracts directly on top of
piecrust
.
Project Structure
The project is organized as follows:
contracts
: Contains a number of example smart contracts that can be ran against thepiecrust
virtual machine.piecrust
: Contains the source code and README for the WASM virtual machine.piecrust-uplink
: Contains the source code and README for the smart contract development kit.
Build and Test
To build and test the crate one will need a
Rust toolchain, Make, and the
wasm-tools
binary.
sudo apt install -y make # ubuntu/debian - adapt to own system
cargo install wasm-tools
make test
Release History
To see the release history for this project, please see the Changelogs of each individual workspace member.
License
This code is licensed under the Mozilla Public License Version 2.0 (MPL-2.0). Please see the LICENSE for further details.
Contribute
If you want to contribute to this project, please check the CONTRIBUTING file.
lib.rs
:
Library for creating and managing copy-on-write memory-mapped regions.
The core functionality is offered by the Mmap
struct, which is a
read-write memory region that keeps track of which pages have been written
to.
Example
use crumbles::Mmap;
let mut mmap = Mmap::new(65536, 65536)?;
// When first created, the mmap is not dirty.
assert_eq!(mmap.dirty_pages().count(), 0);
mmap[24] = 42;
// After writing a single byte, the page it's on is dirty.
assert_eq!(mmap.dirty_pages().count(), 1);
Limitations
This crate currently only builds for 64-bit Unix targets. This is because it
relies on various features of libc
which are not available in other
targets.
Dependencies
~260KB