updated readme

This commit is contained in:
Dmitry Zuikov 2023-03-25 09:55:48 +03:00
parent 9154e84928
commit bc9d1c8d08
1 changed files with 64 additions and 64 deletions

118
README.md
View File

@ -118,22 +118,18 @@ Full procedure:
2. Optional\*. Make hbs2-peer poll this topic: 2. Optional\*. Make hbs2-peer poll this topic:
``` {=html} ```
<!-- --> echo poll reflog 1 "2YNGdnDBnciF1Kgmx1EZTjKUp1h5pvYAjrHoApbArpeX" >> <your-hbs2-peer-config>
``` ```
echo poll reflog 1 "2YNGdnDBnciF1Kgmx1EZTjKUp1h5pvYAjrHoApbArpeX" >> <your-hbs2-peer-config> `<your-hbs2-peer-config>` is typically
`<your-hbs2-peer-config>`{=html} is typically
\~/.config/hbs2-peer/config but it may vary up to setup \~/.config/hbs2-peer/config but it may vary up to setup
3. Fetch the *reflog* (topic) for the repo: 3. Fetch the *reflog* (topic) for the repo:
``` {=html}
<!-- -->
``` ```
hbs2-peer reflog fetch 2YNGdnDBnciF1Kgmx1EZTjKUp1h5pvYAjrHoApbArpeX
hbs2-peer reflog fetch 2YNGdnDBnciF1Kgmx1EZTjKUp1h5pvYAjrHoApbArpeX ```
If you have the set up as in step 2, it will be done periodically and If you have the set up as in step 2, it will be done periodically and
upon hbs2-peer start, so you don\'t have to bother. Also, hbs2-peer upon hbs2-peer start, so you don\'t have to bother. Also, hbs2-peer
@ -142,36 +138,30 @@ automatically.
4. Check the reflog is here: 4. Check the reflog is here:
``` {=html}
<!-- -->
``` ```
hbs2-peer reflog get 2YNGdnDBnciF1Kgmx1EZTjKUp1h5pvYAjrHoApbArpeX
hbs2-peer reflog get 2YNGdnDBnciF1Kgmx1EZTjKUp1h5pvYAjrHoApbArpeX ```
Note, that it may take time to all objects to deliver. Note, that it may take time to all objects to deliver.
5. Clone the project 5. Clone the project
``` {=html}
<!-- -->
``` ```
git clone hbs2://2YNGdnDBnciF1Kgmx1EZTjKUp1h5pvYAjrHoApbArpeX hbs2
git clone hbs2://2YNGdnDBnciF1Kgmx1EZTjKUp1h5pvYAjrHoApbArpeX hbs2 ```
6. Create your own topic 6. Create your own topic
``` {=html}
<!-- -->
``` ```
hbs2 keyring-new > my-keyring.key
hbs2 keyring-list my-keyring.key
hbs2 keyring-new > my-keyring.key [user@host:~]$ hbs2 keyring-list my-keyring.key
hbs2 keyring-list my-keyring.key sign-key: 6CMRnptW8DjiW4S1kv3U6wEAUGwhZmG7522fsqi3SH2d
[user@host:~]$ hbs2 keyring-list my-keyring.key
sign-key: 6CMRnptW8DjiW4S1kv3U6wEAUGwhZmG7522fsqi3SH2d
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
this is your new repo's relog (topic) this is your new repo's relog (topic)
Of course, sign-key will be different. Of course, sign-key will be different.
```
Keep the keyring file private. It contains the key pair (private+public Keep the keyring file private. It contains the key pair (private+public
keys) that wilyl allow you to write to the reflog. If you lose it, you keys) that wilyl allow you to write to the reflog. If you lose it, you
@ -181,14 +171,12 @@ references to a new repo.
7. Export the repo to the new reflog (topic). 7. Export the repo to the new reflog (topic).
``` {=html} ```
<!-- --> git hbs2 export <sign-key> -k <keyring-file>
``` ```
git hbs2 export <sign-key> -k <keyring-file>
In this example, sign-key will be In this example, sign-key will be
6CMRnptW8DjiW4S1kv3U6wEAUGwhZmG7522fsqi3SH2d `<keyring-file>`{=html} 6CMRnptW8DjiW4S1kv3U6wEAUGwhZmG7522fsqi3SH2d `<keyring-file>`
will be my-keyring.key will be my-keyring.key
This step will export all objects to the new created topic. This step will export all objects to the new created topic.
@ -202,11 +190,13 @@ to wait quite a while, but only for the first time.
Example: Example:
[user@host:~]$ cat ~/.config/hbs2-git/w/hbs2/config ```
[user@host:~]$ cat ~/.config/hbs2-git/w/hbs2/config
branch "master" branch "master"
keyring "/home/user/secrets-dir/my-keyring.key" keyring "/home/user/secrets-dir/my-keyring.key"
```
Note, that keyring file must be absolute. And the location supposed to Note, that keyring file must be absolute. And the location supposed to
be safe. be safe.
@ -215,18 +205,18 @@ In my case, it\'s a mounted encrypted directory, but it\'s up to you.
9. Add the new repo to a git 9. Add the new repo to a git
``` {=html}
<!-- -->
``` ```
git remote add mytopic hbs2://<sign-key>
git remote add mytopic hbs2://<sign-key> ```
Example: Example:
git remote add mytopic hbs2://6CMRnptW8DjiW4S1kv3U6wEAUGwhZmG7522fsqi3SH2d ```
git remote add mytopic hbs2://6CMRnptW8DjiW4S1kv3U6wEAUGwhZmG7522fsqi3SH2d
git fetch origin git fetch origin
git fetch mytopic git fetch mytopic
```
You may want to set your own topic as the \"origin,\" and another topic You may want to set your own topic as the \"origin,\" and another topic
as something else. It\'s completely up to you. It works just like as something else. It\'s completely up to you. It works just like
@ -247,24 +237,25 @@ commit and other information required for merging the changes.
Example: Example:
```
docs/\.../some-pr-file docs/\.../some-pr-file
PR: my-very-first-pr PR: my-very-first-pr
Just to test the concept. It may be merged from the Just to test the concept. It may be merged from the
branch branch
branch: pr-XXX-my-very-first branch: pr-XXX-my-very-first
commit: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX commit: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```
13. Commit 13. Commit
14. Push 14. Push
``` {=html}
<!-- -->
``` ```
git push mytopic
git push mytopic ```
Now, if the author of the original topic (reflog, repo) is aware abour Now, if the author of the original topic (reflog, repo) is aware abour
your topic and subscribed to if (added it as a remote to his/her git your topic and subscribed to if (added it as a remote to his/her git
@ -272,28 +263,31 @@ repo) they will be able to receive and merge your pull requests.
15. Check the reflog (just for in case) 15. Check the reflog (just for in case)
``` {=html}
<!-- -->
```
hbs2-peer reflog get <sign-key> ```
hbs2-peer reflog get <sign-key>
```
## How to launch a peer ## How to launch a peer
Example: Example:
hbs2-peer run -p .peers/1 -k .peers/1/key -l addr:port -r rpcaddr:rpcport ```
hbs2-peer run -p .peers/1 -k .peers/1/key -l addr:port -r rpcaddr:rpcport
```
## How to save an encrypted file (TBD) ## How to save an encrypted file (TBD)
keyring-new > kr ```
keyring-list kr keyring-new > kr
; create a file with a list of public keys keyring-list kr
; copy the lines from the output of the keyring-list command ; create a file with a list of public keys
groupkey-new path/to/file/with/list/of/pubkeys > groupkey ; copy the lines from the output of the keyring-list command
store --groupkey groupkey file/to/store groupkey-new path/to/file/with/list/of/pubkeys > groupkey
; get the hash store --groupkey groupkey file/to/store
cat --keyring kr <hash> ; get the hash
cat --keyring kr <hash>
```
# FAQ # FAQ
@ -373,3 +367,9 @@ And since 2023-03-24 I consider the
hbs2://2YNGdnDBnciF1Kgmx1EZTjKUp1h5pvYAjrHoApbArpeX hbs2://2YNGdnDBnciF1Kgmx1EZTjKUp1h5pvYAjrHoApbArpeX
as the main project repository. as the main project repository.
Contact:
telegram: @voidlizard