I am exploring the possibility to implement the Rhizome store (from Serval Project) over GIT. This PoC is a wrapper of GIT plumbing commands to provide Rhizome main commands.
It is implemented in bash, and is not intended to be executed on a phone. There is no full-checking of user inputs, there is no encryption nor signatures.
A real implementation would be in C (in servald), and could store fields as
byte arrays (instead of Strings, even used for binary fields converted in
hexadecimal).
rog create <service> <sender> <recipient> [<file>]
serviceis a String (e.g.meshms)senderis the hexa-SID of sender (but you can put any String you want)recipientis the hexa-SID of recipientfileis the filepath of the payload (empty for stdin)
echo 'Hello' > /tmp/hello
./rog create meshms 1111 2222 /tmp/hello
./rog create meshms 2222 1111 <<< 'How are you?'
# if /tmp/file.pdf exists
./rog create file 1111 '' /tmp/file.pdf
rog list [<service>] [<sender>] [<recipient>]
Result are filtered by service, sender and/or recipient.
Prints 1 result per line, with fields seperated by ':'.
bid:service:sender:recipient:date:length:data:
./rog list
./rog list meshms
./rog list meshms 1111 2222
./rog list meshms '' 2222
./rog list '' 1111
./rog list '' '' 2222
rog update <bid> [<file>]
fileis the filepath of the payload (empty for stdin)
date, length, payload and sign fields of the manifest are automatically updated.
Other fields cannot be modified (service for example).
echo 'Hello world !' > /tmp/hello
./rog update <bid> /tmp/hello
./rog update <bid> <<< 'This is my new message'
rog delete <bid>
rog manifest <bid>
rog payload <bid>
./rog payload <meshms_bid> # prints a String message on stdin
./rog payload <file_bid> > file.pdf # exports a pdf file