You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-30Lines changed: 22 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -19,35 +19,47 @@ Features:
19
19
20
20
To learn more about ZKFlow internals, there is a [docs](docs) directory in this repo. In addition to the [ZKFLow white paper](docs/ZKFlow_whitepaper.pdf), it contains technical documentation in Markdown and PDF format. There is also plenty of documentation throughout the code itself, explaining logic or rationale. Finally, the many test cases will also explain a lot about expected behaviour.
21
21
22
-
## Testing ZKFlow with the sample CorDapp or with your own CorDapp
22
+
## Running the sample ZKDapp
23
23
24
-
The ZKFlow jars are currently not deployed to one of the Maven/Gradle repositories. This means it can not be used directly by CorDapps. Instead, run the tests for ZKFlow and the `sample-zkdapp` to see it in action.
24
+
The sample ZKDapp demonstrates how a basic token contract can be adapted to work with ZKFlow. The contract tests and flow tests show the expected behaviour.
25
25
26
26
Please make sure you have satisfied all [prerequisites](#prerequisites) before you execute the following:
27
27
28
28
```bash
29
-
$ cd sample-zkdapp
29
+
$ cdzkflow/sample-zkdapp
30
30
$ ./gradlew test
31
31
```
32
32
33
-
If you want to test ZKFlow with your own CorDapp, please do the following:
33
+
## Running your own CorDapp with ZKFlow
34
34
35
-
* Copy you CorDapp to the zkflow project, similar to `sample-zkdapp`
36
-
* Add `includeBuild("..")` to your `settings.gradle`. This will give your CorDapp access to undeployed ZKFlow artifacts
37
-
* Enable the ZKFlow Gradle plugin on your CorDapp in your `build.gradle.kts`. Note that it needs no version because of `includeBuild("..")`:
35
+
> [i] This assumes you use the Kotlin DSL for your Gradle build files. If you do not, change accordingly for the Groovy DSL. The changes should be identical except for syntax.
36
+
37
+
The ZKFlow jars are currently not deployed to one of the public Maven/Gradle repositories. If you want to test ZKFlow with your own CorDapp, please make the following changes to your build file:
38
+
39
+
* Make sure that ZKFlow is published to your local Maven repository by running `./gradlew publishToMavenLocal` in the ZKFlow directory.
40
+
* Add the `mavenLocal()` repository to your repositories for Gradle plugins (probably in the `pluginManagement` block in your `settings.gradle.kts`) and to your repositories for normal Gradle dependencies in your `build.gradle.kts`.
41
+
* Enable the ZKFlow Gradle plugin on your CorDapp in your `build.gradle.kts`.
38
42
39
43
```kotlin
40
44
plugins {
41
-
id("com.ing.zkflow.gradle-plugin")
45
+
id("com.ing.zkflow.gradle-plugin") version "1.0-SNAPSHOT"
42
46
}
43
47
```
44
48
*To be able to use ZKFlow's contract test DSL and other convenience functions, add `testImplementation("com.ing.zkflow:test-utils:1.0-SNAPSHOT")` to your `dependencies` block in `build.gradle.kts`.
45
-
* Finally, adapt your contracts, states, commands, contract tests and flow tests to work with ZKFlow. You can inspect `sample-zkdapp` to see how you can make those adaptations. Please note that some significant changes to your state class definitions may be required.
49
+
50
+
Not you are ready to adapt your contracts, states, commands, contract tests and flow tests to work with ZKFlow. You can inspect `sample-zkdapp` to see how you can make those adaptations. Please note that some significant changes to your state class definitions may be required.
51
+
52
+
Not recommended, but feel free to run it immediately as-is and let ZKFlow tell you what should be added to your classes.
53
+
54
+
## Troubleshooting the sample ZKDapp or your own ZKDapp
55
+
56
+
Build issues:
57
+
- `java.lang.IllegalArgumentException: Cannot find circuit manifest`: This should not happen during normal development flow, but it can be solved by running `./gradlew generateZincCircuits --rerun-tasks` in your ZKDapp.
46
58
47
59
## Running ZKFlow tests
48
60
49
61
If you want to make changes to ZKFlow itself, you need to be able to run its tests.
50
-
This is as simple as running `./gradlew test` in the ZKFlow root directlty. It will run all tests, including integration tests.
62
+
This is as simple as running `./gradlew test` in the ZKFlow root directly. It will run all tests, including integration tests.
51
63
Please make sure you have satisfied all [prerequisites](#prerequisites) before running the tests.
52
64
53
65
## Prerequisites for running ZKFlow
@@ -71,26 +83,6 @@ $ cargo b --release
71
83
72
84
Built binaries will be stored in `./target/release`. Move the `zargo`, `znc` and `zvm` binaries to a directory you prefer and add it to your systems PATH. `/usr/local/bin` has been known to work. Then you can delete sources.
73
85
74
-
#### Zinc on internal Azure Pipelines
75
-
76
-
If you make changes to Zinc and create a new tag, please ensure that the [copy of the binaries](./.ci/lib/zinc-linux.tar.gz) in for Azure Pipelines is updated to be that version. Please note that these binaries should be compiled on/for linux, so they can run on the Azure Pipelines agents.
77
-
78
-
For GitHub Actions, this is not required, as that build automatically downloads and installs the correct Zinc binaries.
79
-
80
-
### Gradle
81
-
82
-
Typically, Gradle does not require any specific changes, but you might encounter the following error during the build (path can be different):
83
-
84
-
```bash
85
-
Caused by: java.io.IOException: Cannot run program "zargo" (in directory "/Users/mq23re/Developer/zk-notary/prover/circuits/create"): error=2, No such file or directory
86
-
```
87
-
88
-
To fix it, run the command below from the project directory. It will stop daemon, thus it will clear cache, which can help to resolve the issue.
89
-
90
-
```bash
91
-
./gradlew --stop
92
-
```
93
-
94
86
## Contributing to ZKFlow
95
87
96
88
If you want to make changes to ZKFlow, great! We welcome pull requests at any time. If you decide to create a PR, please keep the [contributing guidelines](CONTRIBUTING.md) in mind.
0 commit comments