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.
wget https://raw.githubusercontent.com/tornadocash/tornado-pool-relayer/master/.env.example -O .env
Setup environment variables
CHAIN_ID(100 for xdai, 1 for mainnet)
PRIVATE_KEYfor your relayer address (without 0x prefix)
LETSENCRYPT_HOSTto your domain and add DNS record pointing to your relayer ip address
REWARD_ADDRESS- eth address that is used to collect fees
RPC_URLrpc url for your node
ORACLE_RPC_URL- rpc url for mainnet node for fetching prices(always have to be on mainnet)
WITHDRAWAL_SERVICE_FEE- fee in % that is used for tornado withdrawals
TRANSFER_SERVICE_FEE- fee is a fixed value in ether for transfer
CONFIRMATIONSif needed - how many block confirmations to wait before processing an event. Not recommended to set less than 3
MAX_GAS_PRICEif needed - maximum value of gwei value for relayer's transaction
docker-compose up -d
cp .env.example .env
- Go to
- In order to execute withdraw/transfer request, you can run following command
curl -X POST -H 'content-type:application/json' --data '<input data>' http://127.0.0.1:8000/transaction
Relayer should return a transaction hash
In that case you will need to add https termination yourself because browsers with default settings will prevent https tornado.cash UI from submitting your request over http connection
- Abi: Json ABI for working with contracts
- Artifacts: The generated file contains typed contract instances
bull.config.tsbull service settings
configuration.tsglobal application configuration
txManager.config.tstxManager service settings
contracts.tsaddresses of contracts and rps
variables.tsvarious variables to make things easier
controller.tsController file that will contain all the application routes
module.tsThe module file essentially bundles all the controllers and providers of your application together.
service.tsThe service will include methods that will perform a certain operation.
main.tsThe entry file of the application will take in your module bundle and create an app instance using the NestFactory provided by Nest.
gas-price.tsupdate gas prices
offchain-price.tsupdate the exchange rate
provider.tsadd-on for working with ethers js
- Types: types for the application
- Utilities: helpers functions
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.