From a20fcc376f54f8d76bbdd17be759a931c568cd5e Mon Sep 17 00:00:00 2001 From: asabya Date: Fri, 10 Feb 2023 11:28:59 +0530 Subject: [PATCH 1/3] add file mode explainer --- text/0061-personal-storage.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/text/0061-personal-storage.md b/text/0061-personal-storage.md index 65f2019..20b1858 100644 --- a/text/0061-personal-storage.md +++ b/text/0061-personal-storage.md @@ -111,7 +111,7 @@ export interface FileMetadata { accessTime: number modificationTime: number fileInodeReference: string // base64 encoded content address - mode: number // Unix file permission; access mode representing read, write and execute permissions on file for user, usergroup and everyone else in form of 3 octals. Default: 0600 + mode: number } ``` @@ -144,7 +144,7 @@ interface Directory { creationTime: number modificationTime: number accessTime: number - mode: number // 3 octals of unix file permission. default is 0700 + mode: number } fileOrDirNames: string[] | null } @@ -157,6 +157,14 @@ The file and directory metadata are encrypted with AES using the password of the The file itself is encrypted by the storage which must return an additional encryption key next to the file reference. This key and the reference is encoded in the `reference.swarm` and `fileInodeReference` properties. +### Modes in metadata + +`mode` is the result of bitwise OR operation of file type and file permissions bits. + +File type represents the classification of a file based on its contents, format or structure. File types can include regular files, directories, symbolic links, sockets, and special files such as block and character devices. Default: 0100000 for regular file and 0040000 for directory. Other type can be found [here](https://pubs.opengroup.org/onlinepubs/7908799/xsh/sysstat.h.html). + +File permission represents read, write and execute permissions on file for user, usergroup and everyone else in form of 3 octals. Default: 0600 for file and 0700 for directory. + ## Addressing In order to address pods, files and directories, the concept leverages the Swarm Epoch-based Feeds. From af2d4f5846e1a06835e4d2d33fd13755a040811e Mon Sep 17 00:00:00 2001 From: asabya Date: Fri, 17 Nov 2023 13:06:19 +0530 Subject: [PATCH 2/3] feat: unlimited-number-of-pods-files-directories --- ...imited-number-of-pods-files-directories.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 text/0000-unlimited-number-of-pods-files-directories.md diff --git a/text/0000-unlimited-number-of-pods-files-directories.md b/text/0000-unlimited-number-of-pods-files-directories.md new file mode 100644 index 0000000..4e96c8c --- /dev/null +++ b/text/0000-unlimited-number-of-pods-files-directories.md @@ -0,0 +1,39 @@ +- FIP: (Number, to be assigned) +- title: Create unlimited number of pods +- author: (Sabyasachi Patra, @asabya) +- status: draft +- created: (2023-11-17) + +# Summary +This proposal is to create unlimited number of pods. + +# Context, motivation and guide level explanation +We store pod list in a single chunk. This limits the number of pods as a single chunk size is 4096 bytes. + +This proposal solves that by storing pod list as a file. This will allow us to create unlimited number of pods. + +We already have a working file uploading mechanism for both fairOS-dfs and fdp-storage. We can use that to upload the pod list file in a new topic `PodsV2`. + +# Reference-level explanation +Technical explanation that explains the design in sufficient detail that interaction with other systems is clear and it is reasonably clear how it would get implemented. Corner case should be covered with examples. + +- we create a new topic `PodsV2`. +- we create a new file object with user's root account and no podname. +- we upload the pod list content with `PodsV2` as filename, `/` as path and user root account private key as podPassword. +- we set the min block size to `1000000` and `gzip` as compression type + +Pseudo code: + +``` +f2 := f.NewFile(beeClient, podRootFeed, rootAccountAddress) +privKey := pod.getAccount().GetPrivateKey() +f2.Upload(podList, "PodsV2", 1000000, "gzip", privKey) +``` + +### Why such approach? +In fairOS-dfs we can update file content given an offset. This allows us to update the pod list file without having to upload the entire file again. + +We do not break anything. We read the previous list and update with this proposed solution at runtime with whatever logic is required. +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From aab3f313ef9e09907a9441e4afd5dd571979fe2b Mon Sep 17 00:00:00 2001 From: asabya Date: Fri, 17 Nov 2023 13:15:07 +0530 Subject: [PATCH 3/3] fix: fip number --- ...pods-files-directories.md => 0074-unlimited-number-of-pods.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename text/{0000-unlimited-number-of-pods-files-directories.md => 0074-unlimited-number-of-pods.md} (100%) diff --git a/text/0000-unlimited-number-of-pods-files-directories.md b/text/0074-unlimited-number-of-pods.md similarity index 100% rename from text/0000-unlimited-number-of-pods-files-directories.md rename to text/0074-unlimited-number-of-pods.md