A platform for self-hosting internet services.

Matthew Carr ae4184b88b * Used the std ilog2 method in merkle_stream::log2. 1 anno fa
.vscode fa09308324 Fixed the ECB-style weakness in SecretStream by hashing the sector offset 2 anni fa
crates ae4184b88b * Used the std ilog2 method in merkle_stream::log2. 1 anno fa
doc 4526f6d4b8 * Moved inessential material out of the README. 2 anni fa
tools ae4184b88b * Used the std ilog2 method in merkle_stream::log2. 1 anno fa
.gitignore cb02f2cbd8 Made major modification to the Block trait. 2 anni fa
Cargo.lock 3770d845f4 Improved the security of inode to path mapping. 2 anni fa
Cargo.toml 066ef2a03c Started implementing btfsd. 2 anni fa
LICENSE 4526f6d4b8 * Moved inessential material out of the README. 2 anni fa
README.md 5d08568cc0 * Fixed the test flakiness in btfuse by using a lazy unmount. 2 anni fa
ROADMAP.md 4526f6d4b8 * Moved inessential material out of the README. 2 anni fa

README.md

Blocktree

Blocktree is a platform for writing distributed internet services. It aims to make it easy for anyone to spin-up servers to host the online services they rely on.

Building

Blocktree requires the nightly rust compiler to be build. The preferred way of installing this is using rustup. Once you have rustup installed you can install the nightly toolchain with rustup toolchain install nightly.

Building is as simple as executing cargo build in the root of this repository. The test suite can be run with cargo test. In order to run the tests swtpm, libtss2 and libfuse need to be installed.

Performance Measurement with flamegraph on Linux

In order to use the flamegraph crate to on Linux you need to setup unprivileged access to the perf utility by your user account. After installing perf (on Arch with pacman -S perf), perform the following as root (if perf is not installed at /usr/bin/perf use which perf to locate it):

# groupadd perf_users
# cd /usr/bin
# ls -alhF perf
-rwxr-xr-x  2 root root  11M Oct 19 15:12 perf
# chgrp perf_users perf
# ls -alhF
-rwxr-xr-x  2 root perf_users  11M Oct 19 15:12 perf
# chmod o-rwx perf
# ls -alhF
-rwxr-x---  2 root perf_users  11M Oct 19 15:12 perf
# setcap "cap_perfmon,cap_sys_ptrace,cap_syslog=ep" perf
# setcap -v "cap_perfmon,cap_sys_ptrace,cap_syslog=ep" perf
perf: OK
# getcap perf
perf = cap_sys_ptrace,cap_syslog,cap_perfmon+ep

(source: https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html) Finally add your user account to the perf_users group:

# usermod -aG perf_users <your username>

You'll need to logout and back in for the new group to take effect. You can confirm you're in the group with:

> groups
tss audio <your username> perf_users

The you can run flamegraph as your user account with:

> cargo flamegraph --unit-test <crate name> -- test::<test name>

(source: https://crates.io/crates/flamegraph)

Test coverage with tarpaulin

The tarpaulin crate can be used to generate code coverage reports. You can install it with cargo with cargo install tarpaulin. To generate an HTML report for the entire repository, execute cargo tarpaulin --out Html from the root of this repository. The generated report will be saved to the root of the repository. You can generate coverage reports for specific crates by first navigating to the crates directory then executing the above command. Note that even if you run the tool in a subdirectory, the report will still be saved in the root of the repository. Please do not commit the coverage report.

License

Copyright 2023 Delease, LLC. The software contained in this repository is licensed under the GNU Affero General Public License Version 3 or later. A copy of this license is provided in the LICENSE file in the root of this repository. A license which allows for the usage of this software without disclosing the source code of the system containing it may be purchased by contacting Delease, LLC.