Remove chainnodes rpc and fixed progress bar #1

Closed
tornadocontrib wants to merge 2 commits from fix-progress into development
9 changed files with 6 additions and 69 deletions

View File

@ -1,8 +1,6 @@
PINATA_API_KEY=
PINATA_SECRET_API_KEY=
CHAINNODES_KEY=
WC_BRIDGE=
STORE_NAME=

View File

@ -32,7 +32,6 @@ jobs:
- name: Build
run: yarn generate
env:
CHAINNODES_KEY: ${{ secrets.CHAINNODES_KEY }}
WC_BRIDGE: ${{ secrets.WC_BRIDGE }}
OLD_STORE_NAME: ${{ secrets.OLD_STORE_NAME }}
STORE_NAME: ${{ secrets.STORE_NAME }}

View File

@ -3,14 +3,15 @@
<div class="loading-container">
<div class="loading-tornado" data-test="tornado_loader"></div>
<div class="loading-message">{{ message }}...</div>
<div v-if="progress >= 0" class="loading-message">{{ progress }}%</div>
<approve-loader v-if="isApprove" />
</div>
</b-loading>
</template>
<script>
import { mapState, mapGetters } from 'vuex'
import ApproveLoader from './ApproveLoader'
export default {
components: {
ApproveLoader
@ -18,7 +19,7 @@ export default {
computed: {
...mapGetters('metamask', ['isWalletConnect']),
...mapState('metamask', ['providerName']),
...mapState('loading', ['enabled', 'message', 'progress', 'type']),
...mapState('loading', ['enabled', 'message', 'type']),
isApprove() {
return this.type === 'approve'
}

View File

@ -338,7 +338,6 @@ export default {
}
this.$store.dispatch('application/setAndUpdateStatistic', { currency, amount: Number(amount) })
this.$store.dispatch('fees/calculateWithdrawalFeeViaRelayer', {})
this.$store.dispatch('loading/updateProgress', { progress: -1 })
this.depositsPast = Number(depositsPast) <= 0 ? 0 : depositsPast
this.depositTxHash = txHash
this.depositTimestamp = timestamp

View File

@ -25,10 +25,6 @@ export default {
name: 'Tornado RPC',
url: 'https://tornadocash-rpc.com/mainnet'
},
chainnodes: {
name: 'Chainnodes RPC',
url: 'https://mainnet.chainnodes.org/d692ae63-0a7e-43e0-9da9-fe4f4cc6c607'
},
mevblockerRPC: {
name: 'MevblockerRPC',
url: 'https://rpc.mevblocker.io'
@ -152,10 +148,6 @@ export default {
name: 'Tornado RPC',
url: 'https://tornadocash-rpc.com/bsc'
},
chainnodes: {
name: 'Chainnodes RPC',
url: 'https://bsc-mainnet.chainnodes.org/d692ae63-0a7e-43e0-9da9-fe4f4cc6c607'
},
oneRPC: {
name: '1RPC',
url: 'https://1rpc.io/bnb'
@ -203,10 +195,6 @@ export default {
multicall: '0x11ce4B23bD875D7F5C6a31084f55fDe1e9A87507',
echoContractAccount: '0xa75BF2815618872f155b7C4B0C81bF990f5245E4',
rpcUrls: {
chainnodes: {
name: 'Chainnodes RPC',
url: 'https://polygon-mainnet.chainnodes.org/d692ae63-0a7e-43e0-9da9-fe4f4cc6c607'
},
oneRpc: {
name: '1RPC',
url: 'https://1rpc.io/matic'
@ -259,10 +247,6 @@ export default {
name: 'Tornado RPC',
url: 'https://tornadocash-rpc.com/op'
},
chainnodes: {
name: 'Chainnodes RPC',
url: 'https://optimism-mainnet.chainnodes.org/d692ae63-0a7e-43e0-9da9-fe4f4cc6c607'
},
oneRpc: {
name: '1RPC',
url: 'https://1rpc.io/op'
@ -310,14 +294,6 @@ export default {
multicall: '0x842eC2c7D803033Edf55E478F461FC547Bc54EB2',
echoContractAccount: '0xa75BF2815618872f155b7C4B0C81bF990f5245E4',
rpcUrls: {
tornadoRPC: {
name: 'Tornado RPC',
url: 'https://tornadocash-rpc.com/arbitrum'
},
chainnodes: {
name: 'Chainnodes RPC',
url: 'https://arbitrum-one.chainnodes.org/d692ae63-0a7e-43e0-9da9-fe4f4cc6c607'
},
oneRpc: {
name: '1rpc',
url: 'https://1rpc.io/arb'
@ -373,10 +349,6 @@ export default {
name: 'Tornado RPC',
url: 'https://tornadocash-rpc.com/gnosis'
},
chainnodes: {
name: 'Chainnodes RPC',
url: 'https://gnosis-mainnet.chainnodes.org/d692ae63-0a7e-43e0-9da9-fe4f4cc6c607'
},
blockPi: {
name: 'BlockPi',
url: 'https://gnosis.blockpi.network/v1/rpc/public'
@ -486,10 +458,6 @@ export default {
sepolia: {
name: 'Sepolia RPC',
url: 'https://rpc.sepolia.org'
},
chainnodes: {
name: 'Chainnodes RPC',
url: 'https://sepolia.chainnodes.org/d692ae63-0a7e-43e0-9da9-fe4f4cc6c607'
}
},
tokens: {

View File

@ -187,7 +187,6 @@ export default {
new webpack.IgnorePlugin(/worker_threads/),
new webpack.DefinePlugin({
'process.env': JSON.stringify({
CHAINNODES_KEY: process.env.CHAINNODES_KEY,
WC_BRIDGE: process.env.WC_BRIDGE,
OLD_STORE_NAME: process.env.OLD_STORE_NAME,
STORE_NAME: process.env.STORE_NAME,
@ -225,7 +224,7 @@ export default {
},
provider: {
rpcUrl: `https://mainnet.chainnodes.org/${process.env.CHAINNODES_KEY}`
rpcUrl: 'https://tornadocash-rpc.com'
},
// todo make custom loading page

View File

@ -7,13 +7,6 @@ import InstanceABI from '@/abis/Instance.abi.json'
import { CONTRACT_INSTANCES, eventsType, httpConfig } from '@/constants'
import { sleep, flattenNArray, formatEvents, capitalizeFirstLetter } from '@/utils'
let store
if (process.browser) {
window.onNuxtReady(({ $store }) => {
store = $store
})
}
class EventService {
constructor({ netId, amount, currency, factoryMethods }) {
this.idb = window.$nuxt.$indexedDB(netId)
@ -36,15 +29,6 @@ class EventService {
return `${type}s_${this.netId}_${this.currency}_${this.amount}`
}
updateEventProgress(percentage, type) {
if (store) {
store.dispatch('loading/updateProgress', {
message: `Fetching past ${type} events`,
progress: Math.ceil(percentage * 100)
})
}
}
async getEvents(type) {
let cachedEvents = await this.getEventsFromDB(type)
@ -345,8 +329,6 @@ class EventService {
const batchCount = Math.ceil(batchDigest / batchSize)
if (fromBlock < currentBlockNumber) {
this.updateEventProgress(0, type)
for (let batchIndex = 0; batchIndex < batchCount; batchIndex++) {
const isLastBatch = batchIndex === batchCount - 1
const params = new Array(batchSize).fill('').map((_, i) => {
@ -361,8 +343,6 @@ class EventService {
failed = failed.concat(requests.filter((e) => e.isFailedBatch))
lastBlock = params[batchSize - 1].toBlock
const progressIndex = batchIndex - failed.length / batchSize
if (isLastBatch && failed.length !== 0) {
const failedBatch = await Promise.all(this.createBatchRequest(failed))
const failedReqs = flattenNArray(failedBatch)
@ -374,7 +354,6 @@ class EventService {
throw new Error('Failed to batch events')
}
}
this.updateEventProgress(progressIndex / batchCount, type)
}
return {

View File

@ -26,7 +26,7 @@ const CHAIN_GRAPH_URLS = {
100: 'https://tornadocash-rpc.com/subgraphs/name/tornadocash/xdai-tornado-subgraph',
137: 'https://tornadocash-rpc.com/subgraphs/name/tornadocash/matic-tornado-subgraph',
42161: 'https://tornadocash-rpc.com/subgraphs/name/tornadocash/arbitrum-tornado-subgraph',
43114: 'https://api.thegraph.com/subgraphs/name/tornadocash/avalanche-tornado-subgraph',
43114: 'https://tornadocash-rpc.com/subgraphs/name/tornadocash/avalanche-tornado-subgraph',
11155111: 'https://tornadocash-rpc.com/subgraphs/name/tornadocash/sepolia-tornado-subgraph'
}

View File

@ -1,7 +1,6 @@
export const state = () => {
return {
message: '',
progress: -1,
enabled: false,
type: null
}
@ -10,16 +9,14 @@ export const state = () => {
export const getters = {}
export const mutations = {
ENABLE(state, { message, progress, type }) {
ENABLE(state, { message, type }) {
state.message = message
state.enabled = true
state.progress = progress
state.type = type
},
DISABLE(state) {
state.message = ''
state.enabled = false
state.progress = -1
state.type = null
}
}
@ -31,9 +28,6 @@ export const actions = {
changeText({ commit }, { message, type }) {
commit('ENABLE', { message, type })
},
updateProgress({ commit }, { message, progress }) {
commit('ENABLE', { message, progress })
},
disable({ commit }) {
commit('DISABLE')
},