This project is a scalable blockchain transaction processor that supports Ethereum, Binance Smart Chain, Solana, and Tron.
-
Multi-chain support: The application can process transactions from Ethereum, Binance Smart Chain, Solana, and Tron, with the ability to easily add more chains in the future.
-
Environment-based configuration: API keys and network settings are loaded from environment variables, allowing for easy deployment across different environments without code changes.
-
Testnet/Mainnet flexibility: Each chain can be configured to use either testnet or mainnet, controlled via environment variables.
-
Multiple RPC endpoints: The Ethereum chain uses multiple RPC endpoints with a round-robin selection mechanism to distribute load and provide failover capabilities.
-
Database integration: Uses Drizzle ORM with SQLite for efficient data storage and retrieval, which can be easily scaled to other databases.
-
API versioning: The API routes are versioned, allowing for future updates without breaking existing integrations.
-
Type safety: Utilizes TypeScript for improved type safety and developer experience.
-
Containerization-ready: The application can be easily containerized using Docker for consistent deployment across different environments.
-
Block progress tracking: Tracks the progress of block processing for each chain, including status and error handling.
-
Wallet counting: Keeps track of the number of unique wallets processed for each chain.
-
Transaction counting: Counts the number of transactions processed per day for each chain.
- Clone the repository
- Install dependencies:
npm install - Copy
.env.exampleto.envand fill in your API keys and configuration - Run the migrations:
npm run migrate - Start the application:
npm start
- Build the Docker image:
docker build -t blockchain-processor . - Run the Docker container:
docker run -p 3100:3100 --env-file .env blockchain-processor
PORT: The port on which the server will run (default: 3100)ETH_TESTNET: Set to 'true' to use Ethereum testnet, 'false' for mainnetBSC_TESTNET: Set to 'true' to use BSC testnet, 'false' for mainnetSOLANA_TESTNET: Set to 'true' to use Solana testnet, 'false' for mainnetTRON_TESTNET: Set to 'true' to use Tron testnet, 'false' for mainnetINFURA_API_KEY: Your Infura API key for EthereumALCHEMY_API_KEY: Your Alchemy API key for EthereumGETBLOCK_API_KEY: Your GetBlock API key for EthereumBSC_TESTNET_RPC_URL: (Optional) Custom BSC testnet RPC URLBSC_MAINNET_RPC_URL: (Optional) Custom BSC mainnet RPC URLSOLANA_TESTNET_RPC_URL: (Optional) Custom Solana testnet RPC URLSOLANA_MAINNET_RPC_URL: (Optional) Custom Solana mainnet RPC URLTRON_TESTNET_RPC_URL: (Optional) Custom Tron testnet RPC URLTRON_MAINNET_RPC_URL: (Optional) Custom Tron mainnet RPC URL
- POST
/v1/hello: A sample endpoint that returns a greeting - GET
/v1/status: Returns the current block processing status for all chains - GET
/v1/blocks: Returns the current block progress and wallet counts for all chains - GET
/v1/transactions: Returns the transaction counts for the last 24 hours for all chains
The project uses SQLite with the following tables:
users: Stores user information (if applicable)transactions: Stores processed transaction detailsblock_progress: Tracks the progress of block processing for each chainwallet_count: Keeps track of the number of unique wallets processed for each chaintransaction_count: Counts the number of transactions processed per day for each chain
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details



