1
0
Fork 0
mirror of synced 2025-09-23 20:28:36 +00:00

Update docs, set stdlib-path as optional parameter

This commit is contained in:
dark64 2020-06-30 13:57:02 +02:00
parent 2ca237be84
commit 4c2a1fc74b
5 changed files with 11 additions and 13 deletions

View file

@ -4,9 +4,10 @@ MAINTAINER JacobEberhardt <jacob.eberhardt@tu-berlin.de>, Thibaut Schaeffer <thi
RUN useradd -u 1000 -m zokrates RUN useradd -u 1000 -m zokrates
ARG RUST_TOOLCHAIN=nightly-2020-01-01
ENV WITH_LIBSNARK=1 ENV WITH_LIBSNARK=1
ENV ZOKRATES_HOME=/home/zokrates/.zokrates
ARG RUST_TOOLCHAIN=nightly-2020-01-01
ARG ZOKRATES_HOME=/home/zokrates/.zokrates
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \ ca-certificates \

View file

@ -5,7 +5,6 @@ MAINTAINER JacobEberhardt <jacob.eberhardt@tu-berlin.de>, Thibaut Schaeffer <thi
RUN useradd -u 1000 -m zokrates RUN useradd -u 1000 -m zokrates
ENV WITH_LIBSNARK=1 ENV WITH_LIBSNARK=1
ENV ZOKRATES_HOME=/home/zokrates/ZoKrates/zokrates_stdlib/stdlib/
COPY ./scripts/install_libsnark_prerequisites.sh /tmp/ COPY ./scripts/install_libsnark_prerequisites.sh /tmp/
RUN /tmp/install_libsnark_prerequisites.sh RUN /tmp/install_libsnark_prerequisites.sh

View file

@ -1,6 +1,6 @@
## Standard library ## Standard library
ZoKrates comes with a number of reusable components which are defined at `./stdlib/` in the ZoKrates root repository. In order to import the standard library as described in the [imports](./imports.html) section the `$ZOKRATES_HOME` environment variable needs to be set to the `stdlib` folder. The standard library is solely based on the ZoKrates DSL and can be easily extended. ZoKrates comes with a number of reusable components which are defined at `./stdlib/` in the ZoKrates root repository. In order to import the standard library as described in the [imports](./imports.html) section, the `--stdlib-path` argument needs to be set to the `stdlib` folder in the compilation step. The standard library is solely based on the ZoKrates DSL and can be easily extended.
The following section highlights a subset of available imports: The following section highlights a subset of available imports:

View file

@ -1,8 +1,5 @@
# Testing # Testing
Before running any tests, make sure your `ZOKRATES_HOME` environment variable is set correctly.
It has to point to `zokrates_stdlib/stdlib/`
## Unit tests ## Unit tests
In ZoKrates, unit tests comprise of In ZoKrates, unit tests comprise of
- internal tests for all zokrates crates - internal tests for all zokrates crates
@ -23,15 +20,14 @@ cargo test --release
Integration tests are excluded from `cargo test` by default. Integration tests are excluded from `cargo test` by default.
They are defined in the `zokrates_cli` crate in `integration.rs` and use the test cases specified in `zokrates_cli/tests/code`. They are defined in the `zokrates_cli` crate in `integration.rs` and use the test cases specified in `zokrates_cli/tests/code`.
Before running integration tests: Before running integration tests, make sure:
1. Make sure your `$ZOKRATES_HOME` is set correctly 1. You have [solc](https://github.com/ethereum/solc-js) installed and in your `$PATH`.
2. You have [solc](https://github.com/ethereum/solc-js) installed and in your `$PATH`.
Solc can conveniently be installed through `npm` by running Solc can conveniently be installed through `npm` by running
``` ```
npm install -g solc npm install -g solc
``` ```
3. You have an Ethereum node running on localhost with a JSON-RPC interface on the default port 8545 (`http://localhost:8545`). 2. You have an Ethereum node running on localhost with a JSON-RPC interface on the default port 8545 (`http://localhost:8545`).
Integration tests can then be run with the following command: Integration tests can then be run with the following command:

View file

@ -439,7 +439,8 @@ fn cli() -> Result<(), String> {
.help("Path to the standard library") .help("Path to the standard library")
.value_name("PATH") .value_name("PATH")
.takes_value(true) .takes_value(true)
.required(true) .required(false)
.default_value("")
).arg(Arg::with_name("abi_spec") ).arg(Arg::with_name("abi_spec")
.short("s") .short("s")
.long("abi_spec") .long("abi_spec")
@ -484,7 +485,8 @@ fn cli() -> Result<(), String> {
.help("Path to the standard library") .help("Path to the standard library")
.value_name("PATH") .value_name("PATH")
.takes_value(true) .takes_value(true)
.required(true) .required(false)
.default_value("")
).arg(Arg::with_name("curve") ).arg(Arg::with_name("curve")
.short("c") .short("c")
.long("curve") .long("curve")