CRUST DIY instructions & discussions

I tend to run the exe directly so cd into the target/debug/examples/ dir and run the example direct. This is in debug so slower than release but handy. You can also compile in release mode to see it as users will (faster, less output)

2 Likes

Modified OP for easier reading.

2 Likes

ok - just for clarification - i started the first node … this seems to be the central node
and all the other nodes are only connected to this node …? and the other nodes can’t communicate with each other …? or did i configure something not/wrong …?

and I started 2 receivers plus one sender - the messages were only sent to the first receiver - that is how it is meant i suppose …?

it is extremely cool that everything just works out of the box (if you install the nightly rust version and not the 1.0 :wink: ) nodes go online and connect to the central node and messages get delivered - but it isn’t a grid yet - is it …? or is it not meant to be a grid and there are always central nodes necessary …?

sorry for having so many questions … i should probably look for some documentation to read before asking stupid questions ;D … i’ll try to do that soon [promise]

That’s right CRUST itself is not able to provide routing info. When you add routing to this (in the routing examples) then you see the interconnect of machines to talk to each other. Then we add vaults and they talk in a language that securely stores data etc. This is a good way to discover the whole process as we release bits at a time and as you say critical it’s an out of the box experience. Shows progress as well nicer than a roadmap alone (which we are updating).

5 Likes

Pretty neat…I’m interested to see how this all goes together.

Hey all, I’m trying compiling on an odroid c1, and I’m getting a bunch of mismatched type errors:

    found enum `core::result::Result`) [E0308]

/home/odroid/.multirust/toolchains/unofficial-nightly/cargo/registry/src/github.com-1285ae84e5963aae/asynchronous-0.4.5/src/lib.rs:143 tx.send(f())
^~~~~~~~~~~~
/home/odroid/.multirust/toolchains/unofficial-nightly/cargo/registry/src/github.com-1285ae84e5963aae/asynchronous-0.4.5/src/lib.rs:201:13: 204:15 error: mismatched types:
expected (),
found core::result::Result<(), std::sync::mpsc::SendError<core::result::Result<TT, EE>>>
(expected (),
found enum core::result::Result) [E0308]

Any idea why? (i set up rust via GitHub - japaric-archived/ruststrap: [SUPERSEDED] by https://github.com/warricksothr/RustBuild )

Have you checked if Rust supports the C1 processor (presumably ARMv7 or something?).

Yeh, that’s why I had to go down this ruststrap route (at least I think that means that it works), the toolchain and the first steps listed in the repo all come out okay. Hmmm. I’ll ping the ruststrap dev about it too and see if anything turns up.

3 Likes

Great work. I’m very keen to hear how you get on!

Hmm. Okay, so I’ve only got rust 1.0.0 not nightly, and trying to install anything else is proving a pain. I’m keen to play around so I’m just going to default to the mac. Here’s hoping that’s simpler.

Just to note in the instructions above (op), you’ve an em-dash where there should be two hyphens. I just realised after playing with self-encryption.

On a related note:
Are these in the wiki? I’d be happy to fire in and edit myself (if I’m able/allowed?)

Okay, so my simple_sender just bugged out with:

New connection made to Tcp(V4(127.0.0.1:8888))
thread 'SimpleSender event handler' panicked at 'cannot access stdout during shutdown'

It also, when not throwing errors, doesn’t appear to give anywhere near as much output as above; it only seems to make one connection and then die, right now. (OSX, Yosemite; can provide more info if it interests)

1 Like

ubuntu 15.04

  mranderson@neo:~/crust$ cargo run --example crust_node
       Compiling crust v0.0.8 (file:///home/mranderson/crust)
    
    error: linking with `cc` failed: exit code: 1
    note: "cc" "-Wl,--as-needed" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/mranderson/crust/target/debug/examples/crust_node.o" "-o" "/home/mranderson/crust/target/debug/examples/crust_node" "-Wl,--whole-archive" "-l" "morestack" "-Wl,--no-whole-archive" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "/home/mranderson/crust/target/debug/libcrust.rlib" "/home/mranderson/crust/target/debug/deps/libcbor-a029b1d21f636c96.rlib" "/home/mranderson/crust/target/debug/deps/libsodiumoxide-a4232303ae15c797.rlib" "/home/mranderson/crust/target/debug/deps/libdocopt-40f44425b0f8ac23.rlib" "/home/mranderson/crust/target/debug/deps/librustc_serialize-9ef26f158d5284e0.rlib" "/home/mranderson/crust/target/debug/deps/libasynchronous-e3362aaa40f64b19.rlib" "/home/mranderson/crust/target/debug/deps/libterm-1a85d6dfb646e607.rlib" "/home/mranderson/crust/target/debug/deps/libbyteorder-b315ab53bf71328b.rlib" "/home/mranderson/crust/target/debug/deps/liblibsodium_sys-a15ae7085732209a.rlib" "/home/mranderson/crust/target/debug/deps/librand-b924d9fc5b3eb5b8.rlib" "/home/mranderson/crust/target/debug/deps/libnum_cpus-d64cdaf0c78cf4e8.rlib" "/home/mranderson/crust/target/debug/deps/libtime-e758cbe877e9589d.rlib" "/home/mranderson/crust/target/debug/deps/liblibc-2eda841eb12a3090.rlib" "/home/mranderson/crust/target/debug/deps/libstrsim-fb046b3f6ce0ea34.rlib" "/home/mranderson/crust/target/debug/deps/libregex-bee3bd02b59b955b.rlib" "/home/mranderson/crust/target/debug/deps/libregex_syntax-030d2a219106b7e6.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-11582ce5.rlib" "-L" "/home/mranderson/crust/target/debug" "-L" "/home/mranderson/crust/target/debug/deps" "-L" "/home/mranderson/crust/target/debug/build/time-e758cbe877e9589d/out" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/mranderson/crust/.rust/lib/x86_64-unknown-linux-gnu" "-L" "/home/mranderson/crust/lib/x86_64-unknown-linux-gnu" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-l" "sodium" "-l" "rt" "-l" "c" "-l" "m" "-l" "dl" "-l" "pthread" "-l" "rt" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "compiler-rt"
    note: /usr/bin/ld: cannot find -lsodium
    collect2: error: ld returned 1 exit status
    
    error: aborting due to previous error
    Could not compile `crust`.

and

mranderson@neo:~/crust$ cargo run --example simple_receiver
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading libsodium-sys v0.0.5
 Downloading sodiumoxide v0.0.4
 Downloading term v0.2.7
   Compiling libsodium-sys v0.0.5
   Compiling regex-syntax v0.1.1
   Compiling gcc v0.3.5
   Compiling byteorder v0.3.10
   Compiling rustc-serialize v0.3.14
   Compiling libc v0.1.8
   Compiling strsim v0.3.0
   Compiling term v0.2.7
   Compiling num_cpus v0.2.6
   Compiling rand v0.3.8
   Compiling time v0.1.25
   Compiling asynchronous v0.4.5
   Compiling regex v0.1.33
   Compiling sodiumoxide v0.0.4
   Compiling cbor v0.3.6
   Compiling docopt v0.6.64
   Compiling crust v0.0.8 (file:///home/mranderson/crust)
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/mranderson/crust/target/debug/examples/simple_receiver.o" "-o" "/home/mranderson/crust/target/debug/examples/simple_receiver" "-Wl,--whole-archive" "-l" "morestack" "-Wl,--no-whole-archive" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "/home/mranderson/crust/target/debug/libcrust.rlib" "/home/mranderson/crust/target/debug/deps/libcbor-a029b1d21f636c96.rlib" "/home/mranderson/crust/target/debug/deps/libsodiumoxide-a4232303ae15c797.rlib" "/home/mranderson/crust/target/debug/deps/librustc_serialize-9ef26f158d5284e0.rlib" "/home/mranderson/crust/target/debug/deps/libasynchronous-e3362aaa40f64b19.rlib" "/home/mranderson/crust/target/debug/deps/libbyteorder-b315ab53bf71328b.rlib" "/home/mranderson/crust/target/debug/deps/liblibsodium_sys-a15ae7085732209a.rlib" "/home/mranderson/crust/target/debug/deps/librand-b924d9fc5b3eb5b8.rlib" "/home/mranderson/crust/target/debug/deps/libnum_cpus-d64cdaf0c78cf4e8.rlib" "/home/mranderson/crust/target/debug/deps/libtime-e758cbe877e9589d.rlib" "/home/mranderson/crust/target/debug/deps/liblibc-2eda841eb12a3090.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-11582ce5.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-11582ce5.rlib" "-L" "/home/mranderson/crust/target/debug" "-L" "/home/mranderson/crust/target/debug/deps" "-L" "/home/mranderson/crust/target/debug/build/time-e758cbe877e9589d/out" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/mranderson/crust/.rust/lib/x86_64-unknown-linux-gnu" "-L" "/home/mranderson/crust/lib/x86_64-unknown-linux-gnu" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-l" "sodium" "-l" "rt" "-l" "c" "-l" "m" "-l" "dl" "-l" "pthread" "-l" "rt" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "compiler-rt"
note: /usr/bin/ld: cannot find -lsodium
collect2: error: ld returned 1 exit status

error: aborting due to previous error
Could not compile `crust`.

and it seemed I successfully installed sodium before?

PASS: aead_chacha20poly1305
PASS: auth
PASS: auth2
PASS: auth3
PASS: auth5
PASS: auth6
PASS: auth7
PASS: box
PASS: box2
PASS: box7
PASS: box8
PASS: box_easy
PASS: box_easy2
PASS: box_seal
PASS: box_seed
PASS: chacha20
PASS: core1
PASS: core2
PASS: core3
PASS: core4
PASS: core5
PASS: core6
PASS: ed25519_convert
PASS: generichash
PASS: generichash2
PASS: generichash3
PASS: hash
PASS: hash3
PASS: onetimeauth
PASS: onetimeauth2
PASS: onetimeauth7
PASS: pwhash
PASS: pwhash_scrypt_ll
PASS: randombytes
PASS: scalarmult
PASS: scalarmult2
PASS: scalarmult5
PASS: scalarmult6
PASS: scalarmult7
PASS: secretbox
PASS: secretbox2
PASS: secretbox7
PASS: secretbox8
PASS: secretbox_easy
PASS: secretbox_easy2
PASS: shorthash
PASS: sign
PASS: sodium_core
PASS: sodium_utils
PASS: sodium_version
PASS: stream
PASS: stream2
PASS: stream3
PASS: stream4
PASS: verify1
PASS: sodium_utils2
PASS: sodium_utils3
============================================================================
Testsuite summary for libsodium 1.0.3
============================================================================
# TOTAL: 57
# PASS:  57
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

This link re: Upgraded to Ubuntu 14.10. Now git clone fails
may help if git clone fails.

Basically go into /usr/local and delete all libgmp.* and reinstall git if needed.

I get
no example target named crust_node

however cargo run --example crust_peer works just fine,

Im using nightly so I assume the file name has changed since this was written 3 weeks ago.
Early days but this looks as if it is working (sort of) across the LAN to/from my wifi connected laptop.
Next step is to install the routing and encryption on laptop and PC (Ubuntu 14.04 and 15.04).
Then I will try to install on my Centos 7 server - if that goes OK I’ll post whatever workarounds I needed and that can form the basis for instructions for RedHat and Fedora variants.
Thanks for the tutorials - its looking good :smile:

Ah sorry - it’s now called crust_peer It changed on Friday so now is cross platform LAN aware. Nice catch

2 Likes

wow that was quick!!

OK I’ll report back later with progress on the Centos box.
I encrypted some photos OK but failed to decrypt but its prob something stupid like a path issue.

Yea the encrypt example is a very simple one, we will probably do a wee test app for multiple files and dirs when we get a chance. Of course very soon you will have a full working client that does all that for you :slight_smile: (end of this sprint)

8 Likes

short feedback - newly installed ubuntu 15.04 VM:

  1. had to use the options listed on the rust-website
    curl -sSf https://static.rust-lang.org/rustup.sh | sudo sh -s – --channel=nightly
    (i think the additional S is necessary at least because of the su-rights and you have to enter the password)

  2. cargo run —example crust_node >>> cargo run —example crust_peer
    oh there was some activity while i was busy :open_mouth: … sorry didn’t want to report it a second time :smiley:

  3. works perfect without a problem

ps: when i stop the first started node before the others the “slave nodes” don’t realize that and the master node doesn’t really stop (it says it would have stoppen and then the terminal still isn’t usable)

2 Likes

feedback on Centos 7 install

install was initially pretty straightforward except I had to add

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib

to /etc/profile to get around
rustc: error while loading shared libraries: librustc-4e7c5e5c.so: cannot open shared object file: No such file or directory
rustc cannot find librustc when installed with rustup.sh
when I ran cargo run —example crust_peer for the first time,
However when I opened several terminals each only displayed its own instance. :disappointed:
This was all run over ssh connections, this server is normally headless.
I will try again tomorrow when I hook a monitor and keybd up to it and work directly on the server.
Likewise routing appeared to install OK without errors but again each instance only saw itself, no others.
I did not try encryption yet - another task for after work tomorrow,

2 Likes