Browse Source

Added a skeletons for the crates.

Matthew Carr 3 years ago
parent
commit
76adae3acb

+ 1 - 0
.gitignore

@@ -4,3 +4,4 @@
 *.pdf
 *.synctex.gz
 *.toc
+**target/

+ 5 - 0
crates/node/Cargo.lock

@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "node"
+version = "0.1.0"

+ 9 - 0
crates/node/Cargo.toml

@@ -0,0 +1,9 @@
+[package]
+name = "node"
+version = "0.1.0"
+authors = ["Matthew Carr <mdcarr941@gmail.com>"]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]

+ 7 - 0
crates/node/README.md

@@ -0,0 +1,7 @@
+## Overview
+This crate implements a blocktree node. It is responsible for the following:
+  * Managing the blocktree data structures in the filesystem.
+  * Communicating over the network with other nodes.
+  * Running programs in their own separate sandbox processes. 
+  * Routing HTTP request to programs which have registered handlers.
+  * Receiving orders from its parent via stdout/stdin.

+ 15 - 0
crates/node/src/main.rs

@@ -0,0 +1,15 @@
+// SHA512 requires 64 bytes.
+const signature_len: usize = 64;
+
+struct Block<'a> {
+    version: u8,
+    path: &'a str,
+    read_caps: (),
+    write_cap: (),
+    body: &'a [u8],
+    signature: [u8; signature_len]
+}
+
+fn main() {
+    println!("Hello, world!");
+}

+ 2 - 0
crates/sandbox/README.md

@@ -0,0 +1,2 @@
+## Overview
+This create implements a sandbox in which user code written in WebAssembly is run.

+ 4 - 0
crates/web-host/README.md

@@ -0,0 +1,4 @@
+## Overview
+This crate implements a web application which runs a node as a child process. The web
+app controls this node via commands send to the child's stdin. This allows us to serve
+an web portal for controlling a node.