Safe Network storage - TreeCRDT filesystem PoC

Here’s something kinda fun to play with.

Using this, @davidrusu and I were able to collaboratively mount a file system (as a linux FUSE FS) from different countries and jointly edit a file, eg with vi.

9 Likes

OK @aatonnomicc, this has solved the problem of how to make up the schedule for the Safe Testneters Dehydration Prevention Team (Glasgow Division) Winter Solstice Meeting without us actually having to meet in the pub.

I expect your proposals within the hour.

If this fails, then the Lauriston at 8 on Friday for another planning meeting, OK?

3 Likes

I failed at building this… any hints?
rustc 1.74.0 (79e9716c9 2023-11-13)

  Compiling brb v1.0.10
error[E0432]: unresolved imports `brb_membership::Actor`, `brb_membership::Sig`, `brb_membership::SigningActor`
  --> /home/willie/.cargo/registry/src/index.crates.io-6f17d22bba15001f/brb-1.0.10/src/lib.rs:16:26
   |
16 | pub use brb_membership::{Actor, Error as MembershipError, Sig, SigningActor};
   |                          ^^^^^                            ^^^  ^^^^^^^^^^^^ no `SigningActor` in the root
   |                          |                                |
   |                          no `Actor` in the root           no `Sig` in the root
   |
   = help: consider importing this trait instead:
           crdts::Actor

error[E0432]: unresolved imports `brb_membership::Actor`, `brb_membership::Sig`, `brb_membership::SigningActor`
  --> /home/willie/.cargo/registry/src/index.crates.io-6f17d22bba15001f/brb-1.0.10/src/deterministic_brb.rs:31:28
   |
31 | use brb_membership::{self, Actor, Generation, Sig, SigningActor};
   |                            ^^^^^              ^^^  ^^^^^^^^^^^^ no `SigningActor` in the root
   |                            |                  |
   |                            |                  no `Sig` in the root
   |                            no `Actor` in the root
   |
   = help: consider importing one of these items instead:
           crate::Actor
           crdts::Actor
   = help: consider importing this unresolved item through its public re-export instead:
           crate::Sig
   = help: consider importing this unresolved item through its public re-export instead:
           crate::SigningActor

error[E0432]: unresolved import `brb_membership::signature`
  --> /home/willie/.cargo/registry/src/index.crates.io-6f17d22bba15001f/brb-1.0.10/src/error.rs:14:5
   |
14 | use brb_membership::signature;
   |     ^^^^^^^^^^^^^^^^---------
   |     |               |
   |     |               help: a similar name exists in the module (notice the capitalization): `Signature`
   |     no `signature` in the root

error[E0433]: failed to resolve: could not find `actor` in `brb_membership`
  --> /home/willie/.cargo/registry/src/index.crates.io-6f17d22bba15001f/brb-1.0.10/src/net.rs:27:25
   |
27 | pub use brb_membership::actor::ed25519::{Actor, Sig, SigningActor};
   |                         ^^^^^ could not find `actor` in `brb_membership`

error[E0432]: unresolved imports `brb_membership::Actor`, `brb_membership::Sig`
  --> /home/willie/.cargo/registry/src/index.crates.io-6f17d22bba15001f/brb-1.0.10/src/error.rs:15:22
   |
15 | use brb_membership::{Actor, Generation, Sig};
   |                      ^^^^^              ^^^ no `Sig` in the root
   |                      |
   |                      no `Actor` in the root
   |
   = help: consider importing one of these items instead:
           crate::Actor
           crdts::Actor
   = help: consider importing this unresolved item through its public re-export instead:
           crate::Sig

error[E0432]: unresolved import `brb_membership::SigningActor`
  --> /home/willie/.cargo/registry/src/index.crates.io-6f17d22bba15001f/brb-1.0.10/src/net.rs:28:5
   |
28 | use brb_membership::SigningActor as SigningActorTrait;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `SigningActor` in the root
   |
help: consider importing this unresolved item through its public re-export instead
   |
28 | use crate::SigningActor as SigningActorTrait;
   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   Compiling sn_fs v0.1.0 (https://github.com/dan-da/sn_fs.git?branch=sn_fs_library_pr#0a9ac6e2)
Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `brb` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0433]: failed to resolve: could not find `actor` in `brb_membership`
  --> /home/willie/.cargo/git/checkouts/sn_fs-253085697d031d1c/0a9ac6e/src/fs_tree_types.rs:15:38
   |
15 | pub type ActorType = brb_membership::actor::ed25519::Actor;
   |                                      ^^^^^ could not find `actor` in `brb_membership`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `sn_fs` (lib) due to previous error
willie@gagarin:~/projects/maidsafe/brb_node_snfs$

It seems that some deps had breaking changes.

Luckily, I still had an old tree sitting around with a Cargo.lock file that references correct/working dependency versions. I just committed that file, so if you git pull and rebuild it should build.

4 Likes

yep that worked :slight_smile:

got a warning, but in keeping with the Thoughts of the Great Helmsman, field ‘clock’ is never used.

 Compiling brb_node_snfs v1.0.4 (/home/willie/projects/maidsafe/brb_node_snfs)
warning: field `clock` is never read
  --> src/brb_node_snfs.rs:58:5
   |
56 | struct SharedBRB {
   |        --------- field in this struct
57 |     brb: Arc<Mutex<BRB>>,
58 |     clock: Clock<Actor>,
   |     ^^^^^
   |
   = note: `SharedBRB` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: `brb_node_snfs` (bin "brb_node_snfs") generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 57.23s

Excellent README btw - if I can get around the NAT problem that has haunted me recently, I will def try this later.

@moderators please can you move this and the replies to a topic such as “Safe Network storage - TreeCRDT filesystem PoC”. Thanks.

1 Like

fixed now.

2 Likes