decentralized-sources/README.md

30 lines
1.8 KiB
Markdown
Raw Normal View History

2023-09-28 09:51:32 +03:00
# Decentralized repositories downloader
2023-09-27 18:45:08 +03:00
2023-09-28 09:51:32 +03:00
Script to download all Tornado Cash git repositories with source code from IPFS by actual hashes in ENS.
### Requirements
1) Node 14 or higher ([Windows](https://github.com/coreybutler/nvm-windows), [Linux](https://github.com/nvm-sh/nvm))
2) Yarn: `npm i -g yarn`
### Installation
1. `yarn install` in repo folder
2. Rename `.env.example` to `.env` and fill set `RPC_URL` pointing to Ethereum Mainnet JSON RPC
3. `yarn start`
### Next steps
Previous command will automatically create folder **repos** in root of this repo and two subfolders in it: **tornadocash** and **tornado-packages**. All main services and contracts (like `classic-ui` or `torn-token`) git repositories will be in **tornadocash** folder, and all packages (like `websnark` or `fixed-merkle-tree`) will be in **tornado-packages** folder.
To publish it on new Gitea and make it working, you need:
1. Create two [organizations](https://docs.gitea.com/usage/permissions?_highlight=or#organization-repository) on Gitea with usernames `tornadocash` and `tornado-packages`
2. Push packages repositories to `tornado-packages` organization. In `package.json` file of every package change repository link to actual site
3. Build and publish packages in [Gitea npm registry](https://docs.gitea.com/next/usage/packages/npm). You need to build at first those packages, which doesn't have recursive dependencies to other Tornado packages (for example, first build & publish `snarkjs` and then `circomlib`, which uses snarkjs dependency). Don't forget to publish all package versions (check branches in packages repos)!
4. Set in each Tornado repo, which uses `@tornado` dependencies, link to new Gitea npm registry in `.npmrc` file
#### All done!
Now you can use it as standard git without problems (but don't forget to update IPFS repos hashes on ENS after big changes)