PNG
https://gist.github.com/assets/168240/25dd56cb-861f-4442-a6fb-b79e8c4afae4
import fetch from 'node-fetch' | |
const username = 'UserNameGoesHere'; // Replace with the npm username | |
const npmAPI = `https://registry.npmjs.org/-/v1/search?text=maintainer:${username}&size=100` | |
async function getPackages() { | |
const response = await fetch(npmAPI) | |
const data = await response.json() | |
return data.objects.map(pkg => pkg.package.name) | |
} |
// run: mitmproxy -p 8080 | |
// run: node proxy.js | |
async function setupProxy (proxyUrl) { | |
// require('global-agent/bootstrap') | |
// process.env.GLOBAL_AGENT_HTTP_PROXY = proxyUrl | |
// process.env.GLOBAL_AGENT_HTTPS_PROXY = proxyUrl | |
// console.log('Global proxy routing set up.') | |
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' // Ignore self-signed certs, use with caution |
git config --global diff.tool meld | |
git config --global difftool.prompt false | |
git difftool --diff-filter=M master..devel |
location ~ /\.git.* { | |
deny all; | |
} |
async function getEtherscanLogs (chain: string, fromBlock: number, toBlock: number, address: string, topic0: string, topic1?: string) { | |
const baseUrl = 'https://api-goerli.etherscan.io' | |
let url = `${baseUrl}/api?module=logs&action=getLogs&address=${address}&fromBlock=${fromBlock}&toBlock=${toBlock}&topic0=${topic0}&page=1&offset=0&apikey=YourApiKeyToken` | |
if (topic1) { | |
url += `&topic0_1_opr=and&topic1=${topic1}` | |
} | |
const res = await fetch(url) | |
const json = await res.json() | |
const logs = json.result | |
return logs |
async function getEtherscanTxs(chain: string, accountAddress: string) { | |
const baseUrl = 'https://api-goerli.etherscan.io' | |
const url = `${baseUrl}/api?module=account&action=txlist&address=${accountAddress}&startblock=0&endblock=99999999&sort=asc&apikey=YourApiKeyToken` | |
const res = await fetch(url) | |
const json = await res.json() | |
const txs = json.result | |
const txHashes = txs.map((tx: any) => tx.hash) | |
return txHashes | |
} |
async function batchFetch (contract: Contract, filter: any, startBlockNumber: number, endBlockNumber: number, batchSize = 10000) { | |
const logs: any[] = [] | |
let start = startBlockNumber | |
let end = Math.min(start + batchSize, endBlockNumber) | |
while (end <= endBlockNumber) { | |
const _logs = await contract.queryFilter( | |
filter, | |
start, | |
end | |
) |
pacman -S csview |
'https://rpc.ankr.com/optimism', | |
'https://optimism.blockpi.network/v1/rpc/public', | |
'https://opt-mainnet.g.alchemy.com/v2/demo', | |
'https://optimism-mainnet.public.blastapi.io', | |
'https://api.zan.top/node/v1/opt/mainnet/public', | |
'https://optimism.publicnode.com', | |
'https://optimism.meowrpc.com', | |
'https://mainnet.optimism.io', | |
'https://rpc.optimism.gateway.fm', | |
'https://gateway.tenderly.co/public/optimism', |