From edd826d63fe6c9b97a3af34b5e8bc659d9f676b7 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 3 Jun 2024 22:47:01 +0300 Subject: [PATCH] update readme --- README.md | 62 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 53541f2..26601f5 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,70 @@ # kevacoin-cli -CLI tools for KevaCoin blockchain +CLI tools for KevaCoin ### put export FS object to blockchain +#### logic + +* create separated namespace with file basename as `_KEVA_NS_` +* append protocol version as `_CLITOR_IS_` +* encode file content to base64 string +* split encoded string to `3072` byte pieces +* save pieces as indexed record values + +#### example + ``` -php cli/put.php processor filename [length] [delay] +php cli/put.php processor filename [delay] ``` -* `processor` - path to `kevacoin-cli` -* `filename` - local file path to store -* `length` - optional split size, `3072` bytes [max](https://kevacoin.org/faq.html) -* `delay` - optional seconds of parts sending delay to prevent `too-long-mempool-chain` reject, default `60` +#### arguments + +1. `processor` - path to `kevacoin-cli` +2. `filename` - path to source file +3. `delay` - _optional_ delay in seconds for pieces pool to prevent `too-long-mempool-chain` reject, default `60` ### fix -check and fix FS object in blockchain +check and fix missed FS segments in blockchain + +#### logic + +similar to the [put](#put) logic but using namespace provided as second argument + +#### example ``` -php cli/fix.php processor filename [delay] +php cli/fix.php processor namespace filename [delay] ``` -* `processor` - path to `kevacoin-cli` -* `filename` - local file path to store -* `delay` - optional seconds of parts sending delay to prevent `too-long-mempool-chain` reject, default `60` +#### arguments + +1. `processor` - path to `kevacoin-cli` +2. `namespace` - hash of namespace where object was stored +3. `filename` - path to source file +4. `delay` - _optional_ delay in seconds for pieces pool to prevent `too-long-mempool-chain` reject, default `60` ### get -import from blockchain to FS location +import stored object from blockchain to FS location + +#### logic + +* check namespace for `_CLITOR_IS_` record +* merge indexed records to base64 string +* decode merged string to original file and save to FS + +#### example ``` -php cli/get.php processor namespace [destination] +php cli/get.php processor namespace [filename] ``` -* `processor` - path to `kevacoin-cli` -* `namespace` - hash received from the `put` command -* `destination` - optional FS location, `data/import` by default \ No newline at end of file +#### arguments + +1. `processor` - path to `kevacoin-cli` +2. `namespace` - hash of namespace where object was stored +3. `filename` - path to the file \ No newline at end of file