diff --git a/.dat/content.bitfield b/.dat/content.bitfield index 263b0f4..e8a027a 100644 Binary files a/.dat/content.bitfield and b/.dat/content.bitfield differ diff --git a/.dat/content.signatures b/.dat/content.signatures index dd35c24..75ab232 100644 Binary files a/.dat/content.signatures and b/.dat/content.signatures differ diff --git a/.dat/content.tree b/.dat/content.tree index 68c4aed..6911071 100644 Binary files a/.dat/content.tree and b/.dat/content.tree differ diff --git a/.dat/metadata.bitfield b/.dat/metadata.bitfield index a74c050..62d0e7c 100644 Binary files a/.dat/metadata.bitfield and b/.dat/metadata.bitfield differ diff --git a/.dat/metadata.data b/.dat/metadata.data index 91d9ce0..75dd912 100644 Binary files a/.dat/metadata.data and b/.dat/metadata.data differ diff --git a/.dat/metadata.signatures b/.dat/metadata.signatures index beb147e..577814a 100644 Binary files a/.dat/metadata.signatures and b/.dat/metadata.signatures differ diff --git a/.dat/metadata.tree b/.dat/metadata.tree index 5c0d46d..ae75f5d 100644 Binary files a/.dat/metadata.tree and b/.dat/metadata.tree differ diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..d886911 --- /dev/null +++ b/INSTALL @@ -0,0 +1,17 @@ +x86_64 +deps +NaCl/libsodium +libutp +//webrtc +//sdl2 + +./configure +make +open a new tty console and log in as root and then cd to the dir then make install + +CONFIG FLAGS y'all can pass +-- + +aarch64 + +rv64 diff --git a/LICENSE b/LICENSE index 242df15..2e40e13 100644 --- a/LICENSE +++ b/LICENSE @@ -3,3 +3,5 @@ This is My Software Freedom is a spook NO WARRANTY, NOT MEANT TO DIAGNOSE OR CURE ANY ILLNESS + +This software must NEVER be hosted on ANY server belonging to Microsoft, Amazon, Alphabet, Meta, or any other Large Corporation or Military. You Agree or Delete This Now. diff --git a/README.txt b/README.txt index 42352b4..ad27d5d 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,40 @@ back up dat thang -breaking out of JS jail and enabling both c and scheme env -dis dat://59d8099399510e23a3c693fb5887b7bba1586f4117f7ef1c5872622ada0c1181 -you might discuss here cabal://cf2caf3a1c4fd299471d315416b6cc3d9c5f7c678046652fb70ede4ff16698db + +breaking out of Node-JS jail and enabling both C and Scheme env + +dis +dat://59d8099399510e23a3c693fb5887b7bba1586f4117f7ef1c5872622ada0c1181 + +you might discuss here +cabal://cf2caf3a1c4fd299471d315416b6cc3d9c5f7c678046652fb70ede4ff16698db + +hosted on the web at +https://git.worlio.com/divorce/dat-thang/ + +BUILD +x86_64 GNU/Linux +see INSTALL + +DESCRIPTION +i implement the SLEEP spec as a C header (similar to REST with HTML) +then i provide FFI bindings so you can call easily from scheme +i also have a novel solution for hyperswarm-dht (i think) + +what this means and what this does is +this is a p2p program that does away with the client-server model, +and enables you to basically share any directory in your system as a torrent (basically esentially) + +"why? when hyper:// is here now with so cool much better justwerks dApps(Decentralized Apps)???" + +I like the sound of dat:// better, this is cooler no offense, and the scope of this project is longevity and community archival. + +{tw: software developer's opinion inc} you can't build community 'archival' tools on flimsy vulnerable npm install hope it works oh it doesn't its obviously not maintained... i am trying to build good minimalist software so 20, 30 years down the line, if i have the hash, i have my files (granted someone else kept them live), "boom". + +"hyperswarm" sounds badass, its just what p2p need(s(ded since 201X)). i wanna be developing hyperswarm. in this implementation its called cesspool. so when people include that particular module in their distros they will package libcess. i've always wanted to write libcess and now here it is, baby. + +i'm using C because ez libraries, assert is the ultimate hack, and scheme because macros *shablamo* and s7 lisp-in-C C-in-scheme because hell yeah i specialize in beautiful elegant solutions to your networking problem. + +LICENSE +see LICENSE + +This is My Software \ No newline at end of file diff --git a/dat.scm b/dat.scm index dd91299..0aedecc 100644 --- a/dat.scm +++ b/dat.scm @@ -1,3 +1,3 @@ -((title . "dat-thang") - (description . "dat:// implemented over c & scheme") - (url . "dat://59d8099399510e23a3c693fb5887b7bba1586f4117f7ef1c5872622ada0c1181")) +((title "dat-thang") + (description "dat:// implemented over c & scheme") + (url "dat://59d8099399510e23a3c693fb5887b7bba1586f4117f7ef1c5872622ada0c1181")) diff --git a/docs/dat.1 b/docs/dat.1 index d5f7ac9..8b57b5c 100644 --- a/docs/dat.1 +++ b/docs/dat.1 @@ -15,7 +15,7 @@ .Op Ar argument ... .Oc .Sh DESCRIPTION -wip +[WIP] dis dat mf thang .Sh OPTIONS .It Fl d Debug @@ -26,8 +26,8 @@ its there .Sh AUTHORS "Dat" was first written about by Mathias Buus Madsen & Maxwell Ogden (c) 2015 .Nm -was written by -.An divorce Aq @4c3NtV5p+7MRCwinLcD+dVMgz2rGbX2wF/ZtDxBA/Lw=.ed25519 +was written and directed by +.An churtzan Aq @4c3NtV5p+7MRCwinLcD+dVMgz2rGbX2wF/ZtDxBA/Lw=.ed25519 .Sh BUGS .Pp Go ahead an fix em ;) diff --git a/inc/cesspool.h b/inc/cesspool.h index e69de29..b9d44a1 100644 --- a/inc/cesspool.h +++ b/inc/cesspool.h @@ -0,0 +1,14 @@ +#ifndef CESSPOOL_H +#define CESSPOOL_H + +#include "key.h" + +// bootstrap node +// dht +// discovery +// lookup (key) ↳ lookup1 +// announce +// ping +// holepunch udp + +#endif /* CESSPOOL_H */ diff --git a/inc/dat.h b/inc/dat.h index e69de29..71918e9 100644 --- a/inc/dat.h +++ b/inc/dat.h @@ -0,0 +1,4 @@ +#ifndef DAT_H +#define DAT_H + +#endif /* DAT_H */ diff --git a/inc/meat.h b/inc/meat.h new file mode 100644 index 0000000..c03748a --- /dev/null +++ b/inc/meat.h @@ -0,0 +1 @@ +//deliverables... what is the core archive diff --git a/inc/sleep.h b/inc/sleep.h new file mode 100644 index 0000000..2eb10eb --- /dev/null +++ b/inc/sleep.h @@ -0,0 +1,17 @@ +// TODO implement SLEEP +#ifndef SLEEP_H +#define SLEEP_H + +#include "key.h" + +/*metadata.key +metadata.signatures +metadata.bitfield +metadata.tree +metadata.data +content.key +content.signatures +content.bitfield +content.tree*/ + +#endif /* NURSERY_H */ diff --git a/src/cesspool.c b/src/cesspool.c new file mode 100644 index 0000000..76eed1f --- /dev/null +++ b/src/cesspool.c @@ -0,0 +1 @@ +// hyperswarm dht diff --git a/src/dat_net.c b/src/dat_net.c new file mode 100644 index 0000000..e69de29 diff --git a/src/sleep.c b/src/sleep.c new file mode 100644 index 0000000..e69de29 diff --git a/src/sleep_crypto.c b/src/sleep_crypto.c new file mode 100644 index 0000000..e69de29 diff --git a/src/sleep_proto.c b/src/sleep_proto.c new file mode 100644 index 0000000..5ea1201 --- /dev/null +++ b/src/sleep_proto.c @@ -0,0 +1,47 @@ +// tiny protobuf +// at init call sleep_write_metadata_header("./.dat/metadata.data", content_pubkey, 32); +#include "sleep.h" +#include +#include +#include + +static size_t write_varint(uint64_t val, uint8_t *buf) { + size_t n = 0; + while (val >= 0x80) { + buf[n++] = (uint8_t)((val & 0x7F) | 0x80); + val >>= 7; + } + buf[n++] = (uint8_t)val; + return n; +} + +// write Header {type="hyperdrive", content=pubkey} +int sleep_write_metadata_header(const char *path, const uint8_t *content_pubkey, size_t pk_len) { + if (!content_pubkey || pk_len != 32) { + errno = EINVAL; + return -1; + } + + FILE *f = fopen(path, "wb"); + if (!f) return -1; + + uint8_t buf[128]; + size_t n = 0; +// 1st field + buf[n++] = 0x0A; + const char *type = "hyperdrive"; + size_t type_len = strlen(type); + n += write_varint(type_len, buf + n); + memcpy(buf + n, type, type_len); + n += type_len; +// 2nd field + buf[n++] = 0x12; + n += write_varing(pk_len, buf + n); + memcpy(buf + n, content_pubkey, pk_len); + n += pk_len; + + size_t written = fwrite(buf, 1, n, f); + fclose(f); + + return written == n ? 0 : -1; +} diff --git a/src/sleep_tree.c b/src/sleep_tree.c new file mode 100644 index 0000000..e69de29 diff --git a/src/sleep_utp.c b/src/sleep_utp.c new file mode 100644 index 0000000..e69de29