parent
5e3c7816bd
commit
a7186328e0
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "silk"
|
||||
description = "A silky smooth implementation of the Loom architecture"
|
||||
version = "0.1.3"
|
||||
version = "0.2.0"
|
||||
documentation = "https://docs.rs/silk"
|
||||
homepage = "http://loomprotocol.com/"
|
||||
repository = "https://github.com/loomprotocol/silk"
|
||||
|
|
26
README.md
26
README.md
|
@ -15,6 +15,32 @@ corresponding benchmarks are also added that demonstrate real performance boots.
|
|||
feature set here will always be a ways behind the loom repo, but that this is an implementation
|
||||
you can take to the bank, literally.
|
||||
|
||||
# Usage
|
||||
|
||||
Add the latest [silk package] (https://crates.io/crates/silk) to the `[dependencies]` section
|
||||
of your Cargo.toml.
|
||||
|
||||
Create a *Historian* and send it *events* to generate an *event log*, where each log *entry*
|
||||
is tagged with the historian's latest *hash*. Then ensure the order of events was not tampered
|
||||
with by verifying each entry's hash can be generated from the hash in the previous entry:
|
||||
|
||||
```rust
|
||||
use historian::Historian;
|
||||
use log::{Event, verify_slice};
|
||||
|
||||
fn main() {
|
||||
let hist = Historian::new(0);
|
||||
|
||||
hist.sender.send(Event::Tick).unwrap();
|
||||
let entry0 = hist.receiver.recv().unwrap();
|
||||
|
||||
hist.sender.send(Event::UserDataKey(0xdeadbeef)).unwrap();
|
||||
let entry1 = hist.receiver.recv().unwrap();
|
||||
|
||||
assert!(verify_slice(&[entry0, entry1], 0));
|
||||
}
|
||||
```
|
||||
|
||||
# Developing
|
||||
|
||||
Building
|
||||
|
|
Loading…
Reference in New Issue