Add Optimistic network support & update README.md

This commit is contained in:
Ayanami 2022-01-23 18:42:08 +09:00
parent e865eb9af8
commit 90a34da5b8
No known key found for this signature in database
GPG Key ID: 0CABDF03077D92E4
3 changed files with 91 additions and 5 deletions

View File

@ -1,13 +1,40 @@
# Warning!
# Tornado cli
Command line tool to interact with [Tornado Cash](https://tornadocash.eth.link).
### Warning!
Current cli version doesn't support [Anonymity Mining](https://tornado-cash.medium.com/tornado-cash-governance-proposal-a55c5c7d0703)
### Goerli, Mainnet, Binance Smart Chain
### How to install tornado cli
Download and install [node.js](https://nodejs.org/en/download/).
If you have git installed on your system, clone the master branch.
```bash
$ git clone https://github.com/tornadocash/tornado-cli
```
Or, download the archive file from github
https://github.com/tornadocash/tornado-cli/archive/refs/heads/master.zip
After downloading or cloning the repository, you must install necessary libraries using the following command.
```bash
$ cd tornado-cli
$ npm install
```
If you want to use Tor connection to conceal ip address, install [Tor Browser](https://www.torproject.org/download/) and add `--tor 9150` for `cli.js` if you connect tor with browser.
Note that you should reset your tor connection by restarting the browser every time when you deposit & withdraw otherwise you will have the same exit node used for connection.
### Goerli, Mainnet, Binance Smart Chain, Gnosis Chain, Polygon Network, Arbitrum, Avalanche
1. Add `PRIVATE_KEY` to `.env` file
2. `./cli.js --help`
2. `node cli.js --help`
Example:
```bash
$ ./cli.js deposit ETH 0.1 --rpc https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161 --tor 9050
$ node cli.js deposit ETH 0.1 --rpc https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161 --tor 9150
Your note: tornado-eth-0.1-5-0xf73dd6833ccbcc046c44228c8e2aa312bf49e08389dadc7c65e6a73239867b7ef49c705c4db227e2fadd8489a494b6880bdcb6016047e019d1abec1c7652
Tornado ETH balance is 8.9
@ -18,7 +45,7 @@ Sender account ETH balance is 1004873.361652048361352542
```
```bash
$ ./cli.js withdraw tornado-eth-0.1-5-0xf73dd6833ccbcc046c44228c8e2aa312bf49e08389dadc7c65e6a73239867b7ef49c705c4db227e2fadd8489a494b6880bdcb6016047e019d1abec1c7652 0x8589427373D6D84E98730D7795D8f6f8731FDA16 --rpc https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161 --relayer https://goerli-frelay.duckdns.org --tor 9050
$ node cli.js withdraw tornado-eth-0.1-5-0xf73dd6833ccbcc046c44228c8e2aa312bf49e08389dadc7c65e6a73239867b7ef49c705c4db227e2fadd8489a494b6880bdcb6016047e019d1abec1c7652 0x8589427373D6D84E98730D7795D8f6f8731FDA16 --rpc https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161 --relayer https://goerli-frelay.duckdns.org --tor 9150
Relay address: 0x6A31736e7490AbE5D5676be059DFf064AB4aC754
Getting current state from tornado contract
@ -520,6 +547,41 @@ Infura API key fetched from https://rpc.info (Same one with Metamask)
"cachedUrl":"https://goerli-v2.defidevotee.xyz"
}
}
},
"netId10":{
"rpcUrls":{
"Optimism":{
"name":"Optimism Public RPC",
"url":"https://mainnet.optimism.io"
}
},
"relayers":{
"optimism.t-relay.eth":{
"url":"optimism.t-relay.eth",
"name":"optimism.t-relay.eth",
"cachedUrl":"https://optimism.t-relay.online/"
},
"optimism.therelayer.eth":{
"url":"optimism.therelayer.eth",
"name":"optimism.therelayer.eth",
"cachedUrl":"https://optimism.therelayer.xyz/"
},
"optimism.relayer-service.eth":{
"url":"optimism.relayer-service.eth",
"name":"optimism.relayer-service.eth",
"cachedUrl":"https://optimism-relayer.hertz.zone/"
},
"optimism.torn.eth":{
"url":"optimism.torn.eth",
"name":"optimism.torn.eth",
"cachedUrl":"https://optimism.torn.cash/"
},
"optimism.relaymy.eth":{
"url":"optimism.relaymy.eth",
"name":"optimism.relaymy.eth",
"cachedUrl":"https://optimism.relaymy.xyz/"
}
}
}
}
```

4
cli.js
View File

@ -486,6 +486,8 @@ function getExplorerLink() {
return 'goerli.etherscan.io'
case 42:
return 'kovan.etherscan.io'
case 10:
return 'optimistic.etherscan.io'
default:
return 'etherscan.io'
}
@ -510,6 +512,8 @@ function getCurrentNetworkName() {
return 'Goerli'
case 42:
return 'Kovan'
case 137:
return 'Optimism'
default:
return 'localRPC'
}

View File

@ -330,5 +330,25 @@ module.exports = {
},
proxy: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
},
netId42161: {
'eth': {
'instanceAddress': {
'0.1': '0x84443CFd09A48AF6eF360C6976C5392aC5023a1F',
'1': '0xd47438C816c9E7f2E2888E060936a499Af9582b3',
'10': '0x330bdFADE01eE9bF63C209Ee33102DD334618e0a',
'100': '0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD'
},
'deployedBlockNumber': {
'0.1': 2243707,
'1': 2243709,
'10': 2243735,
'100': 2243749
},
'miningEnabled': false,
'symbol': 'ETH',
'decimals': 18
},
proxy: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
},
}
}