diff --git a/README.md b/README.md index e626241..1171923 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,36 @@ # Relayer for Tornado Cash Nova [![Build Status](https://github.com/tornadocash/tornado-pool-relayer/workflows/build/badge.svg)](https://github.com/tornadocash/tornado-pool-relayer/actions) [![Docker Image Version (latest semver)](https://img.shields.io/docker/v/tornadocash/nova-relayer?logo=docker&logoColor=%23FFFFFF&sort=semver)](https://hub.docker.com/repository/docker/tornadocash/nova-relayer) -## Deploy with docker-compose +## Deploy with docker-compose (recommended) -docker-compose.yml contains a stack that will automatically provision SSL certificates for your domain name and will add a https redirect to port 80. +_The following instructions are for Ubuntu 22.10, other operating systems may vary. These instructions include automated SSL configuration with LetsEncrypt._ -1. Download [docker-compose.yml](/docker-compose.yml) and [.env.example](/.env.example) +**PREREQUISITES** -``` -wget https://raw.githubusercontent.com/tornadocash/tornado-pool-relayer/master/docker-compose.yml -wget https://raw.githubusercontent.com/tornadocash/tornado-pool-relayer/master/.env.example -O .env -``` +1. Update core dependencies + +- `sudo apt-get update` + +2. Install docker-compose + +- `curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose` + +3. Install Docker + +- `curl -fsSL https://get.docker.com -o get-docker.sh && chmod +x get-docker.sh && ./get-docker.sh` + +4. Install git + +- `sudo apt-get install git` + +5. Install node + +- `sudo apt install nodejs npm` + +**DEPLOYMENT** + +1. Clone this repository + + `git clone https://git.tornado.ws/tornadocash/nova-relayer && cd nova-relayer` 2. Setup environment variables @@ -24,7 +45,9 @@ wget https://raw.githubusercontent.com/tornadocash/tornado-pool-relayer/master/. - set `CONFIRMATIONS` if needed - how many block confirmations to wait before processing an event. Not recommended to set less than 3 - set `MAX_GAS_PRICE` if needed - maximum value of gwei value for relayer's transaction -3. Run `docker-compose up -d` +3. Build and deploy the docker container: + - `npm run build:docker` + - `docker-compose up -d` ## Run locally diff --git a/docker-compose.yml b/docker-compose.yml index 0b2ba6d..8a960cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: server: - image: tornadocash/nova-relayer + image: tornadocash/relayer:nova restart: always command: start:prod env_file: .env diff --git a/package.json b/package.json index a2c20ff..d6d92b9 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "compile": "typechain --target ethers-v5 --out-dir ./src/artifacts './src/abi/*.json'", "prebuild": "rimraf dist", "build": "nest build", + "build:docker": "docker build -t tornadocash/relayer:nova .", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "start": "nest start", "start:dev": "nest start --watch",