Aditya Kulkarni 5 years ago
parent
commit
6d2251ecd1
  1. 6
      README.md
  2. 2
      cli/Cargo.toml
  3. 10
      cli/src/main.rs
  4. 4
      docker/Dockerfile
  5. 2
      qtlib/src/lib.rs

6
README.md

@ -5,12 +5,12 @@ zecpaperwallet is a Zcash Sapling paper wallet generator that can run completely
zecpaperwallet is available as pre-built binaries from our [release page](https://github.com/adityapk00/zecpaperwallet/releases). Download the zip file for your platform, extract it and run the `./zecpaperwallet` binary.
# Generating wallets
To generate a zcash paper wallet, simply run `./zecpaperwallet`
To generate a Zcash paper wallet, simply run `./zecpaperwallet`
You'll be asked to type some random characters that will add entropy to the random number generator. Run with `--help` to see all options
## Saving as PDFs
To generate a zcash paper wallet and save it as a PDF, run
To generate a Zcash paper wallet and save it as a PDF, run
`./zecpaperwallet -z 3 --format pdf zecpaper-output.pdf`
This will generate 3 shielded z-addresses and their corresponding private keys, and save them in a PDF file called `zecpaper-output.pdf`
@ -20,7 +20,7 @@ zecpaperwallet is built with rust. To compile from source, you [install Rust](ht
```
curl https://sh.rustup.rs -sSf | sh
```
Chekout the zecpaperwallet repository and build the CLI
Checkout the zecpaperwallet repository and build the CLI
```
git clone https://github.com/adityapk00/zecpaperwallet.git
cd zecpaperwallet/cli

2
cli/Cargo.toml

@ -5,7 +5,7 @@ authors = ["ZecWallet"]
edition = "2018"
[dependencies]
clap = "~2.33"
clap = "2.33.0"
zecpaperlib = { path = "../lib" }
json = "0.11.14"
printpdf = "0.2.8"

10
cli/src/main.rs

@ -62,6 +62,16 @@ fn main() {
let nohd: bool = matches.is_present("nohd");
// Get the filename and output format
let filename = matches.value_of("output");
let format = matches.value_of("format").unwrap();
// Writing to PDF requires a filename
if format == "pdf" && filename.is_none() {
eprintln!("Need an output file name when writing to PDF");
return;
}
// Get user entropy.
let mut entropy: Vec<u8> = Vec::new();
// If the user hasn't specified any, read from the stdin

4
docker/Dockerfile

@ -1,5 +1,5 @@
FROM rust:1.34
LABEL Description="Rust compile env for linux + windows (cross)"
LABEL Description="Rust compile env for Linux + Windows (cross)"
RUN apt update
RUN apt install -y build-essential mingw-w64 gcc-aarch64-linux-gnu
@ -8,7 +8,7 @@ RUN rustup target add x86_64-pc-windows-gnu
RUN rustup target add x86_64-unknown-linux-musl
RUN rustup target add aarch64-unknown-linux-gnu
# Append the linker to the cargo config for windows cross compile
# Append the linker to the cargo config for Windows cross compile
RUN echo "[target.x86_64-pc-windows-gnu]" >> /usr/local/cargo/config && \
echo "linker = '/usr/bin/x86_64-w64-mingw32-gcc'" >> /usr/local/cargo/config

2
qtlib/src/lib.rs

@ -20,7 +20,7 @@ pub extern fn rust_generate_wallet(testnet: bool, zcount: u32, tcount: u32, entr
}
/**
* Callers that recieve string return values from other functions should call this to return the string
* Callers that receive string return values from other functions should call this to return the string
* back to rust, so it can be freed. Failure to call this function will result in a memory leak
*/
#[no_mangle]

Loading…
Cancel
Save