Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
Danil Kovtonyuk | 6eb71c18e1 | |
Danil Kovtonyuk | 41777a0e67 | |
smart_ex | a935bea718 | |
dependabot[bot] | 32af0c955b | |
Danil Kovtonyuk | a7be72cea5 | |
Alexey Pertsev | ac2e142cf0 |
|
@ -11,7 +11,7 @@ REDIS_URL=redis://redis/0
|
|||
# REDIS_URL=localhost
|
||||
|
||||
CHAIN_ID=100
|
||||
# RPC_URL=https://rpc.xdaichain.com/tornado
|
||||
# RPC_URL=https://rpc.gnosischain.com/tornado
|
||||
|
||||
# ORACLE_RPC_URL should always point to the mainnet
|
||||
# ORACLE_RPC_URL=https://mainnet.infura.io
|
||||
|
|
22
README.md
22
README.md
|
@ -1,25 +1,5 @@
|
|||
# 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)
|
||||
|
||||
## Getting listed on nova.tornado.cash
|
||||
|
||||
If you would like to be listed in nova.tornado.cash UI relayer's dropdown option, please do the following:
|
||||
|
||||
1. Setup tornado.cash relayer node(see below for docker-compose.yml example)
|
||||
2. Setup ENS subdomain(`nova.xxx.eth`) with TEXT record and URL key that points to your DNS or IP address.
|
||||
3. Test your relayer setup at https://nova.tornado.cash by choosing custom relayer's option on withdraw/transfer tab. Enter your ens name or url and initiate an operation.
|
||||
4. Open new Github issue in https://github.com/tornadocash/tornado-pool-relayer/issues and specify the following:
|
||||
|
||||
- your mainnet ens url
|
||||
- your telegram handle
|
||||
- withdrawal tx on mainnet and xdai
|
||||
- transfer tx on xdai
|
||||
|
||||
Please choose your testnet relayer's fee wisely.
|
||||
|
||||
Disclaimer: Please consult with legal and tax advisors regarding the compliance of running a relayer service in your jurisdiction. The authors of this project bear no responsibility.
|
||||
|
||||
USE AT YOUR OWN RISK.
|
||||
|
||||
## Deploy with docker-compose
|
||||
|
||||
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.
|
||||
|
@ -48,7 +28,7 @@ wget https://raw.githubusercontent.com/tornadocash/tornado-pool-relayer/master/.
|
|||
|
||||
## Run locally
|
||||
|
||||
1. `npm i`
|
||||
1. `yarn`
|
||||
2. `cp .env.example .env`
|
||||
3. Modify `.env` as needed
|
||||
4. `yarn start:dev`
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "pool-relayer",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"description": "Relayer for Tornado.cash Nova privacy solution. https://tornado.cash",
|
||||
"author": "tornado.cash",
|
||||
"license": "MIT",
|
||||
|
@ -33,12 +33,12 @@
|
|||
"bull": "^3.22.11",
|
||||
"class-validator": "^0.13.1",
|
||||
"ethers": "^5.4.6",
|
||||
"gas-price-oracle": "^0.4.4",
|
||||
"gas-price-oracle": "^0.4.7",
|
||||
"redis": "^3.1.2",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^7.2.0",
|
||||
"tx-manager": "^0.4.5",
|
||||
"tx-manager": "^0.4.8",
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
|
||||
import { baseConfig } from '@/config';
|
||||
import { QueueModule, ApiModule } from '@/modules';
|
||||
import { setHeadersMiddleware } from '@/modules/api/set-headers.middleware';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
|
@ -14,4 +15,8 @@ import { QueueModule, ApiModule } from '@/modules';
|
|||
QueueModule,
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
export class AppModule implements NestModule {
|
||||
configure(consumer: MiddlewareConsumer) {
|
||||
consumer.apply(setHeadersMiddleware).forRoutes('/');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ export const CONTRACT_NETWORKS: { [chainId in ChainId]: string } = {
|
|||
|
||||
export const RPC_LIST: { [chainId in ChainId]: string } = {
|
||||
[ChainId.MAINNET]: 'https://api.mycryptoapi.com/eth',
|
||||
[ChainId.XDAI]: 'https://rpc.xdaichain.com/tornado',
|
||||
[ChainId.XDAI]: 'https://rpc.gnosischain.com/tornado',
|
||||
};
|
||||
|
||||
export const OFF_CHAIN_ORACLE = '0x07D91f5fb9Bf7798734C3f606dB065549F6893bb';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Controller, Body, Param, Res, Get, Post, HttpStatus } from '@nestjs/common';
|
||||
import { Body, Controller, Get, HttpStatus, Param, Post, Res } from '@nestjs/common';
|
||||
import { Response } from 'express';
|
||||
|
||||
import { ApiService } from './api.service';
|
||||
|
@ -9,13 +9,13 @@ export class ApiController {
|
|||
constructor(private readonly service: ApiService) {}
|
||||
|
||||
@Get('/status')
|
||||
async status(): Promise<Status> {
|
||||
return await this.service.status();
|
||||
async status(@Res() res: Response): Promise<Response<Status>> {
|
||||
return res.json(await this.service.status());
|
||||
}
|
||||
|
||||
@Get('/')
|
||||
async root(): Promise<string> {
|
||||
return this.service.root();
|
||||
root(@Res() res: Response): Response<string> {
|
||||
return res.send(this.service.root());
|
||||
}
|
||||
|
||||
@Get('/job/:jobId')
|
||||
|
@ -25,7 +25,6 @@ export class ApiController {
|
|||
if (!job) {
|
||||
return res.status(HttpStatus.BAD_REQUEST).json({ error: "The job doesn't exist" });
|
||||
}
|
||||
|
||||
return res.json(job);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
import { Injectable, NestMiddleware } from '@nestjs/common';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
|
||||
@Injectable()
|
||||
export class setHeadersMiddleware implements NestMiddleware {
|
||||
use(req: Request, res: Response, next: NextFunction) {
|
||||
res.setHeader('X-Frame-Options', 'DENY');
|
||||
res.setHeader('X-Content-Type-Options', 'nosniff');
|
||||
next();
|
||||
}
|
||||
}
|
24
yarn.lock
24
yarn.lock
|
@ -1746,9 +1746,9 @@ ansi-escapes@^4.2.1:
|
|||
type-fest "^0.21.3"
|
||||
|
||||
ansi-regex@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
|
||||
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1"
|
||||
integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==
|
||||
|
||||
ansi-regex@^5.0.0:
|
||||
version "5.0.0"
|
||||
|
@ -3185,10 +3185,10 @@ functional-red-black-tree@^1.0.1:
|
|||
resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
|
||||
integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
|
||||
|
||||
gas-price-oracle@^0.4.4:
|
||||
version "0.4.4"
|
||||
resolved "https://registry.yarnpkg.com/gas-price-oracle/-/gas-price-oracle-0.4.4.tgz#9b7e5583ed7126a68f9d230b9efbd9d75d864bad"
|
||||
integrity sha512-alAHLiZmPJ+GxKvujZZzEY8NRPqgGGHmDQUPFTa6HAMFB4LR/T6ShTDbqQzsdeWLPSw/j8/Gux0ZSC2AsPK+Hg==
|
||||
gas-price-oracle@^0.4.7:
|
||||
version "0.4.7"
|
||||
resolved "https://registry.yarnpkg.com/gas-price-oracle/-/gas-price-oracle-0.4.7.tgz#47406048083074bcab677efb9de08663e742153d"
|
||||
integrity sha512-Ti8nhpATm83YebWU/Pz5xclZoTkzOblIhT504ZViZJUcd8jOxgj9pWtCasg8RYw+d0f19m0dJUPvdj04RC4o3A==
|
||||
dependencies:
|
||||
axios "^0.21.2"
|
||||
bignumber.js "^9.0.0"
|
||||
|
@ -5793,14 +5793,14 @@ tsutils@^3.21.0:
|
|||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
||||
tx-manager@^0.4.5:
|
||||
version "0.4.5"
|
||||
resolved "https://registry.yarnpkg.com/tx-manager/-/tx-manager-0.4.5.tgz#a1fb64abc6f503ac1f6f43795e6915b70c028aba"
|
||||
integrity sha512-5cG4YUzGG2hB8Sw1SQLbAIQVpMyPBWOrn1zpRe3QKo/gMUbf7JHT7fsK2Gr4m+O6wkd59c/hDgu6QZwZW9VKww==
|
||||
tx-manager@^0.4.8:
|
||||
version "0.4.8"
|
||||
resolved "https://registry.yarnpkg.com/tx-manager/-/tx-manager-0.4.8.tgz#d354af422d6019629c4b80b0872e332e1ab8c338"
|
||||
integrity sha512-gs7V8jWxAjMLl+HtkDI6U04fqqB/Coprz0xRCVYeuBh/5ZiVuC+txd2yP08HyQsSRgAiNMXAlSskrfxaJKsxZg==
|
||||
dependencies:
|
||||
async-mutex "^0.2.4"
|
||||
ethers "^5.4.6"
|
||||
gas-price-oracle "^0.4.4"
|
||||
gas-price-oracle "^0.4.7"
|
||||
web3-core-promievent "^1.3.0"
|
||||
|
||||
type-check@^0.4.0, type-check@~0.4.0:
|
||||
|
|
Loading…
Reference in New Issue