From 02f79a0de0180165e72747f414bd8271cae7f670 Mon Sep 17 00:00:00 2001 From: AlienTornadosaurusHex <> Date: Tue, 4 Jul 2023 13:57:33 +0000 Subject: [PATCH 1/3] allow setting sync interval for blocks Signed-off-by: AlienTornadosaurusHex <> --- networkConfig.js | 1 + scripts/helpers/download.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/networkConfig.js b/networkConfig.js index 24d75ea..8720431 100644 --- a/networkConfig.js +++ b/networkConfig.js @@ -1,3 +1,4 @@ +export const blockSyncInterval = 10000 export const enabledChains = ['1', '10', '56', '100', '137', '42161'] export const chainsWithEncryptedNotes = ['1', '5', '56', '100', '137'] export default { diff --git a/scripts/helpers/download.js b/scripts/helpers/download.js index bfdf143..c7064d8 100644 --- a/scripts/helpers/download.js +++ b/scripts/helpers/download.js @@ -2,7 +2,7 @@ import fs from 'fs' import zlib from 'zlib' import Web3 from 'web3' -import networkConfig from '../../networkConfig' +import networkConfig, { blockSyncInterval } from '../../networkConfig' export function download({ name, directory }) { const path = `${directory}${name}.gz`.toLowerCase() @@ -53,7 +53,7 @@ export async function getPastEvents({ type, fromBlock, netId, events, contractAt const blockDifference = Math.ceil(blockNumberBuffer - fromBlock) // eth_logs and eth_filter are restricted > 10,000 block queries - const blockRange = 10000 + const blockRange = blockSyncInterval ? blockSyncInterval : 10_000 let chunksCount = blockDifference === 0 ? 1 : Math.ceil(blockDifference / blockRange) const chunkSize = Math.ceil(blockDifference / chunksCount) From 03543f87a876d016dc31d9d2ee2b212bcef2a399 Mon Sep 17 00:00:00 2001 From: AlienTornadosaurusHex <> Date: Tue, 4 Jul 2023 18:20:44 +0000 Subject: [PATCH 2/3] update README Signed-off-by: AlienTornadosaurusHex <> --- README.md | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f1235b3..84d5fd4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Tornado Cash Classic UI -> UI for non-custodial Ethereum Privacy solution +> Self-hostable Tornado Cash UI software for interacting with the protocol ## Building locally @@ -31,29 +31,42 @@ For detailed explanation on how things work, checkout [Nuxt.js docs](https://nux ## Update cached files -- For update deposits and withdrawals events use `yarn update:events {chainId}` -- For update encrypted notes use `yarn update:encrypted {chainId}` -- For update merkle tree use `yarn update:tree {chainId}` +- To update deposit and withdrawal events use `yarn update:events {chainId} {optional: tokenOrEvent} {optional: tokenOrEvent}` +- To update encrypted notes use `yarn update:encrypted {chainId}` +- To update merkle tree use `yarn update:tree {chainId}` #### NOTE! -After update cached files do not forget to use `yarn update:zip` +After updating cached files do not forget to use `yarn update:zip`. ### Example for Ethereum Mainnet: -``` -yarn update:events 1 -yarn update:encrypted 1 -yarn update:tree 1 +You may set in [`networkConfig.js`](./networkConfig.js) the `blockSyncInterval` (def: 10_000) to the maximum value allowed by your RPC provider. Command usage follows below. +```bash +# Updating events with just the required chain id parameter +yarn update:events 1 +# Updating events for only one token across all instances on that network +yarn update:events 1 dai +# Updating events for only one event on only some network +yarn update:events 1 deposit +# Both +yarn update:events 1 dai deposit +# Updating encrypted notes for some chain id +yarn update:encrypted 1 +# Updating trees for some chain id +yarn update:tree 1 +# Finally zips must be updated yarn update:zip ``` ### Example for Binance Smart Chain: -``` +```bash yarn update:events 56 +yarn update:events 56 bnb +yarn update:events 56 bnb deposit yarn update:encrypted 56 - +yarn update:tree 56 yarn update:zip ``` From 9e3861c56f9b9f260274eeeb35c754ea219571b7 Mon Sep 17 00:00:00 2001 From: AlienTornadosaurusHex <> Date: Tue, 4 Jul 2023 18:25:01 +0000 Subject: [PATCH 3/3] enable avax Signed-off-by: AlienTornadosaurusHex <> --- networkConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/networkConfig.js b/networkConfig.js index 8720431..b1fb3eb 100644 --- a/networkConfig.js +++ b/networkConfig.js @@ -1,5 +1,5 @@ export const blockSyncInterval = 10000 -export const enabledChains = ['1', '10', '56', '100', '137', '42161'] +export const enabledChains = ['1', '10', '56', '100', '137', '43114', '42161'] export const chainsWithEncryptedNotes = ['1', '5', '56', '100', '137'] export default { netId1: {