tornado-deploy/README.md

36 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2020-12-15 16:10:11 +01:00
## Dependencies
1. node 12
2. yarn
2020-12-17 23:30:57 +01:00
3. zkutil (`brew install rust && cargo install zkutil`) (needed only for circuit compilation and setup)
2020-12-15 16:10:11 +01:00
## Usage
```
git clone --recursive https://github.com/tornadocash/tornado-deploy
cd tornado-deploy
cp .env.example .env
2020-12-17 22:52:58 +01:00
yarn
2020-12-17 21:23:14 +01:00
# optionally copy production snark circuits
mkdir -p tornado-anonymity-mining/build && cp -R ~/Downloads/circuits ./tornado-anonymity-mining/build
2020-12-17 21:21:13 +01:00
yarn build
2020-12-15 16:10:11 +01:00
```
Note: build script will globally `yarn link` `torn-token` package
2020-12-17 23:31:35 +01:00
2020-12-15 16:10:11 +01:00
Note: build script will not recompile snark circuit if compilation result already exists
2020-12-17 23:29:53 +01:00
The result of the build is `actions.json` file, that contains everything that is needed to deploy contracts on Ethereum along with expected deploy addresses.
## Reproducible build
In order to generate exactly the same actions.json the code has to be compiled in `/private/tmp/tornado-deploy` dir because solidity compiler includes a hash of full path to files into contact bytecode as swarm hash. If you compile in other dir this swarm hash will be different. It doesn't affect contract execution but your `actions.json` will have a different hash from the initiation version.
2020-12-15 16:10:11 +01:00
## Verify addresses
```
cat actions.json | jq '.actions[] | {domain,expectedAddress,contract} '
```