Skip to content

Instantly share code, notes, and snippets.

@ianamunoz
Created June 13, 2018 14:12
Show Gist options
  • Select an option

  • Save ianamunoz/32acaf8e1faf80d45f8417114405bf63 to your computer and use it in GitHub Desktop.

Select an option

Save ianamunoz/32acaf8e1faf80d45f8417114405bf63 to your computer and use it in GitHub Desktop.
Run Sapling MPC on OSX
I have the feeling it has only been tested on Linux. I use macOS and are seeing issues with the code.
MacBook-Pro-2011:~ rex$ git clone https://github.com/zcash-hackworks/sapling-mpc.git
Cloning into 'sapling-mpc'...
remote: Counting objects: 35, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 35 (delta 16), reused 31 (delta 12), pack-reused 0
Unpacking objects: 100% (35/35), done.
MacBook-Pro-2011:~ rex$ cd sapling-mpc/
MacBook-Pro-2011:sapling-mpc rex$ mv /Users/rex/Downloads/params.dms /Users/rex/sapling-mpc
MacBook-Pro-2011:sapling-mpc rex$ ls
COPYRIGHT Cargo.lock Cargo.toml LICENSE-APACHE LICENSE-MIT README.md params.dms src
MacBook-Pro-2011:sapling-mpc rex$ cargo run --release --bin compute
warning: unused manifest key: bin.required-features
warning: unused manifest key: bin.required-features
Compiling byteorder v1.2.3
Compiling constant_time_eq v0.1.3
Compiling nodrop v0.1.12
Compiling futures v0.1.21
Compiling bit-vec v0.4.4
Compiling libc v0.2.40
Compiling crossbeam v0.3.2
Compiling arrayvec v0.4.7
Compiling rand v0.4.2
Compiling num_cpus v1.8.0
Compiling blake2-rfc v0.2.18
Compiling pairing v0.14.2
Compiling futures-cpupool v0.1.8
Compiling bellman v0.1.0
Compiling phase2 v0.2.2
Compiling sapling-mpc v0.2.0 (file:///Users/rex/sapling-mpc)
error: couldn't read "src/compute.rs": No such file or directory (os error 2)
error: aborting due to previous error
error: Could not compile `sapling-mpc`.
To learn more, run the command again with --verbose.
MacBook-Pro-2011:sapling-mpc rex$ cargo run --verbose --release --bin compute
warning: unused manifest key: bin.required-features
warning: unused manifest key: bin.required-features
Fresh byteorder v1.2.3
Fresh crossbeam v0.3.2
Fresh bit-vec v0.4.4
Fresh nodrop v0.1.12
Fresh futures v0.1.21
Fresh libc v0.2.40
Fresh constant_time_eq v0.1.3
Fresh arrayvec v0.4.7
Fresh num_cpus v1.8.0
Fresh rand v0.4.2
Fresh blake2-rfc v0.2.18
Fresh futures-cpupool v0.1.8
Fresh pairing v0.14.2
Fresh bellman v0.1.0
Fresh phase2 v0.2.2
Compiling sapling-mpc v0.2.0 (file:///Users/rex/sapling-mpc)
Running `rustc src/compute.rs --crate-name compute --crate-type bin -C opt-level=3 -C metadata=5299b2242b85a820 -C extra-filename=-5299b2242b85a820 --out-dir /Users/rex/sapling-mpc/target/release/deps --emit=dep-info,link -L dependency=/Users/rex/sapling-mpc/target/release/deps --extern blake2_rfc=/Users/rex/sapling-mpc/target/release/deps/libblake2_rfc-f3f2fbda7fa73d19.rlib --extern phase2=/Users/rex/sapling-mpc/target/release/deps/libphase2-b10959643bee17da.rlib --extern pairing=/Users/rex/sapling-mpc/target/release/deps/libpairing-1483ea75bc0d4ee5.rlib --extern rand=/Users/rex/sapling-mpc/target/release/deps/librand-094dba6954ac7308.rlib`
error: couldn't read "src/compute.rs": No such file or directory (os error 2)
error: aborting due to previous error
error: Could not compile `sapling-mpc`.
Caused by:
process didn't exit successfully: `rustc src/compute.rs --crate-name compute --crate-type bin -C opt-level=3 -C metadata=5299b2242b85a820 -C extra-filename=-5299b2242b85a820 --out-dir /Users/rex/sapling-mpc/target/release/deps --emit=dep-info,link -L dependency=/Users/rex/sapling-mpc/target/release/deps --extern blake2_rfc=/Users/rex/sapling-mpc/target/release/deps/libblake2_rfc-f3f2fbda7fa73d19.rlib --extern phase2=/Users/rex/sapling-mpc/target/release/deps/libphase2-b10959643bee17da.rlib --extern pairing=/Users/rex/sapling-mpc/target/release/deps/libpairing-1483ea75bc0d4ee5.rlib --extern rand=/Users/rex/sapling-mpc/target/release/deps/librand-094dba6954ac7308.rlib` (exit code: 101)
So the first problem is that the code is trying to find the file compute.rs under src/comute.rs although the actual path is /src/bin/compute.rs
So I copied the contents of the /bin folder to /src so that it can find the file(s).
MacBook-Pro-2011:sapling-mpc rex$ cargo run --release --bin compute
warning: unused manifest key: bin.required-features
warning: unused manifest key: bin.required-features
Finished release [optimized] target(s) in 0.0 secs
Running `target/release/compute`
thread 'main' panicked at 'couldn't open `./params`: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
MacBook-Pro-2011:sapling-mpc rex$ RUST_BACKTRACE=1 cargo run --release --bin compute
warning: unused manifest key: bin.required-features
warning: unused manifest key: bin.required-features
Finished release [optimized] target(s) in 0.0 secs
Running `target/release/compute`
thread 'main' panicked at 'couldn't open `./params`: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:945:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
1: std::sys_common::backtrace::print
2: std::panicking::default_hook::{{closure}}
3: std::panicking::default_hook
4: std::panicking::rust_panic_with_hook
5: std::panicking::begin_panic_fmt
6: rust_begin_unwind
7: core::panicking::panic_fmt
8: core::result::unwrap_failed
9: compute::main
10: std::rt::lang_start::{{closure}}
11: std::panicking::try::do_call
12: __rust_maybe_catch_panic
13: std::rt::lang_start_internal
14: main
Now it cannot seem to find the ./params file.
I had to manually rename it from params.dms to params.
MacBook-Pro-2011:sapling-mpc rex$ mv params.dms params
MacBook-Pro-2011:sapling-mpc rex$ cargo run --release --bin compute
warning: unused manifest key: bin.required-features
warning: unused manifest key: bin.required-features
Finished release [optimized] target(s) in 0.0 secs
Running `target/release/compute`
Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment