Go to file
Greg Fitzgerald 0a30bd74c1 Tell verifiers when not to parallelize accounting
Without this patch, many batches of transactions could be tossed
into a single entry, but the parallelized accountant can only
guarentee the transactions in the batch can be processed in
parallel.

This patch signals the historian to generate a new Entry after
each batch. Validators must maintain sequential consistency
across Entries.
2018-04-12 21:08:53 -06:00
doc Update docs 2018-04-02 11:51:56 -06:00
src Tell verifiers when not to parallelize accounting 2018-04-12 21:08:53 -06:00
.codecov.yml Add codecov configuration 2018-02-19 13:02:59 -07:00
.gitignore Boot Cargo.lock from git 2018-03-09 16:26:26 -07:00
.travis.yml Boot sha2-asm 2018-03-19 16:42:30 -06:00
Cargo.toml commandline options for client and testnode 2018-04-09 21:14:52 -07:00
LICENSE Prep for ownership transfer and rename 2018-02-16 11:53:14 -07:00
README.md Add the 'why' for code coverage to readme 2018-04-04 09:26:38 -06:00
build.rs Change for cuda verify integration 2018-04-05 20:00:44 -07:00

README.md

Solana crate Solana 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.

Solana: High Performance Blockchain

Solana™ is a new architecture for a high performance blockchain. It aims to support over 700 thousand transactions per second on a gigabit network.

Running the demo

First, install Rust's package manager Cargo.

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

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

    $ echo 1000000000 | cargo run --release --bin solana-mint | tee mint.json
    $ cat mint.json | cargo run --release --bin solana-genesis | tee genesis.log

Now you can start the server:

    $ cat genesis.log | cargo run --release --bin solana-testnode | tee transactions0.log

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

    $ cat mint.json | cargo run --release --bin solana-client-demo

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

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

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

    $ cat genesis.log transactions0.log | cargo run --release --bin solana-testnode | tee 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 | cargo run --release --bin solana-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/solana-labs/solana.git
$ cd solana

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="unstable"

Code coverage

To generate code coverage statistics, run kcov via Docker:

$ docker run -it --rm --security-opt seccomp=unconfined --volume "$PWD:/volume" elmtai/docker-rust-kcov

Why coverage? While most see coverage as a code quality metric, we see it primarily as a developer productivity metric. When a developer makes a change to the codebase, presumably it's a solution to some problem. Our unit-test suite is how we encode the set of problems the codebase solves. Running the test suite should indicate that your change didn't infringe on anyone else's solutions. Adding a test protects your solution from future changes. Say you don't understand why a line of code exists, try deleting it and running the unit-tests. The nearest test failure should tell you what problem was solved by that code. If no test fails, go ahead and submit a Pull Request that asks, "what problem is solved by this code?" On the other hand, if a test does fail and you can think of a better way to solve the same problem, a Pull Request with your solution would most certainly be welcome! Likewise, if rewriting a test can better communicate what code it's protecting, please send us that patch!