A small command line tool for checking an EVM RPC endpoint. It prints the chain ID and latest block number, verifies the expected chain when supplied, and can report the size of the bytecode at an address.
Requires Node.js 22 or later. The tool has no package dependencies.
node rpc-check.mjs --help
node rpc-check.mjs https://cloudflare-eth.com --chain 1
node rpc-check.mjs https://cloudflare-eth.com --chain 1 --address 0xdAC17F958D2ee523a2206206994597C13D831ec7Use EVM_RPC_URL in place of the positional URL when your endpoint includes a private API key. The address you supply is sent to the selected endpoint. The tool only calls eth_chainId, eth_blockNumber, and eth_getCode.
Chain ID and block number are emitted as decimal strings to preserve precision. codeBytes is the bytecode length at the reported block. A positive value shows that the endpoint returned bytecode for the address. Confirm contract identity, permissions, and behavior separately before using it. The command exits with status 1 on a failed check, including a chain ID mismatch.