wrote a simple protobuf sleep_proto.c
begin layout stack begin install instructions added info to manpage license readme
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17
INSTALL
Normal file
17
INSTALL
Normal file
@@ -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
|
||||
2
LICENSE
2
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.
|
||||
|
||||
42
README.txt
42
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
|
||||
6
dat.scm
6
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"))
|
||||
|
||||
@@ -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 ;)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
1
inc/meat.h
Normal file
1
inc/meat.h
Normal file
@@ -0,0 +1 @@
|
||||
//deliverables... what is the core archive
|
||||
17
inc/sleep.h
Normal file
17
inc/sleep.h
Normal file
@@ -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 */
|
||||
1
src/cesspool.c
Normal file
1
src/cesspool.c
Normal file
@@ -0,0 +1 @@
|
||||
// hyperswarm dht
|
||||
0
src/dat_net.c
Normal file
0
src/dat_net.c
Normal file
0
src/sleep.c
Normal file
0
src/sleep.c
Normal file
0
src/sleep_crypto.c
Normal file
0
src/sleep_crypto.c
Normal file
47
src/sleep_proto.c
Normal file
47
src/sleep_proto.c
Normal file
@@ -0,0 +1,47 @@
|
||||
// tiny protobuf
|
||||
// at init call sleep_write_metadata_header("./.dat/metadata.data", content_pubkey, 32);
|
||||
#include "sleep.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
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;
|
||||
}
|
||||
0
src/sleep_tree.c
Normal file
0
src/sleep_tree.c
Normal file
0
src/sleep_utp.c
Normal file
0
src/sleep_utp.c
Normal file
Reference in New Issue
Block a user