Go to file
Greg Fitzgerald 957fb0667c Deterministic historian/accountant hashes
When in tick-less mode, no longer continuously hash on the
background thread. That mode is just used for testing and
genesis log generation, and those extra hashes are just noise.

Note that without the extra hashes, with lose the duration between
events. Effectively, we distinguish proof-of-order from proof-of-time.
2018-03-09 06:58:40 -07:00
doc Sha256Hash -> Hash 2018-03-06 17:40:01 -07:00
src Deterministic historian/accountant hashes 2018-03-09 06:58:40 -07:00
.codecov.yml Add codecov configuration 2018-02-19 13:02:59 -07:00
.gitignore Lock down dependencies 2018-03-08 13:25:40 -07:00
.travis.yml Use sha256 hashes instead of Rust's builtin hasher. 2018-02-19 16:23:53 -07:00
Cargo.lock Deterministic historian/accountant hashes 2018-03-09 06:58:40 -07:00
Cargo.toml Deterministic historian/accountant hashes 2018-03-09 06:58:40 -07:00
LICENSE Prep for ownership transfer and rename 2018-02-16 11:53:14 -07:00
README.md With v0.3.1 published to crates.io, you can now run silk without git 2018-03-08 11:42:06 -07:00

README.md

Silk crate Silk documentation Build Status codecov

Disclaimer

All claims, content, designs, algorithms, estimates, roadmaps, specifications, and performance measurements described in this project are done with the author's best effort. It is up to the reader to check and validate their accuracy and truthfulness. Furthermore nothing in this project constitutes a solicitation for investment.

Silk, a silky smooth implementation of the Loom specification

Loom™ is a new architecture for a high performance blockchain. Its white paper boasts a theoretical throughput of 710k transactions per second on a 1 gbps network. The specification is implemented in two git repositories. Research is performed in the loom repository. That work drives the Loom specification forward. This repository, on the other hand, aims to implement the specification as-is. We care a great deal about quality, clarity and short learning curve. We avoid the use of unsafe Rust and write tests for everything. Optimizations are only added when corresponding benchmarks are also added that demonstrate real performance boosts. We expect the 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.

Running the demo

First, install Rust's package manager Cargo.

$ curl https://sh.rustup.rs -sSf | sh
$ source $HOME/.cargo/env

Install the silk executables:

    $ cargo install silk

The testnode server is initialized with a transaction log from stdin and generates new log entries on stdout. To create the input log, we'll need to create the mint and use it to generate a genesis log. It's done in two steps because the mint.json file contains a private key that will be used later in this demo.

    $ echo 500 | silk-mint > mint.json
    $ cat mint.json | silk-genesis > genesis.log

Now you can start the server:

    $ cat genesis.log | silk-testnode > transactions0.log

Then, in a separate shell, let's execute some transactions. Note we pass in the JSON configuration file here, not the genesis log.

    $ cat mint.json | silk-client-demo

Now kill the server with Ctrl-C, and take a look at the transaction log. You should see something similar to:

{"num_hashes":27,"id":[0, "..."],"event":"Tick"}
{"num_hashes":3,"id":[67, "..."],"event":{"Transaction":{"asset":42}}}
{"num_hashes":27,"id":[0, "..."],"event":"Tick"}

Now restart the server from where we left off. Pass it both the genesis log, and the transaction log.

    $ cat genesis.log transactions0.log | silk-testnode > transactions1.log

Lastly, run the client demo again, and verify that all funds were spent in the previous round, and so no additional transactions are added.

    $ cat mint.json | silk-client-demo

Stop the server again, and verify there are only Tick entries, and no Transaction entries.

Developing

Building

Install rustc, cargo and rustfmt:

$ curl https://sh.rustup.rs -sSf | sh
$ source $HOME/.cargo/env
$ rustup component add rustfmt-preview

Download the source code:

$ git clone https://github.com/loomprotocol/silk.git
$ cd silk

Testing

Run the test suite:

cargo test

Benchmarking

First install the nightly build of rustc. cargo bench requires unstable features:

$ rustup install nightly

Run the benchmarks:

$ cargo +nightly bench --features="asm,unstable"