Skip to main content
Glama

Blockchain MCP Server

by lienhage
worker.ts•1.46 kB
import { parentPort, workerData } from 'worker_threads'; import { ethers } from 'ethers'; interface WorkerData { prefix?: string; suffix?: string; caseSensitive: boolean; workerId: number; } const { prefix, suffix, caseSensitive, workerId } = workerData as WorkerData; let attempts = 0; const progressInterval = 10000; function matchesPattern(address: string, targetPrefix?: string, targetSuffix?: string, isCaseSensitive?: boolean): boolean { const addr = isCaseSensitive ? address : address.toLowerCase(); const addrWithoutPrefix = addr.slice(2); let prefixMatch = true; let suffixMatch = true; if (targetPrefix) { prefixMatch = addrWithoutPrefix.startsWith(targetPrefix); } if (targetSuffix) { suffixMatch = addrWithoutPrefix.endsWith(targetSuffix); } return prefixMatch && suffixMatch; } function generateAndCheck(): void { while (true) { const wallet = ethers.Wallet.createRandom(); attempts++; if (matchesPattern(wallet.address, prefix, suffix, caseSensitive)) { parentPort?.postMessage({ type: 'found', address: wallet.address, privateKey: wallet.privateKey, attempts: attempts }); break; } if (attempts % progressInterval === 0) { parentPort?.postMessage({ type: 'progress', attempts: progressInterval, workerId: workerId }); attempts = 0; } } } generateAndCheck();

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lienhage/blockchain-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server