Compare commits

...

10 Commits

3 changed files with 73 additions and 56 deletions

@ -1,19 +1,19 @@
# Relayer for Tornado Cash [![Build Status](https://github.com/tornadocash/relayer/workflows/build/badge.svg)](https://github.com/tornadocash/relayer/actions) [![Docker Image Version (latest semver)](https://img.shields.io/docker/v/tornadocash/relayer?logo=docker&logoColor=%23FFFFFF&sort=semver)](https://hub.docker.com/repository/docker/tornadocash/relayer)
# Relayer for Tornado Cash [![Build Status](https://github.com/tornadocash/relayer/workflows/build/badge.svg)](https://github.com/tornadocash/relayer/actions)![Sidechains version](https://img.shields.io/badge/version-5.2.1-blue?logo=docker)![Mainnet version](https://img.shields.io/badge/version-4.1.5-blue?logo=docker)
__*Tornado Cash was sanctioned by the US Treasury on 08/08/2022, this makes it illegal for US citizens to interact with Tornado Cash and all of it's associated deployed smart contracts. Please understand the laws where you live and take all necessary steps to protect and anonymize yourself.__
**\*Tornado Cash was sanctioned by the US Treasury on 08/08/2022, this makes it illegal for US citizens to interact with Tornado Cash and all of it's associated deployed smart contracts. Please understand the laws where you live and take all necessary steps to protect and anonymize yourself.**
__*It is recommended to run your Relayer on a VPS instnace ([Virtual Private Server](https://njal.la/)). Ensure SSH configuration is enabled for security, you can find information about SSH keygen and management [here](https://www.ssh.com/academy/ssh/keygen).__
**\*It is recommended to run your Relayer on a VPS instnace (Virtual Private Server). Ensure SSH configuration is enabled for security, you can find information about SSH keygen and management [here](https://www.ssh.com/academy/ssh/keygen).**
## Deploy with script and docker-compose
*The following instructions are for Ubuntu 22.10, other operating systems may vary.*
_The following instructions are for Ubuntu 22.10, other operating systems may vary._
#### Installation:
Just run in terminal:
```bash
curl -s https://git.tornado.ws/tornadocash/classic-relayer/raw/branch/main-v4/install.sh | bash
curl -s https://git.tornado.ws/tornadocash/tornado-relayer/raw/branch/main/install.sh | bash
```
#### Configuring environments:
@ -21,40 +21,40 @@ curl -s https://git.tornado.ws/tornadocash/classic-relayer/raw/branch/main-v4/in
1. Go to `tornado-relayer` folder on the server home directory
2. Check environment files:
By default each network is preconfigured the naming of `.env.<NETWORK>`
By default each network is preconfigured the naming of `.env.<NETWORK>`
- `.env.eth` for Ethereum Mainnet
- `.env.eth` for Ethereum Mainnet
- `.env.bsc` for Binance Smart Chain
- `.env.arb` for Arbitrum
- `.env.op` for Optimism
- `.env.gnosis` for Gnosis (xdai)
- `.env.polygon` for Polygon (matic)
- `.env.avax` for Avalanche C-Chain
- `.env.bsc` for Binance Smart Chain
- `.env.arb` for Arbitrum
- `.env.op` for Optimism
- `.env.gnosis` for Gnosis (xdai)
- `.env.polygon` for Polygon (matic)
- `.env.avax` for Avalanche C-Chain
3. Configure (fill) environment files for those networks on which the relayer will be deployed:
- Set `PRIVATE_KEY` to your relayer address (remove the 0x from your private key) to each environment file
- *It is recommended not to reuse the same private keys for each network as a security measure*
- Set `VIRTUAL_HOST` and `LETSENCRYPT_HOST` a unique subndomain for every network to each environment file
- eg: `mainnet.example.com` for Ethereum, `binance.example.com` for Binance etc
- add a A wildcard record DNS record with the value assigned to your instance IP address to configure subdomains
- Set `RELAYER_FEE` to what you would like to charge as your fee (remember 0.3% is deducted from your staked relayer balance)
- Set `RPC_URL` to a non-censoring RPC (You can [run your own](https://github.com/feshchenkod/rpc-nodes), or use a [free option](https://chainnodes.org/))
- Set `ORACLE_RPC_URL` to an Ethereum native RPC endpoint
3. Configure (fill) environment files for those networks on which the relayer will be deployed:
- Set `PRIVATE_KEY` to your relayer address (remove the 0x from your private key) to each environment file
- _It is recommended not to reuse the same private keys for each network as a security measure_
- Set `VIRTUAL_HOST` and `LETSENCRYPT_HOST` a unique subndomain for every network to each environment file
- eg: `mainnet.example.com` for Ethereum, `binance.example.com` for Binance etc
- add a A wildcard record DNS record with the value assigned to your instance IP address to configure subdomains
- Set `RELAYER_FEE` to what you would like to charge as your fee (remember 0.3% is deducted from your staked relayer balance)
- Set `RPC_URL` to a non-censoring RPC (You can [run your own](https://github.com/feshchenkod/rpc-nodes), or use a [free option](https://chainnodes.org/))
- Set `ORACLE_RPC_URL` to an Ethereum native RPC endpoint
4(Optional). If you want to run relayer for [Nova](https://nova.tornado.ws), fill `.env.nova` file by instructions in [Nova branch](https://git.tornado.ws/tornadocash/tornado-relayer/src/branch/nova), because config is very specific
#### Deployment:
1. Build and deploy the docker source for the configured neworks specified via `--profile <NETWORK_SYMBOL>`, for example (if you run relayer only for Ethereum Mainnet, Binance Smart Chain and Arbitrum):
1. Build and deploy the docker source for the configured networks specified via `--profile <NETWORK_SYMBOL>`, for example (if you run relayer only for Ethereum Mainnet, Binance Smart Chain and Arbitrum):
- `docker-compose --profile eth --profile bsc --profile arb up -d`
- `docker-compose --profile eth --profile bsc --profile arb up -d`
2. Visit your domain addresses and check each `/status` endpoint to ensure there is no errors in the `status` fields
2. Optional: if you want to run Nova relayer, just add `--profile nova` to docker-compose command
If you want to change some relayer parameters, for example, RPC url or fee percent, stop the relayer software with command `docker-compose down --remove-orphans`, change in corresponding `.env.{name}` file what you need and rerun relayer as described above.
Disclaimer:
#### Disclaimer:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -105,7 +105,7 @@ services:
# # This is additional worker for ethereum mainnet
# # So you can process transactions from multiple addresses, but before it you need to set up those addresses as workers
# eth-worker2:
# image: tornadorelayer:mainnet
# image: tornadocash/relayer:mainnet-v4
# profiles: [ 'eth' ]
# restart: always
# command: worker
@ -166,7 +166,7 @@ services:
# ---------------------- BSC (Binance Smart Chain) ----------------------- #
bsc-server:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["bsc"]
restart: always
command: server
@ -178,7 +178,7 @@ services:
depends_on: [redis]
bsc-healthWatcher:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["bsc"]
restart: always
command: healthWatcher
@ -189,7 +189,7 @@ services:
depends_on: [redis, bsc-server]
bsc-worker1:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["bsc"]
restart: always
command: worker
@ -204,7 +204,7 @@ services:
# ---------------------- Polygon (MATIC) --------------------- #
polygon-server:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["polygon"]
restart: always
command: server
@ -216,7 +216,7 @@ services:
depends_on: [redis]
polygon-healthWatcher:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["polygon"]
restart: always
command: healthWatcher
@ -227,7 +227,7 @@ services:
depends_on: [redis, polygon-server]
polygon-worker1:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["polygon"]
restart: always
command: worker
@ -242,7 +242,7 @@ services:
# ---------------------- Gnosis (XDAI) ---------------------- #
gnosis-server:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["gnosis"]
restart: always
command: server
@ -254,7 +254,7 @@ services:
depends_on: [redis]
gnosis-healthWatcher:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["gnosis"]
restart: always
command: healthWatcher
@ -265,7 +265,7 @@ services:
depends_on: [redis, gnosis-server]
gnosis-worker1:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["gnosis"]
restart: always
command: worker
@ -280,7 +280,7 @@ services:
# ---------------------- AVAX ---------------------- #
avax-server:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["avax"]
restart: always
command: server
@ -292,7 +292,7 @@ services:
depends_on: [redis]
avax-healthWatcher:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["avax"]
restart: always
command: healthWatcher
@ -303,7 +303,7 @@ services:
depends_on: [redis, avax-server]
avax-worker1:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["avax"]
restart: always
command: worker
@ -318,7 +318,7 @@ services:
# ---------------------- OP ------------------------ #
op-server:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["op"]
restart: always
command: server
@ -330,7 +330,7 @@ services:
depends_on: [redis]
op-healthWatcher:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["op"]
restart: always
command: healthWatcher
@ -341,7 +341,7 @@ services:
depends_on: [redis, op-server]
op-worker1:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["op"]
restart: always
command: worker
@ -356,7 +356,7 @@ services:
# ---------------------- Arbitrum ----------------------- #
arb-server:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["arb"]
restart: always
command: server
@ -368,7 +368,7 @@ services:
depends_on: [redis]
arb-healthWatcher:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["arb"]
restart: always
command: healthWatcher
@ -379,7 +379,7 @@ services:
depends_on: [redis, arb-server]
arb-worker1:
image: tornadocash/relayer:sidechain-beta
image: tornadocash/relayer:sidechain-v5
profiles: ["arb"]
restart: always
command: worker
@ -394,7 +394,7 @@ services:
# ---------------------- Goerli (Ethereum Testnet) ---------------------- #
goerli-server:
image: tornadorelayer:mainnet
image: tornadocash/relayer:mainnet-v4
profiles: ["geth"]
restart: always
command: server
@ -406,7 +406,7 @@ services:
depends_on: [redis]
goerli-treeWatcher:
image: tornadorelayer:mainnet
image: tornadocash/relayer:mainnet-v4
profiles: ["goerli"]
restart: always
command: treeWatcher
@ -417,7 +417,7 @@ services:
depends_on: [redis, goerli-server]
goerli-priceWatcher:
image: tornadorelayer:mainnet
image: tornadocash/relayer:mainnet-v4
profiles: ["goerli"]
restart: always
command: priceWatcher
@ -428,7 +428,7 @@ services:
depends_on: [redis, goerli-server]
goerli-healthWatcher:
image: tornadorelayer:mainnet
image: tornadocash/relayer:mainnet-v4
profiles: ["goerli"]
restart: always
command: healthWatcher
@ -439,7 +439,7 @@ services:
depends_on: [redis, goerli-server]
goerli-worker1:
image: tornadorelayer:mainnet
image: tornadocash/relayer:mainnet-v4
profiles: ["goerli"]
restart: always
command: worker
@ -450,6 +450,19 @@ services:
depends_on: [redis, goerli-server]
# -------------------------------------------------- #
# ---------------------- Tornado Nova (Gnosis Chain) ----------------------- #
server:
image: tornadocash/relayer:nova
profiles: ["nova"]
restart: always
command: start:prod
env_file: .env.nova
environment:
REDIS_URL: redis://redis/8
nginx_proxy_read_timeout: 600
depends_on: [redis]
volumes:
conf:
vhost:

@ -5,13 +5,14 @@ if [ "$EUID" -ne 0 ];
exit 1;
fi;
relayer_soft_git_repo="https://git.tornado.ws/tornadocash/classic-relayer";
relayer_soft_git_repo="https://git.tornado.ws/tornadocash/tornado-relayer";
user_home_dir=$(eval echo ~$USER);
relayer_folder="$user_home_dir/tornado-relayer";
relayer_mainnet_soft_source_folder="$relayer_folder/mainnet-soft-source";
relayer_sidechains_soft_source_folder="$relayer_folder/sidechains-soft-source";
script_log_file="/tmp/tornado-classic-relayer-installation.log"
nova_relayer_soft_source_folder="$relayer_folder/nova-soft-source";
script_log_file="/tmp/tornado-relayer-installation.log"
if [ -f $script_log_file ]; then rm $script_log_file; fi;
function echo_log_err(){
@ -56,9 +57,10 @@ function install_node(){
}
function install_repositories(){
git clone $relayer_soft_git_repo -b main-v4 $relayer_folder
git clone $relayer_soft_git_repo -b main $relayer_folder
git clone $relayer_soft_git_repo -b mainnet-v4 $relayer_mainnet_soft_source_folder;
git clone $relayer_soft_git_repo -b sidechain-v4 $relayer_sidechains_soft_source_folder;
git clone $relayer_soft_git_repo -b sidechain-v5 $relayer_sidechains_soft_source_folder;
git clone $relayer_soft_git_repo -b nova $nova_relayer_soft_source_folder;
}
function install_docker_utilities(){
@ -93,10 +95,12 @@ function configure_nginx_reverse_proxy(){
function build_relayer_docker_containers(){
cd $relayer_mainnet_soft_source_folder && npm run build;
cd $relayer_sidechains_soft_source_folder && npm run build;
cd $nova_relayer_soft_source_folder && npm run build:docker;
}
function prepare_environments(){
cp $relayer_mainnet_soft_source_folder/.env.example $relayer_folder/.env.eth;
cp $nova_relayer_soft_source_folder/.env.example $relayer_folder/.env.nova;
tee $relayer_folder/.env.bsc $relayer_folder/.env.arb $relayer_folder/.env.goerli $relayer_folder/.env.polygon $relayer_folder/.env.op \
$relayer_folder/.env.avax $relayer_folder/.env.gnosis < $relayer_sidechains_soft_source_folder/.env.example > /dev/null;
}