Crates.io | tea-keyvalue-provider |
lib.rs | tea-keyvalue-provider |
version | 0.1.1 |
source | src |
created_at | 2020-05-02 18:52:36.438053 |
updated_at | 2020-05-02 19:14:32.790673 |
description | Key Value Pair Storage Provider for WaSCC. Part of TeaRust Project |
homepage | |
repository | |
max_upload_size | |
id | 236702 |
size | 39,623 |
This WASCC provider is an enhanced version of Kevin Hoffman's original Key-Value Pair Provider example with the following enhancedments:
Tea Project (Trusted Execution & Attestation) is a Wasm runtime build on top of RoT(Root of Trust) from both trusted hardware environment and blockchain technologies. Developer, Host and Consumer do not have to trust any others to not only protecting privacy but also preventing cyber attacks. The execution environment under remoted attestation can be verified by blockchain consensys. Crypto economy is used as motivation that hosts are willing run trusted computing nodes. This platform can be used by CDN providers, IPFS Nodes or existing cloud providers to enhance existing infrastructure to be more secure and trustless.
Introduction blog post
Project repo. More and more repo will be exposed soon.
Yet to come project site ( not completed yet) http://www.t-rust.com/
Contact: kevin.zhang.canada_at_gmail_dot_com.
We are just started, all kinds of help are welcome!
WaSCC Actors are supposed to be stateless. Global variable and any kind of storage across handler calls are not recommended (although technically doable). Host provided key-value pair is one of the handy storage shared across handler functions.
WaSCC provided Redis provider and a sample key-value pair provider. There are a few reasons I cannot use them:
So I made this library to scrach on my own itch. It can probably help you as well.
Make sure you also clone the tea-codec repo at the same level because it is one of the dependencies.
tea-codec = { path = "../tea-codec"}
Then
cargo build
For unit testing
cargo test
The same as https://github.com/wascc/examples/tree/master/keyvalue-provider with a few changes
const CAPABILITY_ID: &str = "tea:keyvalue";
pub enum KeyValueItem {
Atomic(i32),
Scalar(Vec<u8>),
List(Vec<Vec<u8>>),
Set(HashSet<Vec<u8>>),
SortedVec(KeyVec<i32, Vec<u8>>),
}