Skip to content

vendor/hypercore #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
2 changes: 1 addition & 1 deletion .github/workflows/cargo-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ubuntu-matrix
name: cargo-build-matrix

# Controls when the action will run.
on:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ node_modules
# will have compiled files and executables
debug/
target/
vendor/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
Binary file added BQS97/BQS97.pdf
Binary file not shown.
447 changes: 447 additions & 0 deletions BQS97/Byzantine_Quorum_Systems.md

Large diffs are not rendered by default.

44 changes: 27 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ curve25519-dalek = "4"
crypto_secretstream = "0.2"
rust-crypto = "0.2.36"
git2 = "0.9.1"
argparse = "0.2.2"
argparse = "0.2.2"
time = "0.1.42"
chrono = "0"
nostr = "0.24.0"
Expand Down
13 changes: 13 additions & 0 deletions cargo.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,18 @@ cargo-doc:### cargo-doc
cargo-b-wasm-tokio:
@. $(HOME)/.cargo/env && cargo clean && cargo build --target=wasm32-unknown-emscripten --no-default-features #--features wasm-bindgen,tokio

node-examples-nodejs-run-js-node:### node-examples-nodejs-run-js-node
## node-examples-nodejs-run-js-node
node examples-nodejs/run.js node
node-examples-nodejs-run-js-node-6102:### node-examples-nodejs-run-js-node-6102
## node-examples-nodejs-run-js-node-6102
node examples-nodejs/run.js node 6102
node-examples-nodejs-run-js-rust:### node-examples-nodejs-run-js-rust
## node-examples-nodejs-run-js-rust
node examples-nodejs/run.js rust
node-examples-nodejs-run-js-rust-2106:### node-examples-nodejs-run-js-rust-2106
## node-examples-nodejs-run-js-rust-2106
node examples-nodejs/run.js rust 2106

# vim: set noexpandtab:
# vim: set setfiletype make
4 changes: 2 additions & 2 deletions examples-nodejs/replicate.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hypercore.info().then((_info) => {
console.log('KEY=' + hypercore.key.toString('hex'))
console.log()
if (hypercore.writable && !key) {
hypercore.append(['hi\n', 'ola\n', 'hello\n', 'mundo\n'])
hypercore.append(['hi\n', 'ola\n', 'hello\n', 'mundo\n', hypercore.key.toString('hex')])
}
})

Expand Down Expand Up @@ -58,7 +58,7 @@ function onconnection (opts) {
console.log("");
console.log("### Results (Press Ctrl-C to exit)");
console.log("");
console.log("Replication succeeded if you see '0: hi', '1: ola', '2: hello' and '3: mundo' (not necessarily in that order)")
console.log("Replication succeeded if you see '0: hi', '1: ola', '2: hello', '3: mundo', '4: key', (not necessarily in that order)")
console.log("");
for (let i = 0; i < hypercore.length; i++) {
hypercore.get(i).then(value => {
Expand Down
4 changes: 2 additions & 2 deletions examples-nodejs/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ const p = require('path')
const chalk = require('chalk')
const split = require('split2')

const PORT = 8000

const EXAMPLE_NODE = p.join(__dirname, 'replicate.js')
const EXAMPLE_RUST = 'replication'
const MODE = process.argv[2]
const PORT = process.argv[3] || 8000

if (!MODE) {
usage()
}
Expand Down
7 changes: 5 additions & 2 deletions examples/replication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ fn main() {
});

task::block_on(async move {

let mut hypercore_store: HypercoreStore<RandomAccessMemory> = HypercoreStore::new();

let storage = Storage::new_memory().await.unwrap();

// Create a hypercore.
let hypercore = if let Some(key) = key {
let public_key = VerifyingKey::from_bytes(&key).unwrap();
Expand All @@ -53,7 +56,7 @@ fn main() {
.unwrap()
} else {
let mut hypercore = HypercoreBuilder::new(storage).build().await.unwrap();
let batch: &[&[u8]] = &[b"hi\n", b"ola\n", b"hello\n", b"mundo\n"];
let batch: &[&[u8]] = &[b"hi\n", b"ola\n", b"hello\n", b"mundo\n", b"key\n"];
hypercore.append_batch(batch).await.unwrap();
hypercore
};
Expand Down Expand Up @@ -388,7 +391,7 @@ where
println!();
println!("### Results");
println!();
println!("Replication succeeded if this prints '0: hi', '1: ola', '2: hello' and '3: mundo':");
println!("Replication succeeded if this prints '0: hi', '1: ola', '2: hello', '3: mundo', '4: key':");
println!();
for i in 0..new_info.contiguous_length {
println!(
Expand Down
1 change: 1 addition & 0 deletions vendor/hypercore/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"files":{"CERTIFICATE":"53a0a460f8eccb279580aa16013c5f98936eba73554d267632f5ea83d8e890b1","CHANGELOG.md":"8a4836a83337941142be6b379a079fe7575dc43c72a4708880c77906d4168f5d","Cargo.lock":"f20c29c9f5177c0a4fdf1130739aba95853588fdcee6689884b4551cb834f7df","Cargo.toml":"b80a9f1e01fb34ae1df211fb22dbe252f789de9b5686dd8e83bb5e225a7179db","LICENSE-APACHE":"40b135370517318ee023f4553b49453ab716f4277ccc7801beb3a44ec481c9fb","LICENSE-MIT":"a06326997c80661a79a99f66af7417f3420640323952c92afae69d5a4b7537ee","README.md":"db19ee440a805365a53ca973e374eb46eb794142290f8da2c90f3a284a873918","benches/disk.rs":"5a6c5d2b5a30a519464dec175c37b4ff1245065323cef5c35b1dca47af607c94","benches/memory.rs":"3f84f98a50017389b539d2f4c2208f4430e35bf5dc6af4ed7d6e49e29980c8ec","examples/disk.rs":"62974fe304dfbb6284c92df1a5cb6375058f1d359f5f9d78a6fd6a300f663b0c","examples/memory.rs":"f4ddc81bed815ed63625a5ca5ce67beaa16fc12f841c324eef316e032d94ef27","examples/replication.rs":"161139858c741ac9277564af52b40b2df44c870061fb3acfa939a9f3618d0e61","src/bitfield/dynamic.rs":"6003a197ce52d0aa605ba17bbae66e695771e9900dd68e984dd17c2208294e4d","src/bitfield/fixed.rs":"2dbaac2d56b56f78af2793a6b7e883951a1bae02944f63ee92fa2faae6e4539e","src/bitfield/mod.rs":"76f1555e6389a73e73f7fdee470ed3d51ebfcebbd1d94d5c5731f8c8683dab4a","src/builder.rs":"0411b6ffc73a1cda42075ce987e6ae3e85666f03c5259c968d42da5427c5a75b","src/common/cache.rs":"ed25e719612092fb943099eb07bc8a787cc7a7df650c1371f5a6dc3d0ef0181c","src/common/error.rs":"ac4f5658d8b874f5affde1fe8c51576d6ad8eaf8208b42999319691208c5c133","src/common/mod.rs":"426f30f05ab8ebb178e064370f457b45ccebd824f5505908b6d729024ca6194e","src/common/node.rs":"08ab19770804f4e5ce61d3595b06062af2cc1068f4176af16ccb52cc548d3ee0","src/common/peer.rs":"aa096218932eda26927f3c27a22a583c0b52a4cd8c54a2abc604469209917ebe","src/common/store.rs":"e0490b59ec68dea1f0519727f6f3a3d993bf3f9b8d5fefdf6fad3e66d549e17c","src/core.rs":"43026192ee19ba3b61dd39bbf263911b889659aa8246fd89d60246c549941e31","src/crypto/hash.rs":"0011d7326968c6072d2d416eb31a83afa271d1256517914914bf2371ceef369c","src/crypto/key_pair.rs":"262939ca4da120491308e7de734fc2e41f3fc4d9b916a90a0b0525db98f0b5a0","src/crypto/manifest.rs":"7f0dca0127bcf0290ebb8c385acf6f3add7a6df9987acf883dfcf1a3066262f4","src/crypto/mod.rs":"d227ef04204ac64d5136dbfc6dc5fbd6833ae40e13412dde8c712138898a7c15","src/data/mod.rs":"af89c77f5b45a48b860935f1ea6761afc25847df4f5a7327d9642d515f761363","src/encoding.rs":"725501e6f36cf4548220d1ab3d564670dacf947a53ac974246f8c4acca32a4c4","src/lib.rs":"3799aad86cd033ce830660fd7329c9be00db076d6bea9e6ac5126847f12b3298","src/oplog/entry.rs":"df13ac9985cecbd4e057c0375beadf5296186352024b5b01aec9e3c1a41f2bd0","src/oplog/header.rs":"d2a2779b7b8ded5627b834ce0de87abc759de80c579b621ee217cb6ebb3cf1ec","src/oplog/mod.rs":"8404515befe41225055daa5b6499d1495316368e799cc62251b88f52cf09e998","src/prelude.rs":"254cc894b75d1181a8b677a904da441cc64fe44c4a0aac050f46c9c69c2bb855","src/storage/mod.rs":"0a84af3d6b76dd4afec03374d1ef556c069c48dbeab0c23f13cbe40ed61199f9","src/tree/merkle_tree.rs":"439807c4f46c484223a800a83716570ec24fd0bdde0d3bfd8f629deb85b28fa1","src/tree/merkle_tree_changeset.rs":"9da5e8cbaea13cdd537b979e7e470b387a8811510966fbe6ee826ef3e64f11e1","src/tree/mod.rs":"787b1877ce05197191aa7381752707b0f7a9e14f276bb8ddc5466b14db1e5ea9","tests/common/mod.rs":"5de5296507c1633e21ee63280da79c21cc6572fa8191cdd5da8d993177722a3b","tests/core.rs":"851d32f8149c140fb260cfe58d838e22f24d971c25f9008448981dfa1f633b82","tests/js/interop.js":"6cfde323aab89db0548898e0a0e8c93921cc9e684cc6f7343fb9df9c96a8ab8a","tests/js/mod.rs":"b741ad5f4bedbd482dd423d7b8d5e1248f11e1f9c8dc312666b92dc07c2e7c67","tests/js/package.json":"3fb483760615ba5e27b80bb340c593c90f6a7e2b95a4b895174a9e786c75c715","tests/js_interop.rs":"d4f44309aeda77286e4a5bd13fb74647d807c2abb9094a09dcef18907bf43158","tests/model.rs":"d1ef5bea900f87bd7cb2e72d4df70a8d92bb6291f6f5e85b36afea397254307c"},"package":"f58caa4fc81bfac2b018eda14b81cadbfc5cdd88fcee81c5b37532144027cde8"}
37 changes: 37 additions & 0 deletions vendor/hypercore/CERTIFICATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Loading