The Tornado subgraph can be deployed on all the supported TornadoCash chains.
Prerequisite is a Linux machine, preferably an LTS Ubuntu, with Docker installed, node installed and yarn installed.
You can find Docker installation instructions [over here](https://docs.docker.com/engine/install/ubuntu/).
### Deploy Graph Node
First you will need to deploy a graph node, which is later used to deploy the tornado-subgraph on.
The following docker-compose deploys an IPFS node, a graph node, a postgres instance and a traefik instance which is accessible via ports 80 and 443 from the host machine.
Make sure that you change the domain `custom-graph.domain.com` to your own, which points to the IP of the server you are deploying to.
You will need a directory with the following contents:
```tree
.
├── config.toml
├── data
├── docker-compose.yml
└── packages
```
Run the following commands to create empty directories that will be needed later:
```bash
mkdir -p ./data/ipfs
mkdir -p ./data/letsencrypt
mkdir -p ./data/postgres
mkdir -p ./packages/l1/release-data/traefik
mkdir -p ./packages/l1/release-data/traefik-keys
```
Create the file `docker-compose.yml` with the following contents (go through it and replace things to meet your needs):
You might see some issues about non-existing directories like `build/` or `generated/` the first time you deploy the subgraph. If you do, simply create the directory and re-run the command that failed.
Once those commands have been run, the subgraph is deployed. In the logs you will see the link to access your subgraph. As it will likely be 127.0.0.1, you will need to replace that with the domain you chose in the previous step.
*Other chains*:
To deploy the subgraph for other chains repeat the deploy steps for `tornado-subgraph` only (no need to have multiple graph nodes).
When repeating the steps, make sure you choose a unique name in the `npx graph create` step for each chain. The representing correct yaml file for the `npx graph deploy` step can be found in the `subgraphs/` directory. Make sure to replace it accordingly.