A platform for self-hosting internet services.
|
2 năm trước cách đây | |
---|---|---|
.vscode | 2 năm trước cách đây | |
crates | 2 năm trước cách đây | |
doc | 2 năm trước cách đây | |
tools | 2 năm trước cách đây | |
.gitignore | 2 năm trước cách đây | |
Cargo.lock | 2 năm trước cách đây | |
Cargo.toml | 2 năm trước cách đây | |
README.md | 2 năm trước cách đây | |
TODO.txt | 2 năm trước cách đây |
In broad strokes, theses are the phases of development.
harness
for running nodes as child processes and communicating with
them. This crate must define high level functions for:
test-harness
which uses harness
to write tests for nodes. This
crate should be capable of starting multiple nodes to test their interaction.*Overview Cover major features of the system and describe how it uses and improves traditional web technologies.
*Data Definition Define the format of: -Keys -Blocks -Directories -Files -Paths -Messages -Fragments -Programs
*Node Definition Describe the roles and responsibilities of nodes: -They provide an API to programs -Persitence of data locally and over the network. -Forwarding BlockTree messages and HTTP requests to authorized Programs. -Handling BlockTree messages from the network that are for the node
itself.
-Secure management of cryptographic keys using a TPM. -Forwarding traffic to other nodes. -Resolving node IDs to IP addresses.
*Network Definition -Mechanism to resolve node IDs to IP addresses. -Node hierarchy and leader election among peers. -Distributed Block locking for exclusive writes. -Opportunistic concurrency by default, with the rule that the last write known to the leader is the winner. -In order to participate in the network a node must have a valid TPM. The issuance of these TPMs is controlled to prevent inflation. When a TPM is first connected to the network it is claimed by the party who first registers it. The currency associated with that TPM is then transfered to the party. -Nodes store fragments for other nodes when they are paid. Two nodes create a contract store it in the public blocktree when they agree to do this. -Nodes can also create contracts to forward traffic for each other.
*Program API -Provide file creation API. Blocks can be created which are good for reading sequencially or good for reading randomly. -Provide binary file IO. The caller provides a plan-text Path and can open a block for reading, writing, or both. The API should stream based. -Provide stream wrappers for doing text IO. -Provide API for registering callbacks to be notified when blocks are modified. -Method to lock a block for exclusive write access. -API to register callbacks to handle BlockTree and HTTP requests. -A method to send Messages to other nodes and HTTP requests to other hosts.
*Applications -A distributed document database:
Find or create a library for reading and writing BSON files and use
it for storing data.
-A web development framework which allows one to register middleware to handle HTTP requests. Provides Request and Response abstractions to middleware. -If time allows create an MVC middleware implementation. -A middleware implementation for serving static content. -A video streaming server. -An application for managing contacts. -A secure messaging and chat application.
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)