aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MODULES35
-rw-r--r--README7
-rwxr-xr-xmodules/follow/lib.sh (renamed from bin/ak-follow)32
-rwxr-xr-xmodules/follow/main.sh33
4 files changed, 70 insertions, 37 deletions
diff --git a/MODULES b/MODULES
index 3466d6e..c677261 100644
--- a/MODULES
+++ b/MODULES
@@ -300,6 +300,41 @@ As you have already witnessed, prototype is another way of telling "will do" or
"here is an idea".
+## follow
+
+Prototype - Follows something!
+
+"Something" is completely accurate at this point as it is following nothing in
+particular. The purpose of introducing it was to be able to add a "follow/add"
+block to your chain, so in some sense to inform others that others exist too
+and you "follow" them as in the "social media" terminology.
+
+The place from which you are doing it though is vague. The first thought was to
+have the `ak-config` IPNS key in the list. An update on that key would fetch you
+the new latest of the zchain that this key point to, hence, being able to crawl
+the latest version of it. That was mostly cause the 'ak-config' output would be
+something like this:
+
+```json
+{
+ "profile": {
+ "nickname": "someone",
+ },
+ "genesis": "QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH",
+ "gpg": "42A...",
+ "zchain": "k51q...",
+ "zlatest": "Qm..."
+}
+```
+
+Other than publishing that you follow or unfollow someone's ak-config IPNS key,
+the module doesn't do anything else.
+
+Privacy-wise, someone would not like to let others know what their follow list
+is.
+
+
+
## Notes
- [1] "data_signature" is labeled as "detach" inside the block.
- [2] README file mentions that the whole project is in experimental state, btw
diff --git a/README b/README
index ffaaf37..d3c8955 100644
--- a/README
+++ b/README
@@ -291,15 +291,10 @@ Modules
- transactions # Prototype of transactions in the ZCHAIN
- smfiles # Adds a split file's map to the ZCHAIN
- todos PROTO Adds todo list to the ZCHAIN
+ - follow PROTO Follow IPNS keys of ZCHAIN for changes
Read more at the `./MODULES` file
-Public following (uses ak-profile module)
------------------------------------------
- - ak-follow # Follow something
- - ak-following # List your follows
- - ak-unfollow # Unfollow something
-
FS tools
--------
- ak-fs
diff --git a/bin/ak-follow b/modules/follow/lib.sh
index d8461b8..17ac384 100755
--- a/bin/ak-follow
+++ b/modules/follow/lib.sh
@@ -1,26 +1,8 @@
#!/bin/bash
-##
-## You can maintain a list of friendly zchains or ids
-##
-## Usage:
-##
-## -h, --help Prints this help message
-##
-## -f, --follow Adds a ... to your follow list
-##
-## -l, --list Shows a list of your followings
-##
-## -u, --unfollow Unfollows a ...
-##
-fullprogrampath="$(realpath $0)"
-PROGRAM=$(basename $0)
-descriptionString="Following stuff"
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_script
source $AK_LIBDIR/_ak_ipfs
-FOLLOWING="$HOME/.arching-kaos/following"
+FOLLOWING="$AK_WORKDIR/following"
_ak_follow_follow(){
if [ ! -z $1 ]
@@ -82,15 +64,3 @@ _ak_follow_unfollow(){
exit 1
fi
}
-
-if [ ! -z $1 ]
-then
- case $1 in
- -h | --help) _ak_usage; exit;;
- -f | --follow) _ak_follow_follow $2; exit;;
- -l | --list) _ak_follow_list $2; exit;;
- -u | --unfollow) _ak_follow_unfollow $2; exit;;
- * ) _ak_usage;;
- esac
-else _ak_usage
-fi
diff --git a/modules/follow/main.sh b/modules/follow/main.sh
new file mode 100755
index 0000000..75be507
--- /dev/null
+++ b/modules/follow/main.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+##
+## You can maintain a list of friendly zchains or ids
+##
+## Usage:
+##
+## -h, --help Prints this help message
+##
+## -f, --follow Adds a ... to your follow list
+##
+## -l, --list Shows a list of your followings
+##
+## -u, --unfollow Unfollows a ...
+##
+fullprogrampath="$(realpath $0)"
+PROGRAM="$(realpath $0 | rev |cut -d '/' -f 2 | rev)"
+descriptionString="Following stuff"
+
+source $AK_LIBDIR/_ak_log
+source $AK_LIBDIR/_ak_script
+source $AK_MODULESDIR/$PROGRAM/lib.sh
+
+if [ ! -z $1 ]
+then
+ case $1 in
+ -h | --help) _ak_usage; exit;;
+ -f | --follow) _ak_follow_follow $2; exit;;
+ -l | --list) _ak_follow_list $2; exit;;
+ -u | --unfollow) _ak_follow_unfollow $2; exit;;
+ * ) _ak_usage;;
+ esac
+else _ak_usage
+fi